Agent skill

Docs From Code

by Varnan-Tech in Varnan-Tech/opendirectory

Generates and updates README.md and API reference docs by reading your codebase's functions, routes, types, schemas, and architecture.

MITAuto-check passedKnowledge Management

Install Docs From Code

skills CLI
$ npx skills add Varnan-Tech/opendirectory --skill docs-from-code -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install Varnan-Tech/opendirectory docs-from-code --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/Varnan-Tech/opendirectory.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/docs-from-code .claude/skills/docs-from-code && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
docs-from-code
GitHub stars
672
Token cost
~1.8k tokens
SKILL.md length
745 words
Files
9 (incl. scripts, references)
Skills in repo
61
Repo updated
First seen
Licence
MIT

At a glance

Generates and updates README.md and API reference docs by reading your codebase's functions, routes, types, schemas, and architecture.

  • Works in 5 steps: Install graphify and Build the Knowledge… → Read the Graph Report → Read Existing Documentation → …
  • Asked to write docs
  • SKILL.md covers Workflow, What Good Output Looks Like and What Bad Output Looks Like
  • Runs Python and TypeScript scripts from its folder; calls git, pip and npm

What it does

Docs From Code is an agent skill from Varnan-Tech/opendirectory. 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…

Its SKILL.md is about 1.8k tokens, which your agent loads only when the skill is triggered. The skill folder holds 11 other files, including scripts and reference files (for example `README.md`, `evals/evals.json` and `references/extraction-guide.md`). Compatibility notes: ["claude-code","gemini-cli","github-copilot"]

It sits in Knowledge Management, covering Knowledge graphs and Technical documentation. The repository describes itself as: AI Agent Skills built for Founders who hate Marketing. The licence is MIT.

When your agent uses it

  • Asked to write docs
  • Generate a README
  • Document an API
  • Update stale docs

Example prompts

  • “Use the docs-from-code skill to generate and updates README.md and API reference docs by reading your codebase's functions, routes, types, schemas…”
  • “/docs-from-code”

Requirements

  • Python 3
  • Node.js
  • Compatibility (from SKILL.md): ["claude-code","gemini-cli","github-copilot"]

Workflow steps

5 steps, taken from the step headings in SKILL.md.

  1. Install graphify and Build the Knowledge Graph
  2. Read the Graph Report
  3. Read Existing Documentation
  4. Generate Documentation
  5. Write Files, Clean Up, and Open PR

What it can do on your machine

Read from SKILL.md and the folder at commit 62e437a. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Ships 3 files in scripts/ (Python and TypeScript), which the agent can run.

    Shell commands in SKILL.md call:

    • git
    • pip
    • npm
    • npx
    • python3
    • gh

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md. Its commands use git, pip, npm, npx and gh, which can reach the network depending on how they are called.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

  • Compatibility

    ["claude-code","gemini-cli","github-copilot"]

    From compatibility in the SKILL.md frontmatter.

Context cost

Docs From Code loads about 1.8k tokens when it runs, and up to ~4.1k if it reads all its reference files. Until then it costs about 136 tokens; SKILL.md has 745 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~136
When it runs · the whole SKILL.md, loaded when a task matches
~1.8k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~4.1k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); the scripts in this folder are not scanned.

SKILL.md

The full file from Varnan-Tech/opendirectory at commit 62e437a, republished under its MIT licence (© Varnan-Tech). 745 words, ~1,805 tokens.

Download SKILL.mdSave it as .claude/skills/docs-from-code/SKILL.md (or your agent's skills folder). This skill also uses 8 other files; get the full folder from GitHub.
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"]
author
OpenDirectory
version
1.0.0

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.

bash
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)
bash
# 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.

Then run targeted queries for specific doc sections:

bash
# API routes
graphify query "show all API routes and endpoints" --graph graphify-out/graph.json

# Data models
graphify query "what are the main data models and types?" --graph graphify-out/graph.json

# Auth flow
graphify query "how does authentication work?" --graph graphify-out/graph.json

# Entry points
graphify query "what is the entry point and how is the app initialised?" --graph graphify-out/graph.json

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

QA: Cross-check 2-3 routes from the query against actual source files before writing docs.


Step 3: Read Existing Documentation

Before writing anything new, check what already exists:

  1. Read README.md if present. Note which sections exist and which are stale or missing.
  2. Read docs/API.md, docs/api.md, or API.md if present.
  3. Read CHANGELOG.md for context on recent changes worth noting.

Decide what to generate:

  • No README — generate a full README from Template 1 in references/output-template.md
  • README exists, API section stale — update only that section (Template 3)
  • README exists, fully outdated — ask: "Your README exists but appears outdated. Rewrite fully or update specific sections?"

QA: List exactly what you will write or update before starting.


Show full SKILL.md (345 more words)Show less
Step 4: Generate Documentation

