CO

common-doc-generator

Generates documentation templates based on source code or skill files.

Install

mkdir -p .claude/skills/common-doc-generator && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/14946" && unzip -o skill.zip -d .claude/skills/common-doc-generator && rm skill.zip

Installs to .claude/skills/common-doc-generator

Activation

This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.

Generate a structured 7-section common doc for any subsystem or .github/ component by tracing source code or skill files. Fills Purpose, Source of Truth, Request/Data Flow, Key Constraints, Verification, Common Failure Modes, and Related Files. Marks [NEEDS CONTENT] where evidence is insufficient. Chat output only — does not write files.
339 charsno explicit “when” triggerlonger than Claude Code's old 250-char listing cap (fine on current versions)
Intermediate

Key capabilities

  • Generate a structured 7-section common doc for subsystems
  • Trace source code or skill files to gather evidence
  • Fill sections like Purpose, Source of Truth, and Data Flow
  • Mark sections with `[NEEDS CONTENT]` when evidence is insufficient
  • Cross-reference architecture claims against `.runtime-fidelity.json` or `.scan-report.md`
  • Output the completed doc as a markdown code block

How it works

The skill traces source code or skill files to gather evidence and populate a 7-section common document template, marking gaps where evidence is insufficient.

Inputs & outputs

You give it
A subsystem or component name, directory path, skill name, or agent name
You get back
A 7-section markdown document with evidence gathered from source code or skill files

When to use common-doc-generator

  • Document a subsystem
  • Create tech documentation
  • Understand component structure

About this skill

Common Doc Generator

When to Use

Use this skill when:

  • repo-memory-promoter flags a subsystem as "Target layer: common doc"
  • A new team member needs to understand a subsystem quickly
  • An agent keeps making mistakes about how a subsystem works
  • You want a doc template pre-filled with real code evidence before human editing

Do NOT use when:

  • You want to find what needs documenting (use repo-memory-promoter first)
  • The subsystem already has a good doc with all 7 sections
  • You need architecture diagrams (use generate-sequence-diagram instead)

Workflow

Step 1 — Receive input

Ask: "What subsystem or component do you want to document?" (if not provided).

Accept: free-text name, a directory path, a skill name, or an agent name.


Step 2 — Detect mode

Kit-mode (.github/ component): input matches a known skill name, agent name, or mentions .github/. Trace SKILL.md, .agent.md, or related instruction files.

Code-mode (source subsystem): input matches a directory name, package, or domain concept. Trace source directories and entry points.

If ambiguous, ask one clarifying question:

"Is this a .github/ skill/agent, or a source code subsystem like a service or module?"


Step 3a — Trace (Kit-mode)

  1. Find the matching SKILL.md or .agent.md under .github/
  2. Extract from frontmatter: name, description
  3. Extract from body: when-to-use, workflow steps, output format, limitations
  4. Find any related .instructions.md with applyTo matching the component
  5. Find any existing doc in docs/ for this component

Purpose ← from description + first paragraph of SKILL.md body

Source of Truth ← the SKILL.md or agent file path

Data Flow ← numbered workflow steps from skill

