From NXTG Forge
Documentation standards and code-to-docs sync conventions for Forge projects — JSDoc/TSDoc annotations, README/CHANGELOG structure, auto-generated API reference, doc-tree layout, and staleness detection. Use when writing or reviewing docs, adding JSDoc to exported functions, structuring a docs/ tree, deciding what to document vs auto-generate, or running the Forge docs commands (/forge:docs-status, /forge:docs-audit, /forge:docs-update).
How this skill is triggered — by the user, by Claude, or both
Slash command
/nxtg-forge:documentationWhen to use
Trigger phrases: "document this", "add JSDoc", "write the README", "generate API docs", "is our documentation stale", "docs audit", "documentation coverage", "changelog", "ADR", "how should I structure docs", "docs are out of date".
This skill is limited to the following tools:
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
**Purpose**: Keep documentation synchronized with code
Purpose: Keep documentation synchronized with code
Primary Agent: release-sentinel (opus) — docs↔code sync, staleness, changelog generation
Supporting Agent: docs (sonnet) — writes JSDoc/README/API/architecture docs
Contributors: all agents (each documents its own output)
"Every feature is documented. Every change is tracked. No user is left wondering how something works."
The doc tree below is the recommended layout for a consuming project — it is aspirational, not the structure of this plugin repo itself. Adopt the parts that fit; do not scaffold empty directories to match it.
docs/
├── README.md # Entry point, always current
├── CHANGELOG.md # Auto-generated from commits
├── CONTRIBUTING.md # How to contribute
├──
├── getting-started/ # Onboarding
│ ├── installation.md
│ ├── quick-start.md
│ └── first-project.md
│
├── guides/ # How-to guides
│ ├── authentication.md
│ ├── deployment.md
│ └── troubleshooting.md
│
├── api/ # API reference (auto-generated)
│ ├── overview.md
│ ├── users.md
│ ├── projects.md
│ └── webhooks.md
│
├── components/ # Component docs (auto-generated)
│ ├── button.md
│ ├── input.md
│ └── card.md
│
├── cli/ # CLI reference (auto-generated)
│ └── commands.md
│
├── architecture/ # Design docs (manual)
│ ├── overview.md
│ ├── decisions/ # ADRs
│ │ ├── 001-database-choice.md
│ │ └── 002-auth-strategy.md
│ └── diagrams/
│
└── templates/ # Doc templates
├── api-endpoint.md
├── component.md
└── adr.md
What: API endpoints, component props, CLI commands, config options How: Extract from code annotations (JSDoc, OpenAPI, decorators) When: On every relevant code change Owner: Release Sentinel (automated)
/**
* Create a new user account
*
* @endpoint POST /api/users
* @auth Required (Bearer token)
* @rateLimit 10 requests/minute
*
* @param {string} email - User's email address
* @param {string} password - Password (min 8 chars)
* @param {string} [name] - Display name (optional)
*
* @returns {User} Created user object
* @throws {400} Invalid input
* @throws {409} Email already exists
*
* @example
* ```bash
* curl -X POST https://api.example.com/users \
* -H "Authorization: Bearer <token>" \
* -d '{"email": "[email protected]", "password": "secure123"}'
* ```
*/
export async function createUser(req: Request): Promise<User> {
// Implementation
}
↓ Auto-generates ↓
## POST /api/users
Create a new user account.
### Authentication
Required. Include Bearer token in Authorization header.
### Rate Limit
10 requests per minute.
### Request Body
| Field | Type | Required | Description |
|-------|------|----------|-------------|
| email | string | Yes | User's email address |
| password | string | Yes | Password (min 8 chars) |
| name | string | No | Display name |
### Response
Returns the created `User` object.
### Errors
| Code | Description |
|------|-------------|
| 400 | Invalid input |
| 409 | Email already exists |
### Example
```bash
curl -X POST https://api.example.com/users \
-H "Authorization: Bearer <token>" \
-d '{"email": "[email protected]", "password": "secure123"}'
```
What: Architecture overviews, design decisions, system concepts How: Human writes, AI assists with formatting and linking When: After major architectural changes Owner: Lead Architect creates, Release Sentinel maintains
What: Step-by-step guides, walkthroughs, examples How: Human creates outline, AI can expand and validate When: New features, common workflows Owner: Relevant agent creates, Release Sentinel maintains
What: Version history, changes, migration guides How: Parse conventional commits When: Every release Owner: Release Sentinel (automated)
Documentation becomes stale when:
Code changed, docs didn't
Time-based decay
Link rot
Example failures
Every documentation file must have:
These are namespaced under forge: and are user-typed only — each carries
disable-model-invocation: true, so Claude never auto-invokes them; the user runs them.
| Command | Purpose | Arguments |
|---|---|---|
/forge:docs-status | Show documentation health & coverage | none |
/forge:docs-audit | Comprehensive quality audit (coverage, inventory, links) | none |
/forge:docs-update | Find and update stale docs | --file <path>, --dry-run, --jsdoc, or none = all |
There is no docs-generate command in this plugin. To create a doc from a template, invoke
the docs agent or use /forge:docs-update --jsdoc for source annotations.
/docs-generate does not exist. Earlier revisions of this skill listed it; the plugin ships
only docs-status, docs-audit, docs-update. Do not tell a user to run it./forge:docs-*, not bare /docs-*. A bare /docs-status will not
resolve.disable-model-invocation: true. Saying
"check the docs" does not fire them — the user must type the slash command, or you run the
underlying analysis yourself with Grep/Glob/Bash.docs-update argument surface is inconsistent between frontmatter and body. Its
argument-hint advertises [file-path] [--all], but the command body actually parses
--file <path>, --dry-run, and --jsdoc (bare invocation = update all). Follow the body's
flags, not the hint.docs-update compares
git diff --name-only HEAD~20 -- src/ against docs changes — a doc edited by hand without a
matching source commit inside that window can read as "fresh" even if wrong. It flags drift,
not correctness.release-sentinel (opus) handles sync/staleness/
changelog around releases; docs (sonnet) authors new prose. Route "keep docs current for the
release" to release-sentinel and "write the API guide" to docs.docs-status counts documented vs undocumented
exports precisely so you know the input coverage before generating.docs/architecture/decisions/ — ADRs (Architecture Decision Records), manually authoredcommands/docs-status.md, commands/docs-audit.md, commands/docs-update.mdnpx claudepluginhub nxtg-ai/forge-plugin --plugin nxtg-forgeGuides completion of development work by verifying tests, detecting environment, and presenting structured options for merge, PR, or cleanup.
Enforces test-driven development: write failing test first, then minimal code to pass. Use when implementing features or bugfixes.
Guides creation and editing of skills using test-driven development with pressure scenarios and subagents to verify agent compliance.