| name | scaffold |
| description | Generate the complete documentation structure for a new module. Use when creating a new app or lib module, or when asked to scaffold, initialize, or set up module documentation. Module type must be specified explicitly.
|
| allowed-tools | Read, Write, Bash(mkdir *), Bash(ls *), Bash(cp *) |
| user-invocable | true |
Scaffold — Module Documentation Scaffolding
Generate the complete documentation structure for a new module or the repo root.
Command
/scaffold <module-path> --type core|lib|app
/scaffold --root
Arguments
| Argument | Required | Description |
|---|
<module-path> | Yes (unless --root) | Path to the module root (e.g., packages/payment-gateway) |
--type | Yes (unless --root) | Module type: core, lib, or app. Determines which directories and files are created. |
--root | No | Scaffold the repo-level docs/ structure instead of a module |
Workflow
Module Scaffolding (/scaffold <path> --type <type>)
-
Parse arguments. Extract <module-path> and --type from $ARGUMENTS. Type is required — do not guess or auto-detect.
-
Create core directories:
<module-path>/docs/proposals/
<module-path>/docs/plans/
<module-path>/docs/decisions/
<module-path>/docs/architecture/
-
Create type-specific directories:
- lib:
<module-path>/docs/examples/
- app:
<module-path>/docs/runbooks/, <module-path>/docs/integration/, <module-path>/docs/config/
-
Populate core files from templates/core/:
-
Populate type-specific files:
- lib: Write
INTERFACE.md from templates/lib/INTERFACE.md
- app: (No additional root files — app extensions are directories with template docs)
-
Run validation using scripts/validate-structure.sh:
bash scripts/validate-structure.sh --module-path <module-path> --type <type>
-
Report results to the user: list created directories and files, and validation status.
Root Scaffolding (/scaffold --root)
-
Create repo-root directories:
docs/proposals/
docs/plans/
docs/decisions/
docs/architecture/
-
Run root validation:
bash scripts/validate-structure.sh --root
-
Report results.
Templates
All canonical templates live in this skill's templates/ directory:
templates/core/ — proposal.md, plan.md, decision.md, architecture.md, README.md, CONTRIBUTING.md, CLAUDE.md
templates/lib/ — INTERFACE.md, example.md
templates/app/ — runbook.md, integration.md, config.md
Scripts
scripts/validate-structure.sh — Structural validation engine (canonical copy)
scripts/check-template-drift.sh — CI script to verify template copies match canonical