Read references/output-template.md for the exact templates to use.

README — Project Description: From package.json or pyproject.toml description + god nodes summary from GRAPH_REPORT.md.

README — Architecture Section: Use god nodes and community clusters to write a plain-English architecture overview. Example:

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

README — Installation and Quick Start: From the entry point file + scripts in package.json or Makefile.

API Reference (docs/API.md): 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 type nodes), curl example.

Flag anything without a docstring as [Description needed]. Do not invent behaviour.

QA: Check 3 random routes in the generated docs/API.md against the actual source file. Do the paths and descriptions match?


Step 5: Write Files, Clean Up, and Open PR
  1. Write README.md to the project root (full file or updated sections only).
  2. Write docs/API.md if routes were found. Create docs/ if needed.
  3. Clean up: rm -rf graphify-out/ .docs-extract.json

Ask the user: "Docs written. Should I open a GitHub PR with these changes?"

If yes:

bash
git checkout -b docs/auto-generated-$(date +%Y%m%d)
git add README.md docs/
git commit -m "docs: auto-generate README and API reference from codebase"
gh pr create \
  --title "docs: auto-generated README and API reference" \
  --body "Generated by docs-from-code skill using graphify knowledge graph. All routes and types verified against source."

QA: Did the files write? Do paths exist? Did the PR open cleanly?


What Good Output Looks Like

  • Architecture section explains god nodes and module relationships in plain English
  • Every route in docs/API.md matches a real path from the graphify query output
  • README Quick Start has a runnable snippet from tests or the entry point
  • INFERRED relationships that influenced descriptions are noted as "likely" or "appears to"
  • Missing descriptions are flagged [Description needed], not fabricated

What Bad Output Looks Like

  • Routes or functions that do not appear in the graphify query results
  • Architecture section that is generic ("the app has controllers, services, and models")
  • Examples using wrong function names or parameter types
  • INFERRED edges described as definite facts without a confidence qualifier

© Varnan-Tech, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 8 other files (scripts, references) in skills/docs-from-code of Varnan-Tech/opendirectory.

  • SKILL.md
  • .env.example
  • README.md
  • evals/evals.json
  • references/extraction-guide.md
  • references/output-template.md
  • scripts/extract_py.py
  • scripts/extract_ts.ts
  • scripts/package.json

Open the folder on GitHubat commit 62e437a

Compare with similar skills

Docs From Code next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Docs From Code compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Docs From Code this skillVarnan-Tech/opendirectory672—~1.8kAutomated safety check: PassMIT
Project Onboarding Guide from Knowledge GraphEgonex-AI/Understand-Anything85k—~1.2kAutomated safety check: PassMIT
LLM Wiki Knowledge GraphEgonex-AI/Understand-Anything85k1 repos~1.5kAutomated safety check: PassMIT
Obsidian Canvas BoardsAgriciDaniel/claude-obsidian15k—~1.4kAutomated safety check: PassMIT
Ontology1mancompany/OneManCompany4382 repos~1.5kAutomated safety check: PassApache-2.0
Graphagenticnotetaking/arscontexta3.5k1 repos~4.9kAutomated safety check: NotesMIT

Similar skills

  • Writes an onboarding guide for new team members from a project's existing knowledge graph, after checking that the graph still matches the current commit.

    85k GitHub stars~1.2k tokensUpdated 2 days ago
    DevelopmentAuto-check passed
  • LLM Wiki Knowledge Graph

    Egonex-AI/Understand-Anything

    Detects a Karpathy-pattern LLM wiki and builds an interactive knowledge graph with entities, implicit relationships and topic clusters.

    85k GitHub starsUsed in 1 repo~1.5k tokens
    Knowledge ManagementAuto-check passed
  • Obsidian Canvas Boards

    AgriciDaniel/claude-obsidian

    Creates, inspects and updates Obsidian JSON Canvas boards in a vault, with text, file, link, group and edge nodes, using safe recoverable edits.

    15k GitHub stars~1.4k tokensUpdated 27 days ago
    Knowledge ManagementAuto-check passed
  • Ontology

    1mancompany/OneManCompany

    Typed knowledge graph for structured agent memory and composable skills.

    438 GitHub starsUsed in 2 repos~1.5k tokens
    Knowledge ManagementAuto-check passed
  • Graph

    agenticnotetaking/arscontexta

    Interactive knowledge graph analysis. An agent skill from agenticnotetaking/arscontexta.

    3.5k GitHub starsUsed in 1 repo~4.9k tokens
    Knowledge ManagementAuto-check: notes
  • Knowledge Graph

    gnomeria/usbtree

    Set up and maintain a lightweight, file-based knowledge graph of the repo — entities, typed relations, decisions, gotchas — so agents load context fast instead of re-exploring the codebase every…

    688 GitHub stars~1.5k tokensUpdated 1 mo ago
    Knowledge ManagementAuto-check passed

