docs-from-code

A documentation tool that reads a codebase's functions, routes, data types, schemas, and structure before writing a README or API reference. An API reference explains how other programs can use the code.

In plain words
What is it for?
Use it to create or update README files, API documentation, and architecture explanations from an existing codebase.
Why use it?
It keeps documentation tied to code that actually exists and leaves unclear parts marked instead of guessing.

Skill for Claude CodeCodex

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 skills/varnan-tech/opendirectory/docs-from-code
Any agent
npx skills add Varnan-Tech/opendirectory --skill docs-from-code
Clone the repo
git clone --depth 1 https://github.com/Varnan-Tech/opendirectory

Made for: Claude Code, Codex.

Per session 111 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,644 The whole file, excluding the scripts and references it only reads on demand.
Security scan C 2 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.00111 $0.01644
Opus 5 $0.00056 $0.00822
Sonnet 5 $0.00022 $0.00329
Haiku 4.5 $0.00011 $0.00164

Measured 2d ago against content hash 03dfb7200e93, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade C, and why

docs-from-code scanned grade C with 2 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 2d ago.

The scan reads SKILL.md. This mod also ships 2 executable files (scripts/extract_py.py, scripts/extract_ts.ts), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

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.

Recursive force deletehighDestructive command

rm -rf with a variable or a broad path is one typo away from removing the wrong tree.

3. Clean up: `rm -rf graphify-out/ .docs-extract.json`

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

From 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
skills/docs-from-code/SKILL.md · 161 lines

How it starts

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

docs-from-code

You 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.

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.

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?"


Workflow

Step 1: Install graphify and Build the Knowledge Graph

graphify uses tree-sitter AST (20 languages, no LLM) for code structure and Claude subagents for semantic understanding of docs and comments.

pip install graphifyy
graphify . --no-viz

--no-viz skips HTML output. You only need GRAPH_REPORT.md and graph.json.

This produces graphify-out/ in the project root:

  • GRAPH_REPORT.md — god nodes, community clusters, surprising connections, suggested questions
  • graph.json — full queryable knowledge graph (persistent, SHA256-cached)

QA: Did graphify-out/GRAPH_REPORT.md get created? How many nodes and edges? If graphify fails, go to Step 1B.

Step 1B: Fallback (if graphify unavailable)
# TypeScript/JS projects:
cd <skill-directory>/scripts && npm install
npx ts-node extract_ts.ts <project-root> <project-root>/.docs-extract.json

# Python projects:
python3 <skill-directory>/scripts/extract_py.py <project-root> <project-root>/.docs-extract.json

Read references/extraction-guide.md for framework-specific notes on the fallback output.


Step 2: Read the Graph Report

Read graphify-out/GRAPH_REPORT.md in full. This gives you:

  • God nodes — highest-degree concepts (what everything connects through). Use these for the Architecture section.
  • Community clusters — logical groupings of related code. Use these for module documentation.
  • Surprising connections — non-obvious cross-file relationships. Note these in Architecture.
  • Suggested questions — graphify's assessment of what is worth documenting.

Read the full file on GitHub · 161 lines

Files

What ships with it

8 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 2d ago First seen · 161 lines · 111 tokens per session scan C 03dfb7200e93

Subscribe to this mod's changes

docs-from-code is a skill published in the GitHub repository Varnan-Tech/opendirectory (632 stars, last pushed 16d ago), licensed MIT. It adds 111 tokens to every session and 1,644 once invoked, about $0.0006 per session on Opus 5. A static security scan graded it C with 2 findings (recursive force delete, makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

content-style

Writing Reddit-native content that sounds human, avoids AI tells, and delivers value through structure and specificity. Applies to workshop posts, definitive model guides, research megathreads, and community FYI/update posts.

AtlasOmnia/donna-starter · 37 tokens

hermes-plugin-development

Use when: creating, debugging, or integrating Hermes Agent plugins, including Python backend plugins (tools, hooks, routers, middleware) and JavaScript Hermes Desktop runtime plugins.

AtlasOmnia/donna-starter · 31 tokens

github-pre-push-gates

Before pushing a branch to a shared remote, run through these gates. They prevent pushing credentials, PII, private history, or a broken tree. The skill covers the pre-PR quality phase — use github-pr-workflow for the PR lifecycle itself.

AtlasOmnia/donna-starter · 39 tokens

macos-storage-management

Safely reclaim local Mac storage without mistaking cloud placeholders for resident data, losing File Provider content, or flattening metadata onto an incompatible external filesystem.

AtlasOmnia/donna-starter · 22 tokens

hermes-mnemosyne

Mnemosyne is Hermes' primary local-first memory engine — SQLite with vector + FTS5 hybrid search, 19+ tools, auto-consolidation, and a standalone CLI. It's a pip-installed plugin (not a built-in toolset) discovered via $HERMESHOME/plugins/mnemosyne/.

AtlasOmnia/donna-starter · 30 tokens

skill-auditor

Audit any Hermes skill file and assign a quality grade based on clarity, completeness, tool guidance, and shareability. Returns specific fix suggestions ranked by impact.

AtlasOmnia/donna-starter · 64 tokens