@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,403 +1,432 @@
1
- ---
2
- name: onboard
3
- description: Auto-generate project context for AI sessions. Scans codebase, creates CLAUDE.md and .rune/ setup so every future session starts with full context.
4
- metadata:
5
- author: runedev
6
- version: "0.4.0"
7
- layer: L2
8
- model: sonnet
9
- group: quality
10
- tools: "Read, Write, Edit, Glob, Grep"
11
- emit: project.onboarded
12
- ---
13
-
14
- # onboard
15
-
16
- ## Purpose
17
-
18
- Auto-generate project context for AI sessions. Scans the codebase and creates a CLAUDE.md project config plus .rune/ state directory so every future session starts with full context. Saves 10-20 minutes of re-explaining per session on undocumented projects.
19
-
20
- ## Triggers
21
-
22
- - `/rune onboard` — manual invocation on any project
23
- - Called by `rescue` as Phase 0 (understand before refactoring)
24
- - Auto-trigger: when no CLAUDE.md exists in project root
25
-
26
- ## Calls (outbound)
27
-
28
- - `scout` (L2): deep codebase scan — structure, frameworks, patterns, dependencies
29
- - `autopsy` (L2): when project appears messy or undocumented health assessment
30
-
31
- ## Called By (inbound)
32
-
33
- - User: `/rune onboard` manual invocation
34
- - `rescue` (L1): Phase 0 understand legacy project before refactoring
35
- - `cook` (L1): if no CLAUDE.md found, onboard first
36
-
37
- ## Output Files
38
-
39
- ```
40
- project/
41
- ├── CLAUDE.md # Project config for AI sessions
42
- └── .rune/
43
- ├── conventions.md # Detected patterns & style
44
- ├── decisions.md # Empty, ready for session-bridge
45
- ├── progress.md # Empty, ready for session-bridge
46
- ├── session-log.md # Empty, ready for session-bridge
47
- ├── instincts.md # Empty, ready for session-bridge instinct learning
48
- ├── contract.md # Project invariants enforced by cook/sentinel
49
- └── DEVELOPER-GUIDE.md # Human-readable onboarding for new developers
50
- ```
51
-
52
- ## Executable Steps
53
-
54
- ### Step 1 — Full Scan
55
- Invoke `rune:scout` on the project root. Collect:
56
- - Top-level directory structure (depth 2)
57
- - All config files: `package.json`, `pyproject.toml`, `Cargo.toml`, `go.mod`, `composer.json`, `.nvmrc`, `.python-version`, `Pipfile.lock`, `poetry.lock`, `uv.lock`
58
- - Python environment markers: `.venv/`, `venv/`, `conda-meta/`, `.python-version`
59
- - Entry point files: `main.*`, `index.*`, `app.*`, `server.*`
60
- - Test directory names and test file patterns
61
- - CI/CD config files: `.github/workflows/`, `Makefile`, `Dockerfile`
62
- - README.md if present
63
-
64
- Do not read every source file — scout gives the skeleton. Use `Read` only on config files and entry points.
65
-
66
- ### Step 2Detect Tech Stack
67
- From the scan output, determine with confidence:
68
- - **Language**: TypeScript | JavaScript | Python | Rust | Go | other
69
- - **Framework**: Next.js | Vite+React | SvelteKit | Express | FastAPI | Django | none | other
70
- - **Package manager**: npm | pnpm | yarn | pip | poetry | cargo | go modules
71
- - **Test framework**: Vitest | Jest | pytest | cargo test | go test | none
72
- - **Build tool**: tsc | vite | webpack | esbuild | cargo | none
73
- - **Linter/formatter**: ESLint | Biome | Ruff | Black | Clippy | none
74
- - **Python environment** (if Python project): detect from project markers:
75
- - `.venv/` or `venv/` directory venv
76
- - `poetry.lock` poetry
77
- - `uv.lock`uv
78
- - `.python-version` → pyenv
79
- - `conda-meta/` or `environment.yml` → conda
80
- - `Pipfile.lock`pipenv
81
- - None foundnone (note: recommend setting up a virtual environment)
82
-
83
- If a field cannot be determined with confidence, write "unknown" do not guess.
84
-
85
- ### Step 3Extract Conventions
86
- Read 3–5 representative source files (pick files with the most connections in the project — typically the main module, a route/controller file, and a utility file). Extract:
87
- - **Naming patterns**: camelCase | snake_case | PascalCase for files, functions, variables
88
- - **Import style**: named imports | default imports | barrel files (index.ts)
89
- - **Error handling pattern**: try/catch | Result type | error boundary | unhandled
90
- - **State management**: React Context | Zustand | Redux | Svelte stores | none
91
- - **API pattern**: REST | tRPC | GraphQL | SDK | none
92
- - **Test structure**: co-located (`file.test.ts`) | separate directory (`tests/`) | none
93
-
94
- Write extracted conventions as bullet points be specific, not generic.
95
-
96
- ### Step 4Generate CLAUDE.md
97
- Use `Write` to create `CLAUDE.md` at the project root. Populate every section using data from Steps 2–3. Do not leave template placeholders — if data is unknown, write "unknown" or omit the section. Use the template below as the exact structure.
98
-
99
- If a `CLAUDE.md` already exists, use `Read` to load it first, then mergepreserve any human-written sections (comments starting with `<!-- manual -->`) and update auto-detected sections only.
100
-
101
- ### Step 5Initialize .rune/ Directory
102
- Use `Bash` to create the directory: `mkdir -p .rune`
103
-
104
- Use `Write` to create each file:
105
- - `.rune/conventions.md` — paste the extracted conventions from Step 3 in full detail
106
- - `.rune/decisions.md` create with header `# Architecture Decisions` and one placeholder row in a markdown table (Date | Decision | Rationale | Status)
107
- - `.rune/progress.md` — create with header `# Progress Log` and one placeholder entry
108
- - `.rune/session-log.md` — create with header `# Session Log` and current date as first entry
109
- - `.rune/instincts.md` — create with header `# Project Instincts` and a description: "Learned trigger→action patterns. Managed by session-bridge. See session-bridge SKILL.md Step 5.7 for format."
110
- - `.rune/contract.md` — generate a starter contract based on the detected tech stack:
111
- - Copy structure from `docs/CONTRACT-TEMPLATE.md`
112
- - Customize rules based on Step 2 findings (e.g., Python → add `no bare except`, Node.js add `no console.log`, SQL database add parameterized queries rule)
113
- - Remove sections that don't apply (e.g., `contract.operations` for a library with no deployed service)
114
- - The contract is a starting point tell the user to review and customize it
115
-
116
- ### Step 5.5Load Existing Instincts
117
-
118
- If `.rune/instincts.md` already exists and contains instinct entries, read it and include a summary in the Onboard Report under `### Learned Instincts`. This tells the agent what project-specific behaviors have been learned from previous sessions.
119
-
120
- For each instinct with confidence ≥0.6, include in the report:
121
- - Trigger and action (one line)
122
- - Confidence level
123
-
124
- Instincts with confidence <0.6 are still learning — mention count but don't list individually.
125
-
126
- **Why**: Onboard is the first skill that runs in a new session. Surfacing instincts here ensures the agent starts with project-specific learned behaviors, not just static conventions.
127
-
128
- ### Step 6b — Generate DEVELOPER-GUIDE.md
129
-
130
- Use the data from Steps 2–3 to generate `.rune/DEVELOPER-GUIDE.md` a human-readable onboarding guide for new team members joining the project. This is NOT AI context. This is plain English for humans.
131
-
132
- Use `Write` to create `.rune/DEVELOPER-GUIDE.md` with this template:
133
-
134
- ```markdown
135
- # Developer Guide: [Project Name]
136
-
137
- ## What This Does
138
- [2 sentences max. What problem does this project solve? Who uses it?]
139
-
140
- ## Quick Setup
141
- [Copy-paste commands to get from zero to running locally]
142
- ```bash
143
- # [Python projects] Activate virtual environment
144
- [detected activation command — e.g., source .venv/bin/activate | poetry shell | uv venv && source .venv/bin/activate]
145
-
146
- # Install dependencies
147
- [detected command e.g., pip install -e ".[dev]" | poetry install | npm install]
148
-
149
- # Run development server
150
- [detected command]
151
-
152
- # Run tests
153
- [detected command]
154
- ```
155
-
156
- ## Key Files
157
- [5–10 most important files with one-line description each]
158
- - `[path]` — [what it does]
159
-
160
- ## How to Contribute
161
- 1. Fork or branch from main
162
- 2. Make changes, run tests: `[test command]`
163
- 3. Open a PR — describe what and why
164
-
165
- ## Common Issues
166
- [Top 3 "it doesn't work" situations with fixes. Only include issues you can infer from the codebase — e.g., missing .env, wrong Node version, database not running]
167
-
168
- [Python projects — always include these if applicable:]
169
- - **ModuleNotFoundError** → Virtual environment not activated. Run: `[activation command]`
170
- - **ImportError: cannot import name X** Dependencies outdated. Run: `[install command]`
171
- - **PYTHONPATH issues** → If using src layout, install in editable mode: `pip install -e .`
172
-
173
- ## Who to Ask
174
- [If git log reveals consistent contributors, list them. Otherwise omit this section.]
175
- ```
176
-
177
- If `.rune/DEVELOPER-GUIDE.md` already exists, skip and log **INFO**: "Skipped existing .rune/DEVELOPER-GUIDE.md — manual content preserved."
178
-
179
- ### Step 6c — Suggest L4 Extension Packs
180
-
181
- Based on the detected tech stack from Step 2, recommend relevant L4 extension packs. Use the mapping table below to find applicable packs. Only suggest packs that match the detected stack — do not suggest all packs.
182
-
183
- | Detected Stack | Suggest Pack | Why |
184
- |----------------|-------------|-----|
185
- | React, Next.js, Vue, Svelte, SvelteKit | `@rune/ui` | Frontend component patterns, design system, accessibility audit |
186
- | Express, Fastify, FastAPI, Django, NestJS, Go HTTP | `@rune/backend` | API patterns, auth flows, middleware, rate limiting |
187
- | Docker, GitHub Actions, Kubernetes, Terraform, CI/CD config | `@rune/devops` | Container patterns, deployment pipelines, infrastructure as code |
188
- | React Native, Expo, Flutter, SwiftUI | `@rune/mobile` | Mobile architecture, navigation patterns, offline sync |
189
- | Security-focused codebase (auth, payments, HIPAA/PCI markers) | `@rune/security` | Threat modeling, OWASP flows, compliance patterns |
190
- | Trading, finance, pricing, portfolio, market data | `@rune/trading` | Market data validation, risk calculation, backtesting patterns |
191
- | Subscription billing, tenant isolation, feature flags | `@rune/saas` | Multi-tenancy, billing integration, feature flag patterns |
192
- | Cart, checkout, product catalog, inventory, payments | `@rune/ecommerce` | Cart patterns, payment flows, inventory management |
193
- | ML models, training pipelines, embeddings, LLM integration | `@rune/ai-ml` | Model evaluation, prompt patterns, inference optimization |
194
- | Game loop, physics, entity systems, multiplayer | `@rune/gamedev` | Game architecture, ECS patterns, netcode |
195
- | CMS, blog, newsletter, SEO, content workflows | `@rune/content` | Content modeling, SEO patterns, editorial workflows |
196
- | Analytics, dashboards, metrics, data pipelines, BI | `@rune/analytics` | Data modeling, visualization patterns, pipeline architecture |
197
-
198
- If 0 packs match: omit this section from the report (no suggestions is correct for a generic project).
199
-
200
- **Community pack discovery**: Also check if `.rune/community-packs/registry.json` exists. If it does, list installed community packs alongside core pack suggestions. If community packs are installed, include them under a `### Installed Community Packs` subsection.
201
-
202
- If ≥1 packs match: include in the Onboard Report under a `### Suggested L4 Packs` section:
203
-
204
- ```
205
- ### Suggested L4 Packs
206
- Based on your detected stack ([detected frameworks]), these extension packs may be useful:
207
-
208
- - **@rune/[pack]**[one-line reason based on detected stack]
209
- Install: [link or command when available]
210
- ```
211
-
212
- ### Step 6d Context Budget Check
213
-
214
- Audit the project's baseline context cost from MCP servers and agent configurations. This helps developers understand why their context window fills up faster than expected.
215
-
216
- 1. Count MCP tools available (from session start messages or `settings.json`)
217
- 2. Check CLAUDE.md line count
218
- 3. If total MCP tools >80 or CLAUDE.md >150 lines, include a **Context Budget Advisory** in the Onboard Report:
219
-
220
- ```
221
- ### Context Budget Advisory
222
- - **MCP tools loaded**: [count] across [N] servers
223
- - **CLAUDE.md size**: [N] lines
224
- - **Estimated baseline**: ~[N]k tokens before any work begins
225
- - **Recommendation**: [specific advice disable unused MCP servers, move CLAUDE.md details to .rune/]
226
- ```
227
-
228
- **Skip if**: Total MCP tools ≤80 AND CLAUDE.md ≤150 lines (healthy baseline).
229
-
230
- ### Step 6e — AI-Driven Interview (Optional, User-Initiated)
231
-
232
- When invoked as `/rune onboard --interview` or when the project is too ambiguous for automated detection (e.g., no package.json, no clear entry point, mixed languages), switch to **conversational onboarding** — the AI asks targeted questions instead of relying solely on file scanning.
233
-
234
- #### Interview Flow
235
-
236
- Ask 5-8 questions in sequence, adapting based on answers. Start broad, narrow based on responses:
237
-
238
- ```
239
- Q1: "What does this project do in one sentence?"
240
- → Captures purpose (README may be missing or outdated)
241
-
242
- Q2: "Who uses this — internal team, external users, or both?"
243
- Determines audience, affects DEVELOPER-GUIDE.md tone
244
-
245
- Q3: "What's the main entry point where does execution start?"
246
- Bypasses file scanning for complex monorepos
247
-
248
- Q4: "What commands do you use daily? (dev server, tests, build)"
249
- → Gets verified commands instead of guessing from config files
250
-
251
- Q5: "Any areas of the codebase you'd warn a new developer about?"
252
- Captures tribal knowledge that no scan can detect
253
-
254
- Q6: "Are there external services this depends on? (databases, APIs, queues)"
255
- → Maps integration points for Architecture Map
256
-
257
- Q7: "What's the deployment story how does code get to production?"
258
- → Captures CI/CD context
259
-
260
- Q8 (conditional): "Anything else a new session should know that's not in the code?"
261
- Catches edge cases, workarounds, known issues
262
- ```
263
-
264
- #### Interview Rules
265
-
266
- - **Adapt**: Skip questions that were already answered by earlier responses. If Q1 reveals "it's a Next.js app", don't ask about the framework.
267
- - **Validate**: Cross-reference answers with actual file scan results. If user says "we use Jest" but `vitest.config.ts` exists, ask to clarify.
268
- - **Merge**: Interview answers supplement (not replace) automated scan. Scan provides facts, interview provides context and intent.
269
- - **Store**: Save interview responses as high-confidence entries in `.rune/conventions.md` and `.rune/cumulative-notes.md` (tagged `[from-interview]`)
270
-
271
- #### When to Auto-Suggest Interview
272
-
273
- Suggest switching to interview mode (but don't force it) when:
274
- - Step 2 produces 3+ "unknown" fields in tech stack detection
275
- - Project has no README.md and no package.json/pyproject.toml/Cargo.toml
276
- - Project appears to be a monorepo with 3+ distinct sub-projects
277
-
278
- Output: `"ℹ️ This project is hard to auto-detect. Run /rune onboard --interview for guided setup."`
279
-
280
- ### Step 7 Commit
281
- Use `Bash` to stage and commit the generated files:
282
- ```bash
283
- git add CLAUDE.md .rune/ && git commit -m "chore: initialize rune project context"
284
- ```
285
-
286
- If `git` is not available or the directory is not a git repo, skip this step and add an INFO note to the report: "Not a git repository — files written but not committed."
287
-
288
- If any of the `.rune/` files already exist, do not overwrite them (they may contain human-written decisions). Log **INFO**: "Skipped existing .rune/[file] — manual content preserved."
289
-
290
- ## CLAUDE.md Template
291
-
292
- ```markdown
293
- # [Project Name] — Project Configuration
294
-
295
- ## Overview
296
- [Auto-detected description from README or entry point comments]
297
-
298
- ## Tech Stack
299
- - Framework: [detected]
300
- - Language: [detected]
301
- - Package Manager: [detected]
302
- - Test Framework: [detected]
303
- - Build Tool: [detected]
304
- - Linter: [detected]
305
- - Python Environment: [detected venv/poetry/uv/conda/pyenv/pipenv/none] (only if Python project)
306
-
307
- ## Directory Structure
308
- [Generated tree with one-line annotations per directory]
309
-
310
- ## Conventions
311
- - Naming: [detected patterns — specific, not generic]
312
- - Error handling: [detected pattern]
313
- - State management: [detected pattern]
314
- - API pattern: [detected pattern]
315
- - Test structure: [detected pattern]
316
-
317
- ## Commands
318
- - Install: [detected command]
319
- - Dev: [detected command]
320
- - Build: [detected command]
321
- - Test: [detected command]
322
- - Lint: [detected command]
323
-
324
- ## Key Files
325
- - Entry point: [absolute path]
326
- - Config: [absolute paths]
327
- - Routes/API: [absolute paths]
328
- ```
329
-
330
- ## Output Format
331
-
332
- ```
333
- ## Onboard Report
334
- - **Project**: [name] | **Framework**: [detected] | **Language**: [detected]
335
- - **Files**: [count] | **LOC**: [estimate] | **Modules**: [count]
336
-
337
- ### Generated
338
- - CLAUDE.md (project configuration)
339
- - .rune/conventions.md (detected patterns)
340
- - .rune/decisions.md (initialized)
341
- - .rune/progress.md (initialized)
342
- - .rune/session-log.md (initialized)
343
- - .rune/DEVELOPER-GUIDE.md (human onboarding guide)
344
-
345
- ### Skipped (already exist)
346
- - [list of files not overwritten]
347
-
348
- ### Learned Instincts (if any)
349
- - [trigger] [action] (confidence: [0.6-0.9]) — for each high-confidence instinct
350
- - [N] low-confidence instincts still learning
351
-
352
- ### Observations
353
- - [notable patterns or anomalies found]
354
- - [potential issues detected]
355
- - [recommendations for the developer]
356
-
357
- ### Suggested L4 Packs
358
- - **@rune/[pack]** — [reason] (only shown if applicable packs detected)
359
- ```
360
-
361
- ## Constraints
362
-
363
- 1. MUST scan actual project files never generate CLAUDE.md from assumptions
364
- 2. MUST detect and respect existing CLAUDE.md content — merge, don't overwrite
365
- 3. MUST include: build commands, test commands, lint commands, project structure
366
- 4. MUST NOT include obvious/generic advice ("write clean code", "use meaningful names")
367
- 5. MUST verify generated commands actually work by running them
368
- 6. MUST NOT overwrite existing .rune/ files — always preserve human-written content
369
-
370
- ## Sharp Edges
371
-
372
- Known failure modes for this skill. Check these before declaring done.
373
-
374
- | Failure Mode | Severity | Mitigation |
375
- |---|---|---|
376
- | CLAUDE.md generated from README alone (no file scan) | CRITICAL | Step 1 MUST invoke scout — never skip actual file scanning |
377
- | DEVELOPER-GUIDE.md contains generic placeholder text not derived from project | HIGH | Every section must reference actual detected commands, files, and patterns — no generic advice |
378
- | Overwriting existing .rune/ files with manual content | CRITICAL | Check file existence before every Write skip and log INFO if exists |
379
- | Common Issues section fabricated (no actual issues detected) | MEDIUM | Only list issues inferable from codebase (missing .env, Node version, etc.) — omit section if none found |
380
-
381
- ## Done When
382
-
383
- - CLAUDE.md written (or merged) with all detected tech stack fields populated
384
- - .rune/ directory initialized with conventions, decisions, progress, session-log, instincts
385
- - .rune/DEVELOPER-GUIDE.md written with setup commands from actual scan
386
- - All generated commands verified to exist in package.json/Makefile/etc.
387
- - Onboard Report emitted with Generated + Skipped + Observations sections
388
-
389
- ## Returns
390
-
391
- | Artifact | Format | Location |
392
- |----------|--------|----------|
393
- | Project AI config | Markdown | `CLAUDE.md` (project root) |
394
- | Detected conventions | Markdown | `.rune/conventions.md` |
395
- | Decision log (initialized) | Markdown | `.rune/decisions.md` |
396
- | Developer onboarding guide | Markdown | `.rune/DEVELOPER-GUIDE.md` |
397
- | Session/progress files | Markdown | `.rune/progress.md`, `.rune/session-log.md` |
398
-
399
- ## Cost Profile
400
-
401
- ~2000-5000 tokens input, ~1000-2000 tokens output. Sonnet for analysis quality.
402
-
403
- **Scope guardrail:** onboard generates project context files — it does not modify source code, install dependencies, or change project configuration.
1
+ ---
2
+ name: onboard
3
+ description: Auto-generate project context for AI sessions. Scans codebase, creates CLAUDE.md and .rune/ setup so every future session starts with full context.
4
+ metadata:
5
+ author: runedev
6
+ version: "0.4.0"
7
+ layer: L2
8
+ model: sonnet
9
+ group: quality
10
+ tools: "Read, Write, Edit, Glob, Grep"
11
+ emit: project.onboarded, invariants.seeded
12
+ ---
13
+
14
+ # onboard
15
+
16
+ ## Purpose
17
+
18
+ Auto-generate project context for AI sessions. Scans the codebase and creates a CLAUDE.md project config plus .rune/ state directory so every future session starts with full context. Saves 10-20 minutes of re-explaining per session on undocumented projects.
19
+
20
+ ## Triggers
21
+
22
+ - `/rune onboard` — manual invocation on any project
23
+ - Called by `rescue` as Phase 0 (understand before refactoring)
24
+ - Auto-trigger: when no CLAUDE.md exists in project root
25
+
26
+ ## Calls (outbound)
27
+
28
+ - `scout` (L2): deep codebase scan — structure, frameworks, patterns, dependencies
29
+ - `sentinel-env` (L3): validate developer environment (runtime versions, required tools, env vars) so the onboarded project is actually runnable
30
+ - `autopsy` (L2): when project appears messy or undocumented — health assessment
31
+
32
+ ## Called By (inbound)
33
+
34
+ - User: `/rune onboard` manual invocation
35
+ - `rescue` (L1): Phase 0 understand legacy project before refactoring
36
+ - `cook` (L1): if no CLAUDE.md found, onboard first
37
+
38
+ ## Output Files
39
+
40
+ ```
41
+ project/
42
+ ├── CLAUDE.md # Project config for AI sessions (with invariants pointer block)
43
+ └── .rune/
44
+ ├── conventions.md # Detected patterns & style
45
+ ├── decisions.md # Empty, ready for session-bridge
46
+ ├── progress.md # Empty, ready for session-bridge
47
+ ├── session-log.md # Empty, ready for session-bridge
48
+ ├── instincts.md # Empty, ready for session-bridge instinct learning
49
+ ├── contract.md # Project invariants enforced by cook/sentinel
50
+ ├── INVARIANTS.md # Danger zones + cross-file rules, consumed by logic-guardian
51
+ └── DEVELOPER-GUIDE.md # Human-readable onboarding for new developers
52
+ ```
53
+
54
+ ## Executable Steps
55
+
56
+ ### Step 1 Full Scan
57
+ Invoke `rune:scout` on the project root. Collect:
58
+ - Top-level directory structure (depth 2)
59
+ - All config files: `package.json`, `pyproject.toml`, `Cargo.toml`, `go.mod`, `composer.json`, `.nvmrc`, `.python-version`, `Pipfile.lock`, `poetry.lock`, `uv.lock`
60
+ - Python environment markers: `.venv/`, `venv/`, `conda-meta/`, `.python-version`
61
+ - Entry point files: `main.*`, `index.*`, `app.*`, `server.*`
62
+ - Test directory names and test file patterns
63
+ - CI/CD config files: `.github/workflows/`, `Makefile`, `Dockerfile`
64
+ - README.md if present
65
+
66
+ Do not read every source file scout gives the skeleton. Use `Read` only on config files and entry points.
67
+
68
+ ### Step 2 Detect Tech Stack
69
+ From the scan output, determine with confidence:
70
+ - **Language**: TypeScript | JavaScript | Python | Rust | Go | other
71
+ - **Framework**: Next.js | Vite+React | SvelteKit | Express | FastAPI | Django | none | other
72
+ - **Package manager**: npm | pnpm | yarn | pip | poetry | cargo | go modules
73
+ - **Test framework**: Vitest | Jest | pytest | cargo test | go test | none
74
+ - **Build tool**: tsc | vite | webpack | esbuild | cargo | none
75
+ - **Linter/formatter**: ESLint | Biome | Ruff | Black | Clippy | none
76
+ - **Python environment** (if Python project): detect from project markers:
77
+ - `.venv/` or `venv/` directory venv
78
+ - `poetry.lock`poetry
79
+ - `uv.lock` → uv
80
+ - `.python-version` → pyenv
81
+ - `conda-meta/` or `environment.yml` conda
82
+ - `Pipfile.lock` → pipenv
83
+ - None found none (note: recommend setting up a virtual environment)
84
+
85
+ If a field cannot be determined with confidence, write "unknown" do not guess.
86
+
87
+ ### Step 3 Extract Conventions
88
+ Read 3–5 representative source files (pick files with the most connections in the project — typically the main module, a route/controller file, and a utility file). Extract:
89
+ - **Naming patterns**: camelCase | snake_case | PascalCase for files, functions, variables
90
+ - **Import style**: named imports | default imports | barrel files (index.ts)
91
+ - **Error handling pattern**: try/catch | Result type | error boundary | unhandled
92
+ - **State management**: React Context | Zustand | Redux | Svelte stores | none
93
+ - **API pattern**: REST | tRPC | GraphQL | SDK | none
94
+ - **Test structure**: co-located (`file.test.ts`) | separate directory (`tests/`) | none
95
+
96
+ Write extracted conventions as bullet points be specific, not generic.
97
+
98
+ ### Step 4 — Generate CLAUDE.md
99
+ Use `Write` to create `CLAUDE.md` at the project root. Populate every section using data from Steps 2–3. Do not leave template placeholders if data is unknown, write "unknown" or omit the section. Use the template below as the exact structure.
100
+
101
+ If a `CLAUDE.md` already exists, use `Read` to load it first, then merge preserve any human-written sections (comments starting with `<!-- manual -->`) and update auto-detected sections only.
102
+
103
+ ### Step 5 — Initialize .rune/ Directory
104
+ Use `Bash` to create the directory: `mkdir -p .rune`
105
+
106
+ Use `Write` to create each file:
107
+ - `.rune/conventions.md` — paste the extracted conventions from Step 3 in full detail
108
+ - `.rune/decisions.md` — create with header `# Architecture Decisions` and one placeholder row in a markdown table (Date | Decision | Rationale | Status)
109
+ - `.rune/progress.md` — create with header `# Progress Log` and one placeholder entry
110
+ - `.rune/session-log.md` — create with header `# Session Log` and current date as first entry
111
+ - `.rune/instincts.md` create with header `# Project Instincts` and a description: "Learned trigger→action patterns. Managed by session-bridge. See session-bridge SKILL.md Step 5.7 for format."
112
+ - `.rune/contract.md` generate a starter contract based on the detected tech stack:
113
+ - Copy structure from `docs/CONTRACT-TEMPLATE.md`
114
+ - Customize rules based on Step 2 findings (e.g., Python add `no bare except`, Node.js → add `no console.log`, SQL database → add parameterized queries rule)
115
+ - Remove sections that don't apply (e.g., `contract.operations` for a library with no deployed service)
116
+ - The contract is a starting point tell the user to review and customize it
117
+
118
+ ### Step 5.4 Detect Invariants (Auto-Discipline Seed)
119
+
120
+ Scan the project for rules that span files the kind of mistake a linter cannot catch but a single agent edit can introduce. The goal is to seed `.rune/INVARIANTS.md` with ≥3 plausible rules so `logic-guardian` has something to enforce on day one.
121
+
122
+ Invoke the scanner directly:
123
+
124
+ ```bash
125
+ node skills/onboard/scripts/onboard-invariants.js --root <project-root>
126
+ ```
127
+
128
+ What it produces:
129
+ - `.rune/INVARIANTS.md` — rendered from `skills/onboard/references/invariants-template.md` plus auto-detected rules in four buckets:
130
+ - **Danger Zones**directories with the most cross-file references
131
+ - **Critical Invariants** — shared constants exported and imported in ≥3 places
132
+ - **State Machine Rules** — reducer/switch shapes with state literal pairs
133
+ - **Cross-File Consistency** — literal tuples mirrored across ≥3 files
134
+ - `CLAUDE.md` — adds a pointer block between `<!-- @rune-invariants-pointer:start -->` and `<!-- @rune-invariants-pointer:end -->` listing top danger-zone globs so every session sees them.
135
+
136
+ Merge rules (safe re-runs):
137
+ - If `.rune/INVARIANTS.md` exists, user edits above `## Auto-detected (new)` are **never** overwritten.
138
+ - New detections replace **only** the content under `## Auto-detected (new)`.
139
+ - If a user sets `<!-- @rune-invariants-pointer:skip -->` anywhere in `CLAUDE.md`, the pointer block is not re-injected.
140
+
141
+ Emit signal `invariants.seeded` with `{danger_count, critical_count, state_count, cross_count}` when done. `session-bridge` listens in Phase 3 to surface the loudest rules at session start.
142
+
143
+ **Do not fabricate rules.** If detection yields zero results, write `_No new detections on this run._` under `## Auto-detected (new)` and move on. A quiet INVARIANTS.md is better than fake rules the user has to prune.
144
+
145
+ ### Step 5.5 — Load Existing Instincts
146
+
147
+ If `.rune/instincts.md` already exists and contains instinct entries, read it and include a summary in the Onboard Report under `### Learned Instincts`. This tells the agent what project-specific behaviors have been learned from previous sessions.
148
+
149
+ For each instinct with confidence ≥0.6, include in the report:
150
+ - Trigger and action (one line)
151
+ - Confidence level
152
+
153
+ Instincts with confidence <0.6 are still learning — mention count but don't list individually.
154
+
155
+ **Why**: Onboard is the first skill that runs in a new session. Surfacing instincts here ensures the agent starts with project-specific learned behaviors, not just static conventions.
156
+
157
+ ### Step 6b Generate DEVELOPER-GUIDE.md
158
+
159
+ Use the data from Steps 2–3 to generate `.rune/DEVELOPER-GUIDE.md` — a human-readable onboarding guide for new team members joining the project. This is NOT AI context. This is plain English for humans.
160
+
161
+ Use `Write` to create `.rune/DEVELOPER-GUIDE.md` with this template:
162
+
163
+ ```markdown
164
+ # Developer Guide: [Project Name]
165
+
166
+ ## What This Does
167
+ [2 sentences max. What problem does this project solve? Who uses it?]
168
+
169
+ ## Quick Setup
170
+ [Copy-paste commands to get from zero to running locally]
171
+ ```bash
172
+ # [Python projects] Activate virtual environment
173
+ [detected activation command — e.g., source .venv/bin/activate | poetry shell | uv venv && source .venv/bin/activate]
174
+
175
+ # Install dependencies
176
+ [detected command — e.g., pip install -e ".[dev]" | poetry install | npm install]
177
+
178
+ # Run development server
179
+ [detected command]
180
+
181
+ # Run tests
182
+ [detected command]
183
+ ```
184
+
185
+ ## Key Files
186
+ [5–10 most important files with one-line description each]
187
+ - `[path]` [what it does]
188
+
189
+ ## How to Contribute
190
+ 1. Fork or branch from main
191
+ 2. Make changes, run tests: `[test command]`
192
+ 3. Open a PR describe what and why
193
+
194
+ ## Common Issues
195
+ [Top 3 "it doesn't work" situations with fixes. Only include issues you can infer from the codebase — e.g., missing .env, wrong Node version, database not running]
196
+
197
+ [Python projects — always include these if applicable:]
198
+ - **ModuleNotFoundError** Virtual environment not activated. Run: `[activation command]`
199
+ - **ImportError: cannot import name X** → Dependencies outdated. Run: `[install command]`
200
+ - **PYTHONPATH issues** If using src layout, install in editable mode: `pip install -e .`
201
+
202
+ ## Who to Ask
203
+ [If git log reveals consistent contributors, list them. Otherwise omit this section.]
204
+ ```
205
+
206
+ If `.rune/DEVELOPER-GUIDE.md` already exists, skip and log **INFO**: "Skipped existing .rune/DEVELOPER-GUIDE.md manual content preserved."
207
+
208
+ ### Step 6c Suggest L4 Extension Packs
209
+
210
+ Based on the detected tech stack from Step 2, recommend relevant L4 extension packs. Use the mapping table below to find applicable packs. Only suggest packs that match the detected stack — do not suggest all packs.
211
+
212
+ | Detected Stack | Suggest Pack | Why |
213
+ |----------------|-------------|-----|
214
+ | React, Next.js, Vue, Svelte, SvelteKit | `@rune/ui` | Frontend component patterns, design system, accessibility audit |
215
+ | Express, Fastify, FastAPI, Django, NestJS, Go HTTP | `@rune/backend` | API patterns, auth flows, middleware, rate limiting |
216
+ | Docker, GitHub Actions, Kubernetes, Terraform, CI/CD config | `@rune/devops` | Container patterns, deployment pipelines, infrastructure as code |
217
+ | React Native, Expo, Flutter, SwiftUI | `@rune/mobile` | Mobile architecture, navigation patterns, offline sync |
218
+ | Security-focused codebase (auth, payments, HIPAA/PCI markers) | `@rune/security` | Threat modeling, OWASP flows, compliance patterns |
219
+ | Trading, finance, pricing, portfolio, market data | `@rune/trading` | Market data validation, risk calculation, backtesting patterns |
220
+ | Subscription billing, tenant isolation, feature flags | `@rune/saas` | Multi-tenancy, billing integration, feature flag patterns |
221
+ | Cart, checkout, product catalog, inventory, payments | `@rune/ecommerce` | Cart patterns, payment flows, inventory management |
222
+ | ML models, training pipelines, embeddings, LLM integration | `@rune/ai-ml` | Model evaluation, prompt patterns, inference optimization |
223
+ | Game loop, physics, entity systems, multiplayer | `@rune/gamedev` | Game architecture, ECS patterns, netcode |
224
+ | CMS, blog, newsletter, SEO, content workflows | `@rune/content` | Content modeling, SEO patterns, editorial workflows |
225
+ | Analytics, dashboards, metrics, data pipelines, BI | `@rune/analytics` | Data modeling, visualization patterns, pipeline architecture |
226
+
227
+ If 0 packs match: omit this section from the report (no suggestions is correct for a generic project).
228
+
229
+ **Community pack discovery**: Also check if `.rune/community-packs/registry.json` exists. If it does, list installed community packs alongside core pack suggestions. If community packs are installed, include them under a `### Installed Community Packs` subsection.
230
+
231
+ If ≥1 packs match: include in the Onboard Report under a `### Suggested L4 Packs` section:
232
+
233
+ ```
234
+ ### Suggested L4 Packs
235
+ Based on your detected stack ([detected frameworks]), these extension packs may be useful:
236
+
237
+ - **@rune/[pack]** — [one-line reason based on detected stack]
238
+ Install: [link or command when available]
239
+ ```
240
+
241
+ ### Step 6d — Context Budget Check
242
+
243
+ Audit the project's baseline context cost from MCP servers and agent configurations. This helps developers understand why their context window fills up faster than expected.
244
+
245
+ 1. Count MCP tools available (from session start messages or `settings.json`)
246
+ 2. Check CLAUDE.md line count
247
+ 3. If total MCP tools >80 or CLAUDE.md >150 lines, include a **Context Budget Advisory** in the Onboard Report:
248
+
249
+ ```
250
+ ### Context Budget Advisory
251
+ - **MCP tools loaded**: [count] across [N] servers
252
+ - **CLAUDE.md size**: [N] lines
253
+ - **Estimated baseline**: ~[N]k tokens before any work begins
254
+ - **Recommendation**: [specific advice disable unused MCP servers, move CLAUDE.md details to .rune/]
255
+ ```
256
+
257
+ **Skip if**: Total MCP tools ≤80 AND CLAUDE.md ≤150 lines (healthy baseline).
258
+
259
+ ### Step 6e — AI-Driven Interview (Optional, User-Initiated)
260
+
261
+ When invoked as `/rune onboard --interview` or when the project is too ambiguous for automated detection (e.g., no package.json, no clear entry point, mixed languages), switch to **conversational onboarding** — the AI asks targeted questions instead of relying solely on file scanning.
262
+
263
+ #### Interview Flow
264
+
265
+ Ask 5-8 questions in sequence, adapting based on answers. Start broad, narrow based on responses:
266
+
267
+ ```
268
+ Q1: "What does this project do in one sentence?"
269
+ Captures purpose (README may be missing or outdated)
270
+
271
+ Q2: "Who uses this — internal team, external users, or both?"
272
+ → Determines audience, affects DEVELOPER-GUIDE.md tone
273
+
274
+ Q3: "What's the main entry point where does execution start?"
275
+ Bypasses file scanning for complex monorepos
276
+
277
+ Q4: "What commands do you use daily? (dev server, tests, build)"
278
+ Gets verified commands instead of guessing from config files
279
+
280
+ Q5: "Any areas of the codebase you'd warn a new developer about?"
281
+ Captures tribal knowledge that no scan can detect
282
+
283
+ Q6: "Are there external services this depends on? (databases, APIs, queues)"
284
+ → Maps integration points for Architecture Map
285
+
286
+ Q7: "What's the deployment story how does code get to production?"
287
+ → Captures CI/CD context
288
+
289
+ Q8 (conditional): "Anything else a new session should know that's not in the code?"
290
+ Catches edge cases, workarounds, known issues
291
+ ```
292
+
293
+ #### Interview Rules
294
+
295
+ - **Adapt**: Skip questions that were already answered by earlier responses. If Q1 reveals "it's a Next.js app", don't ask about the framework.
296
+ - **Validate**: Cross-reference answers with actual file scan results. If user says "we use Jest" but `vitest.config.ts` exists, ask to clarify.
297
+ - **Merge**: Interview answers supplement (not replace) automated scan. Scan provides facts, interview provides context and intent.
298
+ - **Store**: Save interview responses as high-confidence entries in `.rune/conventions.md` and `.rune/cumulative-notes.md` (tagged `[from-interview]`)
299
+
300
+ #### When to Auto-Suggest Interview
301
+
302
+ Suggest switching to interview mode (but don't force it) when:
303
+ - Step 2 produces 3+ "unknown" fields in tech stack detection
304
+ - Project has no README.md and no package.json/pyproject.toml/Cargo.toml
305
+ - Project appears to be a monorepo with 3+ distinct sub-projects
306
+
307
+ Output: `"ℹ️ This project is hard to auto-detect. Run /rune onboard --interview for guided setup."`
308
+
309
+ ### Step 7 — Commit
310
+ Use `Bash` to stage and commit the generated files:
311
+ ```bash
312
+ git add CLAUDE.md .rune/ && git commit -m "chore: initialize rune project context"
313
+ ```
314
+
315
+ If `git` is not available or the directory is not a git repo, skip this step and add an INFO note to the report: "Not a git repository — files written but not committed."
316
+
317
+ If any of the `.rune/` files already exist, do not overwrite them (they may contain human-written decisions). Log **INFO**: "Skipped existing .rune/[file] — manual content preserved."
318
+
319
+ ## CLAUDE.md Template
320
+
321
+ ```markdown
322
+ # [Project Name] — Project Configuration
323
+
324
+ ## Overview
325
+ [Auto-detected description from README or entry point comments]
326
+
327
+ ## Tech Stack
328
+ - Framework: [detected]
329
+ - Language: [detected]
330
+ - Package Manager: [detected]
331
+ - Test Framework: [detected]
332
+ - Build Tool: [detected]
333
+ - Linter: [detected]
334
+ - Python Environment: [detected venv/poetry/uv/conda/pyenv/pipenv/none] (only if Python project)
335
+
336
+ ## Directory Structure
337
+ [Generated tree with one-line annotations per directory]
338
+
339
+ ## Conventions
340
+ - Naming: [detected patterns — specific, not generic]
341
+ - Error handling: [detected pattern]
342
+ - State management: [detected pattern]
343
+ - API pattern: [detected pattern]
344
+ - Test structure: [detected pattern]
345
+
346
+ ## Commands
347
+ - Install: [detected command]
348
+ - Dev: [detected command]
349
+ - Build: [detected command]
350
+ - Test: [detected command]
351
+ - Lint: [detected command]
352
+
353
+ ## Key Files
354
+ - Entry point: [absolute path]
355
+ - Config: [absolute paths]
356
+ - Routes/API: [absolute paths]
357
+ ```
358
+
359
+ ## Output Format
360
+
361
+ ```
362
+ ## Onboard Report
363
+ - **Project**: [name] | **Framework**: [detected] | **Language**: [detected]
364
+ - **Files**: [count] | **LOC**: [estimate] | **Modules**: [count]
365
+
366
+ ### Generated
367
+ - CLAUDE.md (project configuration)
368
+ - .rune/conventions.md (detected patterns)
369
+ - .rune/decisions.md (initialized)
370
+ - .rune/progress.md (initialized)
371
+ - .rune/session-log.md (initialized)
372
+ - .rune/DEVELOPER-GUIDE.md (human onboarding guide)
373
+
374
+ ### Skipped (already exist)
375
+ - [list of files not overwritten]
376
+
377
+ ### Learned Instincts (if any)
378
+ - [trigger] [action] (confidence: [0.6-0.9])for each high-confidence instinct
379
+ - [N] low-confidence instincts still learning
380
+
381
+ ### Observations
382
+ - [notable patterns or anomalies found]
383
+ - [potential issues detected]
384
+ - [recommendations for the developer]
385
+
386
+ ### Suggested L4 Packs
387
+ - **@rune/[pack]** [reason] (only shown if applicable packs detected)
388
+ ```
389
+
390
+ ## Constraints
391
+
392
+ 1. MUST scan actual project files — never generate CLAUDE.md from assumptions
393
+ 2. MUST detect and respect existing CLAUDE.md content merge, don't overwrite
394
+ 3. MUST include: build commands, test commands, lint commands, project structure
395
+ 4. MUST NOT include obvious/generic advice ("write clean code", "use meaningful names")
396
+ 5. MUST verify generated commands actually work by running them
397
+ 6. MUST NOT overwrite existing .rune/ files always preserve human-written content
398
+
399
+ ## Sharp Edges
400
+
401
+ Known failure modes for this skill. Check these before declaring done.
402
+
403
+ | Failure Mode | Severity | Mitigation |
404
+ |---|---|---|
405
+ | CLAUDE.md generated from README alone (no file scan) | CRITICAL | Step 1 MUST invoke scout — never skip actual file scanning |
406
+ | DEVELOPER-GUIDE.md contains generic placeholder text not derived from project | HIGH | Every section must reference actual detected commands, files, and patterns — no generic advice |
407
+ | Overwriting existing .rune/ files with manual content | CRITICAL | Check file existence before every Write — skip and log INFO if exists |
408
+ | Common Issues section fabricated (no actual issues detected) | MEDIUM | Only list issues inferable from codebase (missing .env, Node version, etc.) — omit section if none found |
409
+
410
+ ## Done When
411
+
412
+ - CLAUDE.md written (or merged) with all detected tech stack fields populated
413
+ - .rune/ directory initialized with conventions, decisions, progress, session-log, instincts
414
+ - .rune/DEVELOPER-GUIDE.md written with setup commands from actual scan
415
+ - All generated commands verified to exist in package.json/Makefile/etc.
416
+ - Onboard Report emitted with Generated + Skipped + Observations sections
417
+
418
+ ## Returns
419
+
420
+ | Artifact | Format | Location |
421
+ |----------|--------|----------|
422
+ | Project AI config | Markdown | `CLAUDE.md` (project root) |
423
+ | Detected conventions | Markdown | `.rune/conventions.md` |
424
+ | Decision log (initialized) | Markdown | `.rune/decisions.md` |
425
+ | Developer onboarding guide | Markdown | `.rune/DEVELOPER-GUIDE.md` |
426
+ | Session/progress files | Markdown | `.rune/progress.md`, `.rune/session-log.md` |
427
+
428
+ ## Cost Profile
429
+
430
+ ~2000-5000 tokens input, ~1000-2000 tokens output. Sonnet for analysis quality.
431
+
432
+ **Scope guardrail:** onboard generates project context files — it does not modify source code, install dependencies, or change project configuration.