@rune-kit/rune 2.10.0 → 2.12.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 (240) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +65 -6
  3. package/commands/rune.md +168 -168
  4. package/compiler/__tests__/detect-invariants.test.js +136 -0
  5. package/compiler/__tests__/doctor-mesh.test.js +229 -0
  6. package/compiler/__tests__/hook-dispatch.test.js +91 -0
  7. package/compiler/__tests__/hooks-antigravity.test.js +118 -0
  8. package/compiler/__tests__/hooks-cursor.test.js +139 -0
  9. package/compiler/__tests__/hooks-install.test.js +305 -0
  10. package/compiler/__tests__/hooks-merge.test.js +204 -0
  11. package/compiler/__tests__/hooks-tiers.test.js +519 -0
  12. package/compiler/__tests__/hooks-windsurf.test.js +115 -0
  13. package/compiler/__tests__/inject-claude-md.test.js +152 -0
  14. package/compiler/__tests__/load-invariants.test.js +408 -0
  15. package/compiler/__tests__/onboard-invariants.test.js +240 -0
  16. package/compiler/adapters/hooks/antigravity.js +140 -0
  17. package/compiler/adapters/hooks/claude.js +166 -0
  18. package/compiler/adapters/hooks/cursor.js +191 -0
  19. package/compiler/adapters/hooks/index.js +82 -0
  20. package/compiler/adapters/hooks/tier-emitter.js +182 -0
  21. package/compiler/adapters/hooks/windsurf.js +202 -0
  22. package/compiler/bin/rune.js +196 -6
  23. package/compiler/commands/hook-dispatch.js +87 -0
  24. package/compiler/commands/hooks/install.js +120 -0
  25. package/compiler/commands/hooks/merge.js +211 -0
  26. package/compiler/commands/hooks/presets.js +116 -0
  27. package/compiler/commands/hooks/status.js +112 -0
  28. package/compiler/commands/hooks/tiers.js +221 -0
  29. package/compiler/commands/hooks/uninstall.js +94 -0
  30. package/compiler/doctor.js +236 -0
  31. package/contexts/dev.md +34 -34
  32. package/contexts/research.md +43 -43
  33. package/contexts/review.md +55 -55
  34. package/extensions/ai-ml/PACK.md +88 -88
  35. package/extensions/ai-ml/skills/ai-agents.md +172 -172
  36. package/extensions/ai-ml/skills/code-sandbox.md +187 -187
  37. package/extensions/ai-ml/skills/deep-research.md +146 -146
  38. package/extensions/ai-ml/skills/embedding-search.md +66 -66
  39. package/extensions/ai-ml/skills/fine-tuning-guide.md +74 -74
  40. package/extensions/ai-ml/skills/llm-architect.md +125 -125
  41. package/extensions/ai-ml/skills/llm-integration.md +64 -64
  42. package/extensions/ai-ml/skills/prompt-patterns.md +72 -72
  43. package/extensions/ai-ml/skills/rag-patterns.md +66 -66
  44. package/extensions/ai-ml/skills/web-extraction.md +114 -114
  45. package/extensions/analytics/PACK.md +92 -92
  46. package/extensions/analytics/skills/ab-testing.md +72 -72
  47. package/extensions/analytics/skills/dashboard-patterns.md +83 -83
  48. package/extensions/analytics/skills/data-validation.md +68 -68
  49. package/extensions/analytics/skills/funnel-analysis.md +81 -81
  50. package/extensions/analytics/skills/sql-patterns.md +57 -57
  51. package/extensions/analytics/skills/statistical-analysis.md +79 -79
  52. package/extensions/analytics/skills/tracking-setup.md +71 -71
  53. package/extensions/backend/PACK.md +104 -104
  54. package/extensions/backend/skills/api-patterns.md +84 -84
  55. package/extensions/backend/skills/async-pipeline.md +193 -193
  56. package/extensions/backend/skills/auth-patterns.md +97 -97
  57. package/extensions/backend/skills/background-jobs.md +133 -133
  58. package/extensions/backend/skills/caching-patterns.md +108 -108
  59. package/extensions/backend/skills/cli-generation.md +133 -133
  60. package/extensions/backend/skills/database-patterns.md +87 -87
  61. package/extensions/backend/skills/middleware-patterns.md +104 -104
  62. package/extensions/chrome-ext/PACK.md +93 -93
  63. package/extensions/chrome-ext/skills/cws-preflight.md +143 -143
  64. package/extensions/chrome-ext/skills/cws-publish.md +104 -104
  65. package/extensions/chrome-ext/skills/ext-ai-integration.md +251 -251
  66. package/extensions/chrome-ext/skills/ext-messaging.md +139 -139
  67. package/extensions/chrome-ext/skills/ext-storage.md +133 -133
  68. package/extensions/chrome-ext/skills/mv3-scaffold.md +164 -164
  69. package/extensions/content/PACK.md +96 -96
  70. package/extensions/content/skills/blog-patterns.md +88 -88
  71. package/extensions/content/skills/cms-integration.md +131 -131
  72. package/extensions/content/skills/content-scoring.md +107 -107
  73. package/extensions/content/skills/i18n.md +83 -83
  74. package/extensions/content/skills/mdx-authoring.md +137 -137
  75. package/extensions/content/skills/reference.md +1014 -1014
  76. package/extensions/content/skills/seo-patterns.md +67 -67
  77. package/extensions/content/skills/video-repurpose.md +153 -153
  78. package/extensions/devops/PACK.md +101 -101
  79. package/extensions/devops/skills/chaos-testing.md +67 -67
  80. package/extensions/devops/skills/ci-cd.md +75 -75
  81. package/extensions/devops/skills/docker.md +58 -58
  82. package/extensions/devops/skills/edge-serverless.md +163 -163
  83. package/extensions/devops/skills/infra-as-code.md +158 -158
  84. package/extensions/devops/skills/kubernetes.md +110 -110
  85. package/extensions/devops/skills/monitoring.md +57 -57
  86. package/extensions/devops/skills/server-setup.md +64 -64
  87. package/extensions/devops/skills/ssl-domain.md +42 -42
  88. package/extensions/ecommerce/PACK.md +116 -116
  89. package/extensions/ecommerce/skills/cart-system.md +79 -79
  90. package/extensions/ecommerce/skills/inventory-mgmt.md +102 -102
  91. package/extensions/ecommerce/skills/order-management.md +126 -126
  92. package/extensions/ecommerce/skills/payment-integration.md +472 -472
  93. package/extensions/ecommerce/skills/shopify-dev.md +69 -69
  94. package/extensions/ecommerce/skills/subscription-billing.md +93 -93
  95. package/extensions/ecommerce/skills/tax-compliance.md +117 -117
  96. package/extensions/gamedev/PACK.md +142 -142
  97. package/extensions/gamedev/skills/asset-pipeline.md +74 -74
  98. package/extensions/gamedev/skills/audio-system.md +129 -129
  99. package/extensions/gamedev/skills/camera-system.md +87 -87
  100. package/extensions/gamedev/skills/ecs.md +98 -98
  101. package/extensions/gamedev/skills/game-loops.md +72 -72
  102. package/extensions/gamedev/skills/input-system.md +199 -199
  103. package/extensions/gamedev/skills/multiplayer.md +180 -180
  104. package/extensions/gamedev/skills/particles.md +105 -105
  105. package/extensions/gamedev/skills/physics-engine.md +89 -89
  106. package/extensions/gamedev/skills/scene-management.md +146 -146
  107. package/extensions/gamedev/skills/threejs-patterns.md +90 -90
  108. package/extensions/gamedev/skills/webgl.md +71 -71
  109. package/extensions/mobile/PACK.md +106 -106
  110. package/extensions/mobile/skills/app-store-connect.md +152 -152
  111. package/extensions/mobile/skills/app-store-prep.md +66 -66
  112. package/extensions/mobile/skills/deep-linking.md +109 -109
  113. package/extensions/mobile/skills/flutter.md +60 -60
  114. package/extensions/mobile/skills/ios-build-pipeline.md +142 -142
  115. package/extensions/mobile/skills/native-bridge.md +66 -66
  116. package/extensions/mobile/skills/ota-updates.md +97 -97
  117. package/extensions/mobile/skills/push-notifications.md +111 -111
  118. package/extensions/mobile/skills/react-native.md +82 -82
  119. package/extensions/saas/PACK.md +116 -116
  120. package/extensions/saas/skills/billing-integration.md +200 -200
  121. package/extensions/saas/skills/feature-flags.md +130 -130
  122. package/extensions/saas/skills/multi-tenant.md +103 -103
  123. package/extensions/saas/skills/onboarding-flow.md +139 -139
  124. package/extensions/saas/skills/subscription-flow.md +95 -95
  125. package/extensions/saas/skills/team-management.md +144 -144
  126. package/extensions/security/PACK.md +99 -99
  127. package/extensions/security/skills/api-security.md +140 -140
  128. package/extensions/security/skills/compliance.md +68 -68
  129. package/extensions/security/skills/owasp-audit.md +64 -64
  130. package/extensions/security/skills/pentest-patterns.md +77 -77
  131. package/extensions/security/skills/secret-mgmt.md +65 -65
  132. package/extensions/security/skills/supply-chain.md +65 -65
  133. package/extensions/trading/PACK.md +80 -80
  134. package/extensions/trading/skills/chart-components.md +55 -55
  135. package/extensions/trading/skills/experiment-loop.md +125 -125
  136. package/extensions/trading/skills/fintech-patterns.md +47 -47
  137. package/extensions/trading/skills/indicator-library.md +58 -58
  138. package/extensions/trading/skills/quant-analysis.md +111 -111
  139. package/extensions/trading/skills/realtime-data.md +58 -58
  140. package/extensions/trading/skills/trade-logic.md +104 -104
  141. package/extensions/ui/PACK.md +130 -130
  142. package/extensions/ui/skills/a11y-audit.md +91 -91
  143. package/extensions/ui/skills/animation-patterns.md +127 -127
  144. package/extensions/ui/skills/component-patterns.md +100 -100
  145. package/extensions/ui/skills/design-decision.md +108 -108
  146. package/extensions/ui/skills/design-system.md +68 -68
  147. package/extensions/ui/skills/landing-patterns.md +155 -155
  148. package/extensions/ui/skills/palette-picker.md +173 -173
  149. package/extensions/ui/skills/react-health.md +90 -90
  150. package/extensions/ui/skills/type-system.md +125 -125
  151. package/extensions/ui/skills/web-vitals.md +153 -153
  152. package/extensions/zalo/PACK.md +145 -145
  153. package/extensions/zalo/skills/zalo-oa-mcp.md +317 -317
  154. package/extensions/zalo/skills/zalo-oa-messaging.md +429 -429
  155. package/extensions/zalo/skills/zalo-oa-setup.md +236 -236
  156. package/extensions/zalo/skills/zalo-oa-webhook.md +189 -189
  157. package/extensions/zalo/skills/zalo-personal-messaging.md +194 -194
  158. package/extensions/zalo/skills/zalo-personal-setup.md +153 -153
  159. package/extensions/zalo/skills/zalo-rate-guard.md +219 -219
  160. package/hooks/auto-format/index.cjs +48 -48
  161. package/hooks/hooks.json +111 -111
  162. package/hooks/post-session-reflect/index.cjs +189 -189
  163. package/hooks/pre-compact/index.cjs +95 -95
  164. package/hooks/run-hook.cmd +1 -1
  165. package/hooks/secrets-scan/index.cjs +100 -100
  166. package/hooks/session-start/index.cjs +71 -71
  167. package/hooks/typecheck/index.cjs +65 -65
  168. package/package.json +63 -63
  169. package/references/ui-pro-max-data/LICENSE-UI-PRO-MAX +21 -21
  170. package/references/ui-pro-max-data/charts.csv +26 -26
  171. package/references/ui-pro-max-data/colors.csv +161 -161
  172. package/references/ui-pro-max-data/styles.csv +68 -68
  173. package/references/ui-pro-max-data/typography.csv +74 -74
  174. package/references/ui-pro-max-data/ui-reasoning.csv +162 -162
  175. package/references/ui-pro-max-data/ux-guidelines.csv +99 -99
  176. package/skills/adversary/SKILL.md +283 -283
  177. package/skills/asset-creator/SKILL.md +157 -157
  178. package/skills/audit/SKILL.md +147 -2
  179. package/skills/autopsy/SKILL.md +335 -335
  180. package/skills/ba/SKILL.md +85 -1
  181. package/skills/brainstorm/SKILL.md +380 -342
  182. package/skills/browser-pilot/SKILL.md +169 -168
  183. package/skills/constraint-check/SKILL.md +165 -165
  184. package/skills/context-engine/SKILL.md +408 -404
  185. package/skills/cook/SKILL.md +917 -863
  186. package/skills/db/SKILL.md +273 -273
  187. package/skills/debug/SKILL.md +465 -465
  188. package/skills/dependency-doctor/SKILL.md +265 -235
  189. package/skills/deploy/SKILL.md +274 -231
  190. package/skills/design/DESIGN-REFERENCE.md +365 -365
  191. package/skills/design/SKILL.md +590 -589
  192. package/skills/doc-processor/SKILL.md +254 -254
  193. package/skills/docs/SKILL.md +374 -374
  194. package/skills/docs-seeker/SKILL.md +178 -177
  195. package/skills/fix/SKILL.md +332 -330
  196. package/skills/git/SKILL.md +339 -339
  197. package/skills/hallucination-guard/SKILL.md +220 -219
  198. package/skills/incident/SKILL.md +254 -253
  199. package/skills/integrity-check/SKILL.md +169 -169
  200. package/skills/journal/SKILL.md +241 -240
  201. package/skills/launch/SKILL.md +344 -344
  202. package/skills/logic-guardian/SKILL.md +269 -251
  203. package/skills/marketing/SKILL.md +351 -289
  204. package/skills/mcp-builder/SKILL.md +425 -425
  205. package/skills/neural-memory/SKILL.md +359 -362
  206. package/skills/onboard/SKILL.md +432 -403
  207. package/skills/onboard/references/invariants-template.md +76 -0
  208. package/skills/onboard/scripts/detect-invariants.js +439 -0
  209. package/skills/onboard/scripts/inject-claude-md.js +150 -0
  210. package/skills/onboard/scripts/onboard-invariants.js +194 -0
  211. package/skills/perf/SKILL.md +347 -346
  212. package/skills/plan/SKILL.md +435 -428
  213. package/skills/preflight/SKILL.md +415 -415
  214. package/skills/problem-solver/SKILL.md +380 -284
  215. package/skills/rescue/SKILL.md +474 -474
  216. package/skills/research/SKILL.md +4 -0
  217. package/skills/retro/SKILL.md +3 -1
  218. package/skills/review/SKILL.md +614 -588
  219. package/skills/review-intake/SKILL.md +249 -249
  220. package/skills/safeguard/SKILL.md +200 -200
  221. package/skills/sast/SKILL.md +190 -190
  222. package/skills/scaffold/SKILL.md +328 -287
  223. package/skills/scope-guard/SKILL.md +183 -180
  224. package/skills/scout/SKILL.md +269 -263
  225. package/skills/sentinel/SKILL.md +384 -381
  226. package/skills/sentinel-env/SKILL.md +254 -254
  227. package/skills/sequential-thinking/SKILL.md +234 -234
  228. package/skills/session-bridge/SKILL.md +595 -543
  229. package/skills/session-bridge/scripts/load-invariants.js +397 -0
  230. package/skills/skill-forge/SKILL.md +581 -581
  231. package/skills/skill-router/SKILL.md +3 -0
  232. package/skills/slides/SKILL.md +19 -0
  233. package/skills/surgeon/SKILL.md +215 -215
  234. package/skills/team/SKILL.md +557 -537
  235. package/skills/test/SKILL.md +620 -614
  236. package/skills/trend-scout/SKILL.md +145 -145
  237. package/skills/verification/SKILL.md +334 -326
  238. package/skills/video-creator/SKILL.md +201 -201
  239. package/skills/watchdog/SKILL.md +168 -168
  240. 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).