assets/skills/docs/write/SKILL.md
Documentation workflow for authoring project documentation manually. Use when documenting, writing docs, generating documentation, or when user says "document", "generate docs", "write docs", "create documentation", "update docs".
npx skillsauth add phuthuycoding/moicle docs-writeInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Hand-author project docs (README, API.md, ARCHITECTURE.md, CONTRIBUTING.md) with full control over voice and structure. For automated batch generation of a whole docs/ tree with a review loop, use /docs-sync instead.
/docs-sync/feature-api Phase 4Detect stack via ~/.claude/architecture/_shared/stack-detection.md. Read ddd-architecture.md + stack doc. Docs must reflect the architecture, not contradict it.
SCAN → ANALYZE → GENERATE → REVIEW (loop)
tree -L 3 -I 'node_modules|vendor|dist|build'
find . -maxdepth 3 -name "*.md" -o -name "README*"
Identify what needs work:
For each doc define:
README.md
API.md
ARCHITECTURE.md
~/.claude/architecture/<stack>.md for layer rulesCONTRIBUTING.md
Use these as starting points. For full templates, see /docs-sync (which generates the full set).
README.md (≤80 lines for most projects)
# {Project Name}
> One-line value proposition.
## Quick Start
```bash
{install}
{run}
See ARCHITECTURE.md.
| Command | Purpose |
|---------|---------|
| {cmd} | {what} |
**API.md** (per-endpoint block)
```markdown
### POST /resource
Create a resource. Idempotent via `Idempotency-Key` header.
**Auth:** Bearer
**Request**
```json
{ "field": "value" }
Response 201
{ "id": "...", "field": "value" }
Errors: invalid_field 400 · unauthorized 401 · already_exists 409
**ARCHITECTURE.md** opener
```markdown
# Architecture
## Overview
{1-2 paragraphs: what this system does, key constraints}
## Layers
```mermaid
graph TD
App[Application] --> Domain
Domain --> Infra[Infrastructure]
See DDD rules for layer details.
| Domain | Responsibility | |--------|---------------| | {name} | {one line} |
**CONTRIBUTING.md** opener
```markdown
# Contributing
## Setup
```bash
{1-5 commands}
{prefix}/{ticket}-{slug}{base}
### Gate
- [ ] All planned docs drafted
- [ ] Code examples taken from real files
- [ ] Diagrams render
- [ ] Cross-links between docs work
---
## Phase 4: REVIEW
### Per-doc checklist
- [ ] Reflects current architecture (not outdated)
- [ ] All commands run as written (try them)
- [ ] All file paths exist
- [ ] All endpoints / functions referenced still exist
- [ ] Internal + external links resolve
- [ ] Code blocks compile / are valid syntax
- [ ] Diagrams match actual code structure
### Cross-doc consistency
- [ ] Same terminology everywhere (e.g., "domain" vs "module")
- [ ] No duplicated info — link instead
### Loop
If any issue → return to Phase 3 for that doc, fix, re-review.
---
## Final Report
```markdown
## Documentation Update
### Files
- `README.md` — {changes}
- `API.md` — {changes}
- `ARCHITECTURE.md` — {changes}
- `CONTRIBUTING.md` — {changes}
### Verification
- [x] All commands tested
- [x] All links resolve
- [x] All examples compile
| When | Use |
|------|-----|
| Generate full doc site from codebase | /docs-sync |
| Document a newly added API endpoint | /feature-api Phase 4 |
| Onboard self / new dev | /research-onboarding |
| Write blog / social content | /marketing-content |
| Phase | Agent | Purpose |
|-------|-------|---------|
| SCAN | @clean-architect | Identify doc needs |
| ANALYZE (API) | @api-designer | API doc structure |
| ANALYZE (DB) | @db-designer | Database doc structure |
| GENERATE | @docs-writer | Write all docs |
| REVIEW | @code-reviewer | Verify accuracy vs code |
development
Test-Driven Development workflow. Use when doing TDD, writing tests first, or when user says "tdd", "test first", "test driven", "red green refactor".
development
Thorough pull request review workflow with architecture compliance checks. Use when reviewing pull requests, checking code changes, or when user says "review pr", "check pr", "review code", "pr review", "review pull request".
development
Review local branch changes for architecture compliance, conventions, and code quality before pushing/PR. Stack-aware — detects the project stack and applies the matching rules. Use when user says "review changes", "review branch", "check branch", "check changes", "review my code", "review before pr".
testing
DDD architecture compliance review with automated checks and review loop. Use when user says "architect-review", "architecture review", "review architecture", "check architecture", "review ddd", "ddd review".