opencodekit 0.21.10 → 0.23.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 (213) hide show
  1. package/README.md +1 -1
  2. package/dist/index.js +4 -25
  3. package/dist/template/.opencode/.template-manifest.json +115 -188
  4. package/dist/template/.opencode/AGENTS.md +127 -484
  5. package/dist/template/.opencode/README.md +2 -2
  6. package/dist/template/.opencode/agent/build.md +158 -356
  7. package/dist/template/.opencode/agent/explore.md +0 -1
  8. package/dist/template/.opencode/agent/plan.md +7 -16
  9. package/dist/template/.opencode/agent/review.md +0 -1
  10. package/dist/template/.opencode/agent/scout.md +2 -3
  11. package/dist/template/.opencode/agent/vision.md +0 -1
  12. package/dist/template/.opencode/artifacts/.active +1 -0
  13. package/dist/template/.opencode/artifacts/example/plan.md +12 -0
  14. package/dist/template/.opencode/artifacts/example/progress.md +4 -0
  15. package/dist/template/.opencode/artifacts/example/research.md +4 -0
  16. package/dist/template/.opencode/artifacts/example/spec.md +16 -0
  17. package/dist/template/.opencode/artifacts/todo.md +5 -0
  18. package/dist/template/.opencode/artifacts/verify.log +4 -0
  19. package/dist/template/.opencode/command/clarify.md +46 -0
  20. package/dist/template/.opencode/command/commit.md +53 -0
  21. package/dist/template/.opencode/command/create.md +29 -71
  22. package/dist/template/.opencode/command/design.md +1 -2
  23. package/dist/template/.opencode/command/explore.md +3 -4
  24. package/dist/template/.opencode/command/fix.md +55 -0
  25. package/dist/template/.opencode/command/improve-architecture.md +55 -0
  26. package/dist/template/.opencode/command/init.md +86 -69
  27. package/dist/template/.opencode/command/plan.md +30 -60
  28. package/dist/template/.opencode/command/pr.md +10 -28
  29. package/dist/template/.opencode/command/refactor.md +65 -0
  30. package/dist/template/.opencode/command/research.md +7 -29
  31. package/dist/template/.opencode/command/review-codebase.md +6 -13
  32. package/dist/template/.opencode/command/ship.md +136 -78
  33. package/dist/template/.opencode/command/test.md +66 -0
  34. package/dist/template/.opencode/command/ui-review.md +2 -4
  35. package/dist/template/.opencode/command/verify.md +15 -23
  36. package/dist/template/.opencode/dcp.jsonc +96 -85
  37. package/dist/template/.opencode/memory/README.md +4 -6
  38. package/dist/template/.opencode/memory/_templates/adr.md +45 -0
  39. package/dist/template/.opencode/memory/_templates/prd.md +1 -1
  40. package/dist/template/.opencode/memory/_templates/roadmap.md +1 -1
  41. package/dist/template/.opencode/memory/_templates/state.md +1 -1
  42. package/dist/template/.opencode/memory/project/gotchas.md +4 -4
  43. package/dist/template/.opencode/memory/project/project.md +2 -2
  44. package/dist/template/.opencode/memory/project/roadmap.md +1 -1
  45. package/dist/template/.opencode/memory/project/state.md +2 -2
  46. package/dist/template/.opencode/memory/project/tech-stack.md +2 -2
  47. package/dist/template/.opencode/memory/session-context.md +1 -1
  48. package/dist/template/.opencode/opencode.json +14 -152
  49. package/dist/template/.opencode/plugin/README.md +2 -2
  50. package/dist/template/.opencode/plugin/guard.ts +62 -0
  51. package/dist/template/.opencode/plugin/{lib/memory-admin-tools.ts → memory/admin.ts} +4 -4
  52. package/dist/template/.opencode/plugin/{lib → memory}/capture.ts +1 -1
  53. package/dist/template/.opencode/plugin/{lib → memory}/compile.ts +2 -2
  54. package/dist/template/.opencode/plugin/{lib → memory}/context.ts +1 -1
  55. package/dist/template/.opencode/plugin/{lib → memory}/curator.ts +1 -1
  56. package/dist/template/.opencode/plugin/{lib → memory}/db/observations.ts +102 -3
  57. package/dist/template/.opencode/plugin/{lib → memory}/db/schema.ts +43 -1
  58. package/dist/template/.opencode/plugin/{lib → memory}/db/types.ts +22 -0
  59. package/dist/template/.opencode/plugin/{lib/memory-db.ts → memory/db.ts} +1 -1
  60. package/dist/template/.opencode/plugin/{lib → memory}/distill.ts +1 -1
  61. package/dist/template/.opencode/plugin/{lib/memory-helpers.ts → memory/helpers.ts} +5 -1
  62. package/dist/template/.opencode/plugin/{lib/memory-hooks.ts → memory/hooks.ts} +1 -1
  63. package/dist/template/.opencode/plugin/{lib → memory}/index-generator.ts +2 -2
  64. package/dist/template/.opencode/plugin/{lib → memory}/inject.ts +1 -1
  65. package/dist/template/.opencode/plugin/{lib → memory}/lint.ts +2 -2
  66. package/dist/template/.opencode/plugin/memory/tools.ts +322 -0
  67. package/dist/template/.opencode/plugin/{lib → memory}/validate.ts +2 -2
  68. package/dist/template/.opencode/plugin/memory.ts +7 -17
  69. package/dist/template/.opencode/plugin/srcwalk.ts +721 -0
  70. package/dist/template/.opencode/skill/agent-code-quality-gate/SKILL.md +98 -0
  71. package/dist/template/.opencode/skill/behavioral-kernel/SKILL.md +52 -0
  72. package/dist/template/.opencode/skill/brainstorming/SKILL.md +1 -1
  73. package/dist/template/.opencode/skill/browser-testing-with-devtools/SKILL.md +85 -0
  74. package/dist/template/.opencode/skill/code-cleanup/SKILL.md +114 -0
  75. package/dist/template/.opencode/skill/code-navigation/SKILL.md +142 -0
  76. package/dist/template/.opencode/skill/code-review-and-quality/SKILL.md +131 -0
  77. package/dist/template/.opencode/skill/context-engineering/SKILL.md +1 -1
  78. package/dist/template/.opencode/skill/debugging-and-error-recovery/SKILL.md +109 -0
  79. package/dist/template/.opencode/skill/deep-module-design/SKILL.md +207 -0
  80. package/dist/template/.opencode/skill/development-lifecycle/SKILL.md +26 -45
  81. package/dist/template/.opencode/skill/gemini-large-context/SKILL.md +4 -4
  82. package/dist/template/.opencode/skill/git-workflow-and-versioning/SKILL.md +77 -0
  83. package/dist/template/.opencode/skill/grill-me/SKILL.md +140 -0
  84. package/dist/template/.opencode/skill/memory-system/SKILL.md +9 -10
  85. package/dist/template/.opencode/skill/opensrc/references/example-workflow.md +1 -1
  86. package/dist/template/.opencode/skill/planning-and-task-breakdown/SKILL.md +116 -0
  87. package/dist/template/.opencode/skill/shipping-and-launch/SKILL.md +95 -0
  88. package/dist/template/.opencode/skill/source-driven-development/SKILL.md +103 -0
  89. package/dist/template/.opencode/skill/spec-driven-development/SKILL.md +121 -0
  90. package/dist/template/.opencode/skill/srcwalk/SKILL.md +161 -0
  91. package/dist/template/.opencode/skill/subagent-driven-development/SKILL.md +1 -1
  92. package/dist/template/.opencode/skill/ubiquitous-language/SKILL.md +184 -0
  93. package/dist/template/.opencode/skill/using-git-worktrees/SKILL.md +6 -6
  94. package/dist/template/.opencode/skill/verification-before-completion/SKILL.md +6 -6
  95. package/dist/template/.opencode/skill/verification-before-completion/references/VERIFICATION_PROTOCOL.md +5 -5
  96. package/package.json +76 -76
  97. package/dist/template/.opencode/AGENT_ALIGNMENT.md +0 -564
  98. package/dist/template/.opencode/agent/painter.md +0 -83
  99. package/dist/template/.opencode/command/compound.md +0 -240
  100. package/dist/template/.opencode/command/curate.md +0 -299
  101. package/dist/template/.opencode/command/handoff.md +0 -149
  102. package/dist/template/.opencode/command/health.md +0 -356
  103. package/dist/template/.opencode/command/init-context.md +0 -297
  104. package/dist/template/.opencode/command/init-user.md +0 -125
  105. package/dist/template/.opencode/command/iterate.md +0 -200
  106. package/dist/template/.opencode/command/lfg.md +0 -173
  107. package/dist/template/.opencode/command/resume.md +0 -78
  108. package/dist/template/.opencode/command/status.md +0 -126
  109. package/dist/template/.opencode/command/ui-slop-check.md +0 -169
  110. package/dist/template/.opencode/plans/1768385996691-silent-wizard.md +0 -247
  111. package/dist/template/.opencode/plans/1770006237537-mighty-otter.md +0 -418
  112. package/dist/template/.opencode/plans/1770006913647-glowing-forest.md +0 -170
  113. package/dist/template/.opencode/plans/1770013678126-witty-planet.md +0 -278
  114. package/dist/template/.opencode/plans/1770112267595-shiny-rocket.md +0 -258
  115. package/dist/template/.opencode/plans/swarm-protocol.md +0 -123
  116. package/dist/template/.opencode/plugin/lib/memory-tools.ts +0 -535
  117. package/dist/template/.opencode/skill/agent-evals/SKILL.md +0 -208
  118. package/dist/template/.opencode/skill/anti-ai-slop/SKILL.md +0 -76
  119. package/dist/template/.opencode/skill/augment-context-engine/SKILL.md +0 -122
  120. package/dist/template/.opencode/skill/augment-context-engine/mcp.json +0 -6
  121. package/dist/template/.opencode/skill/beads/SKILL.md +0 -182
  122. package/dist/template/.opencode/skill/beads/references/BEST_PRACTICES.md +0 -27
  123. package/dist/template/.opencode/skill/beads/references/BOUNDARIES.md +0 -219
  124. package/dist/template/.opencode/skill/beads/references/DEPENDENCIES.md +0 -124
  125. package/dist/template/.opencode/skill/beads/references/EXAMPLES.md +0 -45
  126. package/dist/template/.opencode/skill/beads/references/FILE_CLAIMING.md +0 -101
  127. package/dist/template/.opencode/skill/beads/references/GIT_SYNC.md +0 -25
  128. package/dist/template/.opencode/skill/beads/references/HIERARCHY.md +0 -71
  129. package/dist/template/.opencode/skill/beads/references/MULTI_AGENT.md +0 -40
  130. package/dist/template/.opencode/skill/beads/references/RESUMABILITY.md +0 -177
  131. package/dist/template/.opencode/skill/beads/references/SESSION_PROTOCOL.md +0 -61
  132. package/dist/template/.opencode/skill/beads/references/TASK_CREATION.md +0 -38
  133. package/dist/template/.opencode/skill/beads/references/TROUBLESHOOTING.md +0 -38
  134. package/dist/template/.opencode/skill/beads/references/WORKFLOWS.md +0 -226
  135. package/dist/template/.opencode/skill/brand-asset-protocol/SKILL.md +0 -222
  136. package/dist/template/.opencode/skill/code-search-patterns/SKILL.md +0 -224
  137. package/dist/template/.opencode/skill/code-simplification/SKILL.md +0 -211
  138. package/dist/template/.opencode/skill/context-condensation/SKILL.md +0 -149
  139. package/dist/template/.opencode/skill/context-initialization/SKILL.md +0 -69
  140. package/dist/template/.opencode/skill/context-management/SKILL.md +0 -390
  141. package/dist/template/.opencode/skill/deep-research/SKILL.md +0 -384
  142. package/dist/template/.opencode/skill/design-direction-advisor/SKILL.md +0 -139
  143. package/dist/template/.opencode/skill/dispatching-parallel-agents/SKILL.md +0 -191
  144. package/dist/template/.opencode/skill/executing-plans/SKILL.md +0 -247
  145. package/dist/template/.opencode/skill/figma-go/SKILL.md +0 -65
  146. package/dist/template/.opencode/skill/finishing-a-development-branch/SKILL.md +0 -357
  147. package/dist/template/.opencode/skill/full-output-enforcement/SKILL.md +0 -62
  148. package/dist/template/.opencode/skill/gh-address-comments/SKILL.md +0 -29
  149. package/dist/template/.opencode/skill/gh-address-comments/scripts/fetch_comments.py +0 -237
  150. package/dist/template/.opencode/skill/gh-fix-ci/SKILL.md +0 -38
  151. package/dist/template/.opencode/skill/gh-fix-ci/scripts/inspect_pr_checks.py +0 -509
  152. package/dist/template/.opencode/skill/hi-fi-prototype-html/SKILL.md +0 -253
  153. package/dist/template/.opencode/skill/html-deck-export/SKILL.md +0 -189
  154. package/dist/template/.opencode/skill/index-knowledge/SKILL.md +0 -413
  155. package/dist/template/.opencode/skill/memory-grounding/SKILL.md +0 -68
  156. package/dist/template/.opencode/skill/playwriter/SKILL.md +0 -158
  157. package/dist/template/.opencode/skill/portless/SKILL.md +0 -109
  158. package/dist/template/.opencode/skill/prd/SKILL.md +0 -146
  159. package/dist/template/.opencode/skill/prd-task/SKILL.md +0 -182
  160. package/dist/template/.opencode/skill/prd-task/references/prd-schema.json +0 -124
  161. package/dist/template/.opencode/skill/prompt-leverage/SKILL.md +0 -90
  162. package/dist/template/.opencode/skill/prompt-leverage/references/framework.md +0 -91
  163. package/dist/template/.opencode/skill/prompt-leverage/scripts/augment_prompt.py +0 -157
  164. package/dist/template/.opencode/skill/receiving-code-review/SKILL.md +0 -263
  165. package/dist/template/.opencode/skill/reconcile/SKILL.md +0 -183
  166. package/dist/template/.opencode/skill/reflection-checkpoints/SKILL.md +0 -183
  167. package/dist/template/.opencode/skill/requesting-code-review/SKILL.md +0 -443
  168. package/dist/template/.opencode/skill/requesting-code-review/references/specialist-profiles.md +0 -108
  169. package/dist/template/.opencode/skill/requesting-code-review/review.md +0 -160
  170. package/dist/template/.opencode/skill/rtk-command-compression/SKILL.md +0 -134
  171. package/dist/template/.opencode/skill/screenshot/SKILL.md +0 -48
  172. package/dist/template/.opencode/skill/screenshot/scripts/ensure_macos_permissions.sh +0 -54
  173. package/dist/template/.opencode/skill/screenshot/scripts/macos_display_info.swift +0 -22
  174. package/dist/template/.opencode/skill/screenshot/scripts/macos_permissions.swift +0 -40
  175. package/dist/template/.opencode/skill/screenshot/scripts/macos_window_info.swift +0 -126
  176. package/dist/template/.opencode/skill/screenshot/scripts/take_screenshot.ps1 +0 -163
  177. package/dist/template/.opencode/skill/screenshot/scripts/take_screenshot.py +0 -585
  178. package/dist/template/.opencode/skill/security-threat-model/SKILL.md +0 -36
  179. package/dist/template/.opencode/skill/security-threat-model/references/prompt-template.md +0 -255
  180. package/dist/template/.opencode/skill/security-threat-model/references/security-controls-and-assets.md +0 -32
  181. package/dist/template/.opencode/skill/sharing-skills/SKILL.md +0 -214
  182. package/dist/template/.opencode/skill/skill-creator/SKILL.md +0 -181
  183. package/dist/template/.opencode/skill/skill-installer/SKILL.md +0 -58
  184. package/dist/template/.opencode/skill/skill-installer/scripts/github_utils.py +0 -21
  185. package/dist/template/.opencode/skill/skill-installer/scripts/install-skill-from-github.py +0 -313
  186. package/dist/template/.opencode/skill/skill-installer/scripts/list-skills.py +0 -106
  187. package/dist/template/.opencode/skill/swarm-coordination/SKILL.md +0 -244
  188. package/dist/template/.opencode/skill/swarm-coordination/references/architecture.md +0 -39
  189. package/dist/template/.opencode/skill/swarm-coordination/references/delegation-worker-protocol.md +0 -145
  190. package/dist/template/.opencode/skill/swarm-coordination/references/dependency-graph.md +0 -50
  191. package/dist/template/.opencode/skill/swarm-coordination/references/drift-check.md +0 -90
  192. package/dist/template/.opencode/skill/swarm-coordination/references/integration-beads.md +0 -20
  193. package/dist/template/.opencode/skill/swarm-coordination/references/launch-flow.md +0 -186
  194. package/dist/template/.opencode/skill/swarm-coordination/references/reconciler.md +0 -172
  195. package/dist/template/.opencode/skill/swarm-coordination/references/tier-enforcement.md +0 -78
  196. package/dist/template/.opencode/skill/swarm-coordination/references/tmux-integration.md +0 -134
  197. package/dist/template/.opencode/skill/systematic-debugging/SKILL.md +0 -402
  198. package/dist/template/.opencode/skill/terse-output-mode/SKILL.md +0 -95
  199. package/dist/template/.opencode/skill/think-in-code/SKILL.md +0 -136
  200. package/dist/template/.opencode/skill/ux-quality-gates/SKILL.md +0 -137
  201. package/dist/template/.opencode/skill/v1-run/SKILL.md +0 -175
  202. package/dist/template/.opencode/skill/v1-run/mcp.json +0 -6
  203. package/dist/template/.opencode/skill/verification-gates/SKILL.md +0 -63
  204. package/dist/template/.opencode/skill/visual-analysis/SKILL.md +0 -154
  205. package/dist/template/.opencode/skill/web-design-guidelines/SKILL.md +0 -46
  206. package/dist/template/.opencode/skill/workspace-setup/SKILL.md +0 -76
  207. package/dist/template/.opencode/skill/writing-plans/SKILL.md +0 -320
  208. /package/dist/template/.opencode/plugin/{lib → memory}/compact.ts +0 -0
  209. /package/dist/template/.opencode/plugin/{lib → memory}/db/graph.ts +0 -0
  210. /package/dist/template/.opencode/plugin/{lib → memory}/db/maintenance.ts +0 -0
  211. /package/dist/template/.opencode/plugin/{lib → memory}/db/pipeline.ts +0 -0
  212. /package/dist/template/.opencode/plugin/{lib → memory}/notify.ts +0 -0
  213. /package/dist/template/.opencode/plugin/{lib → memory}/operation-log.ts +0 -0
