@rune-kit/rune 2.1.1

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 (155) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +357 -0
  3. package/agents/.gitkeep +0 -0
  4. package/agents/architect.md +29 -0
  5. package/agents/asset-creator.md +11 -0
  6. package/agents/audit.md +11 -0
  7. package/agents/autopsy.md +11 -0
  8. package/agents/brainstorm.md +11 -0
  9. package/agents/browser-pilot.md +11 -0
  10. package/agents/coder.md +29 -0
  11. package/agents/completion-gate.md +11 -0
  12. package/agents/constraint-check.md +11 -0
  13. package/agents/context-engine.md +11 -0
  14. package/agents/cook.md +11 -0
  15. package/agents/db.md +11 -0
  16. package/agents/debug.md +11 -0
  17. package/agents/dependency-doctor.md +11 -0
  18. package/agents/deploy.md +11 -0
  19. package/agents/design.md +11 -0
  20. package/agents/docs-seeker.md +11 -0
  21. package/agents/fix.md +11 -0
  22. package/agents/hallucination-guard.md +11 -0
  23. package/agents/incident.md +11 -0
  24. package/agents/integrity-check.md +11 -0
  25. package/agents/journal.md +11 -0
  26. package/agents/launch.md +11 -0
  27. package/agents/logic-guardian.md +11 -0
  28. package/agents/marketing.md +11 -0
  29. package/agents/onboard.md +11 -0
  30. package/agents/perf.md +11 -0
  31. package/agents/plan.md +11 -0
  32. package/agents/preflight.md +11 -0
  33. package/agents/problem-solver.md +11 -0
  34. package/agents/rescue.md +11 -0
  35. package/agents/research.md +11 -0
  36. package/agents/researcher.md +29 -0
  37. package/agents/review-intake.md +11 -0
  38. package/agents/review.md +11 -0
  39. package/agents/reviewer.md +28 -0
  40. package/agents/safeguard.md +11 -0
  41. package/agents/sast.md +11 -0
  42. package/agents/scanner.md +28 -0
  43. package/agents/scope-guard.md +11 -0
  44. package/agents/scout.md +11 -0
  45. package/agents/sentinel.md +11 -0
  46. package/agents/sequential-thinking.md +11 -0
  47. package/agents/session-bridge.md +11 -0
  48. package/agents/skill-forge.md +11 -0
  49. package/agents/skill-router.md +11 -0
  50. package/agents/surgeon.md +11 -0
  51. package/agents/team.md +11 -0
  52. package/agents/test.md +11 -0
  53. package/agents/trend-scout.md +11 -0
  54. package/agents/verification.md +11 -0
  55. package/agents/video-creator.md +11 -0
  56. package/agents/watchdog.md +11 -0
  57. package/agents/worktree.md +11 -0
  58. package/commands/.gitkeep +0 -0
  59. package/commands/rune.md +168 -0
  60. package/compiler/__tests__/openclaw-adapter.test.js +140 -0
  61. package/compiler/__tests__/parser.test.js +55 -0
  62. package/compiler/adapters/antigravity.js +59 -0
  63. package/compiler/adapters/claude.js +37 -0
  64. package/compiler/adapters/cursor.js +67 -0
  65. package/compiler/adapters/generic.js +60 -0
  66. package/compiler/adapters/index.js +45 -0
  67. package/compiler/adapters/openclaw.js +150 -0
  68. package/compiler/adapters/windsurf.js +60 -0
  69. package/compiler/bin/rune.js +288 -0
  70. package/compiler/doctor.js +153 -0
  71. package/compiler/emitter.js +240 -0
  72. package/compiler/parser.js +208 -0
  73. package/compiler/transformer.js +69 -0
  74. package/compiler/transforms/branding.js +27 -0
  75. package/compiler/transforms/cross-references.js +29 -0
  76. package/compiler/transforms/frontmatter.js +38 -0
  77. package/compiler/transforms/hooks.js +68 -0
  78. package/compiler/transforms/subagents.js +36 -0
  79. package/compiler/transforms/tool-names.js +60 -0
  80. package/contexts/dev.md +34 -0
  81. package/contexts/research.md +43 -0
  82. package/contexts/review.md +55 -0
  83. package/extensions/ai-ml/PACK.md +517 -0
  84. package/extensions/analytics/PACK.md +557 -0
  85. package/extensions/backend/PACK.md +678 -0
  86. package/extensions/chrome-ext/PACK.md +995 -0
  87. package/extensions/content/PACK.md +381 -0
  88. package/extensions/devops/PACK.md +520 -0
  89. package/extensions/ecommerce/PACK.md +280 -0
  90. package/extensions/gamedev/PACK.md +393 -0
  91. package/extensions/mobile/PACK.md +273 -0
  92. package/extensions/saas/PACK.md +805 -0
  93. package/extensions/security/PACK.md +536 -0
  94. package/extensions/trading/PACK.md +597 -0
  95. package/extensions/ui/PACK.md +947 -0
  96. package/package.json +47 -0
  97. package/skills/.gitkeep +0 -0
  98. package/skills/adversary/SKILL.md +271 -0
  99. package/skills/asset-creator/SKILL.md +157 -0
  100. package/skills/audit/SKILL.md +466 -0
  101. package/skills/autopsy/SKILL.md +200 -0
  102. package/skills/ba/SKILL.md +279 -0
  103. package/skills/brainstorm/SKILL.md +266 -0
  104. package/skills/browser-pilot/SKILL.md +168 -0
  105. package/skills/completion-gate/SKILL.md +151 -0
  106. package/skills/constraint-check/SKILL.md +165 -0
  107. package/skills/context-engine/SKILL.md +176 -0
  108. package/skills/cook/SKILL.md +636 -0
  109. package/skills/db/SKILL.md +256 -0
  110. package/skills/debug/SKILL.md +240 -0
  111. package/skills/dependency-doctor/SKILL.md +235 -0
  112. package/skills/deploy/SKILL.md +174 -0
  113. package/skills/design/DESIGN-REFERENCE.md +365 -0
  114. package/skills/design/SKILL.md +462 -0
  115. package/skills/doc-processor/SKILL.md +254 -0
  116. package/skills/docs/SKILL.md +336 -0
  117. package/skills/docs-seeker/SKILL.md +166 -0
  118. package/skills/fix/SKILL.md +192 -0
  119. package/skills/git/SKILL.md +285 -0
  120. package/skills/hallucination-guard/SKILL.md +204 -0
  121. package/skills/incident/SKILL.md +241 -0
  122. package/skills/integrity-check/SKILL.md +169 -0
  123. package/skills/journal/SKILL.md +190 -0
  124. package/skills/launch/SKILL.md +330 -0
  125. package/skills/logic-guardian/SKILL.md +240 -0
  126. package/skills/marketing/SKILL.md +229 -0
  127. package/skills/mcp-builder/SKILL.md +311 -0
  128. package/skills/onboard/SKILL.md +298 -0
  129. package/skills/perf/SKILL.md +297 -0
  130. package/skills/plan/SKILL.md +520 -0
  131. package/skills/preflight/SKILL.md +231 -0
  132. package/skills/problem-solver/SKILL.md +284 -0
  133. package/skills/rescue/SKILL.md +434 -0
  134. package/skills/research/SKILL.md +122 -0
  135. package/skills/review/SKILL.md +354 -0
  136. package/skills/review-intake/SKILL.md +222 -0
  137. package/skills/safeguard/SKILL.md +188 -0
  138. package/skills/sast/SKILL.md +190 -0
  139. package/skills/scaffold/SKILL.md +276 -0
  140. package/skills/scope-guard/SKILL.md +150 -0
  141. package/skills/scout/SKILL.md +232 -0
  142. package/skills/sentinel/SKILL.md +320 -0
  143. package/skills/sentinel-env/SKILL.md +226 -0
  144. package/skills/sequential-thinking/SKILL.md +234 -0
  145. package/skills/session-bridge/SKILL.md +287 -0
  146. package/skills/skill-forge/SKILL.md +317 -0
  147. package/skills/skill-router/SKILL.md +267 -0
  148. package/skills/surgeon/SKILL.md +203 -0
  149. package/skills/team/SKILL.md +397 -0
  150. package/skills/test/SKILL.md +271 -0
  151. package/skills/trend-scout/SKILL.md +145 -0
  152. package/skills/verification/SKILL.md +201 -0
  153. package/skills/video-creator/SKILL.md +201 -0
  154. package/skills/watchdog/SKILL.md +166 -0
  155. package/skills/worktree/SKILL.md +140 -0
