{"id":"2862fd0f-97de-44c3-9eb5-d3c11fa97222","shortId":"NkbHeg","kind":"skill","title":"docgen","tagline":"Auto-activate when generating documentation, writing API docs, documenting modules or components, creating README content, building reference guides, or systematically documenting a codebase. Produces structured per-component documentation with completeness tracking — every file ","description":"# Docgen\n\nSystematic documentation generation with progress tracking and completeness guarantees. Analyzes code file-by-file, ensures nothing is skipped, and produces structured output per component.\n\nDocgen complements `flow-docs` — it provides the systematic analysis engine for flow-docs' five-phase workflow. It can also be used standalone for ad-hoc documentation tasks when you need structured, complete documentation without a full flow-docs run.\n\nThe core guarantee: every file in scope gets documented. Progress is tracked explicitly (`[3/12 files documented]`) so you always know what's been covered and what remains.\n\n<workflow>\n\n## Workflow\n\n### 1. Scope the Target\n\nIdentify what needs documenting: single file, directory, module, or entire package. Be specific — \"the auth module\" means every file in that directory.\n\n### 2. Build the File Manifest\n\nEnumerate every file to document with its path. This is the completeness checklist — no file gets dropped silently. Count them: this is your denominator.\n\n### 3. Analyze Each File\n\nFor each file in the manifest:\n\n- **Read the file fully** — do not guess from file names\n- Extract: purpose, public interface, dependencies, key patterns\n- Document using the component template in `references/component-template.md`:\n  - **Purpose** — one sentence\n  - **Public Interface** — every export with signature and description\n  - **Dependencies** — imports and external services\n  - **Key Patterns** — design patterns, invariants, async considerations\n  - **Usage Example** — minimal, copy-pasteable\n  - **Notes** — edge cases and gotchas (only if they exist)\n- Scale the template to complexity: a 10-line utility needs Purpose + Interface + Example; a complex service gets the full template\n- Mark the file as documented. Report progress: `[3/12 files documented]`\n\n### 4. Cross-Reference\n\nAfter all files are documented:\n\n- Verify imports and dependencies between documented components\n- Note common patterns across the module\n- Flag circular dependencies or unclear boundaries\n\n### 5. Synthesize\n\nProduce the final documentation:\n\n- Module overview (what it does, how components relate)\n- Per-component documentation (from step 3)\n- Dependency map (what depends on what)\n\n</workflow>\n\n<guardrails>\n\n### Guardrails\n\n- **Don't guess from file names** — read the actual code. File and function names lie. Read the implementation before writing any documentation claim.\n- **Don't skip small files** — they often contain critical glue (re-exports, config, type definitions).\n- **Don't document in batches from memory** — read each file fresh. Memory drifts.\n- **Don't declare completeness without checking the manifest** — every file must be checked off.\n- **Don't restate code without explaining WHY** — `// increments counter by 1` on `counter++` adds no value. Explain the reason behind the logic.\n\n</guardrails>\n\n<validation>\n\n### Validation Checkpoint\n\nBefore declaring documentation complete, verify:\n\n- [ ] Every file in the manifest was documented (none skipped)\n- [ ] Progress was tracked explicitly throughout\n- [ ] Cross-references between components are accurate\n- [ ] Documentation was generated from code reading, not memory\n\n</validation>\n\n<example>\n\n## Example\n\n**Documenting `src/auth/`:**\n\n**Manifest:** 4 files — `middleware.ts`, `session.ts`, `guards.ts`, `index.ts`\n\n[1/4] `middleware.ts` — Authentication middleware. Extracts JWT from Authorization header, validates with `session.verify()`, attaches user to request context. Exports: `authMiddleware()`.\n\n[2/4] `session.ts` — Session management. Creates/verifies JWTs using `jsonwebtoken`. Token lifetime: 24h. Exports: `createSession()`, `verify()`.\n\n[3/4] `guards.ts` — Route guards. `requireAdmin()` checks `user.role === 'admin'`. `requireAuth()` checks session exists. Both use `authMiddleware` output.\n\n[4/4] `index.ts` — Re-exports: `authMiddleware`, `requireAdmin`, `requireAuth`, `createSession`.\n\n**Cross-reference:** `guards.ts` depends on `middleware.ts` output. `middleware.ts` depends on `session.ts`. `index.ts` is the public API surface.\n\n</example>\n\n## Usage Patterns\n\n- \"Document the authentication module\"\n- \"Generate API reference docs for this package\"\n- \"I need complete docs for everything in src/services/\"\n- \"What does this module do and how do I use it?\" (single-component mode)\n\n## References\n\n- **[Docgen Strategy](references/docgen-strategy.md)** — Five-step documentation workflow: scope target, build file manifest, analyze each file, cross-reference, synthesize\n- **[Component Template](references/component-template.md)** — Per-component documentation structure with scaling guidance for utilities, services, and config files","tags":["docgen","flow","cofin","agent-skills","ai-agents","beads","claude-code","codex","cursor","developer-tools","gemini-cli","opencode"],"capabilities":["skill","source-cofin","skill-docgen","topic-agent-skills","topic-ai-agents","topic-beads","topic-claude-code","topic-codex","topic-cursor","topic-developer-tools","topic-gemini-cli","topic-opencode","topic-plugin","topic-slash-commands","topic-spec-driven-development"],"categories":["flow"],"synonyms":[],"warnings":[],"endpointUrl":"https://skills.sh/cofin/flow/docgen","protocol":"skill","transport":"skills-sh","auth":{"type":"none","details":{"cli":"npx skills add cofin/flow","source_repo":"https://github.com/cofin/flow","install_from":"skills.sh"}},"qualityScore":"0.455","qualityRationale":"deterministic score 0.46 from registry signals: · indexed on github topic:agent-skills · 11 github stars · SKILL.md body (4,683 chars)","verified":false,"liveness":"unknown","lastLivenessCheck":null,"agentReviews":{"count":0,"score_avg":null,"cost_usd_avg":null,"success_rate":null,"latency_p50_ms":null,"narrative_summary":null,"summary_updated_at":null},"enrichmentModel":"deterministic:skill-github:v1","enrichmentVersion":1,"enrichedAt":"2026-04-24T01:03:26.172Z","embedding":null,"createdAt":"2026-04-23T13:03:58.945Z","updatedAt":"2026-04-24T01:03:26.172Z","lastSeenAt":"2026-04-24T01:03:26.172Z","tsv":"'1':135,424 '1/4':482 '10':268 '2':161 '2/4':501 '24h':511 '3':190,340 '3/12':120,289 '3/4':515 '4':292,476 '4/4':531 '5':320 'accur':463 'across':311 'activ':4 'actual':356 'ad':90 'ad-hoc':89 'add':427 'admin':522 'also':84 'alway':125 'analysi':72 'analyz':47,191,608 'api':9,556,565 'async':245 'attach':494 'auth':153 'authent':484,562 'authmiddlewar':500,529,536 'author':489 'auto':3 'auto-activ':2 'batch':391 'behind':433 'boundari':319 'build':18,162,605 'case':255 'check':405,412,520,524 'checklist':178 'checkpoint':437 'circular':315 'claim':370 'code':48,357,417,468 'codebas':25 'common':309 'complement':64 'complet':33,45,98,177,403,441,573 'complex':266,276 'compon':14,30,62,220,307,332,336,461,592,615,620 'config':384,630 'consider':246 'contain':378 'content':17 'context':498 'copi':251 'copy-past':250 'core':108 'count':184 'counter':422,426 'cover':130 'creat':15 'creates/verifies':505 'createsess':513,539 'critic':379 'cross':294,458,541,612 'cross-refer':293,457,540,611 'declar':402,439 'definit':386 'denomin':189 'depend':214,235,304,316,341,344,544,549 'descript':234 'design':242 'directori':145,160 'doc':10,67,77,105,567,574 'docgen':1,37,63,595 'document':7,11,23,31,39,92,99,115,122,142,170,217,286,291,300,306,325,337,369,389,440,449,464,473,560,601,621 'drift':399 'drop':182 'edg':254 'engin':73 'ensur':53 'entir':148 'enumer':166 'everi':35,110,156,167,229,408,443 'everyth':576 'exampl':248,274,472 'exist':261,526 'explain':419,430 'explicit':119,455 'export':230,383,499,512,535 'extern':238 'extract':210,486 'file':36,50,52,111,121,144,157,164,168,180,193,196,202,208,284,290,298,352,358,375,396,409,444,477,606,610,631 'file-by-fil':49 'final':324 'five':79,599 'five-phas':78 'five-step':598 'flag':314 'flow':66,76,104 'flow-doc':65,75,103 'fresh':397 'full':102,280 'fulli':203 'function':360 'generat':6,40,466,564 'get':114,181,278 'glue':380 'gotcha':257 'guarante':46,109 'guard':518 'guardrail':347 'guards.ts':480,516,543 'guess':206,350 'guid':20 'guidanc':625 'header':490 'hoc':91 'identifi':139 'implement':365 'import':236,302 'increment':421 'index.ts':481,532,552 'interfac':213,228,273 'invari':244 'jsonwebtoken':508 'jwt':487 'jwts':506 'key':215,240 'know':126 'lie':362 'lifetim':510 'line':269 'logic':435 'manag':504 'manifest':165,199,407,447,475,607 'map':342 'mark':282 'mean':155 'memori':393,398,471 'middlewar':485 'middleware.ts':478,483,546,548 'minim':249 'mode':593 'modul':12,146,154,313,326,563,582 'must':410 'name':209,353,361 'need':96,141,271,572 'none':450 'note':253,308 'noth':54 'often':377 'one':225 'output':60,530,547 'overview':327 'packag':149,570 'pasteabl':252 'path':173 'pattern':216,241,243,310,559 'per':29,61,335,619 'per-compon':28,334,618 'phase':80 'produc':26,58,322 'progress':42,116,288,452 'provid':69 'public':212,227,555 'purpos':211,224,272 're':382,534 're-export':381,533 'read':200,354,363,394,469 'readm':16 'reason':432 'refer':19,295,459,542,566,594,613 'references/component-template.md':223,617 'references/docgen-strategy.md':597 'relat':333 'remain':133 'report':287 'request':497 'requireadmin':519,537 'requireauth':523,538 'restat':416 'rout':517 'run':106 'scale':262,624 'scope':113,136,603 'sentenc':226 'servic':239,277,628 'session':503,525 'session.ts':479,502,551 'session.verify':493 'signatur':232 'silent':183 'singl':143,591 'single-compon':590 'skill' 'skill-docgen' 'skip':56,373,451 'small':374 'source-cofin' 'specif':151 'src/auth':474 'src/services':578 'standalon':87 'step':339,600 'strategi':596 'structur':27,59,97,622 'surfac':557 'synthes':321,614 'systemat':22,38,71 'target':138,604 'task':93 'templat':221,264,281,616 'throughout':456 'token':509 'topic-agent-skills' 'topic-ai-agents' 'topic-beads' 'topic-claude-code' 'topic-codex' 'topic-cursor' 'topic-developer-tools' 'topic-gemini-cli' 'topic-opencode' 'topic-plugin' 'topic-slash-commands' 'topic-spec-driven-development' 'track':34,43,118,454 'type':385 'unclear':318 'usag':247,558 'use':86,218,507,528,588 'user':495 'user.role':521 'util':270,627 'valid':436,491 'valu':429 'verifi':301,442,514 'without':100,404,418 'workflow':81,134,602 'write':8,367","prices":[{"id":"892b7a78-fa07-47d9-9e3d-d1007c7f9396","listingId":"2862fd0f-97de-44c3-9eb5-d3c11fa97222","amountUsd":"0","unit":"free","nativeCurrency":null,"nativeAmount":null,"chain":null,"payTo":null,"paymentMethod":"skill-free","isPrimary":true,"details":{"org":"cofin","category":"flow","install_from":"skills.sh"},"createdAt":"2026-04-23T13:03:58.945Z"}],"sources":[{"listingId":"2862fd0f-97de-44c3-9eb5-d3c11fa97222","source":"github","sourceId":"cofin/flow/docgen","sourceUrl":"https://github.com/cofin/flow/tree/main/skills/docgen","isPrimary":false,"firstSeenAt":"2026-04-23T13:03:58.945Z","lastSeenAt":"2026-04-24T01:03:26.172Z"}],"details":{"listingId":"2862fd0f-97de-44c3-9eb5-d3c11fa97222","quickStartSnippet":null,"exampleRequest":null,"exampleResponse":null,"schema":null,"openapiUrl":null,"agentsTxtUrl":null,"citations":[],"useCases":[],"bestFor":[],"notFor":[],"kindDetails":{"org":"cofin","slug":"docgen","github":{"repo":"cofin/flow","stars":11,"topics":["agent-skills","ai-agents","beads","claude-code","codex","context-driven-development","cursor","developer-tools","gemini-cli","opencode","plugin","slash-commands","spec-driven-development","subagents","tdd","workflow"],"license":"apache-2.0","html_url":"https://github.com/cofin/flow","pushed_at":"2026-04-19T23:22:27Z","description":"Context-Driven Development toolkit for AI agents — spec-first planning, TDD workflow, and Beads integration.","skill_md_sha":"f37b6060c2f25d7047b5973d32602af8c3287ecf","skill_md_path":"skills/docgen/SKILL.md","default_branch":"main","skill_tree_url":"https://github.com/cofin/flow/tree/main/skills/docgen"},"layout":"multi","source":"github","category":"flow","frontmatter":{"name":"docgen","description":"Auto-activate when generating documentation, writing API docs, documenting modules or components, creating README content, building reference guides, or systematically documenting a codebase. Produces structured per-component documentation with completeness tracking — every file in scope gets documented, progress is explicit ([3/12 files]). Use when: documenting multiple files or components, ensuring complete coverage of a module, generating structured docs from code, or when /flow-docs needs systematic file-by-file analysis. Not for ad-hoc comments in code, inline docstrings, or single-function explanations."},"skills_sh_url":"https://skills.sh/cofin/flow/docgen"},"updatedAt":"2026-04-24T01:03:26.172Z"}}