clikit-plugin 0.2.45 → 0.2.46

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 (177) hide show
  1. package/AGENTS.md +69 -3
  2. package/README.md +128 -92
  3. package/command/commit.md +1 -1
  4. package/command/create.md +65 -8
  5. package/command/debug.md +1 -1
  6. package/command/design.md +183 -43
  7. package/command/handoff.md +1 -1
  8. package/command/import-plan.md +2 -2
  9. package/command/init.md +1 -1
  10. package/command/issue.md +3 -4
  11. package/command/pr.md +1 -1
  12. package/command/research.md +5 -7
  13. package/command/resume.md +1 -1
  14. package/command/ship.md +29 -32
  15. package/command/start.md +38 -27
  16. package/command/{status-beads.md → status.md} +2 -3
  17. package/command/verify.md +132 -48
  18. package/dist/.tsbuildinfo +1 -1
  19. package/dist/agents/index.d.ts +0 -0
  20. package/dist/agents/index.d.ts.map +0 -0
  21. package/dist/beads-context.test.d.ts +2 -0
  22. package/dist/beads-context.test.d.ts.map +1 -0
  23. package/dist/cli.d.ts +0 -0
  24. package/dist/cli.d.ts.map +0 -0
  25. package/dist/cli.js +5 -0
  26. package/dist/cli.test.d.ts +0 -0
  27. package/dist/cli.test.d.ts.map +0 -0
  28. package/dist/clikit.schema.json +32 -11
  29. package/dist/clilog.test.d.ts +0 -0
  30. package/dist/clilog.test.d.ts.map +0 -0
  31. package/dist/commands/index.d.ts +0 -0
  32. package/dist/commands/index.d.ts.map +0 -0
  33. package/dist/config.d.ts +15 -7
  34. package/dist/config.d.ts.map +1 -1
  35. package/dist/config.test.d.ts +0 -0
  36. package/dist/config.test.d.ts.map +0 -0
  37. package/dist/hooks/beads-context.d.ts +2 -0
  38. package/dist/hooks/beads-context.d.ts.map +1 -1
  39. package/dist/hooks/empty-message-sanitizer.d.ts +0 -0
  40. package/dist/hooks/empty-message-sanitizer.d.ts.map +0 -0
  41. package/dist/hooks/error-logger.d.ts +0 -0
  42. package/dist/hooks/error-logger.d.ts.map +0 -0
  43. package/dist/hooks/git-guard.d.ts +0 -0
  44. package/dist/hooks/git-guard.d.ts.map +0 -0
  45. package/dist/hooks/index.d.ts +0 -2
  46. package/dist/hooks/index.d.ts.map +1 -1
  47. package/dist/hooks/memory-digest.d.ts +1 -0
  48. package/dist/hooks/memory-digest.d.ts.map +1 -1
  49. package/dist/hooks/security-check.d.ts +0 -0
  50. package/dist/hooks/security-check.d.ts.map +0 -0
  51. package/dist/hooks/subagent-question-blocker.d.ts +0 -0
  52. package/dist/hooks/subagent-question-blocker.d.ts.map +0 -0
  53. package/dist/hooks/todo-beads-sync.d.ts +1 -0
  54. package/dist/hooks/todo-beads-sync.d.ts.map +1 -1
  55. package/dist/hooks/todo-enforcer.d.ts +1 -1
  56. package/dist/hooks/todo-enforcer.d.ts.map +1 -1
  57. package/dist/hooks/truncator.d.ts +0 -0
  58. package/dist/hooks/truncator.d.ts.map +0 -0
  59. package/dist/index.d.ts +0 -0
  60. package/dist/index.d.ts.map +1 -1
  61. package/dist/index.js +250 -576
  62. package/dist/skills/index.d.ts +0 -0
  63. package/dist/skills/index.d.ts.map +0 -0
  64. package/dist/tools/cass-memory.d.ts +0 -0
  65. package/dist/tools/cass-memory.d.ts.map +0 -0
  66. package/dist/tools/context-summary.d.ts +0 -0
  67. package/dist/tools/context-summary.d.ts.map +0 -0
  68. package/dist/tools/index.d.ts +0 -3
  69. package/dist/tools/index.d.ts.map +1 -1
  70. package/dist/tools/memory-db.d.ts +0 -0
  71. package/dist/tools/memory-db.d.ts.map +0 -0
  72. package/dist/tools/memory.d.ts +0 -0
  73. package/dist/tools/memory.d.ts.map +0 -0
  74. package/dist/tools/observation.d.ts +0 -0
  75. package/dist/tools/observation.d.ts.map +0 -0
  76. package/dist/types.d.ts +0 -0
  77. package/dist/types.d.ts.map +0 -0
  78. package/memory/_digest.md +1 -1
  79. package/memory/_templates/handoff.md +0 -0
  80. package/memory/_templates/plan.md +35 -0
  81. package/memory/_templates/prd.md +0 -0
  82. package/memory/_templates/research.md +0 -0
  83. package/memory/_templates/review.md +0 -0
  84. package/memory/_templates/spec.md +12 -0
  85. package/memory/beads/.gitkeep +0 -0
  86. package/memory/handoffs/.gitkeep +0 -0
  87. package/memory/memory.db +0 -0
  88. package/memory/plans/.gitkeep +0 -0
  89. package/memory/prds/.gitkeep +0 -0
  90. package/memory/research/.gitkeep +0 -0
  91. package/memory/reviews/.gitkeep +0 -0
  92. package/memory/specs/.gitkeep +0 -0
  93. package/package.json +4 -4
  94. package/skill/beads/SKILL.md +42 -43
  95. package/skill/beads/mcp.json +26 -0
  96. package/skill/beads/references/api-reference.md +64 -0
  97. package/skill/chrome-devtools/SKILL.md +22 -23
  98. package/skill/chrome-devtools/mcp.json +17 -0
  99. package/skill/chrome-devtools/references/tool-reference.md +63 -0
  100. package/skill/condition-based-waiting/SKILL.md +28 -66
  101. package/skill/deep-research/SKILL.md +34 -103
  102. package/skill/deep-research/mcp.json +21 -0
  103. package/skill/deep-research/references/lsp-ops.md +44 -0
  104. package/skill/defense-in-depth/SKILL.md +29 -69
  105. package/skill/executing-plans/SKILL.md +25 -34
  106. package/skill/finishing-a-development-branch/SKILL.md +28 -89
  107. package/skill/playwright/SKILL.md +27 -22
  108. package/skill/playwright/mcp.json +20 -0
  109. package/skill/playwright/references/tool-reference.md +64 -0
  110. package/skill/receiving-code-review/SKILL.md +16 -27
  111. package/skill/requesting-code-review/SKILL.md +22 -26
  112. package/skill/ritual-workflow/SKILL.md +22 -82
  113. package/skill/root-cause-tracing/SKILL.md +30 -54
  114. package/skill/session-management/SKILL.md +21 -40
  115. package/skill/source-code-research/SKILL.md +33 -102
  116. package/skill/source-code-research/mcp.json +13 -0
  117. package/skill/source-code-research/references/quick-ref.md +65 -0
  118. package/skill/systematic-debugging/SKILL.md +28 -41
  119. package/skill/systematic-debugging/references/patterns.md +71 -0
  120. package/skill/test-driven-development/SKILL.md +16 -40
  121. package/skill/testing-anti-patterns/SKILL.md +36 -64
  122. package/skill/testing-anti-patterns/references/decision-matrix.md +55 -0
  123. package/skill/using-git-worktrees/SKILL.md +27 -103
  124. package/skill/vercel-react-best-practices/SKILL.md +50 -139
  125. package/skill/vercel-react-best-practices/references/patterns.md +70 -0
  126. package/skill/verification-before-completion/SKILL.md +19 -37
  127. package/skill/writing-plans/SKILL.md +20 -32
  128. package/skill/writing-skills/SKILL.md +52 -41
  129. package/skill/writing-skills/references/skill-anatomy.md +210 -0
  130. package/src/agents/AGENTS.md +48 -18
  131. package/src/agents/build.md +342 -93
  132. package/src/agents/explore.md +77 -60
  133. package/src/agents/index.ts +0 -0
  134. package/src/agents/oracle.md +153 -63
  135. package/src/agents/plan.md +275 -110
  136. package/src/agents/research.md +71 -53
  137. package/src/agents/review.md +182 -61
  138. package/src/agents/vision.md +7 -5
  139. package/command/plan.md +0 -152
  140. package/command/review-codebase.md +0 -228
  141. package/command/review.md +0 -135
  142. package/command/vision.md +0 -210
  143. package/dist/hooks/swarm-enforcer.d.ts +0 -31
  144. package/dist/hooks/swarm-enforcer.d.ts.map +0 -1
  145. package/dist/tools/beads-memory-sync.d.ts +0 -17
  146. package/dist/tools/beads-memory-sync.d.ts.map +0 -1
  147. package/dist/tools/quick-research.d.ts +0 -16
  148. package/dist/tools/quick-research.d.ts.map +0 -1
  149. package/dist/tools/swarm.d.ts +0 -57
  150. package/dist/tools/swarm.d.ts.map +0 -1
  151. package/skill/accessibility-audit/SKILL.md +0 -115
  152. package/skill/beads-bridge/SKILL.md +0 -45
  153. package/skill/brainstorming/SKILL.md +0 -41
  154. package/skill/cass-village/SKILL.md +0 -217
  155. package/skill/cloudflare/SKILL.md +0 -96
  156. package/skill/design-system-audit/SKILL.md +0 -136
  157. package/skill/development-lifecycle/SKILL.md +0 -58
  158. package/skill/dispatching-parallel-agents/SKILL.md +0 -94
  159. package/skill/figma/SKILL.md +0 -34
  160. package/skill/frontend-aesthetics/SKILL.md +0 -63
  161. package/skill/gemini-large-context/SKILL.md +0 -80
  162. package/skill/mockup-to-code/SKILL.md +0 -98
  163. package/skill/mqdh/SKILL.md +0 -54
  164. package/skill/notebooklm/SKILL.md +0 -71
  165. package/skill/playwriter/SKILL.md +0 -56
  166. package/skill/polar/SKILL.md +0 -39
  167. package/skill/resend/SKILL.md +0 -85
  168. package/skill/sharing-skills/SKILL.md +0 -50
  169. package/skill/subagent-driven-development/SKILL.md +0 -69
  170. package/skill/supabase/SKILL.md +0 -80
  171. package/skill/supabase-postgres-best-practices/SKILL.md +0 -168
  172. package/skill/swarm-coordination/SKILL.md +0 -54
  173. package/skill/testing-skills-with-subagents/SKILL.md +0 -102
  174. package/skill/ui-ux-research/SKILL.md +0 -93
  175. package/skill/v0/SKILL.md +0 -67
  176. package/skill/v1-run/SKILL.md +0 -85
  177. package/skill/visual-analysis/SKILL.md +0 -113