@@ -1,402 +0,0 @@
1
- ---
2
- name: systematic-debugging
3
- description: Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes - four-phase framework (root cause investigation, pattern analysis, hypothesis testing, implementation) that ensures understanding before attempting solutions
4
- version: 1.0.0
5
- tags: [debugging, workflow]
6
- dependencies: []
7
- ---
8
-
9
- # Systematic Debugging
10
-
11
- > **Replaces** "shotgun debugging" — making random changes hoping something fixes the issue without understanding the cause
12
-
13
- ## When to Use
14
-
15
- - Test failures, production bugs, build breaks, or unexpected behavior
16
- - Issues with unclear root cause or multiple failed fix attempts
17
- - Situations where time pressure makes “quick fixes” tempting
18
-
19
- ## When NOT to Use
20
-
21
- - Pure feature development with no failures to investigate
22
- - Non-technical questions that don’t require root cause analysis
23
-
24
- ## Debugging Checklist
25
-
26
- - [ ] Read error messages/stack traces fully
27
- - [ ] Reproduce consistently (or gather more data)
28
- - [ ] Check recent changes (diffs, deps, config)
29
- - [ ] Trace data flow to source (use root-cause-tracing if deep)
30
- - [ ] Form a single hypothesis and test minimally
31
- - [ ] Create a failing test before implementing the fix
32
- - [ ] Implement one change and verify it resolves the issue
33
- - [ ] If 3+ fixes fail, stop and question architecture
34
-
35
- ## Overview
36
-
37
- Random fixes waste time and create new bugs. Quick patches mask underlying issues.
38
-
39
- **Core principle:** ALWAYS find root cause before attempting fixes. Symptom fixes are failure.
40
-
41
- **Violating the letter of this process is violating the spirit of debugging.**
42
-
43
- ## The Iron Law
44
-
45
- ```
46
- NO FIXES WITHOUT ROOT CAUSE INVESTIGATION FIRST
47
- ```
48
-
49
- If you haven't completed Phase 1, you cannot propose fixes.
50
-
51
- ## The Four Phases
52
-
53
- You MUST complete each phase before proceeding to the next.
54
-
55
- ### Debug File Protocol
56
-
57
- **Persistent debugging state survives context resets:**
58
-
59
- **Location:** `.planning/debug/{slug}.md` or `.beads/artifacts/<id>/debug/{slug}.md`
60
-
61
- **Template:**
62
-
63
- ```markdown
64
- # Debug: [Brief Issue Description]
65
-
66
- **Opened:** [Date]
67
- **Status:** [gathering | investigating | fixing | verifying | resolved]
68
- **Reporter:** [human partner or "self-detected"]
69
-
70
- ## Symptoms
71
-
72
- - [ ] Symptom 1: [What happens / doesn't happen]
73
- - [ ] Symptom 2: [Additional observation]
74
-
75
- ## Eliminated Hypotheses
76
-
77
- - [x] [Hypothesis]: [Why it was wrong] (date)
78
-
79
- ## Evidence Log
80
-
81
- | Timestamp | Data | Interpretation |
82
- | --------- | ------------------- | --------------- |
83
- | [time] | [What was observed] | [What it means] |
84
-
85
- ## Current Hypothesis
86
-
87
- [I think X is happening because Y. Testing with Z.]
88
-
89
- ## Fix Attempts
90
-
91
- | # | Change | Result | Notes |
92
- | --- | ------------------ | ----------- | ----- |
93
- | 1 | [What was changed] | [Pass/Fail] | [Why] |
94
-
95
- ## Resolution
96
-
97
- **Root Cause:** [What was actually wrong]
98
- **Fix:** [How it was fixed]
99
- **Date:** [When resolved]
100
- ```
101
-
102
- **Update Rules:**
103
-
104
- - **OVERWRITE** when updating status or hypothesis
105
- - **APPEND** to Evidence Log and Fix Attempts
106
-
107
- **Status Transitions:**
108
-
109
- - `gathering` → `investigating` → `fixing` → `verifying` → `resolved`
110
-
111
- ### Phase 1: Root Cause Investigation
112
-
113
- **BEFORE attempting ANY fix:**
114
-
115
- 1. **Read Error Messages Carefully**
116
- - Don't skip past errors or warnings
117
- - They often contain the exact solution
118
- - Read stack traces completely
119
- - Note line numbers, file paths, error codes
120
-
121
- 2. **Reproduce Consistently**
122
- - Can you trigger it reliably?
123
- - What are the exact steps?
124
- - Does it happen every time?
125
- - If not reproducible → gather more data, don't guess
126
-
127
- 3. **Check Recent Changes**
128
- - What changed that could cause this?
129
- - Git diff, recent commits
130
- - New dependencies, config changes
131
- - Environmental differences
132
-
133
- 4. **Gather Evidence in Multi-Component Systems**
134
-
135
- **WHEN system has multiple components (CI → build → signing, API → service → database):**
136
-
137
- **BEFORE proposing fixes, add diagnostic instrumentation:**
138
-
139
- ```
140
- For EACH component boundary:
141
- - Log what data enters component
142
- - Log what data exits component
143
- - Verify environment/config propagation
144
- - Check state at each layer
145
-
146
- Run once to gather evidence showing WHERE it breaks
147
- THEN analyze evidence to identify failing component
148
- THEN investigate that specific component
149
- ```
150
-
151
- **Example (multi-layer system):**
152
-
153
- ```bash
154
- # Layer 1: Workflow
155
- echo "=== Secrets available in workflow: ==="
156
- echo "IDENTITY: ${IDENTITY:+SET}${IDENTITY:-UNSET}"
157
-
158
- # Layer 2: Build script
159
- echo "=== Env vars in build script: ==="
160
- env | grep IDENTITY || echo "IDENTITY not in environment"
161
-
162
- # Layer 3: Signing script
163
- echo "=== Keychain state: ==="
164
- security list-keychains
165
- security find-identity -v
166
-
167
- # Layer 4: Actual signing
168
- codesign --sign "$IDENTITY" --verbose=4 "$APP"
169
- ```
170
-
171
- **This reveals:** Which layer fails (secrets → workflow ✓, workflow → build ✗)
172
-
173
- 5. **Trace Data Flow**
174
-
175
- **WHEN error is deep in call stack:**
176
-
177
- **REQUIRED SUB-SKILL:** Use skill({ name: "root-cause-tracing" }) for backward tracing technique
178
-
179
- **Quick version:**
180
- - Where does bad value originate?
181
- - What called this with bad value?
182
- - Keep tracing up until you find the source
183
- - Fix at source, not at symptom
184
-
185
- ### Phase 2: Pattern Analysis
186
-
187
- **Find the pattern before fixing:**
188
-
189
- 1. **Find Working Examples**
190
- - Locate similar working code in same codebase
191
- - What works that's similar to what's broken?
192
-
193
- 2. **Compare Against References**
194
- - If implementing pattern, read reference implementation COMPLETELY
195
- - Don't skim - read every line
196
- - Understand the pattern fully before applying
197
-
198
- 3. **Identify Differences**
199
- - What's different between working and broken?
200
- - List every difference, however small
201
- - Don't assume "that can't matter"
202
-
203
- 4. **Understand Dependencies**
204
- - What other components does this need?
205
- - What settings, config, environment?
206
- - What assumptions does it make?
207
-
208
- **Evidence-Based Debugging (GSD Method):**
209
-
210
- **Information you have:**
211
-
212
- - ✅ Errors/warnings (with exact messages, line numbers)
213
- - ✅ Code I can read and trace through
214
- - ✅ Evidence from what I can observe directly
215
-
216
- **Information you DON'T have:**
217
-
218
- - ❌ What the user intended (ask if unclear)
219
- - ❌ Environment-specific state I can't observe
220
- - ❌ Intent behind code that doesn't match my understanding
221
-
222
- **When to gather more evidence vs. when to form hypothesis:**
223
-
224
- - **Gather evidence** when: Multiple components involved, unclear which one fails
225
- - **Form hypothesis** when: Error message points to specific location, pattern is clear
226
- - **Ask user** when: Behavior contradicts apparent code intent
227
-
228
- ### Phase 3: Hypothesis and Testing
229
-
230
- **Scientific method:**
231
-
232
- 1. **Form Single Hypothesis**
233
- - State clearly: "I think X is the root cause because Y"
234
- - Write it down
235
- - Be specific, not vague
236
-
237
- 2. **Test Minimally**
238
- - Make the SMALLEST possible change to test hypothesis
239
- - One variable at a time
240
- - Don't fix multiple things at once
241
-
242
- 3. **Verify Before Continuing**
243
- - Did it work? Yes → Phase 4
244
- - Didn't work? Form NEW hypothesis
245
- - DON'T add more fixes on top
246
-
247
- 4. **When You Don't Know**
248
- - Say "I don't understand X"
249
- - Don't pretend to know
250
- - Ask for help
251
- - Research more
252
-
253
- ### Phase 4: Implementation
254
-
255
- **Fix the root cause, not the symptom:**
256
-
257
- 1. **Create Failing Test Case**
258
- - Simplest possible reproduction
259
- - Automated test if possible
260
- - One-off test script if no framework
261
- - MUST have before fixing
262
- - **REQUIRED SUB-SKILL:** Use skill({ name: "test-driven-development" }) for writing proper failing tests
263
-
264
- 2. **Implement Single Fix**
265
- - Address the root cause identified
266
- - ONE change at a time
267
- - No "while I'm here" improvements
268
- - No bundled refactoring
269
-
270
- 3. **Verify Fix**
271
- - Test passes now?
272
- - No other tests broken?
273
- - Issue actually resolved?
274
-
275
- 4. **If Fix Doesn't Work**
276
- - STOP
277
- - Count: How many fixes have you tried?
278
- - If < 3: Return to Phase 1, re-analyze with new information
279
- - **If ≥ 3: STOP and question the architecture (step 5 below)**
280
- - DON'T attempt Fix #4 without architectural discussion
281
-
282
- 5. **If 3+ Fixes Failed: Question Architecture**
283
-
284
- **Pattern indicating architectural problem:**
285
- - Each fix reveals new shared state/coupling/problem in different place
286
- - Fixes require "massive refactoring" to implement
287
- - Each fix creates new symptoms elsewhere
288
-
289
- **STOP and question fundamentals:**
290
- - Is this pattern fundamentally sound?
291
- - Are we "sticking with it through sheer inertia"?
292
- - Should we refactor architecture vs. continue fixing symptoms?
293
-
294
- **Discuss with your human partner before attempting more fixes**
295
-
296
- This is NOT a failed hypothesis - this is a wrong architecture.
297
-
298
- ## Red Flags - STOP and Follow Process
299
-
300
- If you catch yourself thinking:
301
-
302
- - "Quick fix for now, investigate later"
303
- - "Just try changing X and see if it works"
304
- - "Add multiple changes, run tests"
305
- - "Skip the test, I'll manually verify"
306
- - "It's probably X, let me fix that"
307
- - "I don't fully understand but this might work"
308
- - "Pattern says X but I'll adapt it differently"
309
- - "Here are the main problems: [lists fixes without investigation]"
310
- - Proposing solutions before tracing data flow
311
- - **"One more fix attempt" (when already tried 2+)**
312
- - **Each fix reveals new problem in different place**
313
-
314
- **ALL of these mean: STOP. Return to Phase 1.**
315
-
316
- **If 3+ fixes failed:** Question the architecture (see Phase 4.5)
317
-
318
- ## your human partner's Signals You're Doing It Wrong
319
-
320
- **Watch for these redirections:**
321
-
322
- - "Is that not happening?" - You assumed without verifying
323
- - "Will it show us...?" - You should have added evidence gathering
324
- - "Stop guessing" - You're proposing fixes without understanding
325
- - "Ultrathink this" - Question fundamentals, not just symptoms
326
- - "We're stuck?" (frustrated) - Your approach isn't working
327
-
328
- **When you see these:** STOP. Return to Phase 1.
329
-
330
- ## Common Rationalizations
331
-
332
- | Excuse | Reality |
333
- | -------------------------------------------- | ----------------------------------------------------------------------- |
334
- | "Issue is simple, don't need process" | Simple issues have root causes too. Process is fast for simple bugs. |
335
- | "Emergency, no time for process" | Systematic debugging is FASTER than guess-and-check thrashing. |
336
- | "Just try this first, then investigate" | First fix sets the pattern. Do it right from the start. |
337
- | "I'll write test after confirming fix works" | Untested fixes don't stick. Test first proves it. |
338
- | "Multiple fixes at once saves time" | Can't isolate what worked. Causes new bugs. |
339
- | "Reference too long, I'll adapt the pattern" | Partial understanding guarantees bugs. Read it completely. |
340
- | "I see the problem, let me fix it" | Seeing symptoms ≠ understanding root cause. |
341
- | "One more fix attempt" (after 2+ failures) | 3+ failures = architectural problem. Question pattern, don't fix again. |
342
-
343
- ## Anti-Patterns
344
-
345
- | Anti-Pattern | Why It Fails | Instead |
346
- | --- | --- | --- |
347
- | Changing multiple things at once | You can’t isolate what actually fixed or broke behavior | Change one variable at a time and measure outcome |
348
- | Not reading the error message carefully | You skip direct clues (file, line, code, failing invariant) | Read the full error and stack trace before edits |
349
- | Assuming the bug is in the most recently changed code | Correlation bias hides older or shared-state causes | Trace actual data/control flow from symptom to source |
350
- | Skipping reproduction steps | Non-repro bugs encourage guessing and untestable fixes | Establish reliable repro steps, then verify fix against them |
351
-
352
- ## Quick Reference
353
-
354
- | Phase | Key Activities | Success Criteria |
355
- | --------------------- | ------------------------------------------------------ | --------------------------- |
356
- | **1. Root Cause** | Read errors, reproduce, check changes, gather evidence | Understand WHAT and WHY |
357
- | **2. Pattern** | Find working examples, compare | Identify differences |
358
- | **3. Hypothesis** | Form theory, test minimally | Confirmed or new hypothesis |
359
- | **4. Implementation** | Create test, fix, verify | Bug resolved, tests pass |
360
-
361
- ## When Process Reveals "No Root Cause"
362
-
363
- If systematic investigation reveals issue is truly environmental, timing-dependent, or external:
364
-
365
- 1. You've completed the process
366
- 2. Document what you investigated
367
- 3. Implement appropriate handling (retry, timeout, error message)
368
- 4. Add monitoring/logging for future investigation
369
-
370
- **But:** 95% of "no root cause" cases are incomplete investigation.
371
-
372
- ## Integration with Other Skills
373
-
374
- **This skill requires using:**
375
-
376
- - **root-cause-tracing** - REQUIRED when error is deep in call stack (see Phase 1, Step 5)
377
- - **test-driven-development** - REQUIRED for creating failing test case (see Phase 4, Step 1)
378
-
379
- **Complementary skills:**
380
-
381
- - **defense-in-depth** - Add validation at multiple layers after finding root cause
382
- - **condition-based-waiting** - Replace arbitrary timeouts identified in Phase 2
383
- - **verification-before-completion** - Verify fix worked before claiming success
384
-
385
- ## Real-World Impact
386
-
387
- From debugging sessions:
388
-
389
- - Systematic approach: 15-30 minutes to fix
390
- - Random fixes approach: 2-3 hours of thrashing
391
- - First-time fix rate: 95% vs 40%
392
- - New bugs introduced: Near zero vs common
393
-
394
- ## Verification
395
-
396
- - Confirm the fix: reproduce the original bug scenario — it must now succeed.
397
- - Regression check: run related tests to ensure fix didn't break adjacent behavior.
398
-
399
- ## See Also
400
-
401
- - **root-cause-tracing** - Deep call-stack tracing to identify original trigger before fixing
402
- - **condition-based-waiting** - Stabilize timing/race-condition fixes with state-based waits
@@ -1,95 +0,0 @@
1
- ---
2
- name: terse-output-mode
3
- description: Use when the user asks for terse, brief, less-wordy, token-efficient, or caveman-style responses. Applies concise output style while preserving technical precision, verification evidence, safety warnings, and exact code/command/error text.
4
- version: 1.0.0
5
- tags: [workflow]
6
- dependencies: []
7
- ---
8
-
9
- # Terse Output Mode
10
-
11
- ## Overview
12
-
13
- Terse output mode reduces assistant prose, not tool output or reasoning quality. Use it to answer with fewer words while preserving exact technical substance, safety constraints, and verification evidence.
14
-
15
- Default style is professional terse. Use meme-like caveman phrasing only when the user explicitly asks for `caveman mode`.
16
-
17
- ## When to Use
18
-
19
- - User says: "be brief", "less words", "terse", "concise", "token-efficient", "caveman mode", or similar.
20
- - User wants short implementation progress updates.
21
- - User asks for compact status, diff summaries, review findings, or next actions.
22
- - Context pressure is high and user-facing prose can be shortened without losing fidelity.
23
-
24
- ## When NOT to Use
25
-
26
- - Security warnings, secrets handling, destructive actions, or irreversible confirmations.
27
- - PRDs, implementation plans, ADRs, migrations, release notes, or docs where clarity beats brevity.
28
- - Debugging explanations where missing nuance could cause a wrong fix.
29
- - User appears confused, asks for clarification, or repeats a question.
30
- - Verification evidence would be hidden by compression.
31
-
32
- ## Core Rules
33
-
34
- 1. **Preserve exact technical content** — never rewrite code, commands, file paths, error strings, versions, numbers, API names, or config keys.
35
- 2. **Cut filler first** — remove pleasantries, hedging, throat-clearing, repeated context, and generic reassurance.
36
- 3. **Keep evidence** — completion claims still need command output, counts, exit status, or file references.
37
- 4. **Prefer fragments when safe** — short noun-verb sentences are fine for status updates.
38
- 5. **Cite precisely** — keep `file:line` references when making code claims.
39
- 6. **Do not hide uncertainty** — if uncertain, say what is missing in fewer words.
40
- 7. **Normal code artifacts** — commits, PR descriptions, docs, specs, and user-facing copy keep normal professional language unless requested otherwise.
41
-
42
- ## Auto-Clarity Escape Hatch
43
-
44
- Temporarily leave terse mode when brevity would create risk:
45
-
46
- | Situation | Action |
47
- | ----------------------------- | ---------------------------------------- |
48
- | Security or data-loss warning | Use normal explicit wording |
49
- | Destructive confirmation | State full impact and options |
50
- | Multi-step manual instruction | Use numbered complete steps |
51
- | Ambiguous user intent | Ask one clear question |
52
- | User confusion | Explain normally, then resume terse mode |
53
-
54
- After the risky section, return to terse output automatically.
55
-
56
- ## Output Patterns
57
-
58
- ### Status Update
59
-
60
- ```markdown
61
- Changed `src/auth.ts:42` guard. Typecheck running.
62
- ```
63
-
64
- ### Findings
65
-
66
- ```markdown
67
- Critical: `src/form.tsx:88` error text is not associated with input. Screen readers miss failure.
68
- Fix: add `aria-describedby`, `aria-invalid`, and `role="alert"`.
69
- ```
70
-
71
- ### Final Report
72
-
73
- ```markdown
74
- Added optional terse output mode and intent mapping.
75
- `npm run lint` passes: 0 warnings, 0 errors. Typecheck passes.
76
- No commit made.
77
- ```
78
-
79
- ## Boundaries
80
-
81
- - This skill is output style only.
82
- - It does not replace `rtk-command-compression`; RTK handles shell/tool output compression.
83
- - It does not replace DCP/context compression; DCP handles conversation compression.
84
- - It does not install hooks, plugins, binaries, or dependencies.
85
- - It does not rewrite memory files or project documentation unless explicitly asked.
86
-
87
- ## Common Mistakes
88
-
89
- | Mistake | Fix |
90
- | ----------------------------------- | -------------------------------------------------------------- |
91
- | Making terse mode always-on | Activate only on user request or clear token-efficiency intent |
92
- | Dropping verification evidence | Keep fresh command evidence for any completion claim |
93
- | Rewriting exact errors or commands | Preserve exact text in code spans |
94
- | Using caveman meme voice by default | Default to professional terse |
95
- | Compressing plans/specs too hard | Use normal detail for durable artifacts |
@@ -1,136 +0,0 @@
1
- ---
2
- name: think-in-code
3
- description: Use when answering questions that require counting, filtering, parsing, joining, or summarizing data — write a small script that prints only the answer instead of reading large files into context. Saves 90%+ tokens vs raw reads. Adapted from context-mode (mksglu/context-mode).
4
- version: 1.0.0
5
- tags: [context, workflow]
6
- dependencies: []
7
- ---
8
-
9
- # Think in Code
10
-
11
- Compute answers with a small script. Don't drag raw data through context.
12
-
13
- ## Core Principle
14
-
15
- > The model's job is to think. The script's job is to count, parse, filter, join. Then `console.log` only the answer.
16
-
17
- When you need a fact derived from data (logs, JSON, CSV, command output, file lists), the cheapest path is:
18
-
19
- 1. Write 5–30 lines of code that produces the answer
20
- 2. Run it
21
- 3. Read **only** the printed answer
22
-
23
- Reading the raw data into context first is almost always wrong.
24
-
25
- ## When to Use
26
-
27
- - Counting things in files / API output / logs ("how many failed runs in the last 100?")
28
- - Filtering large lists ("which dependencies haven't been updated in 6 months?")
29
- - Parsing structured output (`gh pr list --json`, `git log --pretty=...`, large JSON config)
30
- - Joining data across sources ("which files in `git diff` also have failing tests?")
31
- - Summarizing logs (top 10 error messages, error rate over time)
32
- - Computing diffs/intersections between two lists
33
-
34
- ## When NOT to Use
35
-
36
- - The data is already small (<50 lines and you need most of it)
37
- - You need to **read** the content for understanding, not extract a fact (e.g. reviewing a PR)
38
- - The script itself would be longer than just reading the slice you need
39
- - A single `grep -c` or `wc -l` already answers it — just run that
40
-
41
- ## Quick Decision
42
-
43
- | Situation | Approach |
44
- | --------------------------------------- | ----------------------------------------------- |
45
- | "How many X in Y?" | Script → `console.log(count)` |
46
- | "Which Z match condition?" | Script → `console.log(matches.join('\n'))` |
47
- | "Top N by metric?" | Script → `console.log(top.map(...).join('\n'))` |
48
- | "What does this code do?" | Read the file |
49
- | "What's broken in this 30-line config?" | Read the file |
50
- | "Count errors in 2MB log" | Script — never `cat` it |
51
-
52
- ## Patterns
53
-
54
- ### Node one-liner (preferred for JSON / npm / fs work)
55
-
56
- ```bash
57
- node -e "
58
- const fs = require('fs');
59
- const data = JSON.parse(fs.readFileSync('package-lock.json', 'utf8'));
60
- const deps = Object.keys(data.packages || {}).filter(k => k.startsWith('node_modules/'));
61
- console.log('Total deps:', deps.length);
62
- console.log('Unique top-level:', new Set(deps.map(d => d.split('/')[1])).size);
63
- "
64
- ```
65
-
66
- ### Python one-liner (preferred for CSV / data crunching)
67
-
68
- ```bash
69
- python3 -c "
70
- import csv, sys
71
- with open('data.csv') as f:
72
- rows = list(csv.DictReader(f))
73
- errors = [r for r in rows if r['status'] == 'error']
74
- print(f'errors: {len(errors)} / {len(rows)}')
75
- print(f'top hosts:', sorted({r[\"host\"] for r in errors})[:5])
76
- "
77
- ```
78
-
79
- ### Bash (only when output is guaranteed small)
80
-
81
- ```bash
82
- # OK — output is one number
83
- git log --since='1 week ago' --oneline | wc -l
84
-
85
- # OK — already filtered small
86
- gh pr list --state open --json number,title --jq '.[] | select(.title | contains("fix")) | .number'
87
-
88
- # NOT OK — dumps everything into context
89
- cat huge-log.txt | grep ERROR
90
- # Better:
91
- grep -c ERROR huge-log.txt # if you only need the count
92
- grep ERROR huge-log.txt | head -20 # if you need samples
93
- ```
94
-
95
- ### Save script to a file when it's reusable
96
-
97
- ```bash
98
- cat > /tmp/count-deps.js <<'EOF'
99
- const fs = require('fs');
100
- const lock = JSON.parse(fs.readFileSync(process.argv[2], 'utf8'));
101
- const pkgs = Object.keys(lock.packages || {});
102
- const stale = pkgs.filter(p => p.includes('node_modules/') && !p.includes('node_modules/.'));
103
- console.log(JSON.stringify({ total: pkgs.length, packages: stale.length }, null, 2));
104
- EOF
105
- node /tmp/count-deps.js package-lock.json
106
- ```
107
-
108
- ## Anti-Patterns
109
-
110
- | Anti-Pattern | Why It's Wrong | Do Instead |
111
- | --------------------------------------------------------- | -------------------------------------------- | ------------------------------------------- |
112
- | `cat huge.json` then "let me parse this in my head" | Pulls 100KB+ into context for one answer | `node -e "..."` to compute and print answer |
113
- | `gh pr list --json ...` printing all fields | Dumps 50+ PRs of metadata you don't need | `--jq` to filter to just the field you want |
114
- | `find . -name '*.ts'` to count files | Lists every path | `find . -name '*.ts' \| wc -l` |
115
- | Reading 5 large logs to compare error rates | 5x context bloat for one comparison | Script that opens all 5 and prints summary |
116
- | `curl https://api/...` raw piped to read | Whole response body in context | `curl ... \| jq '.field'` or save to file |
117
- | Asking the model to "estimate" instead of running a count | Hallucination risk; counts are deterministic | Run the script |
118
-
119
- ## Verification
120
-
121
- Before considering an answer "done":
122
-
123
- 1. The script ran without error
124
- 2. The printed output is what you reasoned about (don't substitute memory for output)
125
- 3. If the question was "how many", the script printed a number — not raw rows you then counted manually
126
-
127
- ## Why This Skill Exists
128
-
129
- Adapted from the **Think in Code** pillar of [context-mode](https://github.com/mksglu/context-mode). The original ships a sandboxed executor that _forces_ this pattern; we keep the discipline as a prompt-level skill so it works without bundling new infrastructure.
130
-
131
- The savings compound: a single avoided 100KB read pays for many script iterations, and downstream summarization/handoff becomes cheaper too.
132
-
133
- ## References
134
-
135
- - context-mode: https://github.com/mksglu/context-mode
136
- - Pairs with: `verification-before-completion`, `code-search-patterns`, `rtk-command-compression`