create-doc

A command for creating documentation pages in Notion, a workspace for shared notes and knowledge bases. It describes how to create simple or richly formatted pages, including headings, paragraphs, code blocks, database properties, and tags.

In plain words
What is it for?
Use it to add guides, API documentation, and other reference pages to a Notion knowledge base.
Why use it?
It provides a repeatable way to turn a title and content into a structured Notion document.

Command

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add commands/cyperx84/claude-code-plugin-examples/create-doc
Clone the repo
git clone --depth 1 https://github.com/cyperx84/claude-code-plugin-examples
Per session 8 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 2,000 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00008 $0.02000
Opus 5 $0.00004 $0.01000
Sonnet 5 $0.00002 $0.00400
Haiku 4.5 $0.00001 $0.00200

Measured yesterday against content hash b7119359415a, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

create-doc scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

examples/04-real-world/knowledge-base-plugin/commands/create-doc.md · 316 lines

How it starts

The opening of the file, as written. The whole thing — 316 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Create Documentation

Create doc: $ARGUMENTS (title and content)

Using Notion MCP for knowledge management

Document Creation

1. Basic Page Creation

// Create simple page
await notion.pages.create({
  parent: { database_id: 'docs-database-id' },
  properties: {
    Name: { title: [{ text: { content: 'Getting Started Guide' } }] }
  },
  children: [
    {
      object: 'block',
      type: 'paragraph',
      paragraph: {
        rich_text: [{ type: 'text', text: { content: 'Welcome to our documentation!' } }]
      }
    }
  ]
});

2. Rich Content Pages

// Create page with multiple content types
await notion.pages.create({
  parent: { database_id: 'wiki-id' },
  properties: {
    Name: { title: [{ text: { content: 'API Documentation' } }] },
    Status: { select: { name: 'Published' } },
    Tags: { multi_select: [{ name: 'API' }, { name: 'Backend' }] }
  },
  children: [
    // Heading
    {
      heading_1: {
        rich_text: [{ text: { content: 'API Overview' } }]
      }
    },
    // Paragraph
    {
      paragraph: {
        rich_text: [{ text: { content: 'Our REST API provides...' } }]
      }
    },
    // Code block
    {
      code: {
        rich_text: [{ text: { content: 'GET /api/users' } }],
        language: 'javascript'
      }
    },
    // Bulleted list
    {
      bulleted_list_item: {
        rich_text: [{ text: { content: 'Authentication required' } }]
      }
    },
    // Callout (info box)
    {
      callout: {
        rich_text: [{ text: { content: '💡 Pro tip: Use API keys for authentication' } }],
        icon: { emoji: '💡' }
      }
    },
    // Toggle (collapsible)
    {
      toggle: {
        rich_text: [{ text: { content: 'View example response' } }],
        children: [
          {
            code: {
              rich_text: [{ text: { content: '{ "users": [...] }' } }],
              language: 'json'
            }
          }
        ]
      }
    }
  ]
});

3. Documentation from Code

// Generate docs from source code
async function generateAPIDocsFromCode(sourceFile) {
  const code = await readFile(sourceFile);
  const functions = parseAPIFunctions(code);

  for (const func of functions) {
    await notion.pages.create({
      parent: { database_id: 'api-docs-db' },
      properties: {
        Name: { title: [{ text: { content: func.name } }] },
        Method: { select: { name: func.method } },
        Endpoint: { rich_text: [{ text: { content: func.endpoint } }] }
      },
      children: [
        {
          heading_2: {
            rich_text: [{ text: { content: 'Description' } }]
          }
        },
        {
          paragraph: {
            rich_text: [{ text: { content: func.description } }]
          }
        },
        {
          heading_2: {
            rich_text: [{ text: { content: 'Parameters' } }]
          }
        },
        {
          code: {
            rich_text: [{ text: { content: JSON.stringify(func.params, null, 2) } }],
            language: 'json'
          }
        },
        {
          heading_2: {
            rich_text: [{ text: { content: 'Example' } }]
          }
        },
        {
          code: {
            rich_text: [{ text: { content: func.example } }],
            language: 'javascript'
          }
        }
      ]
    });
  }
}

Read the full file on GitHub · 316 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday First seen · 316 lines · 8 tokens per session scan A b7119359415a

Subscribe to this mod's changes

create-doc is a command published in the GitHub repository cyperx84/claude-code-plugin-examples (2 stars, last pushed 10mo ago), licensed MIT. It adds 8 tokens to every session and 2,000 once invoked, about $0.0000 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.