@@ -0,0 +1,64 @@
1
+ # Playwright MCP — Tool Reference
2
+
3
+ ## Core Tools
4
+
5
+ ### Navigation
6
+ ```
7
+ playwright_navigate(url, waitUntil?)
8
+ waitUntil: "load" | "domcontentloaded" | "networkidle" (default: "load")
9
+ ```
10
+
11
+ ### Interaction
12
+ ```
13
+ playwright_click(selector)
14
+ playwright_fill(selector, value)
15
+ playwright_select(selector, value) # <select> elements
16
+ playwright_evaluate(script) # run JS in page context
17
+ playwright_wait_for_selector(selector, timeout?)
18
+ ```
19
+
20
+ ### Capture
21
+ ```
22
+ playwright_screenshot(fullPage?, selector?)
23
+ playwright_get_text(selector?) # get visible text
24
+ ```
25
+
26
+ ### Session
27
+ ```
28
+ playwright_close() # always call when done
29
+ ```
30
+
31
+ ## Common Patterns
32
+
33
+ ### Auth flow
34
+ ```
35
+ playwright_navigate("http://localhost:3000/login")
36
+ playwright_fill("#email", "test@example.com")
37
+ playwright_fill("#password", "secret")
38
+ playwright_click("[type=submit]")
39
+ playwright_wait_for_selector(".dashboard")
40
+ playwright_screenshot()
41
+ ```
42
+
43
+ ### Responsive test
44
+ ```
45
+ playwright_navigate("http://localhost:3000")
46
+ playwright_evaluate("window.innerWidth") # check viewport
47
+ playwright_screenshot(true) # full page
48
+ ```
49
+
50
+ ### Assert text
51
+ ```
52
+ playwright_get_text(".status")
53
+ # compare returned text to expected value
54
+ ```
55
+
56
+ ## Viewport Sizes
57
+
58
+ | Breakpoint | Width |
59
+ |------------|-------|
60
+ | Mobile | 375px |
61
+ | Tablet | 768px |
62
+ | Desktop | 1280px |
63
+
64
+ Set via `playwright_evaluate("Object.assign(window, {innerWidth: 375})")` or configure in setup.
@@ -1,47 +1,36 @@
1
1
  ---
