code-documentation

A code-writing documentation guide covering README files, API references, inline comments, and technical guides.

In plain words
What is it for?
Use it to document projects, functions, APIs, setup steps, configuration, usage, and contribution processes.
Why use it?
It provides a consistent structure for explaining code so other developers can understand and use it.

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/myths-labs/muse/code-documentation
Any agent
npx skills add myths-labs/muse --skill code-documentation
Clone the repo
git clone --depth 1 https://github.com/myths-labs/muse

Made for: Claude Code, Codex.

Per session 35 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,341 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin 95% copy Near-identical to another mod 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.00035 $0.01341
Opus 5 $0.00017 $0.00671
Sonnet 5 $0.00007 $0.00268
Haiku 4.5 $0.00003 $0.00134

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

Security

Grade A, and why

code-documentation scanned grade A with 0 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.

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.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

Origin

This is a copy

95% identical to code-documentation — 1 line differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

skills/toolkit/code-documentation/SKILL.md · 264 lines

How it starts

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

Code Documentation

README Structure

Standard README Template

# Project Name

Brief description of what this project does.

## Quick Start

\`\`\`bash
npm install
npm run dev
\`\`\`

## Installation

Detailed installation instructions...

## Usage

\`\`\`typescript
import { something } from 'project';

// Example usage
const result = something.doThing();
\`\`\`

## API Reference

### `functionName(param: Type): ReturnType`

Description of what the function does.

**Parameters:**
- `param` - Description of parameter

**Returns:** Description of return value

**Example:**
\`\`\`typescript
const result = functionName('value');
\`\`\`

## Configuration

| Option | Type | Default | Description |
|--------|------|---------|-------------|
| `option1` | `string` | `'default'` | What it does |

## Contributing

How to contribute...

## License

MIT

API Documentation

JSDoc/TSDoc Style

/**
 * Creates a new user account.
 *
 * @param userData - The user data for account creation
 * @param options - Optional configuration
 * @returns The created user object
 * @throws {ValidationError} If email is invalid
 * @example
 * ```ts
 * const user = await createUser({
 *   email: '[email protected]',
 *   name: 'John'
 * });
 * ```
 */
async function createUser(
  userData: UserInput,
  options?: CreateOptions
): Promise<User> {
  // Implementation
}

/**
 * Configuration options for the API client.
 */
interface ClientConfig {
  /** The API base URL */
  baseUrl: string;
  /** Request timeout in milliseconds @default 5000 */
  timeout?: number;
  /** Custom headers to include in requests */
  headers?: Record<string, string>;
}

OpenAPI/Swagger

openapi: 3.0.0
info:
  title: My API
  version: 1.0.0

paths:
  /users:
    post:
      summary: Create a user
      description: Creates a new user account
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UserInput'
      responses:
        '201':
          description: User created successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/User'
        '400':
          description: Invalid input

components:
  schemas:
    UserInput:
      type: object
      required:
        - email
        - name
      properties:
        email:
          type: string
          format: email
        name:
          type: string
    User:
      type: object
      properties:
        id:
          type: string
        email:
          type: string
        name:
          type: string
        createdAt:
          type: string
          format: date-time

Read the full file on GitHub · 264 lines

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 · 264 lines · 35 tokens per session scan A ad96e20d3864

Subscribe to this mod's changes

code-documentation is a skill published in the GitHub repository myths-labs/muse (32 stars, last pushed 1mo ago), licensed MIT. It adds 35 tokens to every session and 1,341 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. It is 95% identical to code-documentation, differing in 1 line, and is treated as a copy.

Related

Other skills, from other repositories

project-brain

Triggers (all require explicit user request — do NOT activate just because a brain/ folder exists): (1) The user wants to set up project-level memory ("set up project brain", "scaffold project context", "init project brain", "建项目脑"). (2) The user is in a directory containing brain/ AND explicitly asks to resume /…

Ethan-YS/project-brain · 237 tokens

context-receipts

Emit privacy-safe receipts for context selection, deferral, hydration, compaction, pruning, delegation, usage attribution, and boundary handoffs.

caioribeiroclw-pixel/pluribus · 33 tokens

engram

Local-first personal AI identity and memory layer for MCP-compatible coding tools (Claude Code, Codex, Cursor, and others). Use this skill when the user wants to continue from a previous session ("continue from last session", "pick up where we left off"), recall a past decision ("what did we decide", "what was our…

Patdolitse/piia-engram · 175 tokens

evidence-attestation

Emit privacy-safe evidence attestations for agent actions, reviews, memory answers, handoffs, scores, approvals, and tool dispatches.

caioribeiroclw-pixel/pluribus · 32 tokens

skill-policy-receipts

Use when a task must obey a hard project policy, such as "do not generate tests for internal services", "do not call production APIs", or "do not edit generated files". Emits a privacy-safe receipt before writes and after guard checks.

caioribeiroclw-pixel/pluribus · 55 tokens

testsprite-verify

TestSprite verification loop — after finishing a feature or fix in a TestSprite-tested repo, use the testsprite CLI to run the relevant TestSprite tests against the change and inspect any failure artifacts before reporting the work as done. Use whenever code has changed outside docs/config and is about to be reported…

shdra06/ai-mind-map · 105 tokens