@rune-kit/rune 2.8.0 → 2.10.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 (118) hide show
  1. package/README.md +66 -34
  2. package/agents/adversary.md +27 -0
  3. package/agents/architect.md +19 -29
  4. package/agents/asset-creator.md +18 -4
  5. package/agents/audit.md +25 -4
  6. package/agents/autopsy.md +19 -4
  7. package/agents/ba.md +35 -0
  8. package/agents/brainstorm.md +31 -4
  9. package/agents/browser-pilot.md +21 -4
  10. package/agents/coder.md +21 -29
  11. package/agents/completion-gate.md +20 -4
  12. package/agents/constraint-check.md +18 -4
  13. package/agents/context-engine.md +22 -4
  14. package/agents/context-pack.md +32 -0
  15. package/agents/cook.md +41 -4
  16. package/agents/db.md +19 -4
  17. package/agents/debug.md +33 -4
  18. package/agents/dependency-doctor.md +20 -4
  19. package/agents/deploy.md +27 -4
  20. package/agents/design.md +22 -4
  21. package/agents/doc-processor.md +27 -0
  22. package/agents/docs-seeker.md +19 -4
  23. package/agents/docs.md +31 -0
  24. package/agents/fix.md +37 -4
  25. package/agents/git.md +29 -0
  26. package/agents/hallucination-guard.md +20 -4
  27. package/agents/incident.md +21 -4
  28. package/agents/integrity-check.md +18 -4
  29. package/agents/journal.md +19 -4
  30. package/agents/launch.md +32 -4
  31. package/agents/logic-guardian.md +26 -11
  32. package/agents/marketing.md +23 -4
  33. package/agents/mcp-builder.md +26 -0
  34. package/agents/neural-memory.md +30 -0
  35. package/agents/onboard.md +22 -4
  36. package/agents/perf.md +21 -4
  37. package/agents/plan.md +29 -4
  38. package/agents/preflight.md +22 -4
  39. package/agents/problem-solver.md +20 -4
  40. package/agents/rescue.md +23 -4
  41. package/agents/research.md +19 -4
  42. package/agents/researcher.md +19 -29
  43. package/agents/retro.md +32 -0
  44. package/agents/review-intake.md +20 -4
  45. package/agents/review.md +32 -4
  46. package/agents/reviewer.md +20 -28
  47. package/agents/safeguard.md +19 -4
  48. package/agents/sast.md +18 -4
  49. package/agents/scaffold.md +41 -0
  50. package/agents/scanner.md +19 -28
  51. package/agents/scope-guard.md +18 -4
  52. package/agents/scout.md +23 -4
  53. package/agents/sentinel-env.md +26 -0
  54. package/agents/sentinel.md +33 -4
  55. package/agents/sequential-thinking.md +20 -4
  56. package/agents/session-bridge.md +24 -4
  57. package/agents/skill-forge.md +22 -4
  58. package/agents/skill-router.md +26 -4
  59. package/agents/slides.md +24 -0
  60. package/agents/surgeon.md +19 -4
  61. package/agents/team.md +30 -4
  62. package/agents/test.md +36 -4
  63. package/agents/trend-scout.md +17 -4
  64. package/agents/verification.md +20 -4
  65. package/agents/video-creator.md +20 -4
  66. package/agents/watchdog.md +19 -4
  67. package/agents/worktree.md +17 -4
  68. package/compiler/__tests__/analytics.test.js +370 -0
  69. package/compiler/adapters/openclaw.js +2 -2
  70. package/compiler/analytics.js +385 -0
  71. package/compiler/bin/rune.js +68 -2
  72. package/compiler/dashboard.js +883 -0
  73. package/compiler/transforms/branding.js +1 -1
  74. package/extensions/ui/skills/animation-patterns.md +21 -0
  75. package/extensions/ui/skills/component-patterns.md +25 -0
  76. package/extensions/ui/skills/landing-patterns.md +1 -1
  77. package/hooks/context-watch/index.cjs +95 -68
  78. package/hooks/metrics-collector/index.cjs +86 -42
  79. package/hooks/post-session-reflect/index.cjs +41 -5
  80. package/hooks/session-start/index.cjs +8 -2
  81. package/package.json +2 -2
  82. package/skills/audit/SKILL.md +1 -0
  83. package/skills/autopsy/SKILL.md +78 -2
  84. package/skills/autopsy/references/repo-analysis-patterns.md +113 -0
  85. package/skills/ba/SKILL.md +72 -2
  86. package/skills/brainstorm/SKILL.md +1 -0
  87. package/skills/cook/SKILL.md +32 -3
  88. package/skills/cook/references/output-format.md +33 -0
  89. package/skills/db/SKILL.md +1 -0
  90. package/skills/debug/SKILL.md +23 -1
  91. package/skills/deploy/SKILL.md +1 -1
  92. package/skills/design/SKILL.md +110 -3
  93. package/skills/docs/SKILL.md +2 -1
  94. package/skills/fix/SKILL.md +23 -1
  95. package/skills/graft/SKILL.md +352 -0
  96. package/skills/graft/references/challenge-framework.md +98 -0
  97. package/skills/graft/references/mode-decision.md +44 -0
  98. package/skills/incident/SKILL.md +2 -0
  99. package/skills/journal/SKILL.md +2 -0
  100. package/skills/launch/SKILL.md +2 -0
  101. package/skills/marketing/SKILL.md +46 -2
  102. package/skills/mcp-builder/SKILL.md +3 -1
  103. package/skills/mcp-builder/references/auto-discovery-pattern.md +169 -0
  104. package/skills/plan/SKILL.md +60 -2
  105. package/skills/plan/references/feature-map.md +84 -0
  106. package/skills/preflight/SKILL.md +20 -1
  107. package/skills/rescue/SKILL.md +25 -1
  108. package/skills/retro/SKILL.md +2 -0
  109. package/skills/review/SKILL.md +55 -2
  110. package/skills/scaffold/SKILL.md +1 -0
  111. package/skills/scope-guard/SKILL.md +35 -17
  112. package/skills/sentinel/SKILL.md +29 -1
  113. package/skills/session-bridge/SKILL.md +155 -9
  114. package/skills/skill-forge/SKILL.md +43 -1
  115. package/skills/skill-router/{skill.md → SKILL.md} +27 -2
  116. package/skills/team/SKILL.md +24 -1
  117. package/skills/test/SKILL.md +29 -2
  118. package/skills/verification/SKILL.md +1 -0