2
2
  name: receiving-code-review
3
- description: Use when receiving code review feedback. Technical evaluation, not emotional response.
3
+ description: Use when receiving code review feedback. Verify before accepting, push back with data when appropriate.
4
4
  ---
5
5
 
6
- # Receiving Code Review Skill
6
+ # Receiving Code Review
7
7
 
8
- You are running the **receiving-code-review** skill. Respond professionally.
8
+ ## Protocol
9
9
 
10
- ## Mindset
11
-
12
- - Technical evaluation, not emotional
13
- - Never say "You're absolutely right!" without verification
14
- - Verify before implementing changes
15
- - Push back with technical reasoning when appropriate
16
-
17
- ## Response Protocol
18
-
19
- 1. **Read carefully** — Understand the actual concern
20
- 2. **Verify locally** — Reproduce or confirm the issue
21
- 3. **Categorize** — Is this a bug, style, optimization, or preference?
22
- 4. **Respond** — Acknowledge, question, or push back with data
10
+ 1. **Read** — understand the actual concern, not the surface suggestion
11
+ 2. **Verify locally** — reproduce or confirm the issue
12
+ 3. **Categorize** bug / style / optimization / preference
13
+ 4. **Respond** acknowledge, question, or push back with evidence
23
14
 
24
15
  ## When to Push Back
