assets/skills/docs/sync/SKILL.md
Sync documentation workflow - reads codebase and docs folder to generate structured output docs with architecture, use cases, diagrams, and README index. Includes automated review loop. Use when user says "sync docs", "sync documentation", "generate docs", "update docs sync", "doc sync".
npx skillsauth add phuthuycoding/moicle docs-syncInstall 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.
Generate a complete docs/ site (business overview, architecture, use cases with sequence diagrams, README index) from the current codebase. Includes a 3-iteration auto-review loop.
docs/ site from current code/docs-write/research-onboarding/feature-api Phase 4Detect stack via ~/.claude/architecture/_shared/stack-detection.md. Read ddd-architecture.md + stack doc.
SCAN → CONFIRM mode → GENERATE → REVIEW loop (≤3x) → COMPLETE
CONFIRM asks the user to pick REFACTOR (full restructure of docs/) or UPDATE (keep existing structure, refresh content).
Goal: map codebase + existing docs in one pass.
# Existing docs
find . -name "*.md" -not -path "*/node_modules/*" -not -path "*/vendor/*" -not -path "*/.dart_tool/*" | sort
ls docs/ 2>/dev/null
# Code surface
tree -L 4 -I 'node_modules|vendor|dist|build|.dart_tool|.git'
# Entry points / use cases (per stack)
# Go: grep -r "func.*Handler" internal/
# NestJS: grep -r "@Controller\|@Get\|@Post" src/
# Laravel: cat routes/web.php routes/api.php
# Remix: ls app/routes/
# Flutter: grep -r "MaterialPageRoute\|GoRoute" lib/
Ask the user explicitly which mode:
| Mode | When to use | Effect |
|------|-------------|--------|
| REFACTOR | Existing docs are messy / partial / wrong structure | Restructure docs/ from scratch, may delete old files |
| UPDATE | Existing structure is fine, content is stale | Keep file paths + headings, refresh content + add missing sections |
If the user is unsure: default to UPDATE (less destructive).
Goal: produce the target docs/ tree.
docs/
├── README.md # Index linking to everything below
├── business.md # WHAT the system does, for non-engineers
├── architecture.md # HOW it's structured (layers + domains + tech)
├── use-cases/
│ ├── README.md # Index of use cases
│ ├── <use-case-1>.md # One file per user-facing flow, with sequence diagram
│ └── ...
├── api.md # If service has external API
└── runbook.md # How to run / deploy / debug
docs/README.md — index only (≤30 lines).
docs/business.md — for non-engineers.
docs/architecture.md — for engineers.
~/.claude/architecture/<stack>.md for layer rulesdocs/use-cases/<name>.md — one per flow.
sequenceDiagram) showing actor → handler → usecase → infra → responsedocs/api.md — only if external API exists.
docs/runbook.md — for ops / on-call.
mermaid-cli if available, otherwise eyeball testGoal: auto-check + fix until docs pass.
For each iteration:
API, JSON, class, file paths)## Docs Sync Complete
### Mode: {REFACTOR / UPDATE}
### Files
- Created: {N}
- Updated: {N}
- Deleted: {N — REFACTOR mode only}
### Coverage
- Domains documented: {N/N}
- Use cases documented: {N/N}
- Diagrams: {N}
### Review iterations: {1/2/3}
### Next steps for the team
- Review `docs/business.md` with product
- Validate `docs/use-cases/*.md` flows with team leads
- Set up doc lint in CI (broken-link checker)
| When | Use |
|------|-----|
| Author single doc by hand | /docs-write |
| Onboard self / new dev | /research-onboarding |
| Doc only one new endpoint | /feature-api Phase 4 |
| Architecture itself needs review | /review-architect |
| Phase | Agent | Purpose |
|-------|-------|---------|
| SCAN | @clean-architect | Identify domains + patterns |
| GENERATE | @docs-writer | Write all doc files |
| GENERATE | @api-designer | API reference accuracy |
| GENERATE | @db-designer | Data model accuracy |
| REVIEW | @code-reviewer | Verify code refs resolve |
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".