@@ -0,0 +1,352 @@
1
+ ---
2
+ name: graft
3
+ description: "Clone, port, or convert features from any GitHub repo into your project. Understand before copy, challenge before implement. 4 modes: port (rewrite), compare (analysis), copy (transplant), improve (copy + optimize)."
4
+ metadata:
5
+ author: runedev
6
+ version: "0.1.0"
7
+ layer: L2
8
+ model: sonnet
9
+ group: creation
10
+ tools: "Read, Write, Edit, Bash, Glob, Grep, WebFetch"
11
+ emit: graft.complete
12
+ listen: codebase.scanned
13
+ ---
14
+
15
+ # graft
16
+
17
+ ## Purpose
18
+
19
+ External code intelligence — structured workflow for learning from, adapting, and integrating features from any public repository into your project. Graft is NOT a copy-paste tool. It enforces understanding before adoption through a mandatory challenge gate that evaluates license compatibility, stack fit, scope, quality, and maintenance health before any code touches your codebase.
20
+
21
+ <HARD-GATE>
22
+ Challenge gate (Step 4) MUST complete before adaptation planning (Step 5).
23
+ No implementation without confronting trade-offs. This applies to ALL modes except compare.
24
+ Skip only with --fast flag (user accepts full responsibility).
25
+ </HARD-GATE>
26
+
27
+ ## Modes
28
+
29
+ ### Port (default)
30
+ Rewrite the target feature using YOUR stack and patterns. Source code is a reference, not a template. Output is idiomatic to your codebase.
31
+
32
+ **When**: Different tech stack (Vue→React, Django→FastAPI), or source patterns conflict with your conventions.
33
+
34
+ ### Compare
35
+ Side-by-side analysis only. No code changes. Outputs a structured comparison report.
36
+
37
+ **When**: Evaluating whether to adopt a feature, benchmarking your implementation against another, or learning patterns without importing code.
38
+
39
+ ### Copy
40
+ Pure transplant with minimal adaptation. Stays as close to the original as possible — only changes imports, paths, and config to fit your project structure.
41
+
42
+ **When**: Same tech stack, source code is high quality, you want the exact implementation.
43
+
44
+ ### Improve
45
+ Copy the feature, then refactor and optimize. Fix anti-patterns, add missing tests, adapt to your codebase conventions, upgrade deprecated APIs.
46
+
47
+ **When**: Same stack but source has quality issues, or you want the feature but better.
48
+
49
+ ## Speed Options
50
+
51
+ | Flag | Research | Challenge Gate | User Approval |
52
+ |------|----------|---------------|---------------|
53
+ | (default) | ✅ Full | ✅ Yes | ✅ Each step |
54
+ | `--auto` | ✅ Full | ✅ Yes | ❌ Auto-approve |
55
+ | `--fast` | ❌ Skip | ❌ Skip | ❌ Auto-approve |
56
+
57
+ **`--fast` warning**: Skipping challenge gate means no license check, no quality assessment. User accepts full responsibility. Announce: "Fast mode: skipping challenge gate. You are responsible for license and quality review."
58
+
59
+ ## Smart Intent Detection
60
+
61
+ | Input Pattern | Detected Mode |
62
+ |---------------|---------------|
63
+ | Contains "compare", "vs", "diff", "analyze" | compare |
64
+ | Contains "copy", "exact", "as-is", "same" | copy |
65
+ | Contains "improve", "better", "adapt", "upgrade" | improve |
66
+ | Contains "port", "convert", "rewrite", "migrate" | port |
67
+ | URL points to specific file/dir (not repo root) | Auto-scope to that path |
68
+ | (default — no keyword match) | port |
69
+
70
+ ## Triggers
71
+
72
+ - `/rune graft <url> [--port|--compare|--copy|--improve] [--auto|--fast]`
73
+ - Delegated from `cook` when task contains "graft", "port from", "copy from repo", "clone feature from"
74
+ - Auto-trigger: when user pastes a GitHub URL with context like "use this", "like this repo", "steal this"
75
+
76
+ ## Calls (outbound)
77
+
78
+ - `research` (L3): fetch repo README, docs, understand purpose and architecture
79
+ - `scout` (L2): scan LOCAL codebase for conventions, patterns, stack detection
80
+ - `fix` (L2): implement adapted code (port and improve modes)
81
+ - `review` (L2): post-graft quality check (improve mode only)
82
+
83
+ ## Called By (inbound)
84
+
85
+ - User: `/rune graft <url>` direct invocation
86
+ - `cook` (L1): delegation when task is "port feature from external repo"
87
+
88
+ ## Data Flow
89
+
90
+ ### Feeds Into →
91
+
92
+ - `fix` (L2): adaptation plan → fix's implementation targets (port/improve modes)
93
+ - `review` (L2): grafted code → review's analysis targets (improve mode)
94
+ - `test` (L2): new grafted code → test coverage targets
95
+ - `journal` (L3): graft.complete signal → auto-logged for pattern tracking
96
+
97
+ ### Fed By ←
98
+
99
+ - `scout` (L2): local codebase conventions → graft's adaptation strategy
100
+ - `research` (L3): repo analysis → graft's understanding of source architecture
101
+
102
+ ## Executable Steps
103
+
104
+ ### Step 0 — Parse Input
105
+ <MUST-READ path="references/mode-decision.md" trigger="when auto-detecting mode"/>
106
+
107
+ Extract from user input:
108
+ 1. **URL** — GitHub/GitLab/Bitbucket repo or file URL
109
+ 2. **Mode** — explicit flag or auto-detect via intent detection table
110
+ 3. **Speed** — `--auto` or `--fast` if present
111
+ 4. **Scope** — specific dir/file path if URL points to subdirectory, or user specifies "just the auth module"
112
+
113
+ Validate URL is accessible. If private repo or URL fails → suggest raw file URLs or manual paste.
114
+
115
+ ### Step 1 — Fetch & Scope
116
+
117
+ ```bash
118
+ # Sparse clone for large repos (skip if small or specific files)
119
+ git clone --depth 1 --filter=blob:none --sparse <url> /tmp/graft-<hash>
120
+ cd /tmp/graft-<hash>
121
+ git sparse-checkout set <target-dir>
122
+ ```
123
+
124
+ For specific files or small repos: use `WebFetch` on raw GitHub URLs instead of cloning.
125
+
126
+ **Read in this order** (stop when you have enough context):
127
+ 1. README.md — purpose, architecture overview
128
+ 2. Target dir's files — the actual code to graft
129
+ 3. package.json / pyproject.toml / Cargo.toml — dependencies and stack
130
+ 4. Tests for target feature — understand expected behavior
131
+
132
+ **Scope guard**: If target feature spans >15 files or >2000 LOC → WARN user: "Feature is large. Suggest narrowing to [specific module]. Continue anyway?"
133
+
134
+ ### Step 2 — Analyze Source
135
+
136
+ Understand the target feature's architecture:
137
+ - **What it does** — 2-3 sentence summary
138
+ - **How it works** — key patterns, data flow, core logic
139
+ - **Dependencies** — external packages required, internal imports
140
+ - **Stack** — framework, language version, tooling
141
+ - **Quality signals** — has tests? typed? documented? last commit date?
142
+
143
+ Output a brief analysis (not full report — save context for later steps).
144
+
145
+ ### Step 3 — Scan Local Codebase
146
+
147
+ Invoke `rune:scout` (or use cached output if `codebase.scanned` signal received):
148
+ - Local tech stack and version
149
+ - Naming conventions (camelCase vs snake_case, file structure)
150
+ - Existing patterns that overlap with target feature
151
+ - Import style, test framework, state management approach
152
+
153
+ **Stack comparison**: Produce a quick compatibility matrix:
154
+ ```
155
+ | Aspect | Source | Local | Compatible? |
156
+ |--------|--------|-------|-------------|
157
+ | Framework | Next.js 14 | Next.js 15 | ✅ Minor adaptation |
158
+ | Language | TypeScript | TypeScript | ✅ |
159
+ | State | Redux | Zustand | ⚠️ Port needed |
160
+ | Testing | Jest | Vitest | ⚠️ Port needed |
161
+ ```
162
+
163
+ If stack is identical → suggest copy or improve mode (not port).
164
+ If stack differs significantly → force port mode.
165
+
166
+ ### Step 4 — Challenge Gate
167
+ <MUST-READ path="references/challenge-framework.md" trigger="always (unless --fast)"/>
168
+
169
+ <HARD-GATE>
170
+ Score all 5 dimensions. If 2+ dimensions score ❌ → BLOCK graft.
171
+ If 1 dimension scores ❌ → WARN + require explicit user override.
172
+ Only --fast skips this gate entirely.
173
+ </HARD-GATE>
174
+
175
+ Present challenge results to user:
176
+ ```
177
+ ## Challenge Gate Results
178
+
179
+ | Dimension | Score | Detail |
180
+ |-----------|-------|--------|
181
+ | License | ✅ | MIT — compatible |
182
+ | Stack Fit | ⚠️ | Redux → Zustand migration needed |
183
+ | Scope | ✅ | 6 files, ~400 LOC — manageable |
184
+ | Quality | ✅ | Typed, tested, documented |
185
+ | Maintenance | ⚠️ | Last commit 4 months ago |
186
+
187
+ **Verdict: PROCEED with caveats** (0 ❌, 2 ⚠️)
188
+ ```
189
+
190
+ Wait for user approval (unless `--auto`).
191
+
192
+ ### Step 5 — Plan Adaptation
193
+
194
+ Based on mode, produce adaptation plan:
195
+
196
+ **Compare mode** → skip to output. Write comparison report and STOP.
197
+
198
+ **Copy mode** → list files to transplant, import path changes, config adjustments. Minimal changes only.
199
+
200
+ **Port mode** → for each source component, describe the rewrite:
201
+ - Source pattern → local pattern mapping
202
+ - Dependencies to replace (Redux→Zustand, Jest→Vitest)
203
+ - Files to create/modify in local project
204
+ - What to keep vs what to rewrite from scratch
205
+
206
+ **Improve mode** → copy plan + improvement list:
207
+ - Anti-patterns to fix (mutations, any types, missing error handling)
208
+ - Missing tests to add
209
+ - Deprecated APIs to upgrade
210
+ - Convention mismatches to align
211
+
212
+ Present plan to user. Wait for approval (unless `--auto`).
213
+
214
+ ### Step 6 — Execute
215
+
216
+ **Compare mode**: Output report → emit `graft.complete` → done.
217
+
218
+ **Copy/Port/Improve modes**:
219
+ 1. Create/modify files per adaptation plan
220
+ 2. For port/improve: invoke `rune:fix` for complex rewrites
221
+ 3. For improve: invoke `rune:review` on grafted code
222
+ 4. Run project verification (lint, type-check, test if applicable)
223
+ 5. Clean up temp clone dir
224
+
225
+ **Post-execution**: Emit `graft.complete` signal with payload:
226
+ ```yaml
227
+ graft.complete:
228
+ mode: "port|copy|improve|compare"
229
+ source_url: "<url>"
230
+ files_changed: ["src/auth/middleware.ts", "src/auth/types.ts"]
231
+ challenge_score: { license: "pass", stack: "warn", scope: "pass", quality: "pass", maintenance: "warn" }
232
+ ```
233
+
234
+ ## Output Format
235
+
236
+ ### Compare Mode Output
237
+ ```markdown
238
+ ## Graft Comparison: [feature] — [source repo] vs [local]
239
+
240
+ ### Summary
241
+ [2-3 sentences: what was compared, key differences]
242
+
243
+ ### Comparison
244
+ | Aspect | Source | Local | Winner | Notes |
245
+ |--------|--------|-------|--------|-------|
246
+ | [aspect] | [approach] | [approach] | [which] | [why] |
247
+
248
+ ### Recommendations
249
+ - [what to adopt from source]
250
+ - [what to keep from local]
251
+ - [what to graft: specific files/patterns]
252
+ ```
253
+
254
+ ### Port/Copy/Improve Output
255
+ ```markdown
256
+ ## Graft Complete: [feature] from [source]
257
+
258
+ ### Mode: [port|copy|improve]
259
+ ### Files Changed
260
+ - `path/file.ts` — [new|modified] — [what changed]
261
+
262
+ ### Adaptations Made
263
+ - [adaptation 1]
264
+ - [adaptation 2]
265
+
266
+ ### Verify
267
+ - [ ] `npm run lint` passes
268
+ - [ ] `npm run test` passes
269
+ - [ ] Feature works as expected
270
+ ```
271
+
272
+ ## Returns
273
+
274
+ | Field | Type | Description |
275
+ |-------|------|-------------|
276
+ | `mode` | enum | port, compare, copy, improve |
277
+ | `source_url` | string | Source repository URL |
278
+ | `files_changed` | string[] | List of created/modified local files |
279
+ | `challenge_score` | object | 5-dimension scores (pass/warn/fail) |
280
+ | `status` | enum | DONE, DONE_WITH_CONCERNS, BLOCKED |
281
+ | `comparison_report` | string? | Markdown report (compare mode only) |
282
+
283
+ ## Constraints
284
+
285
+ 1. MUST run challenge gate before any code changes — no blind copying
286
+ 2. MUST clean up temp clone directories after completion
287
+ 3. MUST detect and warn about license incompatibility before proceeding
288
+ 4. MUST use sparse checkout for repos >100MB — never full clone large repos
289
+ 5. MUST respect local conventions — grafted code should look native, not foreign
290
+ 6. MUST NOT modify the source repository — read-only access only
291
+ 7. MUST NOT graft without scoping — always narrow to specific feature/module
292
+
293
+ ## Mesh Gates
294
+
295
+ | Gate | Requires | If Missing |
296
+ |------|----------|------------|
297
+ | Challenge Gate | 5-dimension score with 0-1 ❌ | BLOCK if 2+ ❌, WARN if 1 ❌ |
298
+ | Scout Gate | Local codebase scanned | Invoke `rune:scout` first |
299
+ | Scope Gate | Target feature ≤15 files | WARN user, suggest narrowing |
300
+
301
+ ## Sharp Edges
302
+
303
+ | Failure Mode | Severity | Mitigation |
304
+ |---|---|---|
305
+ | Grafting GPL code into MIT project | CRITICAL | Challenge gate checks license — blocks incompatible |
306
+ | Blindly copying code without understanding | CRITICAL | HARD-GATE: challenge before implement |
307
+ | Context overflow from large source files | HIGH | Scope guard: >15 files or >2000 LOC triggers warning |
308
+ | Grafted code doesn't match local conventions | HIGH | Step 3 scans local patterns, Step 5 plans adaptation |
309
+ | Stale source (abandoned repo) | MEDIUM | Maintenance dimension in challenge gate |
310
+ | Private repo URL fails | MEDIUM | Fallback to WebFetch raw URLs or manual paste |
311
+ | Port mode when copy would suffice (wasted effort) | MEDIUM | Mode decision tree suggests optimal mode |
312
+
313
+ ## Self-Validation
314
+
315
+ ```
316
+ SELF-VALIDATION (run before emitting graft.complete):
317
+ - [ ] Challenge gate was executed (or --fast acknowledged)
318
+ - [ ] All grafted files follow local naming conventions
319
+ - [ ] No source-specific imports remain (wrong paths, missing packages)
320
+ - [ ] License compatibility confirmed (or user override documented)
321
+ - [ ] Temp clone directory cleaned up
322
+ - [ ] Grafted code compiles/lints without new errors
323
+ IF ANY check fails → fix before reporting done. Do NOT defer to completion-gate.
324
+ ```
325
+
326
+ ## Cross-cutting Updates
327
+
328
+ If this skill is added to the repo (first time):
329
+ - [ ] `README.md` — skill count (61→62), L2 count (28→29)
330
+ - [ ] `docs/ARCHITECTURE.md` — add graft to L2 list
331
+ - [ ] `CLAUDE.md` — add graft to L2 list, routing table, skill count
332
+ - [ ] `docs/index.html` — update meta stats if applicable
333
+
334
+ ## Done When
335
+
336
+ - Input parsed: URL, mode, speed flags extracted
337
+ - Source fetched and scoped (sparse clone or WebFetch)
338
+ - Source analyzed: patterns, dependencies, stack understood
339
+ - Challenge gate passed (5 dimensions scored, 0-1 ❌)
340
+ - Local codebase scanned for conventions
341
+ - Adaptation plan produced and approved
342
+ - Code grafted per mode (port/copy/improve/compare)
343
+ - Verification passed (lint, type-check, tests)
344
+ - Temp files cleaned up
345
+ - `graft.complete` signal emitted
346
+ - Self-Validation: all checks passed
347
+
348
+ ## Cost Profile
349
+
350
+ ~2000-4000 tokens input (SKILL.md + 1-2 references), ~3000-8000 tokens output (analysis + adaptation + code). Sonnet for execution. Heaviest when port mode rewrites significant code — but that's where the value is highest.
351
+
352
+ **Scope guardrail**: Do not become a general-purpose code review tool. Graft analyzes external code for adoption purposes only — use `rune:review` for reviewing your own code, `rune:research` for general technology research.
@@ -0,0 +1,98 @@
1
+ # Challenge Framework
2
+
3
+ 5-dimension evaluation gate. Score each dimension before grafting code into your project.
4
+
5
+ ## Scoring
6
+
7
+ | Score | Meaning | Action |
8
+ |-------|---------|--------|
9
+ | ✅ Pass | No concerns | Proceed |
10
+ | ⚠️ Warn | Minor concerns | Proceed with documented caveats |
11
+ | ❌ Fail | Blocking concern | Requires user override or blocks graft |
12
+
13
+ **Decision matrix**: 0 ❌ → PROCEED. 1 ❌ → WARN + require explicit user override. 2+ ❌ → BLOCK.
14
+
15
+ ## Dimensions
16
+
17
+ ### 1. License Compatibility
18
+
19
+ | Source License | Your Project MIT | Your Project Apache-2.0 | Your Project GPL |
20
+ |---------------|-----------------|------------------------|-----------------|
21
+ | MIT | ✅ | ✅ | ✅ |
22
+ | Apache-2.0 | ✅ | ✅ | ✅ |
23
+ | BSD-2/3 | ✅ | ✅ | ✅ |
24
+ | ISC | ✅ | ✅ | ✅ |
25
+ | GPL-2.0/3.0 | ❌ | ❌ | ✅ |
26
+ | AGPL | ❌ | ❌ | ⚠️ |
27
+ | SSPL/BSL | ❌ | ❌ | ❌ |
28
+ | No license | ❌ | ❌ | ❌ |
29
+ | Unlicense | ✅ | ✅ | ✅ |
30
+
31
+ **Check**: Read LICENSE file in repo root. If missing → ❌ (no license = all rights reserved).
32
+
33
+ ### 2. Stack Fit
34
+
35
+ | Scenario | Score |
36
+ |----------|-------|
37
+ | Identical stack (same framework + language + version) | ✅ |
38
+ | Same language, different framework (React→Svelte) | ⚠️ — port mode recommended |
39
+ | Same framework, major version gap (Next 13→15) | ⚠️ — API changes likely |
40
+ | Different language entirely (Python→TypeScript) | ❌ — port is a rewrite |
41
+ | Incompatible paradigm (OOP→FP, REST→GraphQL) | ❌ — fundamental rethink needed |
42
+
43
+ ### 3. Scope
44
+
45
+ | Scenario | Score |
46
+ |----------|-------|
47
+ | ≤5 files, ≤500 LOC | ✅ — manageable |
48
+ | 6-15 files, 500-2000 LOC | ⚠️ — consider narrowing |
49
+ | >15 files or >2000 LOC | ❌ — too broad, must narrow scope |
50
+ | Feature has clear boundaries (self-contained module) | ✅ bonus |
51
+ | Feature is deeply entangled with source codebase | ❌ — extraction risk high |
52
+
53
+ ### 4. Quality
54
+
55
+ | Signal | Score |
56
+ |--------|-------|
57
+ | Has tests with >60% coverage | ✅ |
58
+ | Has tests but minimal | ⚠️ |
59
+ | No tests | ❌ |
60
+ | TypeScript strict / fully typed | ✅ bonus |
61
+ | Uses `any` extensively or untyped | ⚠️ |
62
+ | Well-documented (JSDoc, README for module) | ✅ bonus |
63
+ | No documentation | ⚠️ |
64
+ | Known anti-patterns (mutations, god classes, deep nesting) | ⚠️ — improve mode recommended |
65
+
66
+ **Composite**: ≥2 ✅ signals → ✅. 1 ✅ + warnings → ⚠️. No tests + untyped → ❌.
67
+
68
+ ### 5. Maintenance
69
+
70
+ | Signal | Score |
71
+ |--------|-------|
72
+ | Last commit < 3 months ago | ✅ |
73
+ | Last commit 3-12 months ago | ⚠️ |
74
+ | Last commit > 12 months ago | ❌ |
75
+ | Active issues being addressed | ✅ |
76
+ | 50+ open issues, no response | ⚠️ |
77
+ | Archived or deprecated | ❌ |
78
+ | Multiple contributors | ✅ |
79
+ | Solo maintainer, inactive | ⚠️ |
80
+
81
+ **Note**: For compare mode, maintenance is informational only — not blocking.
82
+
83
+ ## Presentation Format
84
+
85
+ ```markdown
86
+ ## Challenge Gate Results
87
+
88
+ | # | Dimension | Score | Detail |
89
+ |---|-----------|-------|--------|
90
+ | 1 | License | ✅ | MIT — compatible with your MIT project |
91
+ | 2 | Stack Fit | ⚠️ | React 18 → React 19 — minor API changes |
92
+ | 3 | Scope | ✅ | 4 files, ~350 LOC — well-scoped |
93
+ | 4 | Quality | ✅ | Typed, 12 tests, documented |
94
+ | 5 | Maintenance | ⚠️ | Last commit 5 months ago, but stable |
95
+
96
+ **Verdict**: PROCEED with caveats (0 ❌, 2 ⚠️)
97
+ Caveats: React 18→19 useEffect changes, verify repo still works with latest deps.
98
+ ```
@@ -0,0 +1,44 @@
1
+ # Mode Decision Tree
2
+
3
+ Auto-select the optimal graft mode when user doesn't specify explicitly.
4
+
5
+ ## Decision Flow
6
+
7
+ ```
8
+ 1. User wants analysis only? (says "compare", "vs", "analyze")
9
+ → YES: compare mode
10
+ → NO: continue
11
+
12
+ 2. Source and local tech stacks match?
13
+ → NO (different framework/language): port mode (forced)
14
+ → YES: continue
15
+
16
+ 3. Source code has quality issues? (anti-patterns, no types, no tests)
17
+ → YES: improve mode (fix issues during graft)
18
+ → NO: continue
19
+
20
+ 4. User wants exact replica? (says "exact", "as-is", "copy")
21
+ → YES: copy mode
22
+ → NO: improve mode (default for same-stack, good-quality)
23
+ ```
24
+
25
+ ## Mode Output Contracts
26
+
27
+ | Mode | Creates Files? | Modifies Files? | Produces Report? | Calls fix? | Calls review? |
28
+ |------|---------------|----------------|-----------------|-----------|--------------|
29
+ | compare | ❌ | ❌ | ✅ comparison report | ❌ | ❌ |
30
+ | copy | ✅ | ⚠️ minimal (imports) | ❌ | ❌ | ❌ |
31
+ | port | ✅ | ✅ | ❌ | ✅ | ❌ |
32
+ | improve | ✅ | ✅ | ❌ | ✅ | ✅ |
33
+
34
+ ## Examples
35
+
36
+ | Scenario | Auto Mode | Why |
37
+ |----------|-----------|-----|
38
+ | Next.js auth → your Next.js app | improve | Same stack, default to improving |
39
+ | Django REST → FastAPI | port | Different framework, rewrite needed |
40
+ | "How does Stripe handle webhooks in repo X?" | compare | Analysis intent, no code changes |
41
+ | "Copy their date picker component exactly" | copy | User explicitly wants exact replica |
42
+ | Vue component → React project | port | Different framework |
43
+ | Express middleware, has `any` everywhere | improve | Same stack (Node) but quality issues |
44
+ | "Use their testing approach" | compare | Learning intent, not adoption |
@@ -9,6 +9,7 @@ metadata:
9
9
  model: sonnet
