{"id":"569b52a3-34fe-458a-a374-d7d4b4934f55","shortId":"cPPbVs","kind":"skill","title":"document-code","tagline":"AI DevKit · Document a code entry point with structured analysis, dependency mapping, and saved knowledge docs. Use when users ask to document, understand, or map code for a module, file, folder, function, or API.","description":"# Code Documentation Assistant\n\nBuild structured understanding of code entry points with an analysis-first workflow.\n\n## Hard Rule\n- Do not create documentation until the entry point is validated and analysis is complete.\n\n## Workflow\n\n1. Gather & Validate\n- Confirm entry point (file, folder, function, API), purpose, and desired depth.\n- Verify it exists; resolve ambiguity or suggest alternatives if not found.\n- Search for existing knowledge before analyzing: `npx ai-devkit@latest memory search --query \"<entry point name or purpose>\"`\n\n2. Collect Source Context\n- Summarize purpose, exports, key patterns.\n- Folders: list structure, highlight key modules.\n- Functions/APIs: capture signature, parameters, return values, error handling.\n\n3. Analyze Dependencies\n- Build dependency view up to depth 3, track visited nodes to avoid loops.\n- Categorize: imports, function calls, services, external packages.\n- Exclude external systems or generated code.\n\n4. Synthesize\n- Overview (purpose, language, high-level behavior).\n- Core logic, execution flow, patterns.\n- Error handling, performance, security considerations.\n- Improvements or risks discovered during analysis.\n\n5. Create Documentation\n- Normalize name to kebab-case (`calculateTotalPrice` → `calculate-total-price`).\n- Create `docs/ai/implementation/knowledge-{name}.md` using the Output Template — this is the source of truth.\n- Include mermaid diagrams when they clarify flows or relationships.\n\n6. Offer HTML Artifact\n- After the markdown is written, ask the user once: \"Also generate an HTML artifact for easier scanning? (y/N)\".\n- If yes, generate sibling `docs/ai/implementation/knowledge-{name}.html` per the HTML Artifact spec. Regenerate from the markdown on subsequent runs; never hand-edit.\n- If no or no response, stop here — markdown alone is a complete result.\n\n## HTML Artifact\n\nGenerated only when the user opts in at step 6. A self-contained HTML file optimized for scanning, not reference reading. Complements the markdown — does not replace it.\n\nConstraints:\n- Single file. Inline CSS. No build step. Only external asset allowed is mermaid via CDN (`https://cdn.jsdelivr.net/npm/mermaid/dist/mermaid.min.js`).\n- Card-based grid layout, not a long scroll. The reader should capture structure at a glance.\n- Responsive down to laptop width. Print-friendly.\n- No interactivity beyond collapsible deep-dives and mermaid pan/zoom.\n\nSection mapping (from the Output Template):\n- Overview → hero card: title, one-line purpose, language/type badges.\n- Implementation Details → grid of sectioned cards with short bullets, not prose.\n- Dependencies → graph card (mermaid) plus a categorized list (imports, calls, services, external).\n- Visual Diagrams → full-width rendered mermaid blocks.\n- Additional Insights → callout boxes, color-coded by kind (info, warning, risk).\n- Next Steps → checklist card.\n- Metadata → compact footer (date, depth, files touched).\n\n## Red Flags and Rationalizations\n\n| Rationalization | Why It's Wrong | Do Instead |\n|---|---|---|\n| \"I already understand this code\" | Understanding ≠ documented understanding | Write it down, then verify |\n| \"The code is self-documenting\" | Future readers lack your current context | Capture the why, not just the what |\n| \"Dependencies are obvious\" | Implicit dependencies cause surprises | Map them explicitly to depth 3 |\n\n## Validation\n- Documentation covers all Output Template sections.\n- If an HTML artifact was generated, it opens standalone in a browser, renders mermaid, and reflects the markdown content (no drift).\n- Summarize key insights, open questions, and related areas for deeper dives.\n- Confirm file path(s) and remind to commit.\n\n## Output Template\n- Overview\n- Implementation Details\n- Dependencies\n- Visual Diagrams (mermaid)\n- Additional Insights\n- Metadata (date, depth, files touched)\n- Next Steps","tags":["document","code","devkit","codeaholicguy","agent-skills","ai-assisted-development","antigravity","claude-code","codex","cursor","development","engineering"],"capabilities":["skill","source-codeaholicguy","skill-document-code","topic-agent-skills","topic-ai-assisted-development","topic-antigravity","topic-claude-code","topic-codex","topic-cursor","topic-development","topic-engineering","topic-engineering-enablement","topic-engineering-experience","topic-prd"],"categories":["ai-devkit"],"synonyms":[],"warnings":[],"endpointUrl":"https://skills.sh/codeaholicguy/ai-devkit/document-code","protocol":"skill","transport":"skills-sh","auth":{"type":"none","details":{"cli":"npx skills add codeaholicguy/ai-devkit","source_repo":"https://github.com/codeaholicguy/ai-devkit","install_from":"skills.sh"}},"qualityScore":"0.700","qualityRationale":"deterministic score 0.70 from registry signals: · indexed on github topic:agent-skills · 1196 github stars · SKILL.md body (3,858 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-05-18T18:53:09.153Z","embedding":null,"createdAt":"2026-05-09T18:53:02.948Z","updatedAt":"2026-05-18T18:53:09.153Z","lastSeenAt":"2026-05-18T18:53:09.153Z","tsv":"'/npm/mermaid/dist/mermaid.min.js':331 '1':71 '2':110 '3':133,142,492 '4':162 '5':187 '6':224,293 'addit':414,549 'ai':4,104 'ai-devkit':103 'allow':324 'alon':277 'alreadi':449 'also':237 'altern':92 'ambigu':89 'analysi':13,51,67,186 'analysis-first':50 'analyz':101,134 'api':37,80 'area':528 'artifact':227,241,256,283,503 'ask':23,233 'asset':323 'assist':40 'avoid':147 'badg':382 'base':334 'behavior':170 'beyond':359 'block':413 'box':417 'browser':511 'build':41,136,319 'bullet':391 'calcul':198 'calculate-total-pric':197 'calculatetotalpric':196 'call':152,403 'callout':416 'captur':126,344,473 'card':333,375,388,396,429 'card-bas':332 'case':195 'categor':149,400 'caus':485 'cdn':328 'cdn.jsdelivr.net':330 'cdn.jsdelivr.net/npm/mermaid/dist/mermaid.min.js':329 'checklist':428 'clarifi':220 'code':3,8,29,38,45,161,420,452,462 'collaps':360 'collect':111 'color':419 'color-cod':418 'commit':539 'compact':431 'complement':306 'complet':69,280 'confirm':74,532 'consider':180 'constraint':313 'contain':297 'content':518 'context':113,472 'core':171 'cover':495 'creat':58,188,201 'css':317 'current':471 'date':433,552 'deep':362 'deep-div':361 'deeper':530 'depend':14,135,137,394,480,484,545 'depth':84,141,434,491,553 'desir':83 'detail':384,544 'devkit':5,105 'diagram':217,407,547 'discov':184 'dive':363,531 'doc':19 'docs/ai/implementation/knowledge-':202,250 'document':2,6,25,39,59,189,454,466,494 'document-cod':1 'drift':520 'easier':243 'edit':268 'entri':9,46,62,75 'error':131,176 'exclud':156 'execut':173 'exist':87,98 'explicit':489 'export':116 'extern':154,157,322,405 'file':33,77,299,315,435,533,554 'first':52 'flag':438 'flow':174,221 'folder':34,78,119 'footer':432 'found':95 'friend':356 'full':409 'full-width':408 'function':35,79,151 'functions/apis':125 'futur':467 'gather':72 'generat':160,238,248,284,505 'glanc':348 'graph':395 'grid':335,385 'hand':267 'hand-edit':266 'handl':132,177 'hard':54 'hero':374 'high':168 'high-level':167 'highlight':122 'html':226,240,252,255,282,298,502 'implement':383,543 'implicit':483 'import':150,402 'improv':181 'includ':215 'info':423 'inlin':316 'insight':415,523,550 'instead':447 'interact':358 'kebab':194 'kebab-cas':193 'key':117,123,522 'kind':422 'knowledg':18,99 'lack':469 'languag':166 'language/type':381 'laptop':352 'latest':106 'layout':336 'level':169 'line':379 'list':120,401 'logic':172 'long':339 'loop':148 'map':15,28,368,487 'markdown':230,261,276,308,517 'md':204 'memori':107 'mermaid':216,326,365,397,412,513,548 'metadata':430,551 'modul':32,124 'name':191,203,251 'never':265 'next':426,556 'node':145 'normal':190 'npx':102 'obvious':482 'offer':225 'one':378 'one-lin':377 'open':507,524 'opt':289 'optim':300 'output':207,371,497,540 'overview':164,373,542 'packag':155 'pan/zoom':366 'paramet':128 'path':534 'pattern':118,175 'per':253 'perform':178 'plus':398 'point':10,47,63,76 'price':200 'print':355 'print-friend':354 'prose':393 'purpos':81,115,165,380 'queri':109 'question':525 'ration':440,441 'read':305 'reader':342,468 'red':437 'refer':304 'reflect':515 'regener':258 'relat':527 'relationship':223 'remind':537 'render':411,512 'replac':311 'resolv':88 'respons':273,349 'result':281 'return':129 'risk':183,425 'rule':55 'run':264 'save':17 'scan':244,302 'scroll':340 'search':96,108 'section':367,387,499 'secur':179 'self':296,465 'self-contain':295 'self-docu':464 'servic':153,404 'short':390 'sibl':249 'signatur':127 'singl':314 'skill' 'skill-document-code' 'sourc':112,212 'source-codeaholicguy' 'spec':257 'standalon':508 'step':292,320,427,557 'stop':274 'structur':12,42,121,345 'subsequ':263 'suggest':91 'summar':114,521 'surpris':486 'synthes':163 'system':158 'templat':208,372,498,541 'titl':376 'topic-agent-skills' 'topic-ai-assisted-development' 'topic-antigravity' 'topic-claude-code' 'topic-codex' 'topic-cursor' 'topic-development' 'topic-engineering' 'topic-engineering-enablement' 'topic-engineering-experience' 'topic-prd' 'total':199 'touch':436,555 'track':143 'truth':214 'understand':26,43,450,453,455 'use':20,205 'user':22,235,288 'valid':65,73,493 'valu':130 'verifi':85,460 'via':327 'view':138 'visit':144 'visual':406,546 'warn':424 'width':353,410 'workflow':53,70 'write':456 'written':232 'wrong':445 'y/n':245 'yes':247","prices":[{"id":"5e8bcb7a-9224-4ecb-b053-a3878945d436","listingId":"569b52a3-34fe-458a-a374-d7d4b4934f55","amountUsd":"0","unit":"free","nativeCurrency":null,"nativeAmount":null,"chain":null,"payTo":null,"paymentMethod":"skill-free","isPrimary":true,"details":{"org":"codeaholicguy","category":"ai-devkit","install_from":"skills.sh"},"createdAt":"2026-05-09T18:53:02.948Z"}],"sources":[{"listingId":"569b52a3-34fe-458a-a374-d7d4b4934f55","source":"github","sourceId":"codeaholicguy/ai-devkit/document-code","sourceUrl":"https://github.com/codeaholicguy/ai-devkit/tree/main/skills/document-code","isPrimary":false,"firstSeenAt":"2026-05-09T18:53:02.948Z","lastSeenAt":"2026-05-18T18:53:09.153Z"}],"details":{"listingId":"569b52a3-34fe-458a-a374-d7d4b4934f55","quickStartSnippet":null,"exampleRequest":null,"exampleResponse":null,"schema":null,"openapiUrl":null,"agentsTxtUrl":null,"citations":[],"useCases":[],"bestFor":[],"notFor":[],"kindDetails":{"org":"codeaholicguy","slug":"document-code","github":{"repo":"codeaholicguy/ai-devkit","stars":1196,"topics":["agent-skills","ai","ai-assisted-development","antigravity","claude-code","codex","cursor","development","engineering","engineering-enablement","engineering-experience","prd"],"license":null,"html_url":"https://github.com/codeaholicguy/ai-devkit","pushed_at":"2026-05-17T00:23:12Z","description":"A universal CLI toolkit for AI agent skills, enabling structured AI-assisted development across tools like Cursor, Claude Code, Codex, and more.","skill_md_sha":"06661369e559db5398a55e07def2d449d15e118f","skill_md_path":"skills/document-code/SKILL.md","default_branch":"main","skill_tree_url":"https://github.com/codeaholicguy/ai-devkit/tree/main/skills/document-code"},"layout":"multi","source":"github","category":"ai-devkit","frontmatter":{"name":"document-code","description":"AI DevKit · Document a code entry point with structured analysis, dependency mapping, and saved knowledge docs. Use when users ask to document, understand, or map code for a module, file, folder, function, or API."},"skills_sh_url":"https://skills.sh/codeaholicguy/ai-devkit/document-code"},"updatedAt":"2026-05-18T18:53:09.153Z"}}