---
name: codewright-document
description: Create or update documentation that matches current code, public APIs, modules, or operational workflows. Use for "$codewright-document", "codewright document", legacy "codewright:document", JSDoc or TSDoc, API documentation, module guides, or README updates. Do not document speculative behavior as implemented.
---

# Codewright Document

1. Identify the requested audience and target: inline API docs, module guide, endpoint contract, operational runbook, or project README.
2. Read applicable root and nested `AGENTS.md` files, `.codewright/rules/*.md`, the implementation, tests, types, callers, and existing documentation conventions.
3. Document purpose, public inputs and outputs, errors, side effects, prerequisites, and one minimal verified example.
4. Prefer links to source-of-truth schemas and commands over duplicated details that will drift.
5. Mark planned, experimental, deprecated, and unsupported behavior accurately.
6. Run documentation checks or execute examples when feasible.
7. Report files updated, validation performed, and remaining undocumented surfaces.