10
10
  group: delivery
11
11
  tools: "Read, Write, Edit, Bash, Glob, Grep"
12
+ listen: incident.detected
12
13
  ---
13
14
 
14
15
  # incident
@@ -22,6 +23,7 @@ Structured incident response for production issues. Follows a strict order: tria
22
23
  - `/rune incident "description of what's broken"` — direct user invocation
23
24
  - Called by `launch` (L1): watchdog alerts during Phase 3 VERIFY
24
25
  - Called by `deploy` (L2): health check fails post-deploy
26
+ - Signal: auto-triggers when `watchdog` emits `incident.detected` — no manual invocation needed
25
27
 
26
28
  ## Calls (outbound)
27
29
 
@@ -8,6 +8,7 @@ metadata:
8
8
  model: haiku
9
9
  group: state
10
10
  tools: "Read, Write, Edit, Glob, Grep"
11
+ listen: graft.complete
11
12
  ---
12
13
 
13
14
  # journal
@@ -35,6 +36,7 @@ None — pure L3 state management utility.
35
36
  - `audit` (L2): save AUDIT-REPORT.md and record health trend entry
36
37
  - `incident` (L2): record incident timeline and postmortem
37
38
  - `skill-forge` (L2): record skill creation decisions and rationale
39
+ - `graft` (L2): auto-log graft operations — source URL, mode, challenge score, files changed
38
40
 