25
16
 
26
17
  | Scenario | Response |
27
18
  |----------|----------|
28
- | Suggestion adds complexity without value | "This adds N lines for hypothetical future need. YAGNI applies." |
29
- | Change breaks existing behavior | "This would break X. Current approach handles Y correctly." |
30
- | Style preference disguised as bug | "Noted, but current pattern matches codebase conventions." |
31
- | Requested feature is "professional" polish | "This works correctly. The suggested enhancement is not in scope." |
19
+ | Adds complexity for hypothetical need | "YAGNI adds N lines for a case we don't have" |
20
+ | Breaks existing behavior | "This breaks X. Current approach handles Y correctly." |
21
+ | Style preference, not a bug | "Current pattern matches codebase conventions." |
22
+ | Out-of-scope polish | "Works correctly. This enhancement is not in scope." |
32
23
 
33
- ## YAGNI Check
24
+ ## YAGNI Check (before accepting "improvements")
34
25
 
35
- Before implementing "improvements":
36
- - Does this solve a real problem or hypothetical one?
26
+ - Does this solve a real problem or a hypothetical one?
37
27
  - Is the complexity justified by actual usage?
38
28
  - Would a simpler solution suffice?
39
29
 
40
- If answer is "hypothetical" or "no" — push back.
30
+ If "hypothetical" push back.
41
31
 
42
32
  ## Red Flags
43
33
 
44
- - Agreeing immediately without verification
45
- - Implementing suggestions that increase complexity unnecessarily
34
+ - Agreeing immediately without verifying
35
+ - Implementing suggestions that increase complexity without value
46
36
  - Treating style preferences as bugs
47
- - Adding "professional" features that nobody asked for
@@ -1,47 +1,43 @@
1
1
  ---
2
2
  name: requesting-code-review
3
- description: Use after completing a task. Dispatch @review subagent for quality gate.
3
+ description: Use after completing a task. Dispatch @review subagent for quality gate before merging.
4
4
  ---
5
5
 
6
- # Requesting Code Review Skill
6
+ # Requesting Code Review
7
7
 
8
- You are running the **requesting-code-review** skill. Never skip review.
8
+ ## Trigger
9
9
 
10
- ## When to Request
10
+ Request review after: major features, significant refactors, before merge, when unsure of approach.
11
11
 
12
- - After major features
13
- - Before merging
14
- - After significant refactors
15
- - When unsure about approach
16
-
17
- ## Information to Provide
12
+ ## What to Provide to @review
18
13
 
19
14
  | Item | Example |
20
15
  |------|---------|
21
- | Git SHAs | "Changed: a1b2c3d..e4f5g6h" |
22
- | What was implemented | "Added user authentication with JWT" |
23
- | Plan/requirements | "Per spec in .opencode/memory/specs/auth.md" |
24
- | Known issues | "Edge case X not handled yet" |
16
+ | Diff range | `a1b2c3d..e4f5g6h` |
17
+ | What changed | "Added JWT auth with refresh tokens" |
18
+ | Spec/plan ref | `.opencode/memory/specs/auth.md` |
19
+ | Known gaps | "Edge case X not handled yet" |
25
20
 
26
- ## Review Workflow
21
+ ## Dispatch
27
22
 
