From docs-generator
Write, organize, and refactor documentation optimized for both humans and AI agents (Cursor, Claude Code, etc.). Use this skill WHENEVER the user wants to: create docs for a new project, refactor old docs, asks "AI doesn't understand my codebase", asks about writing context for AI, or mentions "documentation", "context for AI", "structured docs", "docs for Cursor/Claude Code", "restructure README", "organize docs", "improve doc structure". Trigger even when the user just says "help me write docs", "AI keeps answering wrong", "need to document codebase".
npx claudepluginhub nampq11/agent-scripts --plugin docs-generatorThis skill uses the workspace's default tool permissions.
Create and restructure documentation optimized for both humans and AI agents.
Creates new Angular apps using Angular CLI with flags for routing, SSR, SCSS, prefixes, and AI config. Follows best practices for modern TypeScript/Angular development. Use when starting Angular projects.
Generates Angular code and provides architectural guidance for projects, components, services, reactivity with signals, forms, dependency injection, routing, SSR, ARIA accessibility, animations, Tailwind styling, testing, and CLI tooling.
Executes ctx7 CLI to fetch up-to-date library documentation, manage AI coding skills (install/search/generate/remove/suggest), and configure Context7 MCP. Useful for current API refs, skill handling, or agent setup.
Create and restructure documentation optimized for both humans and AI agents.
You MUST complete git workflow BEFORE creating any documentation files.
Check current branch:
git branch --show-current
If already on a feature branch for this task, skip to step 2.
Check repo's branch naming convention:
git branch -r | head -20
Look for patterns like feat/, feature/, docs/, etc.
Create and switch to new branch:
git checkout -b feat/docs-generator
(Replace feat/ with the repo's convention if different)
Before creating/updating/deleting ANY files:
branch="$(git rev-parse --abbrev-ref HEAD)"
git fetch origin
git pull --rebase origin "$branch"
If working tree is not clean, stash first:
git stash push -u -m "pre-sync"
branch="$(git rev-parse --abbrev-ref HEAD)"
git fetch origin && git pull --rebase origin "$branch"
git stash pop
STOP if:
origin is missing→ Ask the user before continuing.
Good documentation isn't about writing more—it's about writing with predictable structure. LLMs process tokens through attention weights: headings, tables, and code blocks receive higher attention than regular prose.
Domain partitioning formula:
Domain = Responsibility × Change-frequency × Dependency-level
| Attribute | What to Look For |
|---|---|
| Project type | Library, API, web app, CLI, microservices |
| Architecture | Monorepo, multi-package, single module |
| User personas | End users, developers, operators |
| Existing docs | README files, docs/ folder, inline comments |
| Gaps | What exists vs. what's missing |
Output status report after analysis (see Status Report format below).
Use 4 questions to classify:
| Question | Purpose |
|---|---|
| Change Q: "If you change X, do you have to change Y?" | X and Y belong in same doc if yes |
| Break Q: "If X breaks, what else breaks?" | Determine order |
| Explain Q: "Can you explain this concept in 3 minutes?" | If no → split it |
| Find Q: "Where would someone look for this info?" | Doc must match mental model |
Output status report after clustering.
For AI-optimized projects:
docs/
├── 00-architecture-overview.md # Foundation
├── 01-[core-flow].md
├── 02-[main-worker].md
├── 03-[interface-layer].md
├── 04-[external-services].md
├── 05-[data-layer].md
└── SITE.md # Index
For general projects:
docs/
├── architecture.md
├── api-reference.md
├── database.md
├── deployment.md
├── development.md
└── user-guide.md
IMPORTANT: Check if docs/ folder exists before using it in links.
docs/ exists: use docs/SITE.md in README linksdocs/ folder: use SITE.md directly (flat structure)For AI-optimized projects: Follow skeleton at references/doc-skeleton.md
For general projects: Use simplified structure:
# [Title]
[2-3 sentence overview]
## [Section Name]
[Use tables for config/data]
| Config | Value |
|--------|-------|
| key | value |
## File Reference
| File | Purpose |
|------|---------|
## Related Docs
| Doc | Relation |
|-----|----------|
Key rules (ALL projects):
Output status report after docs created.
For AI-optimized: use references/site-template.md
For general: simple index with quick reference table and doc descriptions.
Output final status report.
After each major step, output:
◆ [Step Name] ([step N of M] — [context])
··································································
[Check 1]: √ pass
[Check 2]: √ pass (note if relevant)
[Check 3]: × fail — [reason]
[Check 4]: √ pass
[Criteria]: √ N/M met
____________________________
Result: PASS | FAIL | PARTIAL
Git Workflow:
Branch createdRepo syncedProject Analysis:
Project analyzedGaps identifiedClustering:
Domain partitioning appliedDependency ordering determinedDocumentation Creation:
Docs createdFrontmatter complete (AI projects)Diagrams included (AI projects)Cross-references addedValidation:
Links verified (check paths exist!)Code examples validNo orphaned docs| Situation | Solution |
|---|---|
| No existing docs | Generate from code analysis |
| Conflicting docs | Flag to user, prefer code-derived info |
| Git sync fails | STOP and ask user |
| docs/ folder missing | Use flat structure, adjust links |
| Reference | When to Read |
|---|---|
references/doc-skeleton.md | Need full AI-optimized doc template |
references/site-template.md | Need to create SITE.md |
references/example-doc.md | Need complete example |
references/why-structure.md | Need to explain tables vs prose |
| Anti-pattern | Problem | Solution |
|---|---|---|
| Organize by file type | Feature spans types | Organize by responsibility |
| Alphabetical sorting | No learning path | Sort by dependency |
| One mega-doc | Can't chunk | Split into focused docs |
| Too much prose | AI can't extract | Use tables for data |
| No cross-references | Each doc is island | Always link related docs |
| Assume docs/ folder exists | Links break | Check structure first |