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