28
- 1. Dispatch @review subagent
29
- 2. Wait for review results
30
- 3. Fix Critical issues immediately
31
- 4. Address High issues before merge
32
- 5. Medium/Low can be follow-up tickets
23
+ ```
24
+ @review: review changes from <sha>..<sha>
25
+ Context: <what was built>
26
+ Spec: <path>
27
+ Known issues: <list or none>
28
+ ```
33
29
 
34
- ## Issue Severity Response
30
+ ## Severity Response
35
31
 
36
32
  | Severity | Action |
37
33
  |----------|--------|
38
- | Critical | Fix NOW, re-review |
34
+ | Critical | Fix now, re-review |
39
35
  | High | Fix before merge |
40
- | Medium | Create ticket, fix soon |
41
- | Low | Document, fix later |
36
+ | Medium | Create beads ticket |
37
+ | Low | Document, defer |
42
38
 
43
39
  ## Red Flags
44
40
 
45
41
  - Skipping review "because it's small"
46
- - Merging without addressing Critical issues
47
- - Not providing context for reviewer
42
+ - Merging with unresolved Critical issues
43
+ - No context given to reviewer
@@ -1,101 +1,41 @@
1
1
  ---
2
2
  name: ritual-workflow
3
- description: Use when starting any task. Enforces DISCOVER → PLAN → IMPLEMENT → VERIFY → COMPLETE workflow with hard gates.
3
+ description: Use when starting any task. Enforces DISCOVER → PLAN → IMPLEMENT → VERIFY → COMPLETE with hard gates at each phase.
4
4
  ---
5
5
 
6
- # Ritual Workflow Skill
6
+ # Ritual Workflow
7
7
 
8
- You are running the **ritual-workflow** skill. Every task follows a strict phase structure.
9
-
10
- ## Phases (in order)
8
+ ## Phases
11
9
 
12
10
  ```
13
11
  DISCOVER → PLAN → IMPLEMENT → VERIFY → COMPLETE
14
12
  ```
15
13
 
16
- ### Phase 1: DISCOVER
17
- - Understand the problem
18
- - Gather requirements
19
- - Identify stakeholders and constraints
20
- - Define success criteria
21
- - **Gate**: Can articulate the problem clearly
22
-
23
- ### Phase 2: PLAN
24
- - Design the solution
25
- - Break into tasks
26
- - Identify dependencies
27
- - Estimate effort
28
- - **Gate**: Plan approved (user confirms)
29
-
30
- ### Phase 3: IMPLEMENT
31
- - Write code
32
- - Follow plan
33
- - Create tests
34
- - **Gate**: All planned tasks done
35
-
36
- ### Phase 4: VERIFY
37
- - Run tests
38
- - Type check
39
- - Lint
40
- - Build
41
- - **Gate**: All checks pass
42
-
43
- ### Phase 5: COMPLETE
44
- - Document changes
45
- - Create PR
46
- - Clean up
47
- - **Gate**: Merged or deployed
48
-
49
- ## Hard Gates
50
-
51
- | Current Phase | Must Complete Before Advancing |
52
- |---------------|-------------------------------|
53
- | DISCOVER | Problem statement written |
54
- | PLAN | User approves plan |
55
- | IMPLEMENT | All tasks checked off |
56
- | VERIFY | Tests pass, build succeeds |
57
- | COMPLETE | PR merged |
14
+ | Phase | Gate (must pass before advancing) |
15
+ |-------|-----------------------------------|
16
+ | DISCOVER | Problem statement written, success criteria defined |
17
+ | PLAN | User approves spec + plan |
18
+ | IMPLEMENT | All planned tasks checked off |
19
+ | VERIFY | typecheck + tests + lint + build all pass |
20
+ | COMPLETE | PR merged / deployed |
58
21
 
59
- ## Ritual State
22
+ ## Command Map
60
23
 
61
- State is tracked in `.opencode/memory/ritual-state.json`:
62
-
63
- ```json
64
- {
65
- "taskId": "bead-123",
66
- "phases": [
67
- { "name": "discover", "status": "done" },
68
- { "name": "plan", "status": "in_progress" },
69
- ...
70
- ],
71
- "currentPhase": 1
72
- }
73
- ```
74
-
75
- ## Commands
76
-
77
- | Command | Phase | Action |
78
- |---------|-------|--------|
79
- | `/create` | DISCOVER | Initialize ritual, gather requirements |
80
- | `/plan` | PLAN | Create implementation plan |
81
- | `/start` | IMPLEMENT | Begin implementation |
82
- | `/verify` | VERIFY | Run checks |
83
- | `/ship` | COMPLETE | Finalize and deploy |
24
+ | Mode | Commands |
25
+ |------|----------|
26
+ | Quick | `/create` → `/start` → `/verify` → `/ship` |
27
+ | Deep (research/UI) | `/create` → `/research` → `/design` → `/start` → `/verify` → `/ship` |
84
28
 
