@rune-kit/rune 2.10.0 → 2.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (205) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +8 -6
  3. package/commands/rune.md +168 -168
  4. package/contexts/dev.md +34 -34
  5. package/contexts/research.md +43 -43
  6. package/contexts/review.md +55 -55
  7. package/extensions/ai-ml/PACK.md +88 -88
  8. package/extensions/ai-ml/skills/ai-agents.md +172 -172
  9. package/extensions/ai-ml/skills/code-sandbox.md +187 -187
  10. package/extensions/ai-ml/skills/deep-research.md +146 -146
  11. package/extensions/ai-ml/skills/embedding-search.md +66 -66
  12. package/extensions/ai-ml/skills/fine-tuning-guide.md +74 -74
  13. package/extensions/ai-ml/skills/llm-architect.md +125 -125
  14. package/extensions/ai-ml/skills/llm-integration.md +64 -64
  15. package/extensions/ai-ml/skills/prompt-patterns.md +72 -72
  16. package/extensions/ai-ml/skills/rag-patterns.md +66 -66
  17. package/extensions/ai-ml/skills/web-extraction.md +114 -114
  18. package/extensions/analytics/PACK.md +92 -92
  19. package/extensions/analytics/skills/ab-testing.md +72 -72
  20. package/extensions/analytics/skills/dashboard-patterns.md +83 -83
  21. package/extensions/analytics/skills/data-validation.md +68 -68
  22. package/extensions/analytics/skills/funnel-analysis.md +81 -81
  23. package/extensions/analytics/skills/sql-patterns.md +57 -57
  24. package/extensions/analytics/skills/statistical-analysis.md +79 -79
  25. package/extensions/analytics/skills/tracking-setup.md +71 -71
  26. package/extensions/backend/PACK.md +104 -104
  27. package/extensions/backend/skills/api-patterns.md +84 -84
  28. package/extensions/backend/skills/async-pipeline.md +193 -193
  29. package/extensions/backend/skills/auth-patterns.md +97 -97
  30. package/extensions/backend/skills/background-jobs.md +133 -133
  31. package/extensions/backend/skills/caching-patterns.md +108 -108
  32. package/extensions/backend/skills/cli-generation.md +133 -133
  33. package/extensions/backend/skills/database-patterns.md +87 -87
  34. package/extensions/backend/skills/middleware-patterns.md +104 -104
  35. package/extensions/chrome-ext/PACK.md +93 -93
  36. package/extensions/chrome-ext/skills/cws-preflight.md +143 -143
  37. package/extensions/chrome-ext/skills/cws-publish.md +104 -104
  38. package/extensions/chrome-ext/skills/ext-ai-integration.md +251 -251
  39. package/extensions/chrome-ext/skills/ext-messaging.md +139 -139
  40. package/extensions/chrome-ext/skills/ext-storage.md +133 -133
  41. package/extensions/chrome-ext/skills/mv3-scaffold.md +164 -164
  42. package/extensions/content/PACK.md +96 -96
  43. package/extensions/content/skills/blog-patterns.md +88 -88
  44. package/extensions/content/skills/cms-integration.md +131 -131
  45. package/extensions/content/skills/content-scoring.md +107 -107
  46. package/extensions/content/skills/i18n.md +83 -83
  47. package/extensions/content/skills/mdx-authoring.md +137 -137
  48. package/extensions/content/skills/reference.md +1014 -1014
  49. package/extensions/content/skills/seo-patterns.md +67 -67
  50. package/extensions/content/skills/video-repurpose.md +153 -153
  51. package/extensions/devops/PACK.md +101 -101
  52. package/extensions/devops/skills/chaos-testing.md +67 -67
  53. package/extensions/devops/skills/ci-cd.md +75 -75
  54. package/extensions/devops/skills/docker.md +58 -58
  55. package/extensions/devops/skills/edge-serverless.md +163 -163
  56. package/extensions/devops/skills/infra-as-code.md +158 -158
  57. package/extensions/devops/skills/kubernetes.md +110 -110
  58. package/extensions/devops/skills/monitoring.md +57 -57
  59. package/extensions/devops/skills/server-setup.md +64 -64
  60. package/extensions/devops/skills/ssl-domain.md +42 -42
  61. package/extensions/ecommerce/PACK.md +116 -116
  62. package/extensions/ecommerce/skills/cart-system.md +79 -79
  63. package/extensions/ecommerce/skills/inventory-mgmt.md +102 -102
  64. package/extensions/ecommerce/skills/order-management.md +126 -126
  65. package/extensions/ecommerce/skills/payment-integration.md +472 -472
  66. package/extensions/ecommerce/skills/shopify-dev.md +69 -69
  67. package/extensions/ecommerce/skills/subscription-billing.md +93 -93
  68. package/extensions/ecommerce/skills/tax-compliance.md +117 -117
  69. package/extensions/gamedev/PACK.md +142 -142
  70. package/extensions/gamedev/skills/asset-pipeline.md +74 -74
  71. package/extensions/gamedev/skills/audio-system.md +129 -129
  72. package/extensions/gamedev/skills/camera-system.md +87 -87
  73. package/extensions/gamedev/skills/ecs.md +98 -98
  74. package/extensions/gamedev/skills/game-loops.md +72 -72
  75. package/extensions/gamedev/skills/input-system.md +199 -199
  76. package/extensions/gamedev/skills/multiplayer.md +180 -180
  77. package/extensions/gamedev/skills/particles.md +105 -105
  78. package/extensions/gamedev/skills/physics-engine.md +89 -89
  79. package/extensions/gamedev/skills/scene-management.md +146 -146
  80. package/extensions/gamedev/skills/threejs-patterns.md +90 -90
  81. package/extensions/gamedev/skills/webgl.md +71 -71
  82. package/extensions/mobile/PACK.md +106 -106
  83. package/extensions/mobile/skills/app-store-connect.md +152 -152
  84. package/extensions/mobile/skills/app-store-prep.md +66 -66
  85. package/extensions/mobile/skills/deep-linking.md +109 -109
  86. package/extensions/mobile/skills/flutter.md +60 -60
  87. package/extensions/mobile/skills/ios-build-pipeline.md +142 -142
  88. package/extensions/mobile/skills/native-bridge.md +66 -66
  89. package/extensions/mobile/skills/ota-updates.md +97 -97
  90. package/extensions/mobile/skills/push-notifications.md +111 -111
  91. package/extensions/mobile/skills/react-native.md +82 -82
  92. package/extensions/saas/PACK.md +116 -116
  93. package/extensions/saas/skills/billing-integration.md +200 -200
  94. package/extensions/saas/skills/feature-flags.md +130 -130
  95. package/extensions/saas/skills/multi-tenant.md +103 -103
  96. package/extensions/saas/skills/onboarding-flow.md +139 -139
  97. package/extensions/saas/skills/subscription-flow.md +95 -95
  98. package/extensions/saas/skills/team-management.md +144 -144
  99. package/extensions/security/PACK.md +99 -99
  100. package/extensions/security/skills/api-security.md +140 -140
  101. package/extensions/security/skills/compliance.md +68 -68
  102. package/extensions/security/skills/owasp-audit.md +64 -64
  103. package/extensions/security/skills/pentest-patterns.md +77 -77
  104. package/extensions/security/skills/secret-mgmt.md +65 -65
  105. package/extensions/security/skills/supply-chain.md +65 -65
  106. package/extensions/trading/PACK.md +80 -80
  107. package/extensions/trading/skills/chart-components.md +55 -55
  108. package/extensions/trading/skills/experiment-loop.md +125 -125
  109. package/extensions/trading/skills/fintech-patterns.md +47 -47
  110. package/extensions/trading/skills/indicator-library.md +58 -58
  111. package/extensions/trading/skills/quant-analysis.md +111 -111
  112. package/extensions/trading/skills/realtime-data.md +58 -58
  113. package/extensions/trading/skills/trade-logic.md +104 -104
  114. package/extensions/ui/PACK.md +130 -130
  115. package/extensions/ui/skills/a11y-audit.md +91 -91
  116. package/extensions/ui/skills/animation-patterns.md +127 -127
  117. package/extensions/ui/skills/component-patterns.md +100 -100
  118. package/extensions/ui/skills/design-decision.md +108 -108
  119. package/extensions/ui/skills/design-system.md +68 -68
  120. package/extensions/ui/skills/landing-patterns.md +155 -155
  121. package/extensions/ui/skills/palette-picker.md +173 -173
  122. package/extensions/ui/skills/react-health.md +90 -90
  123. package/extensions/ui/skills/type-system.md +125 -125
  124. package/extensions/ui/skills/web-vitals.md +153 -153
  125. package/extensions/zalo/PACK.md +145 -145
  126. package/extensions/zalo/skills/zalo-oa-mcp.md +317 -317
  127. package/extensions/zalo/skills/zalo-oa-messaging.md +429 -429
  128. package/extensions/zalo/skills/zalo-oa-setup.md +236 -236
  129. package/extensions/zalo/skills/zalo-oa-webhook.md +189 -189
  130. package/extensions/zalo/skills/zalo-personal-messaging.md +194 -194
  131. package/extensions/zalo/skills/zalo-personal-setup.md +153 -153
  132. package/extensions/zalo/skills/zalo-rate-guard.md +219 -219
  133. package/hooks/auto-format/index.cjs +48 -48
  134. package/hooks/hooks.json +111 -111
  135. package/hooks/post-session-reflect/index.cjs +189 -189
  136. package/hooks/pre-compact/index.cjs +95 -95
  137. package/hooks/run-hook.cmd +1 -1
  138. package/hooks/secrets-scan/index.cjs +100 -100
  139. package/hooks/session-start/index.cjs +71 -71
  140. package/hooks/typecheck/index.cjs +65 -65
  141. package/package.json +63 -63
  142. package/references/ui-pro-max-data/LICENSE-UI-PRO-MAX +21 -21
  143. package/references/ui-pro-max-data/charts.csv +26 -26
  144. package/references/ui-pro-max-data/colors.csv +161 -161
  145. package/references/ui-pro-max-data/styles.csv +68 -68
  146. package/references/ui-pro-max-data/typography.csv +74 -74
  147. package/references/ui-pro-max-data/ui-reasoning.csv +162 -162
  148. package/references/ui-pro-max-data/ux-guidelines.csv +99 -99
  149. package/skills/adversary/SKILL.md +283 -283
  150. package/skills/asset-creator/SKILL.md +157 -157
  151. package/skills/audit/SKILL.md +147 -2
  152. package/skills/autopsy/SKILL.md +335 -335
  153. package/skills/brainstorm/SKILL.md +342 -342
  154. package/skills/browser-pilot/SKILL.md +168 -168
  155. package/skills/constraint-check/SKILL.md +165 -165
  156. package/skills/context-engine/SKILL.md +404 -404
  157. package/skills/cook/SKILL.md +917 -863
  158. package/skills/db/SKILL.md +273 -273
  159. package/skills/debug/SKILL.md +465 -465
  160. package/skills/dependency-doctor/SKILL.md +265 -235
  161. package/skills/deploy/SKILL.md +274 -231
  162. package/skills/design/DESIGN-REFERENCE.md +365 -365
  163. package/skills/design/SKILL.md +589 -589
  164. package/skills/doc-processor/SKILL.md +254 -254
  165. package/skills/docs/SKILL.md +374 -374
  166. package/skills/docs-seeker/SKILL.md +177 -177
  167. package/skills/fix/SKILL.md +330 -330
  168. package/skills/git/SKILL.md +339 -339
  169. package/skills/hallucination-guard/SKILL.md +219 -219
  170. package/skills/incident/SKILL.md +254 -253
  171. package/skills/integrity-check/SKILL.md +169 -169
  172. package/skills/journal/SKILL.md +240 -240
  173. package/skills/launch/SKILL.md +344 -344
  174. package/skills/logic-guardian/SKILL.md +251 -251
  175. package/skills/marketing/SKILL.md +290 -289
  176. package/skills/mcp-builder/SKILL.md +425 -425
  177. package/skills/neural-memory/SKILL.md +362 -362
  178. package/skills/onboard/SKILL.md +404 -403
  179. package/skills/perf/SKILL.md +346 -346
  180. package/skills/plan/SKILL.md +433 -428
  181. package/skills/preflight/SKILL.md +415 -415
  182. package/skills/problem-solver/SKILL.md +380 -284
  183. package/skills/rescue/SKILL.md +474 -474
  184. package/skills/retro/SKILL.md +3 -1
  185. package/skills/review/SKILL.md +612 -588
  186. package/skills/review-intake/SKILL.md +249 -249
  187. package/skills/safeguard/SKILL.md +200 -200
  188. package/skills/sast/SKILL.md +190 -190
  189. package/skills/scaffold/SKILL.md +328 -287
  190. package/skills/scope-guard/SKILL.md +180 -180
  191. package/skills/scout/SKILL.md +263 -263
  192. package/skills/sentinel/SKILL.md +382 -381
  193. package/skills/sentinel-env/SKILL.md +254 -254
  194. package/skills/sequential-thinking/SKILL.md +234 -234
  195. package/skills/session-bridge/SKILL.md +543 -543
  196. package/skills/skill-forge/SKILL.md +581 -581
  197. package/skills/skill-router/SKILL.md +3 -0
  198. package/skills/surgeon/SKILL.md +215 -215
  199. package/skills/team/SKILL.md +556 -537
  200. package/skills/test/SKILL.md +614 -614
  201. package/skills/trend-scout/SKILL.md +145 -145
  202. package/skills/verification/SKILL.md +326 -326
  203. package/skills/video-creator/SKILL.md +201 -201
  204. package/skills/watchdog/SKILL.md +168 -168
  205. package/skills/worktree/SKILL.md +140 -140
