agentleFS
marwan562marwan562/agents-skills/skills/documentation/SKILL.md

documentation

Skill8 starsChanged 2 months agoMITView on GitHub

Use this skill when creating or maintaining project documentation — README, API docs, guides, ADRs, or inline docs. The agent should first understand the existing codebase before writing, ensuring docs are accurate and not hallucinated.

  • Reads credentials

58 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use refactoring, typescript and 10 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • pproencaSkill

    refactoring

    Code refactoring best practices based on Martin Fowler's catalog and Clean Code principles. This skill should be used when refactoring existing code, improving code structure, reducing complexity, eliminating code smells, or reviewing code for maintainability. Triggers on tasks involving extract method, rename, decompose conditional, reduce coupling, or improve readability.

    Also in 8 projects that use this

  • MicrosoftSkill

    typescript

    Use this guide when working on TypeScript changes in the FAST monorepo — authoring Web Components, writing templates and styles, working with the observable/reactive system, and testing.

    Also in 5 projects that use this

  • VercelSkill

    oauth

    Configure OAuth providers (Google, Apple, Microsoft, Facebook, GitHub, etc.) to work with portless local dev URLs. Use when setting up OAuth redirect URIs, fixing "redirect_uri_mismatch" or "invalid redirect" errors, configuring sign-in providers for local development, or when a provider rejects .localhost subdomains. Triggers include "OAuth not working with portless", "redirect URI mismatch", "Google/Apple/Microsoft sign-in fails locally", "configure OAuth for local dev", or any task involving OAuth callback URLs with portless domains.

    Also in 3 projects that use this

  • MicrosoftSkill

    rust

    Use this guide when working on Rust changes in the FAST monorepo.

    Also in 3 projects that use this

  • JohnJBorenSkill

    ci-cd

    CI/CD pipeline design, GitHub Actions, testing automation, and deployment strategies

    Also in 3 projects that use this

  • Microsoft AzureSkill

    git-workflow

    Squad branching model: dev-first workflow with insiders preview channel

    Also in 10 projects that use this

The file

Show its rules and text

We split this skill into the rules it gives an agent

18 rules. 0 are common, 13 are distinctive, and 5 are very specific to this project.

  • 0

    Common

    Most of the 52 edited versions we read keep these.

  • 13

    Distinctive

    This author's own choices. Worth a look.

  • 5

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Create documentation that is true to the code, easy to navigate, and cheap to keep updated.

    line 12
  2. Very specific:

    Check for existing docs: README.md, docs/, CONTRIBUTING.md, CHANGELOG.md, inline comments

    line 27
  3. Very specific:

    Use absolute file references with line numbers where helpful: src/auth/login.ts:42

    line 54
  4. Distinctive:

    Keep language concise, active, and consistent (present tense for behavior, imperative for instructions)

    line 57
  5. Distinctive:

    Add diagrams (Mermaid) only when they clarify a non-obvious flow

    line 58
  6. Distinctive:

    Remove or fix stale sections you discovered in step 2

    line 85
  7. Very specific:

    Leave a maintenance note where docs are likely to drift ("Source: src/routes.ts:18-45 — update here if routes change")

    line 86
  8. Distinctive:

    If the repo has a docs linter or link checker, run it

    line 87
  9. Distinctive:

    Never document from memory: Every command, env var, flag, and endpoint must be traced to a file:line you read.

    line 95
  10. Distinctive:

    Prefer discovery via tools: Use glob/grep to inventory files, read to extract facts, bash to verify commands.

    line 96
  11. Very specific:

    Minimize duplication: If package.json already declares the dev command, the README should call it out once and point to the file — don't …

    line 97
  12. Distinctive:

    Keep diffs focused: When updating docs, preserve surrounding formatting and TOC.

    line 99
  13. Very specific:

    Flag drift explicitly: If code and existing docs disagree, say so: "> Note: README says npm start but package.json:8 defines npm run dev — …

    line 100
  14. Distinctive:

    Do NOT invent APIs, env vars, commands, or file paths not found in the codebase

    line 104
  15. Distinctive:

    Do NOT write documentation before reading relevant source files

    line 105
  16. Distinctive:

    Do NOT duplicate large code blocks into docs when a file reference suffices

    line 106
  17. Distinctive:

    Do NOT use placeholder examples that could be mistaken for real usage without a clear label

    line 107
  18. Distinctive:

    Do NOT over-document: skip internal helpers that are not part of the public surface unless requested

    line 108

“Common” is measured: kept by at least 6 in 10 of the 52 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Documentation

Guides an AI agent to produce accurate, maintainable documentation by first grounding itself in the actual codebase.

Purpose

Create documentation that is true to the code, easy to navigate, and cheap to keep updated. Avoids the common failure of writing plausible but incorrect docs from memory or assumptions.

When to Use

  • User asks to write, update, or improve docs (README, CONTRIBUTING, API reference, guides, docs/ pages)
  • User asks to document a module, endpoint, function, or workflow
  • User says "explain this codebase" or "onboard me to this repo"
  • User requests ADRs, architecture docs, or runbooks
  • Keywords: documentation, docs, README, guide, API docs, explain, onboard

Workflow