@@ -0,0 +1,166 @@
1
+ ---
2
+ name: docs-seeker
3
+ description: Find documentation for APIs, libraries, and error messages. Looks up official docs, changelog entries, and migration guides.
4
+ metadata:
5
+ author: runedev
6
+ version: "0.2.0"
7
+ layer: L3
8
+ model: haiku
9
+ group: knowledge
10
+ tools: "Read, Glob, Grep, WebFetch, WebSearch"
11
+ ---
12
+
13
+ # docs-seeker
14
+
15
+ ## Purpose
16
+
17
+ Documentation lookup utility. Receives a library name, API reference, or error message, resolves the correct documentation, and returns API signatures, usage examples, and known issues. Stateless — no memory between calls.
18
+
19
+ ## Calls (outbound)
20
+
21
+ None — pure L3 utility using `WebSearch`, `WebFetch`, and Context7 MCP tools directly.
22
+
23
+ ## Called By (inbound)
24
+
25
+ - `debug` (L2): lookup API docs for unclear errors
26
+ - `fix` (L2): check correct API usage before applying changes
27
+ - `review` (L2): verify API usage is current and correct
28
+
29
+ ## Execution
30
+
31
+ ### Input
32
+
33
+ ```
34
+ target: string — library name, API endpoint, or error message
35
+ version: string — (optional) specific version to look up
36
+ query: string — specific question about the target (e.g., "how to configure retry")
37
+ ```
38
+
39
+ ### Step 1 — Identify Target
40
+
41
+ Parse the input to extract:
42
+ - Library or framework name (e.g., "react-query", "fastapi", "prisma")
43
+ - Version if specified
44
+ - The specific API, method, or error to look up
45
+
46
+ ### Step 2 — Try Context7 MCP (fastest)
47
+
48
+ Attempt Context7 MCP lookup first (faster, higher quality):
49
+
50
+ 1. Call `mcp__plugin_context7_context7__resolve-library-id` with the library name and query
51
+ 2. Select the best matching library ID from results (prioritize: name match, source reputation, snippet count)
52
+ 3. Call `mcp__plugin_context7_context7__query-docs` with the resolved library ID and the specific query
53
+ 4. If Context7 returns a satisfactory answer with code examples, proceed to Step 5
54
+
55
+ ### Step 3 — Try llms.txt Discovery
56
+
57
+ If Context7 MCP is unavailable or insufficient, try llms.txt (AI-optimized documentation):
58
+
59
+ **For GitHub repos** — pattern: `https://context7.com/{org}/{repo}/llms.txt`
60
+ ```
61
+ github.com/vercel/next.js → context7.com/vercel/next.js/llms.txt
62
+ github.com/shadcn-ui/ui → context7.com/shadcn-ui/ui/llms.txt
63
+ ```
64
+
65
+ **For doc sites** — pattern: `https://context7.com/websites/{normalized-domain}/llms.txt`
66
+ ```
67
+ docs.imgix.com → context7.com/websites/imgix/llms.txt
68
+ ffmpeg.org/doxygen/8.0 → context7.com/websites/ffmpeg_doxygen_8_0/llms.txt
69
+ ```
70
+
71
+ **Topic-specific** — append `?topic={query}` for focused results:
72
+ ```
73
+ context7.com/shadcn-ui/ui/llms.txt?topic=date-picker
74
+ context7.com/vercel/next.js/llms.txt?topic=cache
75
+ ```
76
+
77
+ **Traditional llms.txt fallback**: `WebSearch "[library] llms.txt"` → common paths: `docs.[lib].com/llms.txt`, `[lib].dev/llms.txt`
78
+
79
+ Use `WebFetch` on the resolved llms.txt URL. If it contains multiple section URLs (3+), launch parallel Explorer agents (one per section, max 5).
80
+
81
+ ### Step 4 — Fallback to Web Search
82
+
83
+ If neither Context7 nor llms.txt available:
84
+
85
+ 1. Use `WebSearch` with queries:
86
+ - "[library] [api/method] official documentation"
87
+ - "[library] [version] [query]"
88
+ - "[error message] [library] fix"
89
+ 2. Identify official documentation URLs (docs.*, official GitHub, npm/pypi pages)
90
+ 3. Call `WebFetch` on the top 1-3 official sources
91
+
92
+ **Repository analysis fallback** (when docs are sparse but code is available):
93
+ ```bash
94
+ npx repomix --output /tmp/repomix-output.xml # in the cloned repo
95
+ ```
96
+ Read the repomix output to extract API patterns, usage examples, and internal documentation.
97
+
98
+ ### Step 5 — Extract Answer
99
+
100
+ From Context7, llms.txt, or fetched pages, extract:
101
+ - Exact API signature with parameter types and return type
102
+ - Minimal working code example
103
+ - Version-specific notes (deprecated in X, changed in Y)
104
+ - Known issues or common pitfalls mentioned in docs
105
+
106
+ ### Step 6 — Report
107
+
108
+ Return structured documentation in the output format below.
109
+
110
+ ## Constraints
111
+
112
+ - Prefer Context7 MCP → llms.txt → WebSearch (in that priority order)
113
+ - Only fall back to web if Context7 and llms.txt both lack coverage
114
+ - Use `?topic=` parameter on llms.txt URLs for targeted results
115
+ - Always include source URL so callers can verify
116
+ - If the API is deprecated, say so explicitly and link to the replacement
117
+ - For parallel fetching: 1-3 URLs = single agent, 4-10 = 3-5 Explorer agents, 11+ = 5-7 agents
118
+
119
+ ## Output Format
120
+
121
+ ```
122
+ ## Documentation: [Library/API]
123
+ - **Version**: [detected or "latest"]
124
+ - **Source**: [official docs URL or "Context7"]
125
+
126
+ ### API Reference
127
+ - **Signature**: `functionName(param1: Type, param2: Type): ReturnType`
128
+ - **Parameters**:
129
+ - `param1` — description
130
+ - `param2` — description
131
+ - **Returns**: description
132
+
133
+ ### Usage Example
134
+ ```[lang]
135
+ [minimal working code snippet from official docs]
136
+ ```
137
+
138
+ ### Known Issues / Deprecations
139
+ - [relevant warning, deprecation notice, or common mistake]
140
+ ```
141
+
142
+ ## Sharp Edges
143
+
144
+ Known failure modes for this skill. Check these before declaring done.
145
+
146
+ | Failure Mode | Severity | Mitigation |
147
+ |---|---|---|
148
+ | Returning deprecated API without flagging it | HIGH | Must explicitly state "deprecated in X.Y, use Z instead" with replacement link |
149
+ | Wrong version docs returned when version specified | HIGH | Verify version match — if version-specific docs unavailable, state that explicitly |
150
+ | Skipping Context7 and going directly to web search | MEDIUM | Constraint: Context7 MCP → llms.txt → WebSearch — follow the priority chain |
151
+ | Not using ?topic= on llms.txt for focused queries | LOW | Topic parameter dramatically reduces noise — always append when query is specific |
152
+ | Returning docs without source URL | MEDIUM | Constraint: always include source URL so callers can verify |
153
+
154
+ ## Done When
155
+
156
+ - Context7 attempted first (resolve-library-id + query-docs)
157
+ - If Context7 insufficient: top 1-3 official doc URLs fetched via WebFetch
158
+ - API signature extracted with parameter types and return type
159
+ - Minimal working code example included
160
+ - Deprecation/version notes included if applicable
161
+ - Source URL provided
162
+ - Documentation emitted in output format
163
+
164
+ ## Cost Profile
165
+
166
+ ~300-600 tokens input, ~200-400 tokens output. Haiku. Fast lookup.
@@ -0,0 +1,192 @@
1
+ ---
2
+ name: fix
3
+ description: Apply code changes and fixes. Writes implementation code, applies bug fixes, and verifies changes with tests. Core action hub in the development mesh.
4
+ metadata:
5
+ author: runedev
6
+ version: "0.3.0"
7
+ layer: L2
8
+ model: sonnet
9
+ group: development
10
+ tools: "Read, Write, Edit, Bash, Glob, Grep"
11
+ ---
12
+
13
+ # fix
14
+
15
+ ## Purpose
16
+
17
+ Apply code changes. Fix receives a plan, debug finding, or review finding and writes the actual code. It does NOT investigate root causes — that is rune:debug's job. Fix is the action hub: locate, change, verify, report.
18
+
19
+ <HARD-GATE>
20
+ Never change test files to make tests pass unless the tests themselves are provably wrong (wrong expected value, wrong test setup, testing a removed API). The rule: fix the CODE, not the TESTS.
21
+ If unsure whether the test is wrong or the implementation is wrong → call `rune:debug` to investigate.
22
+ </HARD-GATE>
23
+
24
+ ## Triggers
25
+
26
+ - Called by `cook` Phase 4 IMPLEMENT — write code to pass tests
27
+ - Called by `debug` when root cause found and fix is ready
28
+ - Called by `review` when bugs found during review
29
+ - `/rune fix <issue>` — manual fix application
30
+ - Auto-trigger: after successful debug diagnosis
31
+
32
+ ## Calls (outbound)
33
+
34
+ - `debug` (L2): when root cause unclear before fixing — need diagnosis first
35
+ - `test` (L2): verify fix with tests after applying changes
36
+ - `review` (L2): self-review for complex or risky fixes
37
+ - `verification` (L3): validate fix doesn't break existing functionality
38
+ - `docs-seeker` (L3): check correct API usage before applying changes
39
+ - `hallucination-guard` (L3): verify imports after code changes
40
+ - `scout` (L2): find related code before applying changes
41
+
42
+ ## Called By (inbound)
43
+
44
+ - `cook` (L1): Phase 4 IMPLEMENT — apply code changes
45
+ - `debug` (L2): root cause found, ready to apply fix
46
+ - `review` (L2): bug found during review, needs fixing
47
+ - `surgeon` (L2): apply refactoring changes
48
+ - `review-intake` (L2): apply fixes identified during structured review intake
49
+
50
+ ## Cross-Hub Connections
51
+
52
+ - `fix` ↔ `debug` — bidirectional: debug diagnoses → fix applies, fix can't determine cause → debug investigates
53
+ - `fix` → `test` — after applying fix, run tests to verify
54
+ - `fix` ← `review` — review finds bug → fix applies correction
55
+ - `fix` → `review` — complex fix requests self-review
56
+
57
+ ## Execution
58
+
59
+ ### Step 1: Understand
60
+
61
+ Read and fully understand the fix request before touching any file.
62
+
63
+ - Read the incoming request: debug report, plan spec, or review finding
64
+ - Identify what is broken or missing and what the expected behavior should be
65
+ - If the request is ambiguous or root cause is unclear → call `rune:debug` before proceeding
66
+ - Note the scope: single function, single file, or multi-file change
67
+
68
+ ### Step 2: Locate
69
+
70
+ Find the exact files and lines to change.
71
+
72
+ - Use `rune:scout` to locate the relevant files, functions, and surrounding code
73
+ - Use `Read` to examine the specific file:line identified in the debug report or plan
74
+ - Use `Glob` to find related files: types, tests, config that may also need updating
75
+ - Map all touch points before writing a single line of code
76
+
77
+ ### Step 3: Change
78
+
79
+ Apply the minimal set of changes needed.
80
+
81
+ - Use `Edit` for targeted modifications to existing files
82
+ - Use `Write` only when creating a genuinely new file is required
83
+ - Follow project conventions: naming, immutability patterns, error handling style
84
+ - Keep changes minimal — fix the stated problem, do not refactor unrelated code (YAGNI)
85
+ - Never use `any` in TypeScript; never use bare `except:` in Python
86
+ - If a new import is needed → note it for Step 5 hallucination-guard check
87
+
88
+ ### Step 4: Verify
89
+
90
+ Confirm the change works and nothing is broken.
91
+
92
+ - Use `Bash` to run the relevant tests: the specific failing test first, then the full suite
93
+ - If tests fail after the fix:
94
+ - Investigate with `rune:debug` (max 3 debug loops before escalating)
95
+ - Do NOT change test files to make tests pass — fix the implementation code
96
+ - If project has a type-check command, run it via `Bash`
97
+ - If project has a lint command, run it via `Bash`
98
+
99
+ ### Step 5: Post-Fix Hardening (Defense-in-Depth)
100
+
101
+ After the fix works, make the bug **structurally impossible** — not just "fixed this time."
102
+
103
+ Single validation at one point can be bypassed by different code paths, refactoring, or mocks. Add validation at EVERY layer data passes through:
104
+
105
+ | Layer | Purpose | Example |
106
+ |-------|---------|---------|
107
+ | **Entry Point** | Reject invalid input at API boundary | Validate params not empty/exists/correct type |
108
+ | **Business Logic** | Ensure data makes sense for this operation | Check preconditions specific to this function |
109
+ | **Environment Guard** | Prevent dangerous ops in specific contexts | In tests: refuse writes outside tmpdir |
110
+ | **Debug Instrumentation** | Capture context for forensics if bug recurs | Log stack trace + key values before risky ops |
111
+
112
+ Apply this when: the bug was caused by invalid data flowing through multiple layers. Skip for trivial one-liner fixes.
113
+
114
+ ### Step 6: Self-Review
115
+
116
+ Verify correctness of the changes just made.
117
+
118
+ - Call `rune:hallucination-guard` to verify all imports introduced or modified are real and correctly named
119
+ - Call `rune:docs-seeker` if any external API, library method, or SDK call was added or changed
120
+ - For complex or risky fixes (auth, data mutation, async logic): call `rune:review` for a full quality check
121
+
122
+ ### Step 7: Report
123
+
124
+ Produce a structured summary of all changes made.
125
+
126
+ - List every file modified and a one-line description of what changed
127
+ - Include verification results (tests, types, lint)
128
+ - Note any follow-up work if the fix is partial or has known limitations
129
+
130
+ ## Constraints
131
+
132
+ 1. MUST NOT change test files to make tests pass — fix the CODE, not the TESTS
133
+ 2. MUST have a diagnosis (from debug or clear error) before applying fixes
134
+ 3. MUST run tests after each fix attempt — never batch multiple untested changes
135
+ 4. MUST NOT exceed 3 fix attempts — if 3 fixes fail, re-diagnose via rune:debug (which will classify: wrong approach → brainstorm rescue, wrong design → plan redesign)
136
+ 5. MUST follow project conventions found by scout — don't invent new patterns
137
+ 6. MUST NOT add unplanned features while fixing — fix only what was diagnosed
138
+ 7. MUST track fix attempt number — this feeds debug's 3-Fix Escalation classification
139
+
140
+ ## Mesh Gates
141
+
142
+ | Gate | Requires | If Missing |
143
+ |------|----------|------------|
144
+ | Evidence Gate | Debug report OR clear error description before fixing | Run rune:debug first |
145
+ | Test Gate | Tests run after each fix attempt | Run tests before claiming fix works |
146
+
147
+ ## Output Format
148
+
149
+ ```
150
+ ## Fix Report
151
+ - **Task**: [what was fixed/implemented]
152
+ - **Status**: complete | partial | blocked
153
+
154
+ ### Changes
155
+ - `path/to/file.ts` — [description of change]
156
+ - `path/to/other.ts` — [description of change]
157
+
158
+ ### Verification
159
+ - Lint: PASS | FAIL
160
+ - Types: PASS | FAIL
161
+ - Tests: PASS | FAIL ([n] passed, [m] failed)
162
+
163
+ ### Notes
164
+ - [any caveats or follow-up needed]
165
+ ```
166
+
167
+ ## Sharp Edges
168
+
169
+ Known failure modes for this skill. Check these before declaring done.
170
+
171
+ | Failure Mode | Severity | Mitigation |
172
+ |---|---|---|
173
+ | Modifying test files to make tests pass | CRITICAL | HARD-GATE blocks this — fix the code, never the tests (unless test setup is provably wrong) |
174
+ | Applying fix without a diagnosis | HIGH | Evidence Gate: need debug report or clear error description before touching code |
175
+ | Exceeding 3 fix attempts without re-diagnosing | HIGH | Constraint 4: after 3 failures, call debug again — the hypothesis was wrong |
176
+ | Introducing unrelated refactoring while fixing | MEDIUM | YAGNI: fix only what was diagnosed — unrelated changes belong in a separate task |
177
+ | Not running tests after each individual change | MEDIUM | Constraint 3: never batch untested changes — run tests after each edit |
178
+ | Fixing at crash site without tracing data origin | HIGH | Defense-in-depth: trace where bad data ORIGINATES, add validation at every layer it passes through |
179
+ | Single-point validation (fix one spot, hope it holds) | MEDIUM | Step 5: add entry + business logic + environment + debug layers for data-flow bugs |
180
+
181
+ ## Done When
182
+
183
+ - Root cause identified (debug report or clear error received)
184
+ - Minimal changes applied targeting only the diagnosed problem
185
+ - Tests pass for the fixed functionality (actual output shown)
186
+ - Lint and type check pass
187
+ - hallucination-guard verified any new imports
188
+ - Fix Report emitted with changed files and verification results
189
+
190
+ ## Cost Profile
191
+
192
+ ~2000-5000 tokens input, ~1000-3000 tokens output. Sonnet for code writing quality. Most active skill during implementation.
@@ -0,0 +1,285 @@
1
+ ---
2
+ name: git
3
+ description: Specialized git operations — semantic commits, PR descriptions, branch management, conflict resolution guidance. Replaces ad-hoc git commands with a dedicated, convention-aware utility.
4
+ metadata:
5
+ author: runedev
6
+ version: "0.2.0"
7
+ layer: L3
8
+ model: haiku
9
+ group: utility
10
+ tools: "Read, Bash, Glob, Grep"
11
+ ---
12
+
13
+ # git
14
+
15
+ ## Purpose
16
+
17
+ Specialized git operations utility. Handles semantic commits, PR descriptions, branch naming, and changelog generation with consistent conventions. Replaces scattered git logic across cook Phase 7 and other skills with a single, convention-aware utility.
18
+
19
+ ## Triggers
20
+
21
+ - Called by `cook` Phase 7 for commit creation
22
+ - Called by `scaffold` Phase 8 for initial commit
23
+ - Called by `team` for parallel branch/PR management
24
+ - Called by `docs` for changelog generation
25
+ - Called by `launch` for release tagging
26
+ - `/rune git commit` — manual semantic commit
27
+ - `/rune git pr` — manual PR generation
28
+ - `/rune git branch <description>` — generate branch name
29
+ - `/rune git changelog` — generate changelog from commits
30
+
31
+ ## Calls (outbound)
32
+
33
+ None — pure L3 utility. Reads git state, produces git commands/output.
34
+
35
+ ## Called By (inbound)
36
+
37
+ - `cook` (L1): Phase 7 — create semantic commit after implementation
38
+ - `scaffold` (L1): Phase 8 — initial commit with generated project
39
+ - `team` (L1): parallel PR management across workstreams
40
+ - `launch` (L1): release tagging and changelog
41
+ - `docs` (L2): changelog generation sub-workflow
42
+ - User: `/rune git` direct invocation
43
+
44
+ ## Modes
45
+
46
+ ### Commit Mode (default)
47
+
48
+ Analyze staged changes and produce a semantic commit.
49
+
50
+ ### PR Mode
51
+
52
+ Analyze full branch diff against base and produce a pull request.
53
+
54
+ ### Branch Mode
55
+
56
+ Generate a branch name from a task description.
57
+
58
+ ### Changelog Mode
59
+
60
+ Generate changelog entries from commit history.
61
+
62
+ ## Executable Steps
63
+
64
+ ### Commit Mode
65
+
66
+ #### Step 1 — Analyze Staged Changes
67
+
68
+ Read `git diff --staged` and `git status`. Classify the change:
69
+
70
+ | Type | Signal | Prefix |
71
+ |------|--------|--------|
72
+ | New feature | New files, new exports, new routes | `feat` |
73
+ | Bug fix | Changed logic in existing code, test fix | `fix` |
74
+ | Refactor | Structural change, no behavior change | `refactor` |
75
+ | Test | Only test files changed | `test` |
76
+ | Documentation | Only .md, comments, JSDoc changed | `docs` |
77
+ | Build/CI | Config files, CI pipelines, Dockerfile | `chore` |
78
+ | Performance | Optimization, caching, query improvement | `perf` |
79
+
80
+ #### Step 2 — Detect Scope
81
+
82
+ Extract scope from file paths:
83
+ - `src/auth/*` → scope: `auth`
84
+ - `src/components/Button.tsx` → scope: `ui`
85
+ - `api/routes/users.ts` → scope: `api`
86
+ - Multiple directories → omit scope or use most relevant
87
+ - Root config files → scope: `config`
88
+
89
+ #### Step 3 — Generate Commit Message
90
+
91
+ Format: `<type>(<scope>): <description>`
92
+
93
+ Rules:
94
+ - Description: imperative mood, lowercase first letter, no period
95
+ - Max 72 characters for subject line
96
+ - If > 5 files changed → add body with bullet summary
97
+ - If breaking change detected (removed export, changed API signature, schema change) → add `!` suffix and `BREAKING CHANGE:` footer
98
+
99
+ ```
100
+ feat(auth): add JWT refresh token rotation
101
+
102
+ - Add refresh token endpoint with sliding window expiry
103
+ - Store token family for reuse detection
104
+ - Add middleware to validate refresh tokens
105
+
106
+ BREAKING CHANGE: /api/auth/refresh now requires refresh_token in body instead of cookie
107
+ ```
108
+
109
+ #### Step 4 — Execute
110
+
111
+ Run `git commit` with the generated message. If pre-commit hooks fail → report the failure, do not `--no-verify`.
112
+
113
+ ### PR Mode
114
+
115
+ #### Step 1 — Analyze Branch
116
+
117
+ Read ALL commits on the current branch vs base branch using `git log <base>..HEAD` and `git diff <base>...HEAD`.
118
+
119
+ Do NOT just look at the latest commit — PRs include ALL branch commits.
120
+
121
+ #### Step 2 — Generate PR
122
+
123
+ ```markdown
124
+ ## Summary
125
+ <1-3 bullet points covering ALL changes, not just the last commit>
126
+
127
+ ## Changes
128
+ - [grouped by feature/area]
129
+
130
+ ## Test Plan
131
+ - [ ] [specific test scenarios]
132
+
133
+ ## Breaking Changes
134
+ - [if any — list explicitly]
135
+ ```
136
+
137
+ Title: < 70 characters, descriptive of the full change set.
138
+
139
+ #### Step 3 — Execute
140
+
141
+ Run `gh pr create` with generated title and body. If no remote branch → push with `-u` first.
142
+
143
+ ### Branch Mode
144
+
145
+ #### Step 1 — Parse Task
146
+
147
+ Extract key intent from task description:
148
+ - Feature → `feat/short-kebab-description`
149
+ - Bug fix → `fix/issue-number-or-description`
150
+ - Refactor → `refactor/module-name`
151
+ - Chore → `chore/description`
152
+
153
+ Rules:
154
+ - Max 50 characters total
155
+ - Kebab-case, no uppercase
156
+ - Include issue number if referenced: `fix/123-login-crash`
157
+
158
+ #### Step 2 — Execute
159
+
160
+ Run `git checkout -b <branch-name>` from current branch.
161
+
162
+ ### Changelog Mode
163
+
164
+ #### Step 1 — Read History
165
+
166
+ Read commits since last tag (`git log $(git describe --tags --abbrev=0)..HEAD`) or since specified reference.
167
+
168
+ #### Step 2 — Group and Format
169
+
170
+ Group commits by conventional commit type. Format as [Keep a Changelog](https://keepachangelog.com/):
171
+
172
+ ```markdown
173
+ ## [Unreleased]
174
+
175
+ ### Added
176
+ - New feature description (#PR)
177
+
178
+ ### Fixed
179
+ - Bug fix description (#PR)
180
+
181
+ ### Changed
182
+ - Change description (#PR)
183
+
184
+ ### Removed
185
+ - Removed feature (#PR)
186
+ ```
187
+
188
+ Link to PRs/issues when references found in commit messages.
189
+
190
+ ## Output Format
191
+
192
+ ### Commit Mode
193
+ ```
194
+ <type>(<scope>): <description>
195
+
196
+ [optional body — bullet summary if > 5 files changed]
197
+
198
+ [BREAKING CHANGE: description — if breaking change detected]
199
+ ```
200
+
201
+ ### PR Mode
202
+ ```
203
+ Title: <type>: <short description> (< 70 chars)
204
+
205
+ ## Summary
206
+ - [bullet points covering ALL branch changes]
207
+
208
+ ## Changes
209
+ - [grouped by feature/area]
210
+
211
+ ## Test Plan
212
+ - [ ] [specific test scenarios]
213
+
214
+ ## Breaking Changes
215
+ - [if any]
216
+ ```
217
+
218
+ ### Branch Mode
219
+ ```
220
+ <type>/<short-kebab-description>
221
+ ```
222
+ Examples: `feat/jwt-refresh`, `fix/123-login-crash`, `refactor/auth-module`
223
+
224
+ ### Changelog Mode
225
+ ```markdown
226
+ ## [Unreleased]
227
+
228
+ ### Added
229
+ - Feature description (#PR)
230
+
231
+ ### Fixed
232
+ - Bug fix description (#PR)
233
+
234
+ ### Changed
235
+ - Change description (#PR)
236
+ ```
237
+
238
+ ## Constraints
239
+
240
+ 1. MUST use conventional commit format — no freeform messages
241
+ 2. MUST analyze full diff before generating message — don't guess from file names alone
242
+ 3. MUST detect breaking changes — missing BREAKING CHANGE footer causes downstream issues
243
+ 4. MUST NOT use `--no-verify` — if hooks fail, report and fix
244
+ 5. MUST NOT force push unless explicitly requested by user
245
+ 6. PR mode MUST analyze ALL commits on branch, not just the latest
246
+ 7. MUST respect project's existing commit conventions if detected (check recent git log)
247
+
248
+ ## Sharp Edges
249
+
250
+ | Failure Mode | Severity | Mitigation |
251
+ |---|---|---|
252
+ | Commit message doesn't match actual changes | HIGH | Step 1 reads full diff, not just file names |
253
+ | PR description covers only last commit | HIGH | Step 1 reads ALL commits on branch |
254
+ | Missing breaking change detection | HIGH | Check: removed exports, changed function signatures, schema changes |
255
+ | Branch name too long or has special characters | LOW | Max 50 chars, kebab-case only |
256
+ | Force push without user consent | CRITICAL | Constraint 5: never force push unless explicitly requested |
257
+ | Ignoring project's existing conventions | MEDIUM | Check recent `git log --oneline -10` for existing style |
258
+
259
+ ## Done When
260
+
261
+ ### Commit Mode
262
+ - Staged diff analyzed and change type classified
263
+ - Scope extracted from file paths
264
+ - Semantic commit message generated (subject + body if needed)
265
+ - Breaking changes detected and flagged
266
+ - Commit executed (or failure reported)
267
+
268
+ ### PR Mode
269
+ - All branch commits analyzed (not just latest)
270
+ - Summary covers full change set
271
+ - Test plan included
272
+ - PR created with `gh pr create`
273
+
274
+ ### Branch Mode
275
+ - Branch name follows convention
276
+ - Branch created from current HEAD
277
+
278
+ ### Changelog Mode
279
+ - All commits since last tag grouped by type
280
+ - Formatted as Keep a Changelog
281
+ - PR/issue references linked
282
+
283
+ ## Cost Profile
284
+
285
+ ~500-2000 tokens input, ~200-800 tokens output. Haiku — git operations are mechanical and convention-based, no deep reasoning needed.