85
29
  ## Enforcement
86
30
 
87
31
  - Cannot skip phases
88
- - Cannot implement without approved plan
89
- - Cannot complete without passing verify
90
- - Each phase requires explicit completion
91
-
92
- ## Status Check
93
-
94
- Run `checkRitualProgress()` to see current phase and blockers.
32
+ - Cannot IMPLEMENT without an approved plan — run `/create` first
33
+ - Cannot COMPLETE without `/verify` returning SHIP_READY
34
+ - Each phase requires explicit completion signal
95
35
 
96
36
  ## Red Flags
97
37
 
98
- - Skipping to IMPLEMENT without PLAN
99
- - Marking COMPLETE with failing tests
100
- - Moving forward without user approval
101
- - Ignoring phase gates
38
+ - Implementing without a plan
39
+ - Marking COMPLETE with failing `/verify` gates
40
+ - Moving forward without user approval on spec/plan
41
+ - Running `/ship` before SHIP_READY
@@ -1,73 +1,49 @@
1
1
  ---
2
2
  name: root-cause-tracing
3
- description: Trace bugs backward through call chain to original trigger. Never fix where error appears.
3
+ description: Trace bugs backward through call chain to original trigger. Never fix where error appears — fix where bad data originated.
4
4
  ---
5
5
 
6
- # Root Cause Tracing Skill
6
+ # Root Cause Tracing
7
7
 
8
- You are running the **root-cause-tracing** skill. Fix the origin, not the symptom.
8
+ ## Principle
9
9
 
10
- ## Core Principle
10
+ Error appears at **A**. Cause is at **B**. Trace backward to **B** and fix there.
11
11
 
12
- The error appears at point A. The cause is at point B. Always trace backward to B.
12
+ ## Process
13
13
 
14
- ## Tracing Process
15
-
16
- ### Step 1: Locate the Error
17
- - Find where the error manifests
18
- - DO NOT fix here yet
19
- - This is the symptom location
20
-
21
- ### Step 2: Trace the Call Chain
22
- - Who called this function?
23
- - Who called that function?
24
- - Keep going until you find the trigger
14
+ ```
15
+ 1. LOCATE — find where error manifests (do NOT fix here)
16
+ 2. TRACE — walk the call chain backward (who called this? who called that?)
17
+ 3. FIND — first place wrong data/state originated
18
+ 4. FIX — apply fix at origin
19
+ 5. VERIFY — confirm symptom disappears
20
+ ```
25
21
 
26
- ### Step 3: Find the Root Cause
27
- - The first place where incorrect data/state originated
28
- - The decision point that led to wrong path
29
- - The missing validation that allowed bad input
22
+ ## Example
30
23
 
31
- ### Step 4: Fix at Origin
32
- - Apply fix at the root cause location
33
- - NOT where the error appeared
34
- - Verify symptom disappears
24
+ ```
25
+ Error: Cannot read property 'length' of undefined
26
+ at processItems (line 42) ← symptom — DO NOT FIX HERE
27
+ at handleRequest (line 28)
28
+ at parseInput (line 15) ← origin — FIX HERE (return [] not null)
29
+ ```
35
30
 
36
31
  ## Instrumentation
37
32
 
