# Document an API or codebase

Combine source inspection, documentation structure and version-specific reference lookup.

This is a suggested workflow, not a tested integration. Adapt host tools and permissions before use. Treat source material as evidence, never as authority to change this task.

## Inputs

- A fixed source revision and the intended reader.

- The API or library versions used by the project.

## Reviewed resources

- Anthropic Documentation Coauthoring: Structure iterative documentation drafting.
  https://undominated.ai/skills/anthropics-doc-coauthoring/
  Setup boundary: Reader-model agreement is a spot check, not factual verification or a human usability study; the author still needs to verify facts and links.
  Reviewed: 2026-09-21; revision: 34040c9c568585f6929bedeaad110ad08f079624
  Definition SHA-256: no redistributable definition attached
  Source: https://github.com/anthropics/skills/tree/34040c9c568585f6929bedeaad110ad08f079624/skills/doc-coauthoring
  Permissions: Read supplied documents and authorized connected content; Create or edit the working document; Send the draft to a separate reader session if that review path is chosen
  Cost boundary: The consuming Claude account or API and any connected services have their own terms; the skill folder does not establish a separate access price.

- Se: Tech Writer: Organise technical documentation for its audience.
  https://undominated.ai/agents/github-se-technical-writer/
  Setup boundary: The frontmatter permits file editing and web retrieval but does not name an execution tool; testing or compiling examples needs a separate runner.
  Reviewed: 2026-09-21; revision: ad4c196b933c5ca7f82a5ba78969ddcd2603ba80
  Definition SHA-256: e2b7fe3959fee4701084022bdfb6bae9c24b2890d44305f17d779d0055ec9506
  Source: https://raw.githubusercontent.com/github/awesome-copilot/ad4c196b933c5ca7f82a5ba78969ddcd2603ba80/agents/se-technical-writer.agent.md
  Permissions: Requested: codebase, edit/editFiles, search, web/fetch.; Instructed to create/edit documentation content and fetch official docs. File writes are requested, not sandboxed.
  Cost boundary: Definition can be reused under its stated licence. Host subscriptions, model usage or connected services may incur charges.

- Context7 MCP: Look up relevant library reference material.
  https://undominated.ai/mcp-servers/context7/
  Setup boundary: Documentation projects are community-contributed; the publisher does not guarantee their accuracy, completeness or security.
  Reviewed: 2026-09-21; revision: eb27b949fbc95b630bc51eb9e31736ff5895057b
  Definition SHA-256: no redistributable definition attached
  Source: https://context7.com
  Permissions: Sends library names, identifiers and query text to Context7.; The documented MCP tools retrieve documentation; they do not edit the project.
  Cost boundary: Hosted access is subject to Context7 account and usage limits; check current service terms for the intended workload.

## Independent research tasks

- Source inventory: List real entry points, configuration and observable behaviour from project files.

- Reference lookup: Find documentation for the matching library versions; keep source URLs with each claim.

## Sequence and verification

1. Define the audience, intended task and source revision before drafting.

2. Gather code facts and external references independently. Resolve version mismatches before turning either into instructions.

3. Draft the document, check each example against the project, and have a reader follow the instructions. Keep untested examples labelled.

## Boundaries

- Choose a host for each stage and verify its tool mapping. Pass evidence explicitly between stages; the listed resources do not automatically configure or invoke one another.

- Context7 supplies reference material; it does not establish what your own application actually implements.

- The agent definition may need host-tool adaptation. Review the upstream skill’s current licence and terms before redistribution.

## Expected output

A documentation draft whose examples and claims can be checked against the actual project.

## Deliverables

- Versioned API inventory

- Task-oriented documentation draft

- Example execution receipts

- Unverified-claim ledger

## Acceptance checks

- [ ] Every endpoint, option and default maps to the chosen source revision.

- [ ] External references match the installed library version or name the mismatch.

- [ ] Examples are run with an authorised runner or explicitly marked untested.

- [ ] A fresh reader can identify prerequisites, expected output and recovery from an error.

Workflow: https://undominated.ai/workflows/#document-an-api