39
41
  ## Files Managed
40
42
 
@@ -11,6 +11,7 @@ metadata:
11
11
  model: sonnet
12
12
  group: orchestrator
13
13
  tools: "Read, Write, Edit, Bash, Glob, Grep"
14
+ listen: audit.complete
14
15
  ---
15
16
 
16
17
  # launch
@@ -34,6 +35,7 @@ Orchestrate the full deployment and marketing pipeline. Launch coordinates testi
34
35
  - `audit` (L2): pre-launch health check — full 7-phase quality gate
35
36
  - `deploy` (L2): push to target platform
36
37
  - `incident` (L2): if post-launch health check fails → triage and contain
38
+ - `retro` (L2): post-launch retrospective — what went well, what didn't
37
39
  - `browser-pilot` (L3): verify live site screenshots and performance
38
40
  - `marketing` (L2): create launch assets (landing copy, social, SEO)
39
41
  - `watchdog` (L3): setup post-deploy monitoring
@@ -3,7 +3,7 @@ name: marketing
3
3
  description: Create marketing assets and execute launch strategy. Generates landing copy, social banners, SEO meta, blog posts, and video scripts.
4
4
  metadata:
5
5
  author: runedev
6
- version: "0.3.0"
6
+ version: "0.4.0"
7
7
  layer: L2