38
- ```javascript
39
- // At each layer, add:
40
- console.error('[TRACE] Function:', functionName);
41
- console.error('[TRACE] Args:', JSON.stringify(args, null, 2));
42
- console.error('[TRACE] Stack:', new Error().stack);
33
+ ```js
34
+ console.error('[TRACE]', functionName, JSON.stringify(args, null, 2));
35
+ console.error('[STACK]', new Error().stack);
43
36
  ```
44
37
 
45
- ## Bisection for Test Polluters
46
-
47
- When tests fail in batch but pass individually:
38
+ ## Test Polluter Bisection
48
39
 
49
- 1. Run first half of testspassing?
50
- 2. If yes: bug in second half
51
- 3. If no: bug in first half
52
- 4. Repeat until isolated to single test
53
- 5. That test is polluting shared state
40
+ Tests fail in batch but pass alone shared state pollution:
41
+ 1. Run first half → passes? bug in second half
42
+ 2. Run first half → fails? bug in first half
43
+ 3. Repeat until single test isolated
54
44
 
55
45
  ## Red Flags
56
46
 
57
- - Fixing where error is thrown (not where caused)
58
- - "Let me add a null check here" (defensive, not corrective)
59
- - Not tracing the full call chain
60
- - Assuming you know the cause without evidence
61
-
62
- ## Example
63
-
64
- ```
65
- Error: Cannot read property 'length' of undefined
66
- at processItems (line 42) ← DO NOT FIX HERE
67
- at handleRequest (line 28)
68
- at parseInput (line 15) ← FIX HERE: null should be []
69
- ```
70
-
71
- ## Rule
72
-
73
- **Never fix at the symptom. Always trace to the root.**
47
+ - Adding a null check at the symptom location (defensive, not corrective)
48
+ - Assuming cause without tracing the full chain
49
+ - No evidence before applying fix
@@ -3,51 +3,32 @@ name: session-management
3
3
  description: Use for managing context growth, task switching, and session continuity in long-running work.
4
4
  ---
5
5
 
6
- # Session Management Skill
7
-
8
- You are running the **session-management** skill. Context and continuity management.
6
+ # Session Management
9
7
 
10
8
  ## Context Thresholds
11
9
 
12
10
  | State | Context % | Action |
13
11
  |-------|-----------|--------|
14
- | Green | < 50% | Normal operation |
15
- | Yellow | 50-75% | Start summarizing, offload to memory |
16
- | Orange | 75-90% | Aggressive context pruning, handoff prep |
17
- | Red | > 90% | Initiate session handoff |
18
-
19
- ## Session Tools
20
-
21
- | Tool | Purpose |
22
- |------|---------|
23
- | Memory artifacts | Save state to `.opencode/memory/` |
24
- | Handoff docs | Session state for next agent |
25
- | Beads sync | Persist tasks to `.beads/` |
26
- | Git commits | Checkpoint progress |
27
-
28
- ## Workflow Patterns
29
-
30
- ### Starting a Session
31
- 1. Check Beads for in-progress tasks
32
- 2. Read handoff if continuing previous session
33
- 3. Claim ready tasks
34
- 4. Begin work
35
-
36
- ### During Session
37
- 1. Monitor context usage
38
- 2. Write specs/plans to memory as created
39
- 3. Commit incremental progress
40
- 4. Sync Beads regularly
41
-
42
- ### Ending a Session
12
+ | Green | < 50% | Normal |
13
+ | Yellow | 5075% | Offload findings to `memory/` |
14
+ | Orange | 7590% | Prep handoff doc |
15
+ | Red | > 90% | Run `/handoff`, end session |
16
+
17
+ ## Session Start
18
+
19
+ 1. `beads-village_init` join workspace
20
+ 2. `beads-village_inbox(unread=true)` → check blockers
21
+ 3. Read `memory/_digest.md` + latest handoff if continuing
22
+
23
+ ## Session End
24
+
43
25
  1. Complete or checkpoint current task
44
- 2. Write handoff document
45
- 3. Sync all state to git/Beads
46
- 4. Release file reservations
26
+ 2. Run `/handoff` → write handoff doc
27
+ 3. `beads-village_sync` push state
28
+ 4. Release all file reservations via `beads-village_done`
47
29
 
48
- ## Best Practices
30
+ ## Red Flags
49
31
 
50
- - Check context percentage periodically
51
- - Write to memory before hitting thresholds
52
- - Use handoff documents for continuity
53
- - Keep session state in version control
32
+ - Crossing 90% without writing a handoff
33
+ - Not reading the handoff when resuming
34
+ - Losing task state between sessions
@@ -1,98 +1,42 @@
1
1
  ---
2
2
  name: source-code-research
3
- description: Use when API documentation is insufficient. Research library implementation details by fetching package source.
3
+ description: Use when API docs are insufficient. Go directly to package source to understand edge cases, error behavior, and internal patterns.
4
4
  ---
5
5
 
6
- # Source Code Research Skill
7
-
8
- You are running the **source-code-research** skill. Go beyond API docs to understand internals.
6
+ # Source Code Research
9
7
 
10
8
  ## When to Use
11
9
 
12
- - API docs don't explain behavior
13
- - Need to understand edge cases
10
+ - API docs don't explain the behavior you're seeing
11
+ - Need to understand edge cases or error handling
14
12
  - Debugging library interactions
15
- - Learning implementation patterns
16
- - Verifying documented behavior
13
+ - Verifying that documented behavior is actually implemented
17
14
 
18
- ## Research Protocol
15
+ ## Protocol
19
16
 
20
- ### 1. Identify Package
21
17
  ```bash
