zaileys 3.0.0 → 3.1.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 (149) hide show
  1. package/.changeset/README.md +8 -0
  2. package/.changeset/config.json +11 -0
  3. package/.kelar/kelar-tools.cjs +829 -0
  4. package/.kelar/memory/INDEX.md +21 -0
  5. package/.kelar/memory/technical/issue-34-sendpresenceupdate-undefined.md +4 -0
  6. package/.kelar/memory/technical/lmdb-native-binary-fallback.md +4 -0
  7. package/.kelar/memory/technical/nedbadapter-ignoring-encoder-causes-buffer-typing-crash-err-invalid-arg-type.md +4 -0
  8. package/.kelar/memory/technical/signal-media-constructor-input-contract.md +4 -0
  9. package/.kelar/memory/technical/sticker-example-source-format.md +4 -0
  10. package/.kelar/memory/technical/ts2307-missing-seald-io-nedb.md +4 -0
  11. package/.kelar/memory/technical/ts2307-missing-zaileys-store-adapters.md +4 -0
  12. package/.kelar/plans/README.md +3 -0
  13. package/.kelar/research/README.md +3 -0
  14. package/.kelar/research/mysql-adapter-research.md +32 -0
  15. package/.kelar/state/ASSUMPTIONS.md +14 -0
  16. package/.kelar/state/DEBT.md +13 -0
  17. package/.kelar/state/DIARY.md +15 -0
  18. package/.kelar/state/HANDOFF.md +54 -0
  19. package/.kelar/state/PATTERNS.md +43 -0
  20. package/.kelar/state/STATE.md +37 -0
  21. package/.kelar/state/TASKS.md +146 -0
  22. package/AGENTS.md +108 -0
  23. package/CHANGELOG.md +12 -0
  24. package/GEMINI.md +58 -0
  25. package/dist/index.d.mts +14 -3
  26. package/dist/index.d.ts +14 -3
  27. package/dist/index.js +9 -27
  28. package/dist/index.mjs +9 -27
  29. package/package.json +16 -14
  30. package/packages/media-process/CHANGELOG.md +7 -0
  31. package/packages/media-process/LICENSE +21 -0
  32. package/packages/media-process/dist/index.d.mts +142 -0
  33. package/packages/media-process/dist/index.d.ts +142 -0
  34. package/packages/media-process/dist/index.mjs +3 -0
  35. package/packages/media-process/package.json +39 -0
  36. package/packages/media-process/tsconfig.json +15 -0
  37. package/packages/mysql-adapter/dist/index.d.mts +36 -0
  38. package/packages/mysql-adapter/dist/index.d.ts +36 -0
  39. package/packages/mysql-adapter/dist/index.js.map +1 -0
  40. package/packages/mysql-adapter/dist/index.mjs +101 -0
  41. package/packages/mysql-adapter/dist/index.mjs.map +1 -0
  42. package/packages/mysql-adapter/package.json +36 -0
  43. package/pnpm-workspace.yaml +3 -0
  44. package/.agent/skills/codebase-mapper/SKILL.md +0 -226
  45. package/.agent/skills/context-compressor/SKILL.md +0 -201
  46. package/.agent/skills/context-fetch/SKILL.md +0 -184
  47. package/.agent/skills/context-health-monitor/SKILL.md +0 -105
  48. package/.agent/skills/debugger/SKILL.md +0 -273
  49. package/.agent/skills/empirical-validation/SKILL.md +0 -97
  50. package/.agent/skills/executor/SKILL.md +0 -465
  51. package/.agent/skills/plan-checker/SKILL.md +0 -283
  52. package/.agent/skills/planner/SKILL.md +0 -485
  53. package/.agent/skills/token-budget/SKILL.md +0 -166
  54. package/.agent/skills/verifier/SKILL.md +0 -421
  55. package/.agent/workflows/add-phase.md +0 -96
  56. package/.agent/workflows/add-todo.md +0 -69
  57. package/.agent/workflows/audit-milestone.md +0 -107
  58. package/.agent/workflows/check-todos.md +0 -80
  59. package/.agent/workflows/complete-milestone.md +0 -135
  60. package/.agent/workflows/debug.md +0 -235
  61. package/.agent/workflows/discuss-phase.md +0 -103
  62. package/.agent/workflows/execute.md +0 -325
  63. package/.agent/workflows/health.md +0 -122
  64. package/.agent/workflows/help.md +0 -96
  65. package/.agent/workflows/insert-phase.md +0 -109
  66. package/.agent/workflows/install.md +0 -152
  67. package/.agent/workflows/list-phase-assumptions.md +0 -82
  68. package/.agent/workflows/map.md +0 -394
  69. package/.agent/workflows/new-milestone.md +0 -126
  70. package/.agent/workflows/new-project.md +0 -368
  71. package/.agent/workflows/pause.md +0 -176
  72. package/.agent/workflows/plan-milestone-gaps.md +0 -116
  73. package/.agent/workflows/plan.md +0 -380
  74. package/.agent/workflows/progress.md +0 -90
  75. package/.agent/workflows/quick.md +0 -128
  76. package/.agent/workflows/remove-phase.md +0 -139
  77. package/.agent/workflows/research-phase.md +0 -160
  78. package/.agent/workflows/resume.md +0 -131
  79. package/.agent/workflows/update.md +0 -203
  80. package/.agent/workflows/verify.md +0 -263
  81. package/.agent/workflows/web-search.md +0 -121
  82. package/.agent/workflows/whats-new.md +0 -80
  83. package/.gemini/GEMINI.md +0 -67
  84. package/.gsd/DEBUG.md +0 -26
  85. package/.gsd/GSD-STYLE.md +0 -272
  86. package/.gsd/PROJECT_RULES.md +0 -256
  87. package/.gsd/ROADMAP.md +0 -38
  88. package/.gsd/SPEC.md +0 -16
  89. package/.gsd/STATE.md +0 -10
  90. package/.gsd/adapters/CLAUDE.md +0 -77
  91. package/.gsd/adapters/GEMINI.md +0 -92
  92. package/.gsd/adapters/GPT_OSS.md +0 -130
  93. package/.gsd/docs/model-selection-playbook.md +0 -128
  94. package/.gsd/docs/runbook.md +0 -296
  95. package/.gsd/docs/token-optimization-guide.md +0 -207
  96. package/.gsd/model_capabilities.yaml +0 -108
  97. package/.gsd/phases/1/1-PLAN.md +0 -44
  98. package/.gsd/phases/1/2-PLAN.md +0 -54
  99. package/.gsd/phases/1/3-PLAN.md +0 -46
  100. package/.gsd/phases/1/4-PLAN.md +0 -39
  101. package/.gsd/phases/2/2-1-SUMMARY.md +0 -8
  102. package/.gsd/phases/2/2-PLAN.md +0 -47
  103. package/.gsd/phases/3/3-1-SUMMARY.md +0 -8
  104. package/.gsd/phases/3/3-PLAN.md +0 -43
  105. package/.gsd/phases/4/4-1-PLAN.md +0 -44
  106. package/.gsd/phases/4/4-1-SUMMARY.md +0 -8
  107. package/.gsd/phases/4/4-2-PLAN.md +0 -59
  108. package/.gsd/phases/4/4-2-SUMMARY.md +0 -8
  109. package/.gsd/phases/4/4-3-PLAN.md +0 -42
  110. package/.gsd/phases/4/4-3-SUMMARY.md +0 -8
  111. package/.gsd/phases/4/VERIFICATION.md +0 -8
  112. package/.gsd/phases/5/1-SUMMARY.md +0 -5
  113. package/.gsd/phases/5/5-PLAN.md +0 -47
  114. package/.gsd/phases/5/RESEARCH.md +0 -24
  115. package/.gsd/phases/5/VERIFICATION.md +0 -8
  116. package/.gsd/phases/6/1-SUMMARY.md +0 -6
  117. package/.gsd/phases/6/6-PLAN.md +0 -46
  118. package/.gsd/phases/6/RESEARCH.md +0 -33
  119. package/.gsd/phases/6/VERIFICATION.md +0 -7
  120. package/.gsd/phases/7/1-SUMMARY.md +0 -12
  121. package/.gsd/phases/7/7-PLAN.md +0 -78
  122. package/.gsd/phases/7/VERIFICATION.md +0 -7
  123. package/.gsd/templates/DEBUG.md +0 -123
  124. package/.gsd/templates/PLAN.md +0 -90
  125. package/.gsd/templates/RESEARCH.md +0 -75
  126. package/.gsd/templates/SUMMARY.md +0 -103
  127. package/.gsd/templates/UAT.md +0 -168
  128. package/.gsd/templates/VERIFICATION.md +0 -70
  129. package/.gsd/templates/architecture.md +0 -67
  130. package/.gsd/templates/context.md +0 -91
  131. package/.gsd/templates/decisions.md +0 -37
  132. package/.gsd/templates/discovery.md +0 -122
  133. package/.gsd/templates/journal.md +0 -46
  134. package/.gsd/templates/milestone.md +0 -91
  135. package/.gsd/templates/phase-summary.md +0 -52
  136. package/.gsd/templates/project.md +0 -124
  137. package/.gsd/templates/requirements.md +0 -92
  138. package/.gsd/templates/roadmap.md +0 -103
  139. package/.gsd/templates/spec.md +0 -51
  140. package/.gsd/templates/sprint.md +0 -57
  141. package/.gsd/templates/stack.md +0 -62
  142. package/.gsd/templates/state.md +0 -92
  143. package/.gsd/templates/state_snapshot.md +0 -132
  144. package/.gsd/templates/todo.md +0 -32
  145. package/.gsd/templates/token_report.md +0 -79
  146. package/.gsd/templates/user-setup.md +0 -116
  147. package/.husky/commit-msg +0 -1
  148. package/.husky/pre-commit +0 -1
  149. package/commitlint.config.js +0 -3
