# Docs From Code: Document Only What the Code Proves

> Draft reference docs from your code — every statement traceable to the code, and requested or expected details the code does not establish listed separately as NOT IN CODE.

Docs From Code: Document Only What the Code Proves is a free AI agent skill on Agensi by apitoolbox, in Technical Documentation. It loads into your AI agent through the Agensi MCP server, always in its latest approved version.

- Price: Free
- Creator: [apitoolbox](https://www.agensi.io/creators/apitoolbox)
- Category: [Technical Documentation](https://www.agensi.io/skills/technical-documentation)
- Version: 1.0
- Last updated: 2026-12-01
- Security: scan passed (2026-12-01); every new listing is also reviewed by a person
- Listing: https://www.agensi.io/skills/docs-from-code-document-only-what-the-code-proves
- Tags: documentation, technical-writing, api-docs, readme, coding-agents, skillmd

## About this skill

Paste the code and, if you have it, the existing documentation. This skill reads the whole body before writing — including the parts where side effects, validation, and error paths actually live — and drafts reference documentation covering parameters, defaults, return values, raised exceptions, and side effects, with every statement traceable to the code that proves it. Anything you asked for — or that reference docs conventionally cover — which the code does not prove (recommended settings, typical limits, use cases, the behaviour of helpers you did not paste) is never written into the draft as fact; it goes in a separate NOT IN CODE list, so the gaps are visible instead of filled with plausible guesses. When the existing documentation disagrees with the code, the code wins and every disagreement is listed, never silently overwritten. Each draft ends with exactly one verdict: DOCUMENTED or PARTIAL. It is a language-agnostic procedure that works from the code you provide. One thing to know before you use it: the verdict describes documentation coverage, not runtime verification — DOCUMENTED means the draft covers what the code proves, not that the code was executed or tested. In our own three-case contrast test, the verdict matched the answer key in only 1 of 3 cases; in the other 2 it came out PARTIAL because the skill counted unrequested unknowns, such as library return types, as gaps.

## Known limitations

Requires full code bodies, not just signatures. Cannot verify behaviors of external libraries or unprovided helper functions. Output is a draft, not a direct file edit.

## How to use this skill

1. Connect your AI agent to Agensi once: add the MCP server https://mcp.agensi.io/mcp/auth and sign in with your Agensi account (OAuth, no API key). Steps for Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and other agents: https://www.agensi.io/docs/mcp-setup
2. Ask your agent: "Use the Docs From Code: Document Only What the Code Proves skill from Agensi" and describe your task.
3. Your agent loads the skill from Agensi when it needs it. Nothing is downloaded.

## Frequently asked questions

### How does this skill prevent documentation from becoming inaccurate or misleading?

This skill eliminates technical hallucinations by drafting documentation strictly from source code logic. It solves the problem of outdated READMEs and unverified assumptions by enforcing a code first approach where every statement must be traceable to a specific line or branch in the implementation.

### What do I need to provide for the skill to generate documentation?

You only need to provide the source code you want documented and any existing documentation you wish to audit. The skill works best when you provide the full body of functions, including any internal helper logic you want analyzed.

### What specific outputs will I receive after the analysis?

The skill produces a structured draft covering signatures, parameters, return values, explicit exceptions, and side effects. You also receive a NOT IN CODE list for unprovable details and a Discrepancies report if the code contradicts your old documentation.

### How should I ask my agent to use this skill?

You can ask your agent to document a specific function, write the docs for an API endpoint, update a README for a provided code snippet, or check if existing docs are out of date. Simply paste the code and request a technical reference draft.

### Are there any types of technical information the skill cannot provide?

The skill cannot document behaviors of external libraries or helper functions if their source code is not included in the provided context. It also refuses to guess at performance guarantees, use cases, or security properties that are not explicitly defined within the code logic.

### How do I know if the documentation is complete based on the source code provided?

Every output ends with a verdict of either DOCUMENTED or PARTIAL. This tells you whether every requested detail was verified in the code or if some information was missing from the source and moved to the NOT IN CODE list.

---

Source: [Agensi](https://www.agensi.io), the marketplace of skills for AI agents. Any MCP-compatible agent (Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and more) connects at https://mcp.agensi.io/mcp/auth and signs in with an Agensi account; setup for every agent: https://www.agensi.io/docs/mcp-setup. Append .md to any skill, guide or docs address on agensi.io for its markdown version.