More from Varnan-Tech/opendirectory

All 61 skills in this repo
  • Podcast Transcript Fetcher

    Varnan-Tech/opendirectory

    A skill your agent uses when fetching, searching, or analyzing transcripts from Lenny's Podcast, Dwarkesh Podcast, Cheeky Pint, 20VC, or A16z Podcast.

    672 GitHub starsUsed in 1 repo~1.9k tokens
    Auto-check: notes
  • Graphic Ebook

    Varnan-Tech/opendirectory

    Creates professionally designed B2B SaaS e-books in HTML + CSS, exported as print-ready PDF.

    672 GitHub stars~5k tokensUpdated 1 mo ago
    Auto-check passed
  • Graphic Chart

    Varnan-Tech/opendirectory

    Generates data visualization charts (bar, line, area, pie, doughnut, scatter, radar, treemap) as PNG using Apache ECharts v6.

    672 GitHub stars~2.9k tokensUpdated 1 mo ago
    Auto-check passed
  • Graphic Gif

    Varnan-Tech/opendirectory

    Creates animated looping GIFs from CSS animations (default) or AI image-to-video.

    672 GitHub stars~3k tokensUpdated 1 mo ago
    Auto-check passed
  • Map Your Market

    Varnan-Tech/opendirectory

    Given a product description, category keywords, or competitor names (any combination), searches Reddit, Hacker News, GitHub Issues, G2, and Google Trends for the real pains your market experiences…

    672 GitHub stars~4.3k tokensUpdated 1 mo ago
    Auto-check passed
  • Newsletter Digest

    Varnan-Tech/opendirectory

    Aggregates RSS feeds from the past week, synthesizes the top stories using Gemini, and publishes a newsletter digest to Ghost CMS.

    672 GitHub stars~1.9k tokensUpdated 1 mo ago
    Auto-check passed

Questions about Docs From Code

What does Docs From Code do?

Generates and updates README.md and API reference docs by reading your codebase's functions, routes, types, schemas, and architecture. Docs From Code is an agent skill from Varnan-Tech/opendirectory.md and API reference docs by reading your codebase's functions, routes, types, schemas, and architecture.

When should I use Docs From Code?

Docs From Code fits situations like: asked to write docs; generate a README; document an API; update stale docs.

How do I install Docs From Code in Claude Code?

Run `npx skills add Varnan-Tech/opendirectory --skill docs-from-code -a claude-code`. Or copy the skill folder (skills/docs-from-code in Varnan-Tech/opendirectory) into .claude/skills/docs-from-code in your project. Claude Code loads it when a task matches its description.

How do I install Docs From Code in Codex?

Run `npx skills add Varnan-Tech/opendirectory --skill docs-from-code -a codex`. Or copy the skill folder (skills/docs-from-code in Varnan-Tech/opendirectory) into .agents/skills/docs-from-code in your project. Codex loads it when a task matches its description.

Can I use Docs From Code in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add Varnan-Tech/opendirectory --skill docs-from-code -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/docs-from-code, .gemini/skills/docs-from-code, .github/skills/docs-from-code and .opencode/skills/docs-from-code in your project.

What does Docs From Code need to run?

Going by SKILL.md and its folder, Docs From Code needs Python and TypeScript for the scripts in its folder and the command-line tools its instructions call (git, pip, npm, npx, python3 and gh). Our summary lists: Python 3; Node.js. Compatibility (from SKILL.md): ["claude-code","gemini-cli","github-copilot"].

Does Docs From Code access the network?

SKILL.md contains no URLs. Its commands use git, pip, npm, npx and gh, which can reach the network depending on how they are called. This is read from the text; nothing was executed.

Is Docs From Code safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. The check reads SKILL.md only: the scripts in the folder are not scanned, so read them before running anything.

What licence does Docs From Code use?

Docs From Code is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Docs From Code use?

About 1.8k tokens (SKILL.md is roughly 7.2k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 2.3k tokens, read only when the agent opens those files.

What are the alternatives to Docs From Code?

Skills that share tags, products or a category with Docs From Code: Project Onboarding Guide from Knowledge Graph (Egonex-AI/Understand-Anything, 85k stars), LLM Wiki Knowledge Graph (Egonex-AI/Understand-Anything, 85k stars), Obsidian Canvas Boards (AgriciDaniel/claude-obsidian, 15k stars) and Ontology (1mancompany/OneManCompany, 438 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Docs From Code?

Varnan-Tech (a GitHub organization) maintains it in Varnan-Tech/opendirectory, which has 672 GitHub stars. The repository holds 61 skills in this directory. The repository was last updated on August 16, 2026.

Source: Varnan-Tech/opendirectory on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.