8
8
  model: sonnet
9
9
  group: delivery
@@ -31,6 +31,8 @@ Create marketing assets and execute launch strategy. Marketing generates landing
31
31
  - `slides` (L3): generate presentation decks for launches and demos
32
32
  - `browser-pilot` (L3): capture screenshots for marketing assets
33
33
  - L4 extension packs: domain-specific content when context matches (e.g., @rune/content for blog posts, @rune/analytics for campaign measurement)
34
+ - `@rune-pro/growth/content-scorer` (L4 Pro, optional): 5-dimension content quality gate — if available, score all generated copy for AI phrase contamination and humanity
35
+ - `@rune-pro/growth/cro-analyst` (L4 Pro, optional): psychology-driven CRO analysis for landing pages — if available, audit generated landing copy through 7 behavioral lenses
34
36
 
35
37
  ## Execution Steps
36
38
 
@@ -87,8 +89,15 @@ If `marketing/brand-voice.md` already exists → Read it and apply. Do NOT regen
87
89
 
88
90
  Using product understanding, market research, and **brand voice contract**, produce:
89
91
 
92
+ **Anti-AI Copy Rules** (apply to ALL generated copy):
93
+ - NEVER open with "In today's...", "Are you struggling with...", "Have you ever wondered..."
94
+ - NEVER use: "game-changer", "revolutionary", "seamlessly", "leverage", "unlock the power of", "dive deep into", "delve", "robust", "streamline", "cutting-edge"
95
+ - MUST use one of 5 hook types for headlines: Provocative Question, Specific Scenario, Surprising Statistic, Bold Statement, or Counterintuitive Claim
96
+ - MUST include specific numbers, names, or outcomes — not vague claims ("many users love it")
97
+ - If the copy sounds like it was written by a generic AI → rewrite until it has personality
98
+
90
99
  **Hero section**