Constraints ← when-to-use (Do) + "Do NOT" section (Don't)

Verification ← any "verify" or "test" section in the skill

Failure Modes ← any warnings, limitations, or "if not found" branches in workflow

Related Files ← instruction files with matching applyTo, cross-referenced skills


Step 3b — Trace (Code-mode)

  1. Find directories/files matching the input name (fuzzy: split words, try subdirectories)
  2. Identify entry points: controllers, handlers, facades, index.*, __init__.*, public interfaces
  3. Trace 2-3 levels deep from entry points: collect services called, data stores accessed, external calls made
  4. Read any existing README or doc comments in the entry files
  5. Find test files for the subsystem (pattern: *Test*, *Spec*, test_*.py)

Purpose ← package-level Javadoc / docstring / README first paragraph

Source of Truth ← entry point file(s) + key service class(es)

Data Flow ← method call chain from entry point, numbered steps

Constraints ← validation logic, guard clauses, annotations (@NotNull, @Valid, etc.)

Verification ← test file paths + any @Test method names that describe happy path

Failure Modescatch blocks, error returns, validation failure branches

Related Files ← all files touched in trace + config/migration files


Step 4 — Fill template

Fill this template with evidence gathered. For each section, use real file/line references where possible.

# <Subsystem Name>

## Purpose
<1-2 sentences: what this does and why it exists.>

## Source of Truth
- `<path>` — <what this file owns>
- `<path>` — <what this file owns>

## Request / Data Flow
1. <step — include caller and callee>
2. <step>
3. <step>

## Key Constraints
**Do:**
- <rule derived from code or skill>

**Don't:**
- <anti-pattern found in code or explicit warning>

## Verification
- <command to run tests or check behaviour>
- <manual check: what to observe>

## Common Failure Modes
- **<symptom>** → <diagnosis and fix>

## Related Files
- `<path>` — <purpose>

Step 5 — Mark gaps and enforce evidence contract

For any section where evidence is insufficient after tracing, insert:

[NEEDS CONTENT: <specific instruction for what to add, e.g. "Add the test command for this module">]

Aim for at most 2-3 [NEEDS CONTENT] markers. If more than 4 sections need markers, note at the top:

> ⚠️ Low evidence: most sections need manual completion. Consider reading the source more deeply before generating.

Evidence Contract

Every generated doc must satisfy these rules:

  1. Source of Truth required: the Source of Truth section must list at least one specific file path. Never leave it as a generic placeholder.
  2. Traceable claims: every assertion about behavior, architecture, or business rules must link back to a file/line discovered during tracing. If no evidence supports a claim, use [NEEDS CONTENT] instead.
  3. No unsupported certainty: do not write "this module handles X" unless the trace found code or tests that confirm it. Prefer "appears to handle X based on [file]" when evidence is indirect.
  4. Scan-anchored architecture: if .github/.runtime-fidelity.json or .github/.scan-report.md exists, cross-reference architecture claims against them. Flag contradictions as warnings in the doc.

Step 6 — Output doc

Output the completed doc as a markdown code block (so user can copy easily).


Step 7 — Add save hint

After the doc, append:

> 💡 Suggested save path: `docs/<subsystem-slug>.md`
> To save: create the file at that path and paste the content above.

7-Section Template Reference

SectionSource in Kit-modeSource in Code-mode
PurposeFrontmatter descriptionPackage docstring / README
Source of TruthSKILL.md / agent file pathEntry point + key service
Request / Data FlowWorkflow stepsMethod call chain
Key ConstraintsDo / Don't sectionsValidations + guard clauses
VerificationVerify sectionTest file paths
Common Failure ModesLimitations / warningsCatch blocks / error returns
Related FilesCross-ref skills + instructionsAll traced files

Limitations

  • Code-mode tracing is limited to statically readable call chains — dynamic dispatch and reflection cannot be traced
  • Kit-mode cannot capture runtime agent behavior (only the static SKILL.md instructions)
  • Generated doc is a starting point — always review before sharing with team

When not to use it

  • When finding what needs documenting
  • When the subsystem already has a good doc with all 7 sections
  • When needing architecture diagrams

Limitations

  • Code-mode tracing is limited to statically readable call chains
  • Kit-mode cannot capture runtime agent behavior
  • Generated doc is a starting point and requires review

How it compares

This skill automatically generates a structured documentation template pre-filled with code evidence, unlike manually creating documentation from scratch.

Compared to similar skills

common-doc-generator side by side with the closest alternatives in the catalog.

SkillInstallsUpdatedSafetyDifficulty
common-doc-generator (this skill)03moReviewIntermediate
korean-skill-creator89moReviewBeginner
skill-forge119moReviewIntermediate
svelte-expert119moNo flagsIntermediate

Try saying

Example prompts that trigger this skill in your AI assistant.

You might also like

korean-skill-creator

clwmfksek

한글 기반 클로드 스킬 자동 생성 도구. 사용자가 "클로드 스킬을 만들어줘" 또는 "[요구사항] 스킬 만들어줘"라고 요청할 때 사용. Progressive disclosure 원칙을 따르는 한글 문서 구조(SKILL.md + references/)를 자동으로 생성하고, 실전 예시를 포함한 일관성 있는 스킬 템플릿을 제공.

8132

skill-forge

WilliamSaysX

Automated skill creation workshop with intelligent source detection, smart path management, and end-to-end workflow automation. This skill should be used when users want to create a new skill or convert external resources (GitHub repositories, online documentation, or local directories) into a skill. Automatically fetches, organizes, and packages skills with proactive cleanup management.

11115

svelte-expert

Raudbjorn

Expert Svelte/SvelteKit development assistant for building components, utilities, and applications. Use when creating Svelte components, SvelteKit applications, implementing reactive patterns, handling state management, working with stores, transitions, animations, or any Svelte/SvelteKit development task. Includes comprehensive documentation access, code validation with svelte-autofixer, and playground link generation.

11107

build-free-types

paulirish

This skill should be used when the user asks to "set up types without a build step", "use vanilla JS with types", "configure erasable syntax", or mentions "JSDoc type checking". It provides instructions for modern type safety using JSDoc in browsers and native TypeScript execution in Node.js.

95

vscode-ext-commands

github

Guidelines for contributing commands in VS Code extensions. Indicates naming convention, visibility, localization and other relevant attributes, following VS Code extension development guidelines, libraries and good practices

23

project-bootstrapper

mhattingpete

Sets up new projects or improves existing projects with development best practices, tooling, documentation, and workflow automation. Use when user wants to start a new project, improve project structure, add development tooling, or establish professional workflows.

12

Search skills

Search the agent skills registry