{"id":"114d944d-a25a-4483-8074-209fa1bee0e0","shortId":"cQPsGY","kind":"skill","title":"docs-from-code","tagline":"Generates and updates README.md and API reference docs by reading your codebase's functions, routes, types, schemas, and architecture. Uses graphify to build a knowledge graph first, then writes accurate docs from it. Use when asked to write docs, generate a README, document an A","description":"# docs-from-code\n\nYou are a technical writer. Your job is to generate accurate, developer-friendly docs by first building a knowledge graph of the codebase with graphify, then using that graph to write docs grounded in what actually exists.\n\n**DO NOT invent code.** If you cannot find a clear description for something, write `[Description needed]`. Accurate but sparse docs are better than confident but wrong docs.\n\n**Before starting:** Confirm you are inside a codebase directory. If the user pointed you at a remote repo, clone it first. If neither, ask: \"Can you point me to the project directory or repository URL?\"\n\n---\n\n## Workflow\n\n### Step 1: Install graphify and Build the Knowledge Graph\n\ngraphify uses tree-sitter AST (20 languages, no LLM) for code structure and Claude subagents for semantic understanding of docs and comments.\n\n```bash\npip install graphifyy\ngraphify . --no-viz\n```\n\n`--no-viz` skips HTML output. You only need `GRAPH_REPORT.md` and `graph.json`.\n\nThis produces `graphify-out/` in the project root:\n- `GRAPH_REPORT.md` — god nodes, community clusters, surprising connections, suggested questions\n- `graph.json` — full queryable knowledge graph (persistent, SHA256-cached)\n\n**QA:** Did `graphify-out/GRAPH_REPORT.md` get created? How many nodes and edges? If graphify fails, go to Step 1B.\n\n#### Step 1B: Fallback (if graphify unavailable)\n\n```bash\n# TypeScript/JS projects:\ncd <skill-directory>/scripts && npm install\nnpx ts-node extract_ts.ts <project-root> <project-root>/.docs-extract.json\n\n# Python projects:\npython3 <skill-directory>/scripts/extract_py.py <project-root> <project-root>/.docs-extract.json\n```\n\nRead `references/extraction-guide.md` for framework-specific notes on the fallback output.\n\n---\n\n### Step 2: Read the Graph Report\n\nRead `graphify-out/GRAPH_REPORT.md` in full. This gives you:\n- **God nodes** — highest-degree concepts (what everything connects through). Use these for the Architecture section.\n- **Community clusters** — logical groupings of related code. Use these for module documentation.\n- **Surprising connections** — non-obvious cross-file relationships. Note these in Architecture.\n- **Suggested questions** — graphify's assessment of what is worth documenting.\n\nThen run targeted queries for specific doc sections:\n\n```bash\n# API routes\ngraphify query \"show all API routes and endpoints\" --graph graphify-out/graph.json\n\n# Data models\ngraphify query \"what are the main data models and types?\" --graph graphify-out/graph.json\n\n# Auth flow\ngraphify query \"how does authentication work?\" --graph graphify-out/graph.json\n\n# Entry points\ngraphify query \"what is the entry point and how is the app initialised?\" --graph graphify-out/graph.json\n```\n\nEach query returns a focused subgraph. Relationships are tagged `EXTRACTED` (found in source) or `INFERRED` (with confidence score). Trust `EXTRACTED` fully. Use `INFERRED` but flag uncertainty.\n\n**QA:** Cross-check 2-3 routes from the query against actual source files before writing docs.\n\n---\n\n### Step 3: Read Existing Documentation\n\nBefore writing anything new, check what already exists:\n\n1. Read `README.md` if present. Note which sections exist and which are stale or missing.\n2. Read `docs/API.md`, `docs/api.md`, or `API.md` if present.\n3. Read `CHANGELOG.md` for context on recent changes worth noting.\n\nDecide what to generate:\n- **No README** — generate a full README from Template 1 in `references/output-template.md`\n- **README exists, API section stale** — update only that section (Template 3)\n- **README exists, fully outdated** — ask: \"Your README exists but appears outdated. Rewrite fully or update specific sections?\"\n\n**QA:** List exactly what you will write or update before starting.\n\n---\n\n### Step 4: Generate Documentation\n\nRead `references/output-template.md` for the exact templates to use.\n\n**README — Project Description:**\nFrom `package.json` or `pyproject.toml` description + god nodes summary from `GRAPH_REPORT.md`.\n\n**README — Architecture Section:**\nUse god nodes and community clusters to write a plain-English architecture overview. Example:\n> \"The system is organised around 3 core modules: `AuthService` (god node, connects to 14 other components), `DatabaseAdapter` (bridges all data access), and `EventBus` (central to async flows). The auth and request-handling modules are tightly coupled; the analytics module is independent.\"\n\n**README — Installation and Quick Start:**\nFrom the entry point file + `scripts` in `package.json` or `Makefile`.\n\n**API Reference (`docs/API.md`):**\nFrom the `graphify query \"show all API routes\"` output. One section per resource, grouped by path prefix. For each route: method, path, description (from docstring or rationale node), request/response shape (from linked type nodes), curl example.\n\nFlag anything without a docstring as `[Description needed]`. Do not invent behaviour.\n\n**QA:** Check 3 random routes in the generated `docs/API.md` against the actual source file. Do the paths and descriptions match?\n\n---\n\n### Step 5: Write Files, Clean Up, and Open PR\n\n1. Write `README.md` to the project root (full file or updated sections only).\n2. Write `docs/API.md` if routes were found. Create `docs/` if needed.\n3. Clean up: `rm -rf graphify-out/ .docs-extract.json`\n\nAsk the user: \"Docs written. Should I open a GitHub PR with these changes?\"\n\nIf yes:\n```bash\ngit checkout -b docs/auto-generated-$(date +%Y%m%d)\ngit add README.md docs/\ngit commit -m \"docs: auto-generate README and API reference from codebase\"\ngh pr create \\\n  --title \"docs: auto-generated README and API reference\" \\\n  --body \"Generated by docs-from-code skill using graphify knowledge graph. All routes and types verified against source.\"\n```\n\n**QA:** Did the files write? Do paths exist? Did the PR open cleanly?\n\n---\n\n## What Good Output Looks Like\n\n- Architecture section explains god nodes and module relationships in plain English\n- Every route in `docs/API.md` matches a real path from the graphify query output\n- README Quick Start has a runnable snippet from tests or the entry point\n- INFERRED relationships that influenced descriptions are noted as \"likely\" or \"appears to\"\n- Missing descriptions are flagged `[Description needed]`, not fabricated\n\n## What Bad Output Looks Like\n\n- Routes or functions that do not appear in the graphify query results\n- Architecture section that is generic (\"the app has controllers, services, and models\")\n- Examples using wrong function names or parameter types\n- INFERRED edges described as definite facts without a confidence qualifier","tags":["docs","from","code","opendirectory","varnan-tech","agent-skills","gtm","hermes-agent","openclaw-skills","skills","technical-seo"],"capabilities":["skill","source-varnan-tech","skill-docs-from-code","topic-agent-skills","topic-gtm","topic-hermes-agent","topic-openclaw-skills","topic-skills","topic-technical-seo"],"categories":["opendirectory"],"synonyms":[],"warnings":[],"endpointUrl":"https://skills.sh/Varnan-Tech/opendirectory/docs-from-code","protocol":"skill","transport":"skills-sh","auth":{"type":"none","details":{"cli":"npx skills add Varnan-Tech/opendirectory","source_repo":"https://github.com/Varnan-Tech/opendirectory","install_from":"skills.sh"}},"qualityScore":"0.511","qualityRationale":"deterministic score 0.51 from registry signals: · indexed on github topic:agent-skills · 123 github stars · SKILL.md body (6,549 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-02T00:55:49.658Z","embedding":null,"createdAt":"2026-04-18T22:18:26.783Z","updatedAt":"2026-05-02T00:55:49.658Z","lastSeenAt":"2026-05-02T00:55:49.658Z","tsv":"'-3':461 '/.docs-extract.json':272,277 '/graph.json':379,396,409,429 '/graph_report.md':239,299 '/scripts':264 '/scripts/extract_py.py':276 '1':156,486,531,753 '14':629 '1b':253,255 '2':290,460,501,766 '20':170 '3':474,509,544,621,726,777 '4':574 '5':745 'access':636 'accur':34,64,108 'actual':90,467,735 'add':812 'alreadi':484 'analyt':654 'anyth':480,713 'api':10,365,371,536,673,682,824,838 'api.md':506 'app':423,957 'appear':554,924,945 'architectur':23,319,345,599,613,877,951 'around':620 'ask':40,142,549,786 'assess':350 'ast':169 'async':641 'auth':397,644 'authent':403 'authservic':624 'auto':820,834 'auto-gener':819,833 'b':805 'bad':935 'bash':187,260,364,802 'behaviour':723 'better':113 'bodi':840 'bridg':633 'build':27,71,160 'cach':233 'cannot':98 'cd':263 'central':639 'chang':516,799 'changelog.md':511 'check':459,482,725 'checkout':804 'claud':178 'clean':748,778,871 'clear':101 'clone':137 'cluster':220,322,606 'code':4,53,95,175,327,846 'codebas':16,77,126,827 'comment':186 'commit':816 'communiti':219,321,605 'compon':631 'concept':310 'confid':115,446,979 'confirm':121 'connect':222,313,334,627 'context':513 'control':959 'core':622 'coupl':652 'creat':241,773,830 'cross':339,458 'cross-check':457 'cross-fil':338 'curl':710 'd':810 'data':380,388,635 'databaseadapt':632 'date':807 'decid':519 'definit':975 'degre':309 'describ':973 'descript':102,106,587,592,698,718,742,918,927,930 'develop':66 'developer-friend':65 'directori':127,150 'doc':2,12,35,43,51,68,86,111,118,184,362,472,774,789,814,818,832,844 'docs-extract.json':785 'docs-from-cod':1,50,843 'docs/api.md':503,504,675,732,768,891 'docs/auto-generated-':806 'docstr':700,716 'document':47,332,355,477,576 'edg':246,972 'endpoint':374 'english':612,887 'entri':410,417,665,912 'eventbus':638 'everi':888 'everyth':312 'exact':564,581 'exampl':615,711,963 'exist':91,476,485,494,535,546,552,866 'explain':879 'extract':439,449 'extract_ts.ts':271 'fabric':933 'fact':976 'fail':249 'fallback':256,287 'file':340,469,667,737,747,761,862 'find':99 'first':31,70,139 'flag':454,712,929 'flow':398,642 'focus':434 'found':440,772 'framework':282 'framework-specif':281 'friend':67 'full':226,301,527,760 'fulli':450,547,557 'function':18,941,966 'generat':5,44,63,522,525,575,731,821,835,841 'generic':955 'get':240 'gh':828 'git':803,811,815 'github':795 'give':303 'go':250 'god':217,305,593,602,625,880 'good':873 'graph':30,74,83,163,229,293,375,392,405,425,851 'graph.json':206,225 'graph_report.md':204,216,597 'graphifi':25,79,158,164,191,210,237,248,258,297,348,367,377,382,394,399,407,412,427,678,783,849,898,948 'graphify-out':209,236,296,376,393,406,426,782 'graphifyy':190 'ground':87 'group':324,689 'handl':648 'highest':308 'highest-degre':307 'html':199 'independ':657 'infer':444,452,914,971 'influenc':917 'initialis':424 'insid':124 'instal':157,189,266,659 'invent':94,722 'job':60 'knowledg':29,73,162,228,850 'languag':171 'like':876,922,938 'link':707 'list':563 'llm':173 'logic':323 'look':875,937 'm':809,817 'main':387 'makefil':672 'mani':243 'match':743,892 'method':696 'miss':500,926 'model':381,389,962 'modul':331,623,649,655,883 'name':967 'need':107,203,719,776,931 'neither':141 'new':481 'no-viz':192,195 'node':218,244,270,306,594,603,626,703,709,881 'non':336 'non-obvi':335 'note':284,342,491,518,920 'npm':265 'npx':267 'obvious':337 'one':685 'open':751,793,870 'organis':619 'outdat':548,555 'output':200,288,684,874,900,936 'overview':614 'package.json':589,670 'paramet':969 'path':691,697,740,865,895 'per':687 'persist':230 'pip':188 'plain':611,886 'plain-english':610 'point':131,145,411,418,666,913 'pr':752,796,829,869 'prefix':692 'present':490,508 'produc':208 'project':149,214,262,274,586,758 'pyproject.toml':591 'python':273 'python3':275 'qa':234,456,562,724,859 'qualifi':980 'queri':359,368,383,400,413,431,465,679,899,949 'queryabl':227 'question':224,347 'quick':661,902 'random':727 'rational':702 'read':14,278,291,295,475,487,502,510,577 'readm':46,524,528,534,545,551,585,598,658,822,836,901 'readme.md':8,488,755,813 'real':894 'recent':515 'refer':11,674,825,839 'references/extraction-guide.md':279 'references/output-template.md':533,578 'relat':326 'relationship':341,436,884,915 'remot':135 'repo':136 'report':294 'repositori':152 'request':647 'request-handl':646 'request/response':704 'resourc':688 'result':950 'return':432 'rewrit':556 'rf':781 'rm':780 'root':215,759 'rout':19,366,372,462,683,695,728,770,853,889,939 'run':357 'runnabl':906 'schema':21 'score':447 'script':668 'section':320,363,493,537,542,561,600,686,764,878,952 'semant':181 'servic':960 'sha256':232 'sha256-cached':231 'shape':705 'show':369,680 'sitter':168 'skill':847 'skill-docs-from-code' 'skip':198 'snippet':907 'someth':104 'sourc':442,468,736,858 'source-varnan-tech' 'spars':110 'specif':283,361,560 'stale':498,538 'start':120,572,662,903 'step':155,252,254,289,473,573,744 'structur':176 'subag':179 'subgraph':435 'suggest':223,346 'summari':595 'surpris':221,333 'system':617 'tag':438 'target':358 'technic':57 'templat':530,543,582 'test':909 'tight':651 'titl':831 'topic-agent-skills' 'topic-gtm' 'topic-hermes-agent' 'topic-openclaw-skills' 'topic-skills' 'topic-technical-seo' 'tree':167 'tree-sitt':166 'trust':448 'ts':269 'ts-node':268 'type':20,391,708,855,970 'typescript/js':261 'unavail':259 'uncertainti':455 'understand':182 'updat':7,539,559,570,763 'url':153 'use':24,38,81,165,315,328,451,584,601,848,964 'user':130,788 'verifi':856 'viz':194,197 'without':714,977 'work':404 'workflow':154 'worth':354,517 'write':33,42,85,105,471,479,568,608,746,754,767,863 'writer':58 'written':790 'wrong':117,965 'y':808 'yes':801","prices":[{"id":"2de2323f-1b8f-4c52-8be0-977f3d6e43f2","listingId":"114d944d-a25a-4483-8074-209fa1bee0e0","amountUsd":"0","unit":"free","nativeCurrency":null,"nativeAmount":null,"chain":null,"payTo":null,"paymentMethod":"skill-free","isPrimary":true,"details":{"org":"Varnan-Tech","category":"opendirectory","install_from":"skills.sh"},"createdAt":"2026-04-18T22:18:26.783Z"}],"sources":[{"listingId":"114d944d-a25a-4483-8074-209fa1bee0e0","source":"github","sourceId":"Varnan-Tech/opendirectory/docs-from-code","sourceUrl":"https://github.com/Varnan-Tech/opendirectory/tree/main/skills/docs-from-code","isPrimary":false,"firstSeenAt":"2026-04-18T22:18:26.783Z","lastSeenAt":"2026-05-02T00:55:49.658Z"}],"details":{"listingId":"114d944d-a25a-4483-8074-209fa1bee0e0","quickStartSnippet":null,"exampleRequest":null,"exampleResponse":null,"schema":null,"openapiUrl":null,"agentsTxtUrl":null,"citations":[],"useCases":[],"bestFor":[],"notFor":[],"kindDetails":{"org":"Varnan-Tech","slug":"docs-from-code","github":{"repo":"Varnan-Tech/opendirectory","stars":123,"topics":["agent-skills","gtm","hermes-agent","openclaw-skills","skills","technical-seo"],"license":null,"html_url":"https://github.com/Varnan-Tech/opendirectory","pushed_at":"2026-04-30T18:54:05Z","description":" AI Agent Skills built for GTM, Technical Marketing, and growth automation.","skill_md_sha":"3749524977ae7b3303e79f228ed29f098c951af4","skill_md_path":"skills/docs-from-code/SKILL.md","default_branch":"main","skill_tree_url":"https://github.com/Varnan-Tech/opendirectory/tree/main/skills/docs-from-code"},"layout":"multi","source":"github","category":"opendirectory","frontmatter":{"name":"docs-from-code","description":"Generates and updates README.md and API reference docs by reading your codebase's functions, routes, types, schemas, and architecture. Uses graphify to build a knowledge graph first, then writes accurate docs from it. Use when asked to write docs, generate a README, document an API, update stale docs, create an API reference from code, add an architecture section, or document a project in any language. Trigger when a user says their docs are missing, outdated, or wants to document their codebase without writing it manually.","compatibility":"[claude-code, gemini-cli, github-copilot]"},"skills_sh_url":"https://skills.sh/Varnan-Tech/opendirectory/docs-from-code"},"updatedAt":"2026-05-02T00:55:49.658Z"}}