91
- - Headline (under 10 words, outcome-focused)
100
+ - Headline (under 10 words, outcome-focused, uses one of the 5 hook types above)
92
101
  - Subheadline (1-2 sentences expanding the promise)
93
102
  - Primary CTA button text
94
103
 
@@ -147,6 +156,41 @@ If the project already has a deployed site or existing pages, run a technical SE
147
156
  7. **Sitemap**: Check for `sitemap.xml` or sitemap generation in build config. Flag if missing.
148
157
  8. **Robots**: Check for `robots.txt`. Verify it doesn't accidentally block important pages.
149
158
 
159
+ **9. Schema Markup**: Check for `application/ld+json` blocks. Recommend adding relevant types:
160
+
161
+ | Content Type | Schema Type | Key Properties |
162
+ |-------------|-------------|---------------|
163
+ | Product page | `Product` | name, description, offers, review, aggregateRating |
164
+ | Article/Blog | `Article` | headline, author, datePublished, dateModified, image |
165
+ | FAQ section | `FAQPage` | mainEntity[].name, mainEntity[].acceptedAnswer |
166
+ | How-to guide | `HowTo` | name, step[].name, step[].text, totalTime |
167
+ | Organization | `Organization` | name, url, logo, sameAs[] |
168
+ | Breadcrumbs | `BreadcrumbList` | itemListElement[].name, itemListElement[].item |
169
+ | Software | `SoftwareApplication` | name, operatingSystem, applicationCategory, offers |
170
+ | Review | `Review` | itemReviewed, reviewRating, author, reviewBody |
171
+ | Comparison | `ItemList` | itemListElement[] with individual Product/Review schemas |
172
+ | Local biz | `LocalBusiness` | name, address, telephone, openingHoursSpecification |
173
+
174
+ Use `@graph` pattern to combine multiple schema types on a single page:
175
+ ```json
176
+ {
177
+ "@context": "https://schema.org",
178
+ "@graph": [
179
+ { "@type": "Organization", ... },
180
+ { "@type": "WebPage", ... },
181
+ { "@type": "BreadcrumbList", ... }
182
+ ]
183
+ }
184
+ ```
185
+
186
+ **10. Programmatic SEO awareness**: If the site has repeatable content patterns (product listings, city pages, comparison pages), note the opportunity for template-driven SEO pages. Common playbooks:
187
+ - **Templates**: `best [tool] for [persona]` pages across personas
188
+ - **Comparisons**: `[product A] vs [product B]` for all competitor pairs
189
+ - **Locations**: `[service] in [city]` for local reach
190
+ - **Integrations**: `[product] + [integration]` for every supported integration
191
+
192
+ Flag programmatic SEO opportunities in the audit report. Execution details are in `@rune-pro/growth` pack.
193
+
150
194
  **Output**: SEO Audit Report with pass/fail per check. Save to `marketing/seo-audit.md`.
151
195
 
152
196
  Fix critical SEO issues (missing titles, broken heading hierarchy) in the implementation plan. Non-critical issues go to `marketing/seo-backlog.md`.
@@ -3,7 +3,7 @@ name: mcp-builder
3
3
  description: Build Model Context Protocol servers from specifications. Generates tool definitions, resource handlers, and test suites for MCP servers in TypeScript or Python (FastMCP).
4
4
  metadata:
5
5
  author: runedev
6
- version: "0.4.0"
6
+ version: "0.5.0"
7
7
  layer: L2
8
8
  model: sonnet
9
9
  group: creation
@@ -54,6 +54,8 @@ If user provides a detailed spec or existing API docs → extract answers, confi
54
54
 
55
55
  ### Step 2 — Architecture Design
56
56
 
57
+ <MUST-READ path="references/auto-discovery-pattern.md" trigger="when the server has 5+ tools OR multiple API providers — use auto-discovery registry for graceful degradation"/>
58
+
57
59
  Determine server structure based on spec:
58
60
 
59
61
  **TypeScript (default):**