@@ -1,287 +1,328 @@
1
- ---
2
- name: scaffold
3
- description: Autonomous project bootstrapper. Generates complete project from a description — structure, code, tests, docs, config. Orchestrates ba → plan → design → fix → test → docs → git in one pipeline. The "0 to production-ready" skill.
4
- metadata:
5
- author: runedev
6
- version: "0.1.0"
7
- layer: L1
8
- model: sonnet
9
- group: orchestrator
10
- tools: "Read, Write, Edit, Bash, Glob, Grep, WebFetch, WebSearch"
11
- ---
12
-
13
- # scaffold
14
-
15
- ## Purpose
16
-
17
- The "zero to production-ready" orchestrator. Takes a project description and autonomously generates a complete, working project — directory structure, code, tests, documentation, git setup, and verification. Orchestrates 8+ skills in sequence to produce output that builds, passes tests, and is ready for development.
18
-
19
- <HARD-GATE>
20
- Generated projects MUST build and pass tests. A scaffold that produces broken code is WORSE than no scaffold. Phase 9 (VERIFY) is mandatory — if verification fails, fix before presenting to user.
21
- </HARD-GATE>
22
-
23
- ## Triggers
24
-
25
- - `/rune scaffold <description>` — Interactive mode (asks questions)
26
- - `/rune scaffold express <detailed-description>` — Express mode (autonomous)
27
- - Called by `team` when task is greenfield project creation
28
- - Auto-trigger: when user says "new project", "start from scratch", "bootstrap", "create a new [app/api/lib]"
29
-
30
- ## Calls (outbound)
31
-
32
- - `ba` (L2): Phase 1 — requirement elicitation (always, even in Express mode)
33
- - `research` (L3): Phase 2best practices, starter templates, library comparison
34
- - `plan` (L2): Phase 3architecture and implementation plan
35
- - `design` (L2): Phase 4design system (frontend projects only)
36
- - `skill-forge` (L2): when scaffolded project includes custom skills or plugin structure
37
- - `fix` (L2): Phase 5 code generation (implements the plan)
38
- - `team` (L1): Phase 5 — parallel implementation when 3+ independent modules
39
- - `test` (L2): Phase 6test suite generation
40
- - `docs` (L2): Phase 7README, API docs, architecture doc
41
- - `git` (L3): Phase 8initial commit with semantic message
42
- - `verification` (L3): Phase 9lint + types + tests + build
43
- - `sentinel` (L2): Phase 9 — security scan on generated code
44
-
45
- ## Called By (inbound)
46
-
47
- - User: `/rune scaffold` direct invocation
48
- - `team` (L1): when decomposed task is a new project
49
- - `cook` (L1): when task is classified as greenfield (rare — cook usually handles features, not projects)
50
-
51
- ## Modes
52
-
53
- ### Interactive Mode (default)
54
-
55
- Full phase-gate workflow. User reviews and approves at each major phase:
56
- 1. BA asks 5 questions user answers
57
- 2. Plan presented → user approves
58
- 3. Design system presented → user approves (if frontend)
59
- 4. Implementation proceeds
60
- 5. Results presented with full report
61
-
62
- ### Express Mode
63
-
64
- Autonomous mode for detailed descriptions. User provides enough context upfront:
65
- 1. BA extracts requirements from description (no questions asked)
66
- 2. Plan auto-approved (user gave enough detail)
67
- 3. Implementation proceeds autonomously
68
- 4. User reviews only the final output
69
-
70
- <HARD-GATE>
71
- Express mode MUST still validate. Auto-approve doesn't mean skip quality checks.
72
- BA still extracts requirements it just doesn't ask questions.
73
- Verification (Phase 9) is NEVER skipped in any mode.
74
- </HARD-GATE>
75
-
76
- ## Project Templates
77
-
78
- Auto-detected from BA output. Template selection informs Phase 3 (Plan) architecture decisions.
79
-
80
- | Template | Stack | Key Generation Targets |
81
- |----------|-------|----------------------|
82
- | REST API | Node.js/Python + DB + Auth | Routes, models, middleware, migrations, Docker, CI |
83
- | Web App (Full-stack) | Next.js/SvelteKit + DB | Pages, components, API routes, auth, DB setup |
84
- | CLI Tool | Node.js/Python/Rust | Commands, arg parsing, config, tests |
85
- | Library/Package | TypeScript/Python | Src, tests, build config, npm/pypi publish setup |
86
- | MCP Server | TypeScript/Python | Tools, resources, handlers, tests (delegates to mcp-builder) |
87
- | Chrome Extension | React/Vanilla | Manifest, popup, content script, background, tests |
88
- | Mobile App | React Native/Expo | Screens, navigation, auth, API client |
89
-
90
- ## Executable Steps
91
-
92
- ### Phase 1 — BA (Requirement Elicitation)
93
-
94
- Invoke `rune:ba` with the user's project description.
95
-
96
- **Interactive Mode**: BA asks 5 questions, discovers hidden requirements, produces Requirements Document.
97
-
98
- **Express Mode**: BA extracts requirements from the detailed description without asking questions. Still produces Requirements Document with scope, user stories, and acceptance criteria.
99
-
100
- Output: `.rune/features/<project-name>/requirements.md`
101
-
102
- Gate: In Interactive mode, user must approve requirements before proceeding.
103
-
104
- ### Phase 2 — RESEARCH (Best Practices & Templates)
105
-
106
- Invoke `rune:research` to find:
107
- - Best practices for the detected project type
108
- - Recommended libraries (compare 2-3 options for each concern)
109
- - Starter templates or skeleton projects to reference
110
- - Common pitfalls for this stack
111
-
112
- Do NOT clone templates blindly. Use them as REFERENCE for architecture decisions in Phase 3.
113
-
114
- ### Phase 3 — PLAN (Architecture & Implementation)
115
-
116
- Invoke `rune:plan` with the Requirements Document from Phase 1 and research from Phase 2.
117
-
118
- Plan must include:
119
- - Directory structure (exact paths)
120
- - File list with purpose of each file
121
- - Implementation order (dependency-aware)
122
- - Technology choices with rationale
123
- - Test strategy (what to test, coverage target)
124
-
125
- Gate: In Interactive mode, user must approve plan before proceeding.
126
-
127
- ### Phase 4 — DESIGN (Design System — Frontend Only)
128
-
129
- If project has frontend (Web App, Mobile App, Chrome Extension):
130
- - Invoke `rune:design` to generate design system
131
- - Output: `.rune/design-system.md` with tokens, components, patterns
132
-
133
- If backend-only or CLI → skip this phase.
134
-
135
- ### Phase 5 — IMPLEMENT (Code Generation)
136
-
137
- Execute the plan from Phase 3. For each planned file:
138
-
139
- 1. Create directory structure first
140
- 2. Generate shared types/interfaces
141
- 3. Generate core modules (models, services, utilities)
142
- 4. Generate API layer (routes, controllers, handlers)
143
- 5. Generate UI layer (pages, components) if applicable
144
- 6. Generate configuration (env, docker, CI)
145
-
146
- **Parallelization**: If plan has 3+ independent modules → invoke `rune:team` to implement in parallel using worktrees.
147
-
148
- **Quality during generation**:
149
- - Follow project conventions from research
150
- - Include proper error handling
151
- - Use environment variables for config (never hardcode)
152
- - Add TypeScript strict types / Python type hints
153
- - Follow file size limits (< 500 LOC per file)
154
-
155
- ### Phase 6 — TEST (Test Suite Generation)
156
-
157
- Invoke `rune:test` to generate tests based on acceptance criteria from Phase 1:
158
-
159
- - Unit tests for each module/function
160
- - Integration tests for API endpoints
161
- - E2E test template for critical flows
162
- - Target: 80%+ coverage on generated code
163
-
164
- Each acceptance criterion from BA → at least one test case.
165
-
166
- ### Phase 7 — DOCS (Documentation)
167
-
168
- Invoke `rune:docs init` to generate:
169
-
170
- - `README.md` — Quick Start, Features, Tech Stack, Commands
171
- - `ARCHITECTURE.md` — if project has 10+ files
172
- - `docs/API.md` — if project has API endpoints
173
- - `.env.example` — all required environment variables with descriptions
174
-
175
- ### Phase 8 — GIT (Initial Commit)
176
-
177
- Invoke `rune:git commit` to create initial commit:
178
-
179
- - Stage all generated files (except .env, node_modules, __pycache__)
180
- - Commit message: `feat: scaffold <project-name> with <template> template`
181
- - Set up `.gitignore` appropriate for the stack
182
-
183
- ### Phase 9 — VERIFY (Quality Gate)
184
-
185
- Invoke `rune:verification` to run ALL checks:
186
-
187
- 1. **Lint**: ESLint/Ruff/Clippy — zero errors
188
- 2. **Types**: tsc --noEmit / mypy — zero errors
189
- 3. **Tests**: npm test / pytestall pass
190
- 4. **Build**: npm run build / python -m build — succeeds
191
- 5. **Security**: `rune:sentinel` quick scan no critical issues
192
-
193
- <HARD-GATE>
194
- If ANY check fails → fix the issue (invoke rune:fix) and re-verify.
195
- Do NOT present broken scaffold to user.
196
- Max 3 fix-verify loops. If still failing after 3 → report failures to user with context.
197
- </HARD-GATE>
198
-
199
- ## Output Format
200
-
201
- ```
202
- ## Scaffold Report: [Project Name]
203
- - **Template**: [detected template]
204
- - **Stack**: [framework, language, DB, etc.]
205
- - **Files Generated**: [count]
206
- - **Test Coverage**: [percentage]
207
- - **Phases**: BA → Research → Plan → Design? → Implement → Test Docs → Git → Verify
208
- - **Verification**: All checks passed / ⚠️ [issues]
209
-
210
- ### Generated Structure
211
- [file tree — max 30 lines, group similar files]
212
-
213
- ### What's Included
214
- - [feature list with key implementation details]
215
-
216
- ### What's NOT Included (Next Steps)
217
- - [out-of-scope items from BA — things user should build next]
218
-
219
- ### Commands
220
- - `[start command]` — start development server
221
- - `[test command]` — run tests
222
- - `[build command]` — production build
223
- - `[lint command]` — check code quality
224
- ```
225
-
226
- ## Error Recovery
227
-
228
- | Phase | Failure | Recovery |
229
- |-------|---------|----------|
230
- | Phase 1 (BA) | User refuses to answer questions | Extract what you can, flag assumptions prominently |
231
- | Phase 2 (Research) | No good references found | Use built-in knowledge, flag as "no external reference" |
232
- | Phase 3 (Plan) | Plan too complex (10+ phases) | Split into MVP (Phase 1) + Future (Phase 2) |
233
- | Phase 5 (Implement) | Code generation errors | Invoke fix retry, max 3 attempts per file |
234
- | Phase 6 (Test) | Tests fail on generated code | Fix code (not tests) re-run, max 3 loops |
235
- | Phase 9 (Verify) | Lint/type/build errors | Fix → re-verify, max 3 loops |
236
- | Phase 9 (Verify) | Still failing after 3 loops | Report to user with specific failures |
237
-
238
- ## Constraints
239
-
240
- 1. MUST run BA (Phase 1) before generating any code — even in Express mode
241
- 2. MUST generate tests no project without test suite is "production-ready"
242
- 3. MUST generate docs — README at minimum, API docs if applicable
243
- 4. MUST pass verification — generated project must build and pass lint/types/tests
244
- 5. MUST NOT use `--dangerously-skip-permissions` or `--no-verify` — quality gates are mandatory
245
- 6. MUST NOT generate hardcoded secrets — use .env.example with placeholder values
246
- 7. Express mode MUST still extract and validate requirements auto-approve ≠ skip analysis
247
- 8. MUST generate .gitignore appropriate for the stack
248
- 9. MUST respect user's existing project if scaffolding into non-empty directory — warn and ask before overwriting
249
- 10. Generated files MUST be < 500 LOC each — split large files
250
-
251
- ## Returns
252
-
253
- | Artifact | Format | Location |
254
- |----------|--------|----------|
255
- | Project directory structure | Directories + files | Project root (per plan) |
256
- | Source code | Source files | Per plan file list |
257
- | Test suite | Source files | Co-located or `tests/` per framework convention |
258
- | Documentation | Markdown | `README.md`, `ARCHITECTURE.md`, `docs/API.md` as applicable |
259
- | Scaffold Report | Markdown (inline) | Emitted at session end |
260
-
261
- ## Sharp Edges
262
-
263
- | Failure Mode | Severity | Mitigation |
264
- |---|---|---|
265
- | Generating code without BA wrong features | CRITICAL | Constraint 1: BA is Phase 1, always runs |
266
- | Scaffold passes locally but fails on fresh clone | HIGH | Phase 9 catches this verify build from clean state |
267
- | Overwriting existing files in non-empty directory | HIGH | Constraint 9: detect existing files, warn user |
268
- | Express mode skipping quality checks | HIGH | HARD-GATE: Express mode still validates everything |
269
- | Template mismatch (CLI template for web app) | MEDIUM | Template auto-detected from BA output, confirmed with user |
270
- | Generated tests are trivial (only smoke tests) | MEDIUM | Phase 6: tests derived from acceptance criteria, not generic |
271
- | Missing .gitignore → committing node_modules | MEDIUM | Constraint 8: generate stack-appropriate .gitignore |
272
-
273
- ## Done When
274
-
275
- - Requirements gathered (BA complete, Requirements Document produced)
276
- - Architecture planned (directory structure, tech choices, implementation order)
277
- - Design system generated (if frontend project)
278
- - All code generated (following plan, < 500 LOC per file)
279
- - Test suite generated (80%+ coverage target, acceptance criteria covered)
280
- - Documentation generated (README + ARCHITECTURE + API docs as applicable)
281
- - Initial git commit created
282
- - All verification checks passed (lint + types + tests + build + security)
283
- - Scaffold Report presented to user
284
-
285
- ## Cost Profile
286
-
287
- ~10000-20000 tokens total (across all sub-skill invocations). Sonnet for orchestration sub-skills use their own model selection (ba uses opus, git uses haiku, etc.). Most expensive L1 skill due to 9-phase pipeline, but runs rarely (project creation is infrequent).
1
+ ---
2
+ name: scaffold
3
+ description: Autonomous project bootstrapper. Generates complete project from a description — structure, code, tests, docs, config. Orchestrates ba → plan → design → fix → test → docs → git in one pipeline. The "0 to production-ready" skill.
4
+ metadata:
5
+ author: runedev
6
+ version: "0.1.0"
7
+ layer: L1
8
+ model: sonnet
9
+ group: orchestrator
10
+ tools: "Read, Write, Edit, Bash, Glob, Grep, WebFetch, WebSearch"
11
+ ---
12
+
13
+ # scaffold
14
+
15
+ ## Purpose
16
+
17
+ The "zero to production-ready" orchestrator. Takes a project description and autonomously generates a complete, working project — directory structure, code, tests, documentation, git setup, and verification. Orchestrates 8+ skills in sequence to produce output that builds, passes tests, and is ready for development.
18
+
19
+ <HARD-GATE>
20
+ Generated projects MUST build and pass tests. A scaffold that produces broken code is WORSE than no scaffold. Phase 9 (VERIFY) is mandatory — if verification fails, fix before presenting to user.
21
+ </HARD-GATE>
22
+
23
+ ## Triggers
24
+
25
+ - `/rune scaffold <description>` — Interactive mode (asks questions)
26
+ - `/rune scaffold express <detailed-description>` — Express mode (autonomous)
27
+ - Called by `team` when task is greenfield project creation
28
+ - Auto-trigger: when user says "new project", "start from scratch", "bootstrap", "create a new [app/api/lib]"
29
+
30
+ ## Calls (outbound)
31
+
32
+ - `ba` (L2): Phase 1 — requirement elicitation (always, even in Express mode)
33
+ - `sentinel-env` (L3): Phase 1.5environment pre-flight (validate runtime versions, ports, required tools before generating code)
34
+ - `research` (L3): Phase 2best practices, starter templates, library comparison
35
+ - `plan` (L2): Phase 3architecture and implementation plan
36
+ - `design` (L2): Phase 4 design system (frontend projects only)
37
+ - `skill-forge` (L2): when scaffolded project includes custom skills or plugin structure
38
+ - `fix` (L2): Phase 5 — code generation (implements the plan)
39
+ - `team` (L1): Phase 5parallel implementation when 3+ independent modules
40
+ - `test` (L2): Phase 6test suite generation
41
+ - `docs` (L2): Phase 7README, API docs, architecture doc
42
+ - `git` (L3): Phase 8initial commit with semantic message
43
+ - `verification` (L3): Phase 9 — lint + types + tests + build
44
+ - `sentinel` (L2): Phase 9 — security scan on generated code
45
+
46
+ ## Called By (inbound)
47
+
48
+ - User: `/rune scaffold` direct invocation
49
+ - `team` (L1): when decomposed task is a new project
50
+ - `cook` (L1): when task is classified as greenfield (rare — cook usually handles features, not projects)
51
+
52
+ ## Modes
53
+
54
+ ### Interactive Mode (default)
55
+
56
+ Full phase-gate workflow. User reviews and approves at each major phase:
57
+ 1. BA asks 5 questions → user answers
58
+ 2. Plan presented → user approves
59
+ 3. Design system presented → user approves (if frontend)
60
+ 4. Implementation proceeds
61
+ 5. Results presented with full report
62
+
63
+ ### Express Mode
64
+
65
+ Autonomous mode for detailed descriptions. User provides enough context upfront:
66
+ 1. BA extracts requirements from description (no questions asked)
67
+ 2. Plan auto-approved (user gave enough detail)
68
+ 3. Implementation proceeds autonomously
69
+ 4. User reviews only the final output
70
+
71
+ <HARD-GATE>
72
+ Express mode MUST still validate. Auto-approve doesn't mean skip quality checks.
73
+ BA still extracts requirements it just doesn't ask questions.
74
+ Verification (Phase 9) is NEVER skipped in any mode.
75
+ </HARD-GATE>
76
+
77
+ ## Project Templates
78
+
79
+ Auto-detected from BA output. Template selection informs Phase 3 (Plan) architecture decisions.
80
+
81
+ | Template | Stack | Key Generation Targets |
82
+ |----------|-------|----------------------|
83
+ | REST API | Node.js/Python + DB + Auth | Routes, models, middleware, migrations, Docker, CI |
84
+ | Web App (Full-stack) | Next.js/SvelteKit + DB | Pages, components, API routes, auth, DB setup |
85
+ | CLI Tool | Node.js/Python/Rust | Commands, arg parsing, config, tests |
86
+ | Library/Package | TypeScript/Python | Src, tests, build config, npm/pypi publish setup |
87
+ | MCP Server | TypeScript/Python | Tools, resources, handlers, tests (delegates to mcp-builder) |
88
+ | Chrome Extension | React/Vanilla | Manifest, popup, content script, background, tests |
89
+ | Mobile App | React Native/Expo | Screens, navigation, auth, API client |
90
+
91
+ ## Executable Steps
92
+
93
+ ### Phase 1 — BA (Requirement Elicitation)
94
+
95
+ Invoke `rune:ba` with the user's project description.
96
+
97
+ **Interactive Mode**: BA asks 5 questions, discovers hidden requirements, produces Requirements Document.
98
+
99
+ **Express Mode**: BA extracts requirements from the detailed description without asking questions. Still produces Requirements Document with scope, user stories, and acceptance criteria.
100
+
101
+ Output: `.rune/features/<project-name>/requirements.md`
102
+
103
+ Gate: In Interactive mode, user must approve requirements before proceeding.
104
+
105
+ ### Phase 2 — RESEARCH (Best Practices & Templates)
106
+
107
+ Invoke `rune:research` to find:
108
+ - Best practices for the detected project type
109
+ - Recommended libraries (compare 2-3 options for each concern)
110
+ - Starter templates or skeleton projects to reference
111
+ - Common pitfalls for this stack
112
+
113
+ Do NOT clone templates blindly. Use them as REFERENCE for architecture decisions in Phase 3.
114
+
115
+ ### Phase 3 — PLAN (Architecture & Implementation)
116
+
117
+ Invoke `rune:plan` with the Requirements Document from Phase 1 and research from Phase 2.
118
+
119
+ Plan must include:
120
+ - Directory structure (exact paths)
121
+ - File list with purpose of each file
122
+ - Implementation order (dependency-aware)
123
+ - Technology choices with rationale
124
+ - Test strategy (what to test, coverage target)
125
+
126
+ Gate: In Interactive mode, user must approve plan before proceeding.
127
+
128
+ ### Phase 4 — DESIGN (Design System — Frontend Only)
129
+
130
+ If project has frontend (Web App, Mobile App, Chrome Extension):
131
+ - Invoke `rune:design` to generate design system
132
+ - Output: `.rune/design-system.md` with tokens, components, patterns
133
+
134
+ If backend-only or CLI → skip this phase.
135
+
136
+ ### Phase 5 — IMPLEMENT (Code Generation)
137
+
138
+ Execute the plan from Phase 3. For each planned file:
139
+
140
+ 1. Create directory structure first
141
+ 2. Generate shared types/interfaces
142
+ 3. Generate core modules (models, services, utilities)
143
+ 4. Generate API layer (routes, controllers, handlers)
144
+ 5. Generate UI layer (pages, components) if applicable
145
+ 6. Generate configuration (env, docker, CI)
146
+
147
+ **Parallelization**: If plan has 3+ independent modules → invoke `rune:team` to implement in parallel using worktrees.
148
+
149
+ **Quality during generation**:
150
+ - Follow project conventions from research
151
+ - Include proper error handling
152
+ - Use environment variables for config (never hardcode)
153
+ - Add TypeScript strict types / Python type hints
154
+ - Follow file size limits (< 500 LOC per file)
155
+
156
+ ### Phase 6 — TEST (Test Suite Generation)
157
+
158
+ Invoke `rune:test` to generate tests based on acceptance criteria from Phase 1:
159
+
160
+ - Unit tests for each module/function
161
+ - Integration tests for API endpoints
162
+ - E2E test template for critical flows
163
+ - Target: 80%+ coverage on generated code
164
+
165
+ Each acceptance criterion from BA → at least one test case.
166
+
167
+ ### Phase 7 — DOCS (Documentation)
168
+
169
+ Invoke `rune:docs init` to generate:
170
+
171
+ - `README.md` — Quick Start, Features, Tech Stack, Commands
172
+ - `ARCHITECTURE.md` — if project has 10+ files
173
+ - `docs/API.md` — if project has API endpoints
174
+ - `.env.example` — all required environment variables with descriptions
175
+
176
+ ### Phase 8 — GIT (Initial Commit)
177
+
178
+ Invoke `rune:git commit` to create initial commit:
179
+
180
+ - Stage all generated files (except .env, node_modules, __pycache__)
181
+ - Commit message: `feat: scaffold <project-name> with <template> template`
182
+ - Set up `.gitignore` appropriate for the stack
183
+
184
+ ### Phase 9 — VERIFY (Quality Gate)
185
+
186
+ Invoke `rune:verification` to run ALL checks:
187
+
188
+ 1. **Lint**: ESLint/Ruff/Clippy — zero errors
189
+ 2. **Types**: tsc --noEmit / mypyzero errors
190
+ 3. **Tests**: npm test / pytest all pass
191
+ 4. **Build**: npm run build / python -m build — succeeds
192
+ 5. **Security**: `rune:sentinel` quick scan — no critical issues
193
+
194
+ <HARD-GATE>
195
+ If ANY check fails fix the issue (invoke rune:fix) and re-verify.
196
+ Do NOT present broken scaffold to user.
197
+ Max 3 fix-verify loops. If still failing after 3 → report failures to user with context.
198
+ </HARD-GATE>
199
+
200
+ ## Output Format
201
+
202
+ ```
203
+ ## Scaffold Report: [Project Name]
204
+ - **Template**: [detected template]
205
+ - **Stack**: [framework, language, DB, etc.]
206
+ - **Files Generated**: [count]
207
+ - **Test Coverage**: [percentage]
208
+ - **Phases**: BA Research Plan Design? → Implement → Test → Docs → Git → Verify
209
+ - **Verification**: ✅ All checks passed / ⚠️ [issues]
210
+
211
+ ### Generated Structure
212
+ [file tree — max 30 lines, group similar files]
213
+
214
+ ### What's Included
215
+ - [feature list with key implementation details]
216
+
217
+ ### What's NOT Included (Next Steps)
218
+ - [out-of-scope items from BA — things user should build next]
219
+
220
+ ### Commands
221
+ - `[start command]` — start development server
222
+ - `[test command]` — run tests
223
+ - `[build command]` — production build
224
+ - `[lint command]` — check code quality
225
+ ```
226
+
227
+ ## Error Recovery
228
+
229
+ | Phase | Failure | Recovery |
230
+ |-------|---------|----------|
231
+ | Phase 1 (BA) | User refuses to answer questions | Extract what you can, flag assumptions prominently |
232
+ | Phase 2 (Research) | No good references found | Use built-in knowledge, flag as "no external reference" |
233
+ | Phase 3 (Plan) | Plan too complex (10+ phases) | Split into MVP (Phase 1) + Future (Phase 2) |
234
+ | Phase 5 (Implement) | Code generation errors | Invoke fixretry, max 3 attempts per file |
235
+ | Phase 6 (Test) | Tests fail on generated code | Fix code (not tests) → re-run, max 3 loops |
236
+ | Phase 9 (Verify) | Lint/type/build errors | Fix re-verify, max 3 loops |
237
+ | Phase 9 (Verify) | Still failing after 3 loops | Report to user with specific failures |
238
+
239
+ ## Monorepo Mode
240
+
241
+ When user says "monorepo", "workspace", "turborepo", "nx", or "multi-package", scaffold switches to Monorepo Mode.
242
+
243
+ ### Monorepo Detection & Setup
244
+
245
+ ```
246
+ SIGNALS: pnpm-workspace.yaml | turbo.json | nx.json | packages/ directory | "monorepo" in task
247
+ ```
248
+
249
+ ### Structure Generated
250
+
251
+ ```
252
+ project/
253
+ ├── packages/
254
+ │ ├── core/ ← shared types, utilities
255
+ │ ├── api/ ← backend service
256
+ │ └── web/ ← frontend app
257
+ ├── package.json ← root workspace config (private: true)
258
+ ├── pnpm-workspace.yaml or turbo.json
259
+ ├── tsconfig.base.json shared TS config
260
+ └── .gitignore
261
+ ```
262
+
263
+ ### Monorepo-Specific Steps (additions to standard scaffold)
264
+
265
+ 1. **Workspace config**: generate `pnpm-workspace.yaml` (preferred) or `package.json` workspaces field
266
+ 2. **Build orchestration**: if turborepo generate `turbo.json` with `build`, `test`, `lint` pipelines and `dependsOn` for cross-package deps
267
+ 3. **Shared TS config**: `tsconfig.base.json` at root; each package extends it
268
+ 4. **Internal packages**: use `workspace:*` protocol for cross-package deps (not file: paths)
269
+ 5. **Test isolation**: each package has its own `npm test` script; root runs `turbo run test`
270
+ 6. **Affected-only CI guidance**: include `.github/workflows/ci.yml` with `turbo run test --filter=...[HEAD^1]` for affected-only runs
271
+
272
+ ### Monorepo Anti-Patterns
273
+
274
+ - DO NOT generate a single root `package.json` with all deps — defeats workspace isolation
275
+ - DO NOT use `file:../core` use `workspace:*` (pnpm) or `*` (yarn)
276
+ - DO NOT run all tests from root without turborepo/nx orchestration — causes O(n) sequential runs
277
+ - DO NOT share mutable state between packages via imports — use events or shared types only
278
+
279
+ ## Constraints
280
+
281
+ 1. MUST run BA (Phase 1) before generating any code — even in Express mode
282
+ 2. MUST generate tests no project without test suite is "production-ready"
283
+ 3. MUST generate docs README at minimum, API docs if applicable
284
+ 4. MUST pass verification — generated project must build and pass lint/types/tests
285
+ 5. MUST NOT use `--dangerously-skip-permissions` or `--no-verify` — quality gates are mandatory
286
+ 6. MUST NOT generate hardcoded secrets — use .env.example with placeholder values
287
+ 7. Express mode MUST still extract and validate requirementsauto-approve skip analysis
288
+ 8. MUST generate .gitignore appropriate for the stack
289
+ 9. MUST respect user's existing project if scaffolding into non-empty directory — warn and ask before overwriting
290
+ 10. Generated files MUST be < 500 LOC each — split large files
291
+
292
+ ## Returns
293
+
294
+ | Artifact | Format | Location |
295
+ |----------|--------|----------|
296
+ | Project directory structure | Directories + files | Project root (per plan) |
297
+ | Source code | Source files | Per plan file list |
298
+ | Test suite | Source files | Co-located or `tests/` per framework convention |
299
+ | Documentation | Markdown | `README.md`, `ARCHITECTURE.md`, `docs/API.md` as applicable |
300
+ | Scaffold Report | Markdown (inline) | Emitted at session end |
301
+
302
+ ## Sharp Edges
303
+
304
+ | Failure Mode | Severity | Mitigation |
305
+ |---|---|---|
306
+ | Generating code without BA → wrong features | CRITICAL | Constraint 1: BA is Phase 1, always runs |
307
+ | Scaffold passes locally but fails on fresh clone | HIGH | Phase 9 catches this — verify build from clean state |
308
+ | Overwriting existing files in non-empty directory | HIGH | Constraint 9: detect existing files, warn user |
309
+ | Express mode skipping quality checks | HIGH | HARD-GATE: Express mode still validates everything |
310
+ | Template mismatch (CLI template for web app) | MEDIUM | Template auto-detected from BA output, confirmed with user |
311
+ | Generated tests are trivial (only smoke tests) | MEDIUM | Phase 6: tests derived from acceptance criteria, not generic |
312
+ | Missing .gitignore → committing node_modules | MEDIUM | Constraint 8: generate stack-appropriate .gitignore |
313
+
314
+ ## Done When
315
+
316
+ - Requirements gathered (BA complete, Requirements Document produced)
317
+ - Architecture planned (directory structure, tech choices, implementation order)
318
+ - Design system generated (if frontend project)
319
+ - All code generated (following plan, < 500 LOC per file)
320
+ - Test suite generated (80%+ coverage target, acceptance criteria covered)
321
+ - Documentation generated (README + ARCHITECTURE + API docs as applicable)
322
+ - Initial git commit created
323
+ - All verification checks passed (lint + types + tests + build + security)
324
+ - Scaffold Report presented to user
325
+
326
+ ## Cost Profile
327
+
328
+ ~10000-20000 tokens total (across all sub-skill invocations). Sonnet for orchestration — sub-skills use their own model selection (ba uses opus, git uses haiku, etc.). Most expensive L1 skill due to 9-phase pipeline, but runs rarely (project creation is infrequent).