mk-docs-init
Generate initial docs/ from codebase analysis when a project has none. Triggers on 'init docs', 'create/generate documentation'. NOT for updating existing docs (mk:document-release).
- License 许可
- MIT
- 最近更新
- 2026-11-15
- Stars
- ★ 16
- Forks
- 3
01 前言 Front Matter
- name
- mk-docs-init
- description
- Generate initial docs/ from codebase analysis when a project has none. Triggers on 'init docs', 'create/generate documentation'. NOT for updating existing docs (mk:document-release).
02 资源文件 1
- 参考文档references/gotchas.md1.1 KB
03 SKILL.md 正文
Docs Init
Generate initial project documentation from codebase analysis.
Scope: Creates docs/ from scratch. For updating existing docs → mk:document-release.
Also run
mk:project-contextto generate the agent-constitution file (docs/project-context.md).mk:docs-initgenerates the full documentation suite;mk:project-contextgenerates only the constitution.
When to Use
- Project has no
docs/directory docs/exists but is empty or has only stubs- User asks to "initialize docs", "create documentation", "generate docs"
- After
mk:bootstrapcompletes (new project needs docs)
Do NOT invoke when: docs already exist and need updating (use mk:document-release).
Process
- Check existing state — does
docs/exist? Are files already populated?- If populated docs exist → suggest
mk:document-releaseinstead, stop.
- If populated docs exist → suggest
- Scout codebase — activate
mk:scoutto analyze project structure. Skip:.codex/,.git/,node_modules/,__pycache__/,dist/,build/ - Merge findings — consolidate scout reports into context for doc generation
- Generate docs — spawn
documentersub-task via Task tool with scout context. Output files (adapt to what the project actually has):README.md— project overview (≤300 lines)docs/project-overview.md— what this project is, who it's fordocs/codebase-summary.md— directory map, key modules, entry pointsdocs/code-standards.md— conventions found in codebasedocs/architecture/system-architecture.md— component diagram, data flow Optional (generate only if relevant):docs/deployment-guide.md— if CI/CD or Docker config detecteddocs/design-guidelines.md— if frontend/UI code detected
- Size check — run
wc -l docs/*.md | sort -rn. Flag files >800 lines. - Report — print generated files list with line counts.
Hard gate: Do NOT write code or implementation. Only documentation.
Gotchas
- Hallucinating architecture: generating docs about code that doesn't exist → always scout FIRST, generate from findings only
- Over-documenting small projects: creating 7 docs for a 50-line script → check project size; small projects get README + codebase-summary only
- Stale on first run: docs describe initial state but drift immediately → tell user to run
mk:document-releaseafter each feature ship
Full list: references/gotchas.md
Workflow Integration
Runs after mk:bootstrap or on any existing project without docs.
mk:bootstrap → mk:docs-init → mk:plan-creator (first feature)
Also invoked standalone: mk:docs-init on existing undocumented project.
Handoff Protocol
On completion:
- Print generated files list + line counts
- "Docs initialized. Run
mk:document-releaseafter shipping features to keep them in sync."
04 同仓库更多 Skills
mk-worktree
Manages git worktrees for parallel agent isolation: creates parallel/{name}-{timestamp} branches, merges with conflict detection. NOT for user feature branches (use git worktree directly).
mk-workflow-orchestrator
Auto-invoked 7-phase workflow for complex-feature intent; fasttrack mode for pre-approved specs. NOT for explicit single tasks (mk:cook), green-field builds (mk:autobuild), or simple fixes (mk:fix).
mk-web-to-markdown
Fetch a URL and return clean markdown, for arbitrary external pages (blog, RFC, GitHub issue, vendor doc) not covered by mk:docs-finder. Static-only by default; opt-in JS rendering available.
mk-vulnerability-scanner
Vulnerability analysis: OWASP Top 10, current threat landscape, supply chain security, attack surface mapping, risk prioritization. Use for security audits. NOT for STRIDE/CSO infra audits (mk:cso).
mk-vue
Vue 3 authoring/review: components, composables, reactivity, Pinia, Pinia Colada, file routing, forms. Composition API + script setup. Auto-activates on .vue files. Deep review: mk:vue-best-practices.
mk-vue-testing-best-practices
Vue 3 testing best-practices review: Vitest + Vue Test Utils for components, composables, Pinia, Router, async/Suspense, forms, a11y, plus Playwright E2E strategy. Advisory only.