1. Discover before writing

  • Inventory the codebase: entry points, top-level folders, package manifests (package.json, go.mod, pyproject.toml, etc.), routing/config files
  • Check for existing docs: README.md, docs/, CONTRIBUTING.md, CHANGELOG.md, inline comments
  • Identify the primary audience: new contributor, end user, operator, or API consumer — scope and tone follow from this
  • Do not write yet. Grounding first prevents hallucinated endpoints, env vars, or commands.

2. Read the source of truth

  • For each doc section you plan to write, open the corresponding source file(s) and extract facts:
    • Commands actually in package.json scripts / Makefile / justfile
    • Routes/handlers actually registered, not guessed
    • Env vars actually read (process.env, os.Getenv, etc.)
    • Dependencies and versions from lockfiles/manifests
  • Note any contradictions between existing docs and code — surface them to the user

3. Design the doc structure

Choose the minimal set needed; avoid duplicating information:

  • README.md — what it is, why it matters, quick start, links to deeper docs (keep under ~150 lines; details live in docs/)
  • API reference — endpoints/operations, auth, request/response examples, error codes (derive from OpenAPI/spec or handler code, not memory)
  • Guides / How-tos — task-oriented ("Deploy to Fly.io", "Add a new skill")
  • Architecture / ADRs — why the system is shaped this way (link to docs/architecture.md)
  • Reference — configuration, env vars, CLI flags (table format)

Include a table of contents when the doc exceeds ~80 lines.

4. Write with accuracy and navigability

  • Use absolute file references with line numbers where helpful: `src/auth/login.ts:42`
  • Provide copy-pasteable commands verified in step 2; never invent flags
  • Show real examples: actual request/response payloads, not placeholder foo/bar unless clearly labeled as schematic
  • Keep language concise, active, and consistent (present tense for behavior, imperative for instructions)
  • Add diagrams (Mermaid) only when they clarify a non-obvious flow

Templates:

README quick-start:

## Quick Start
\`\`\`bash
git clone <repo>
cd <repo>
npm ci         # verified from package.json:12
npm run dev    # starts http://localhost:3000
\`\`\`

API endpoint:

### POST /api/habits
Auth: Bearer token
Request: { "title": "string", "frequency": "daily|weekly" }
Response 201: { "id": "uuid", "title": "..." }
Errors: 400 validation, 401 unauthorized

5. Verify and maintain

  • Click every link; run every command sequence in a clean checkout when feasible
  • Remove or fix stale sections you discovered in step 2
  • Leave a maintenance note where docs are likely to drift ("Source: src/routes.ts:18-45 — update here if routes change")
  • If the repo has a docs linter or link checker, run it
  • Optional Jev gate (skipped without JEV_API_KEY): send the doc diff + source facts to jev_review. Full protocol: contribute Jev gates. Never send secrets.

Instructions

  • Never document from memory. Every command, env var, flag, and endpoint must be traced to a file:line you read.
  • Prefer discovery via tools. Use glob/grep to inventory files, read to extract facts, bash to verify commands.
  • Minimize duplication. If package.json already declares the dev command, the README should call it out once and point to the file — don't copy-paste a second source of truth.
  • Match the project's voice. Mirror tone and formatting from existing docs; don't introduce a new style guide mid-repo.
  • Keep diffs focused. When updating docs, preserve surrounding formatting and TOC; only change what is inaccurate or missing.
  • Flag drift explicitly. If code and existing docs disagree, say so: "> Note: README says npm start but package.json:8 defines npm run dev — docs updated to match."

Constraints

  • Do NOT invent APIs, env vars, commands, or file paths not found in the codebase
  • Do NOT write documentation before reading relevant source files
  • Do NOT duplicate large code blocks into docs when a file reference suffices
  • Do NOT use placeholder examples that could be mistaken for real usage without a clear label
  • Do NOT over-document: skip internal helpers that are not part of the public surface unless requested

Examples

Example 1 — Create a README from scratch

User: "Document this repo — there's no README yet."

Agent:

  1. Globs **/*.{json,md,toml,yaml}, reads package.json, src/index.ts:1-30, CONTRIBUTING.md
  2. Drafts README.md with: description from package.json:3, quick start from package.json:12-18, project structure from directory listing
  3. Verifies npm run dev actually starts the server before committing the example

Example 2 — Update API docs

User: "Update docs/api.md — we added a new endpoint POST /teams."

Agent:

  1. Reads src/routes/teams.ts:10-55, extracts auth, validation, response code
  2. Updates docs/api.md with the POST /teams section using the exact schema from src/schemas/team.ts:5-20
  3. Runs Markdown link check, confirms no broken anchors

Example 3 — Fix stale documentation

User: "The README says yarn start but we migrated to pnpm."

Agent:

  1. Reads README.md:24, package.json:10 (pnpm dev), pnpm-lock.yaml existence
  2. Patches README.md:24 to pnpm dev, adds note about pnpm install vs npm ci
  3. Greps for other occurrences of yarn start across docs/ and fixes them in the same pass

References

  • Works alongside project-architecture (architecture docs) and code-review (flags missing docs)
  • For skill docs, see CONTRIBUTING.md → "How to Create a New Skill" for SKILL.md structure

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.