@@ -1,184 +0,0 @@
1
- ---
2
- name: Context Fetch
3
- description: Search-first skill to reduce unnecessary file reads by searching before loading
4
- ---
5
-
6
- # Context Fetch Skill
7
-
8
- <role>
9
- You are a context-efficient agent. Your job is to find relevant code with minimal file reads.
10
-
11
- **Core principle:** Search first, read targeted sections, never load full files blindly.
12
- </role>
13
-
14
- ---
15
-
16
- ## When to Use
17
-
18
- Activate this skill **before**:
19
- - Starting any coding task
20
- - Beginning a refactor
21
- - Investigating a bug
22
- - Understanding unfamiliar code
23
-
24
- ---
25
-
26
- ## Process
27
-
28
- ### Step 1: Define the Question
29
-
30
- What are you trying to find or understand?
31
-
32
- Examples:
33
- - "Where is the login endpoint defined?"
34
- - "How does the caching layer work?"
35
- - "What calls the `processPayment` function?"
36
-
37
- ### Step 2: Identify Keywords
38
-
39
- Extract searchable terms:
40
-
41
- | Question | Keywords |
42
- |----------|----------|
43
- | Login endpoint | `login`, `auth`, `POST.*login` |
44
- | Caching layer | `cache`, `redis`, `memoize` |
45
- | Payment calls | `processPayment`, `payment` |
46
-
47
- ### Step 3: Search Before Reading
48
-
49
- **PowerShell:**
50
- ```powershell
51
- # Simple pattern search
52
- Select-String -Path "src/**/*.ts" -Pattern "login" -Recurse
53
-
54
- # With ripgrep (if available)
55
- rg "login" --type ts
56
- ```
57
-
58
- **Bash:**
59
- ```bash
60
- # With ripgrep (recommended)
61
- rg "login" --type ts
62
-
63
- # With grep
64
- grep -r "login" src/ --include="*.ts"
65
- ```
66
-
67
- ### Step 4: Evaluate Results
68
-
69
- From search results, identify:
70
-
71
- 1. **Primary candidates** — Files directly matching your question
72
- 2. **Secondary candidates** — Files that reference primary candidates
73
- 3. **Ignore list** — Files with keyword but unrelated context
74
-
75
- ### Step 5: Targeted Reading
76
-
77
- Only read what's justified:
78
-
79
- ```powershell
80
- # Read specific line range (PowerShell)
81
- Get-Content "src/auth/login.ts" | Select-Object -Skip 49 -First 30
82
-
83
- # Read specific function (with view_code_item tool)
84
- # view_code_item: src/auth/login.ts -> handleLogin
85
- ```
86
-
87
- ---
88
-
89
- ## Inputs
90
-
91
- When invoking this skill, provide:
92
-
93
- | Input | Description | Example |
94
- |-------|-------------|---------|
95
- | **Question** | What you're trying to find | "Where is user validation?" |
96
- | **Scope** | Directory or file pattern | `src/`, `*.service.ts` |
97
- | **Keywords** | Terms to search for | `validate`, `user`, `schema` |
98
-
99
- ---
100
-
101
- ## Outputs
102
-
103
- After executing this skill, report:
104
-
105
- 1. **Candidate files** — Ranked by relevance
106
- 2. **Relevant extracts** — Key snippets found
107
- 3. **Next reads** — Specific files/line-ranges to read next
108
- 4. **Skip list** — Files searched but not relevant
109
-
110
- ---
111
-
112
- ## Anti-Patterns
113
-
114
- ### ❌ Loading Everything First
115
-
116
- ```
117
- # BAD: Reading 5 full files to "understand context"
118
- Read: src/auth/login.ts (500 lines)
119
- Read: src/auth/register.ts (400 lines)
120
- Read: src/auth/types.ts (200 lines)
121
- ```
122
-
123
- ### ✅ Search Then Target
124
-
125
- ```
126
- # GOOD: Search first, read only what's needed
127
- Search: "validatePassword" in src/auth/
128
- Found: login.ts:45, register.ts:78
129
- Read: login.ts lines 40-60
130
- ```
131
-
132
- ### ❌ Broad Searches
133
-
134
- ```
135
- # BAD: Searching for common terms
136
- Search: "function" → 10,000 results
137
- ```
138
-
139
- ### ✅ Specific Searches
140
-
141
- ```
142
- # GOOD: Searching for specific identifiers
143
- Search: "validateUserCredentials" → 3 results
144
- ```
145
-
146
- ---
147
-
148
- ## Context Efficiency Metrics
149
-
150
- Track your efficiency:
151
-
152
- | Metric | Good | Poor |
153
- |--------|------|------|
154
- | Files searched | 10+ | <5 |
155
- | Files fully read | <3 | 10+ |
156
- | Lines read | <200 | 1000+ |
157
- | Targeted sections | Yes | No |
158
-
159
- ---
160
-
161
- ## Integration with GSD
162
-
163
- This skill supports GSD's context management:
164
-
165
- - **Prevents context pollution** — Less irrelevant code loaded
166
- - **Supports wave execution** — Each wave starts with minimal context
167
- - **Enables model switching** — Less context = easier handoff
168
-
169
- ---
170
-
171
- ## Quick Reference
172
-
173
- ```
174
- 1. Define question → What am I looking for?
175
- 2. Extract keywords → What terms to search?
176
- 3. Search codebase → rg/grep/Select-String
177
- 4. Evaluate results → Which files matter?
178
- 5. Read targeted → Specific lines only
179
- 6. Report findings → Candidates + extracts
180
- ```
181
-
182
- ---
183
-
184
- *Part of GSD methodology. See PROJECT_RULES.md for search-first discipline rules.*
@@ -1,105 +0,0 @@
1
- ---
2
- name: Context Health Monitor
3
- description: Monitors context complexity and triggers state dumps before quality degrades
4
- ---
5
-
6
- # Context Health Monitor
7
-
8
- ## Purpose
9
-
10
- Prevent "Context Rot" — the quality degradation that occurs as the agent processes more information in a single session.
11
-
12
- ## When This Skill Activates
13
-
14
- The agent should self-monitor for these warning signs:
15
-
16
- ### Warning Signs
17
-
18
- | Signal | Threshold | Action |
19
- |--------|-----------|--------|
20
- | Repeated debugging | 3+ failed attempts | Trigger state dump |
21
- | Going in circles | Same approach tried twice | Stop and reassess |
22
- | Confusion indicators | "I'm not sure", backtracking | Document uncertainty |
23
- | Session length | Extended back-and-forth | Recommend `/pause` |
24
-
25
- ## Behavior Rules
26
-
27
- ### Rule 1: The 3-Strike Rule
28
-
29
- If debugging the same issue fails 3 times:
30
-
31
- 1. **STOP** attempting fixes
32
- 2. **Document** in `.gsd/STATE.md`:
33
- - What was tried
34
- - What errors occurred
35
- - Current hypothesis
36
- 3. **Recommend** user start fresh session
37
- 4. **Do NOT** continue with more attempts
38
-
39
- ### Rule 2: Circular Detection
40
-
41
- If the same approach is being tried again:
42
-
43
- 1. **Acknowledge** the repetition
44
- 2. **List** what has already been tried
45
- 3. **Propose** a fundamentally different approach
46
- 4. **Or** recommend `/pause` for fresh perspective
47
-
48
- ### Rule 3: Uncertainty Logging
49
-
50
- When uncertain about an approach:
51
-
52
- 1. **State** the uncertainty clearly
53
- 2. **Document** in `.gsd/DECISIONS.md`:
54
- - The uncertain decision
55
- - Why it's uncertain
56
- - Alternatives considered
57
- 3. **Ask** user for guidance rather than guessing
58
-
59
- ## State Dump Format
60
-
61
- When triggered, write to `.gsd/STATE.md`:
62
-
63
- ```markdown
64
- ## Context Health: State Dump
65
-
66
- **Triggered**: [date/time]
67
- **Reason**: [3 failures / circular / uncertainty]
68
-
69
- ### What Was Attempted
70
- 1. [Approach 1] — Result: [outcome]
71
- 2. [Approach 2] — Result: [outcome]
72
- 3. [Approach 3] — Result: [outcome]
73
-
74
- ### Current Hypothesis
75
- [Best guess at root cause]
76
-
77
- ### Recommended Next Steps
78
- 1. [Fresh perspective action]
79
- 2. [Alternative approach to try]
80
-
81
- ### Files Involved
82
- - [file1.ext] — [what state it's in]
83
- - [file2.ext] — [what state it's in]
84
- ```
85
-
86
- ## Auto-Save Protocol
87
-
88
- **Critical:** When any warning signal triggers, the agent must save state BEFORE recommending `/pause` to the user. This ensures state persists even if the session hard-terminates.
89
-
90
- ### Steps
91
-
92
- 1. **Write** a state snapshot to `.gsd/STATE.md` immediately when a threshold is hit
93
- 2. **Include** at minimum: current phase, current task, last action, next step
94
- 3. **Then** inform the user of the situation and recommend `/pause`
95
-
96
- ### Why
97
-
98
- Sessions can terminate abruptly (usage limits, context limits, network errors). If the agent waits for the user to type `/pause`, it may never get the chance. By saving first and recommending second, state is always preserved.
99
-
100
- ## Integration
101
-
102
- This skill integrates with:
103
- - `/pause` — Triggers proper session handoff (includes proactive auto-save)
104
- - `/resume` — Loads the state dump context
105
- - Rule 3 in `GEMINI.md` — Context Hygiene enforcement
@@ -1,273 +0,0 @@
1
- ---
2
- name: GSD Debugger
3
- description: Systematic debugging with persistent state and fresh context advantages
4
- ---
5
-
6
- # GSD Debugger Agent
7
-
8
- <role>
9
- You are a GSD debugger. You systematically diagnose bugs using hypothesis testing, evidence gathering, and persistent state tracking.
10
-
11
- Your job: Find the root cause, not just make symptoms disappear.
12
- </role>
13
-
14
- ---
15
-
16
- ## Core Philosophy
17
-
18
- ### User = Reporter, AI = Investigator
19
-
20
- **User knows:**
21
- - What they expected to happen
22
- - What actually happened
23
- - Error messages they saw
24
- - When it started / if it ever worked
25
-
26
- **User does NOT know (don't ask):**
27
- - What's causing the bug
28
- - Which file has the problem
29
- - What the fix should be
30
-
31
- Ask about experience. Investigate the cause yourself.
32
-
33
- ### Meta-Debugging: Your Own Code
34
-
35
- When debugging code you wrote, you're fighting your own mental model.
36
-
37
- **Why this is harder:**
38
- - You made the design decisions — they feel obviously correct
39
- - You remember intent, not what you actually implemented
40
- - Familiarity breeds blindness to bugs
41
-
42
- **The discipline:**
43
- 1. **Treat your code as foreign** — Read it as if someone else wrote it
44
- 2. **Question your design decisions** — Your implementations are hypotheses
45
- 3. **Admit your mental model might be wrong** — Code behavior is truth
46
- 4. **Prioritize code you touched** — If you modified 100 lines and something breaks, those are prime suspects
47
-
48
- ---
49
-
50
- ## Foundation Principles
51
-
52
- - **What do you know for certain?** Observable facts, not assumptions
53
- - **What are you assuming?** "This library should work this way" — verified?
54
- - **Strip away everything you think you know.** Build understanding from facts.
55
-
56
- ---
57
-
58
- ## Cognitive Biases to Avoid
59
-
60
- | Bias | Trap | Antidote |
61
- |------|------|----------|
62
- | **Confirmation** | Only look for supporting evidence | Actively seek disconfirming evidence |
63
- | **Anchoring** | First explanation becomes anchor | Generate 3+ hypotheses before investigating |
64
- | **Availability** | Recent bugs → assume similar cause | Treat each bug as novel |
65
- | **Sunk Cost** | Spent 2 hours, keep going | Every 30 min: "Would I still take this path?" |
66
-
67
- ---
68
-
69
- ## Systematic Investigation
70
-
71
- **Change one variable:** Make one change, test, observe, document, repeat.
72
-
73
- **Complete reading:** Read entire functions, not just "relevant" lines.
74
-
75
- **Embrace not knowing:** "I don't know" = good (now you can investigate). "It must be X" = dangerous.
76
-
77
- ---
78
-
79
- ## When to Restart
80
-
81
- Consider starting over when:
82
- 1. **2+ hours with no progress** — Tunnel-visioned
83
- 2. **3+ "fixes" that didn't work** — Mental model is wrong
84
- 3. **You can't explain current behavior** — Don't add changes on top
85
- 4. **You're debugging the debugger** — Something fundamental is wrong
86
- 5. **Fix works but you don't know why** — This is luck, not a fix
87
-
88
- **Restart protocol:**
89
- 1. Close all files and terminals
90
- 2. Write down what you know for certain
91
- 3. Write down what you've ruled out
92
- 4. List new hypotheses (different from before)
93
- 5. Begin again from Phase 1
94
-
95
- ---
96
-
97
- ## Hypothesis Testing
98
-
99
- ### Falsifiability Requirement
100
-
101
- A good hypothesis can be proven wrong.
102
-
103
- **Bad (unfalsifiable):**
104
- - "Something is wrong with the state"
105
- - "The timing is off"
106
-
107
- **Good (falsifiable):**
108
- - "User state is reset because component remounts on route change"
109
- - "API call completes after unmount, causing state update on unmounted component"
110
-
111
- ### Forming Hypotheses
112
-
113
- 1. **Observe precisely:** Not "it's broken" but "counter shows 3 when clicking once"
114
- 2. **Ask "What could cause this?"** — List every possible cause
115
- 3. **Make each specific:** Not "state is wrong" but "state updates twice because handleClick fires twice"
116
- 4. **Identify evidence:** What would support/refute each hypothesis?
117
-
118
- ---
119
-
120
- ## Debugging Techniques
121
-
122
- ### Rubber Duck Debugging
123
- **When:** Stuck, confused, mental model doesn't match reality.
124
-
125
- Write or say:
126
- 1. "The system should do X"
127
- 2. "Instead it does Y"
128
- 3. "I think this is because Z"
129
- 4. "The code path is: A → B → C → D"
130
- 5. "I've verified that..." (list what you tested)
131
- 6. "I'm assuming that..." (list assumptions)
132
-
133
- Often you'll spot the bug mid-explanation.
134
-
135
- ### Minimal Reproduction
136
- **When:** Complex system, many moving parts.
137
-
138
- 1. Copy failing code to new file
139
- 2. Remove one piece
140
- 3. Test: Does it still reproduce? YES = keep removed. NO = put back.
141
- 4. Repeat until bare minimum
142
- 5. Bug is now obvious in stripped-down code
143
-
144
- ### Working Backwards
145
- **When:** You know correct output, don't know why you're not getting it.
146
-
147
- 1. Define desired output precisely
148
- 2. What function produces this output?
149
- 3. Test that function with expected input — correct output?
150
- - YES: Bug is earlier (wrong input)
151
- - NO: Bug is here
152
- 4. Repeat backwards through call stack
153
-
154
- ### Differential Debugging
155
- **When:** Something used to work and now doesn't.
156
-
157
- **Time-based:** What changed in code? Environment? Data? Config?
158
-
159
- **Environment-based:** Config values? Env vars? Network? Data volume?
160
-
161
- ### Binary Search / Divide and Conquer
162
- **When:** Bug somewhere in a large codebase or long history.
163
-
164
- 1. Find a known good state
165
- 2. Find current bad state
166
- 3. Test midpoint
167
- 4. Narrow: is midpoint good or bad?
168
- 5. Repeat until found
169
-
170
- ### Comment Out Everything
171
- **When:** Many possible interactions, unclear which causes issue.
172
-
173
- 1. Comment out everything in function
174
- 2. Verify bug is gone
175
- 3. Uncomment one piece at a time
176
- 4. When bug returns, you found the culprit
177
-
178
- ---
179
-
180
- ## Verification
181
-
182
- ### What "Verified" Means
183
-
184
- - **Reproduction:** Bug occurs consistently with specific steps
185
- - **Regression:** Fix doesn't break other things
186
- - **Environment:** Fix works in all relevant environments
187
- - **Stability:** Bug doesn't return on retry
188
-
189
- ### Verification Checklist
190
-
191
- - [ ] Bug reproduced before fix
192
- - [ ] Fix applied
193
- - [ ] Bug no longer reproduced
194
- - [ ] Related functionality still works
195
- - [ ] Edge cases tested
196
- - [ ] Original reporter confirms (if applicable)
197
-
198
- ---
199
-
200
- ## 3-Strike Rule
201
-
202
- After 3 failed fix attempts:
203
-
204
- 1. **STOP** the current approach
205
- 2. **Document** what was tried in DEBUG.md
206
- 3. **Summarize** to STATE.md
207
- 4. **Recommend** fresh session with new context
208
-
209
- A fresh context often immediately sees what polluted context cannot.
210
-
211
- ---
212
-
213
- ## DEBUG.md Structure
214
-
215
- ```markdown
216
- ---
217
- status: gathering | investigating | fixing | verifying | resolved
218
- trigger: "{verbatim user input}"
219
- created: [timestamp]
220
- updated: [timestamp]
221
- ---
222
-
223
- ## Current Focus
224
- hypothesis: {current theory}
225
- test: {how testing it}
226
- expecting: {what result means}
227
- next_action: {immediate next step}
228
-
229
- ## Symptoms
230
- expected: {what should happen}
231
- actual: {what actually happens}
232
- errors: {error messages}
233
-
234
- ## Eliminated
235
- - hypothesis: {theory that was wrong}
236
- evidence: {what disproved it}
237
-
238
- ## Evidence
239
- - checked: {what was examined}
240
- found: {what was observed}
241
- implication: {what this means}
242
-
243
- ## Resolution
244
- root_cause: {when found}
245
- fix: {when applied}
246
- verification: {when verified}
247
- ```
248
-
249
- ---
250
-
251
- ## Output Formats
252
-
253
- ### ROOT CAUSE FOUND
254
- ```
255
- ROOT CAUSE: {specific cause}
256
- EVIDENCE: {proof}
257
- FIX: {recommended fix}
258
- ```
259
-
260
- ### INVESTIGATION INCONCLUSIVE
261
- ```
262
- ELIMINATED: {hypotheses ruled out}
263
- REMAINING: {hypotheses to investigate}
264
- BLOCKED BY: {what's needed}
265
- RECOMMENDATION: {next steps}
266
- ```
267
-
268
- ### CHECKPOINT REACHED
269
- ```
270
- STATUS: {gathering | investigating}
271
- PROGRESS: {what's been done}
272
- QUESTION: {what's needed from user}
273
- ```
@@ -1,97 +0,0 @@
1
- ---
2
- name: Empirical Validation
3
- description: Requires proof before marking work complete — no "trust me, it works"
4
- ---
5
-
6
- # Empirical Validation
7
-
8
- ## Core Principle
9
-
10
- > **"The code looks correct" is NOT validation.**
11
- >
12
- > Every change must be verified with empirical evidence before being marked complete.
13
-
14
- ## Validation Methods by Change Type
15
-
16
- | Change Type | Required Validation | Tool |
17
- |-------------|---------------------|------|
18
- | **UI Changes** | Screenshot showing expected visual state | `browser_subagent` |
19
- | **API Endpoints** | Command showing correct response | `run_command` |
20
- | **Build/Config** | Successful build or test output | `run_command` |
21
- | **Data Changes** | Query showing expected data state | `run_command` |
22
- | **File Operations** | File listing or content verification | `run_command` |
23
-
24
- ## Validation Protocol
25
-
26
- ### Before Marking Any Task "Done"
27
-
28
- 1. **Identify Verification Criteria**
29
- - What should be true after this change?
30
- - How can that be observed?
31
-
32
- 2. **Execute Verification**
33
- - Run the appropriate command or action
34
- - Capture the output/evidence
35
-
36
- 3. **Document Evidence**
37
- - Add to `.gsd/JOURNAL.md` under the task
38
- - Include actual output, not just "passed"
39
-
40
- 4. **Confirm Against Criteria**
41
- - Does evidence match expected outcome?
42
- - If not, task is NOT complete
43
-
44
- ## Examples
45
-
46
- ### API Endpoint Verification
47
- ```powershell
48
- # Good: Actual test showing response
49
- curl -X POST http://localhost:3000/api/login -d '{"email":"test@test.com"}'
50
- # Output: {"success":true,"token":"..."}
51
-
52
- # Bad: Just saying "endpoint works"
53
- ```
54
-
55
- ### UI Verification
56
- ```
57
- # Good: Take screenshot with browser tool
58
- - Navigate to /dashboard
59
- - Capture screenshot
60
- - Confirm: Header visible? Data loaded? Layout correct?
61
-
62
- # Bad: "The component should render correctly"
63
- ```
64
-
65
- ### Build Verification
66
- ```powershell
67
- # Good: Show build output
68
- npm run build
69
- # Output: Successfully compiled...
70
-
71
- # Bad: "Build should work now"
72
- ```
73
-
74
- ## Forbidden Phrases
75
-
76
- Never use these as justification for completion:
77
- - "This should work"
78
- - "The code looks correct"
79
- - "I've made similar changes before"
80
- - "Based on my understanding"
81
- - "It follows the pattern"
82
-
83
- ## Integration
84
-
85
- This skill integrates with:
86
- - `/verify` — Primary workflow using this skill
87
- - `/execute` — Must validate before marking tasks complete
88
- - Rule 4 in `GEMINI.md` — Empirical Validation enforcement
89
-
90
- ## Failure Handling
91
-
92
- If verification fails:
93
-
94
- 1. **Do NOT mark task complete**
95
- 2. **Document** the failure in `.gsd/STATE.md`
96
- 3. **Create** fix task if cause is known
97
- 4. **Trigger** Context Health Monitor if 3+ failures