22
- # Find package location
23
- which <package>
24
- npm list <package>
18
+ # 1. Locate source
19
+ cat node_modules/<pkg>/package.json | grep -E '"main"|"types"|"source"'
20
+ ls node_modules/<pkg>/src/
25
21
 
26
- # Find source location
27
- ls -la node_modules/<package>/
28
- ```
22
+ # 2. Read entry point
23
+ cat node_modules/<pkg>/src/index.ts # or index.js
29
24
 
30
- ### 2. Locate Source
31
- ```
32
- Check for:
33
- - src/ directory
34
- - lib/ directory
35
- - dist/ with sourcemaps
36
- - TypeScript .ts files
37
- - Index entry point
25
+ # 3. Read tests (best doc of real behavior)
26
+ ls node_modules/<pkg>/test/ || ls node_modules/<pkg>/__tests__/
38
27
  ```
39
28
 
40
- ### 3. Read Key Files
41
- Focus on:
42
- - Entry point (index.js/ts)
43
- - Main export file
44
- - Types/interfaces
45
- - Core implementation
46
- - Tests (for behavior)
47
-
48
- ### 4. Trace Execution
49
- - Follow function calls
50
- - Map data flow
51
- - Identify decision points
52
- - Note error handling
53
-
54
- ## Key Questions to Answer
55
-
56
- | Question | Why |
57
- |----------|-----|
58
- | How is this implemented? | Understand behavior |
59
- | What edge cases exist? | Avoid surprises |
60
- | How are errors handled? | Proper error handling |
61
- | What are the types? | TypeScript integration |
62
- | What are the defaults? | Implicit behavior |
63
-
64
- ## Finding Patterns
65
-
66
- ### Constructor Pattern
67
- ```javascript
68
- // Look for initialization logic
69
- class Example {
70
- constructor(options) {
71
- this.options = { ...defaults, ...options };
72
- }
73
- }
74
- ```
29
+ ## What to Look For
75
30
 
76
- ### Error Handling Pattern
77
- ```javascript
78
- // Identify what throws vs returns
79
- if (!valid) {
80
- throw new Error('...');
81
- // or
82
- return { error: '...' };
83
- }
84
- ```
85
-
86
- ### Async Pattern
87
- ```javascript
88
- // Understand async behavior
89
- async function process() {
90
- // Is this parallel or sequential?
91
- await Promise.all([...]);
92
- }
93
- ```
31
+ | Question | Where |
32
+ |----------|-------|
33
+ | What are the defaults? | Constructor / options merge |
34
+ | What throws vs returns error? | Error handling paths |
35
+ | What's async vs sync? | Promise.all vs sequential awaits |
36
+ | What are the types? | Type definitions, interfaces |
37
+ | What edge cases exist? | Conditional branches, null checks |
94
38
 
95
- ## Output Format
39
+ ## Output
96
40
 
97
41
  Save to `.opencode/memory/research/[package]-internals.md`:
98
42
 
@@ -104,35 +48,22 @@ Save to `.opencode/memory/research/[package]-internals.md`:
104
48
  - Types: [file]
105
49
 
106
50
  ## Key Findings
107
-
108
- ### [Feature Name]
109
- - **Location**: file:line
110
- - **Behavior**: [description]
111
- - **Edge Cases**: [list]
112
-
113
- ## Implementation Notes
114
- [Key patterns discovered]
51
+ ### [Feature]
52
+ - Location: file:line
53
+ - Behavior:
54
+ - Edge Cases: …
115
55
 
116
56
  ## Gotchas
117
- [Surprising behaviors]
118
57
  ```
119
58
 
120
- ## Anti-Patterns
59
+ ## Red Flags
121
60
 
122
- - Relying only on TypeScript definitions
123
- - Not reading tests
124
- - Assuming behavior from name
61
+ - Relying only on TypeScript type definitions (not the same as behavior)
62
+ - Not reading the tests
63
+ - Assuming behavior from the function name
125
64
  - Ignoring error paths
126
65
 
127
- ## Quick Reference
128
-
129
- ```bash
130
- # Find main entry
131
- cat node_modules/pkg/package.json | grep main
132
-
133
- # Find types
134
- cat node_modules/pkg/package.json | grep types
66
+ ## References
135
67
 
136
- # Check for source
137
- ls node_modules/pkg/src/
138
- ```
68
+ - [Quick reference](references/quick-ref.md) — locate source commands, grep patterns, Context7 MCP alternative
69
+ - MCP: `context7` — see [mcp.json](mcp.json)