opencodekit 0.2.2 → 0.2.4

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.
package/README.md CHANGED
@@ -247,6 +247,8 @@ You've successfully set up OpenCodeKit when:
247
247
  - **Custom Commands**: `.opencode/command/` - All 45+ workflow commands
248
248
  - **Skills System**: `.opencode/skills/` - 24 skills (8 core, 7 stack, 9 specialized)
249
249
  - **Memory System**: `.opencode/memory/` - Persistent cross-session knowledge
250
+ - **Templates**: `.opencode/memory/_templates/` - PRD, observation, and session-summary templates
251
+ - **Memory Tools**: `.opencode/tool/` - memory-read, memory-update, memory-search, observation
250
252
 
251
253
  ---
252
254
 
package/dist/index.js CHANGED
@@ -750,7 +750,7 @@ var cac = (name = "") => new CAC(name);
750
750
  // package.json
751
751
  var package_default = {
752
752
  name: "opencodekit",
753
- version: "0.2.1",
753
+ version: "0.2.4",
754
754
  description: "CLI tool for bootstrapping and managing OpenCodeKit projects",
755
755
  type: "module",
756
756
  repository: {
@@ -5,7 +5,7 @@
5
5
  # ============================================================================
6
6
 
7
7
  # Configure bash command timeout (default: 120000ms = 2 minutes)
8
- OPENCODE_EXPERIMENTAL_BASH_DEFAULT_TIMEOUT_MS=300000
8
+ export OPENCODE_EXPERIMENTAL_BASH_DEFAULT_TIMEOUT_MS=300000
9
9
  export OPENCODE_DISABLE_AUTOCOMPACT=0 # Disable broken compaction
10
10
  export OPENCODE_DISABLE_PRUNE=0 # Disable potentially buggy pruning
11
11
  export OPENCODE_EXPERIMENTAL_TURN_SUMMARY=1
@@ -100,13 +100,53 @@
100
100
 
101
101
  ```
102
102
  .opencode/memory/
103
- _templates/ # Task templates
103
+ _templates/ # Task templates (prd, observation, session-summary)
104
104
  handoffs/ # Phase transitions
105
105
  research/ # Research findings
106
+ observations/ # Structured observations
107
+ ```
108
+
109
+ ### Memory Tools
110
+
111
+ | Tool | Use For |
112
+ | --------------- | -------------------------------- |
113
+ | `memory-read` | Load previous context, templates |
114
+ | `memory-update` | Save learnings, handoffs |
115
+ | `memory-search` | Search across all memory files |
116
+ | `observation` | Create structured observations |
117
+
118
+ ### Observations
119
+
120
+ Record important findings with structured metadata:
121
+
122
+ ```
123
+ observation(
124
+ type: "decision", # decision, bugfix, feature, pattern, discovery, learning, warning
125
+ title: "Use JWT auth",
126
+ content: "Decided to use JWT because...",
127
+ concepts: "auth, security",
128
+ files: "src/auth.ts",
129
+ bead_id: "bd-abc123"
130
+ )
131
+ ```
132
+
133
+ **When to create observations:**
134
+
135
+ - Major architectural decisions
136
+ - Bug root causes discovered
137
+ - Patterns worth reusing
138
+ - Gotchas and warnings for future
139
+
140
+ ### Memory Search
141
+
142
+ Find past decisions, research, or handoffs:
143
+
144
+ ```
145
+ memory-search(query: "authentication")
146
+ memory-search(query: "bugfix", type: "observations")
147
+ memory-search(query: "session", type: "handoffs")
106
148
  ```
107
149
 
108
- - `memory-read` - Load previous context
109
- - `memory-update` - Save learnings
110
150
  - Task tracking uses Beads (`bd` CLI)
111
151
 
112
152
  ## Session Management
@@ -56,43 +56,86 @@ bd create "[title]" -t [type] -p [priority] -d "[description]" --json
56
56
  mkdir -p .beads/artifacts/<bead-id>
57
57
  ```
58
58
 
59
+ Use the PRD template from `.opencode/memory/_templates/prd.md` as the base structure.
60
+
59
61
  Write `.beads/artifacts/<bead-id>/spec.md`:
60
62
 
61
63
  ```markdown
62
64
  # [Title]
63
65
 
64
66
  **Bead:** <bead-id>
65
- **Mode:** [Quick/Deep]
67
+ **Created:** [date]
68
+ **Status:** To Do
69
+
70
+ ## Goal
71
+
72
+ [1-2 sentences: What exactly are we building and why?]
73
+
74
+ ## Scope
75
+
76
+ ### In-Scope:
77
+
78
+ - [What we ARE doing]
66
79
 
67
- ## Problem
80
+ ### Out-of-Scope:
68
81
 
69
- [1-2 sentences]
82
+ - [What we are NOT doing]
70
83
 
71
- ## Requirements
84
+ ## User Flow
72
85
 
73
- - [Requirement 1]
74
- - [Requirement 2]
86
+ 1. [Step 1: What user sees/does]
87
+ 2. [Step 2]
88
+ 3. [Step 3]
75
89
 
76
90
  ## Success Criteria
77
91
 
78
- - [ ] [Criterion 1]
79
- - [ ] [Criterion 2]
92
+ - [ ] [Specific, measurable criterion 1]
93
+ - [ ] [Specific, measurable criterion 2]
94
+ - [ ] [Specific, measurable criterion 3]
95
+
96
+ ## Dependencies
97
+
98
+ - [List any prerequisites or blocking tasks]
99
+
100
+ ## Notes
101
+
102
+ [Additional context or constraints]
80
103
  ```
81
104
 
105
+ For **Quick** mode, simplify: Goal, Success Criteria, Notes only.
106
+
82
107
  For **Deep** mode, add:
83
108
 
84
109
  ```markdown
85
- ## Scope
86
-
87
- **In:** [What we ARE doing]
88
- **Out:** [What we are NOT doing]
89
-
90
110
  ## Open Questions
91
111
 
92
112
  - [Question for research phase]
113
+
114
+ ## Technical Approach
115
+
116
+ [To be filled during /research phase]
93
117
  ```
94
118
 
95
- ## Phase 5: Report
119
+ ## Phase 5: Review Spec
120
+
121
+ Present the spec for approval:
122
+
123
+ ```
124
+ Spec Preview:
125
+ ━━━━━━━━━━━━━
126
+
127
+ [Show full spec.md content]
128
+
129
+ ━━━━━━━━━━━━━
130
+ Approve spec? (yes/modify)
131
+ ```
132
+
133
+ **STOP and wait for human response.**
134
+
135
+ If "modify": Iterate on spec based on feedback until approved.
136
+ If "yes": Proceed to report.
137
+
138
+ ## Phase 6: Report
96
139
 
97
140
  ```
98
141
  Created: <bead-id>
@@ -33,26 +33,55 @@ Save the bead ID for subsequent commands. Add the GitHub issue reference:
33
33
  bd edit <bead-id> --note "GitHub issue: #$ARGUMENTS"
34
34
  ```
35
35
 
36
- ## Implementation Plan
36
+ ## Create Spec from PRD Template
37
+
38
+ Use `.opencode/memory/_templates/prd.md` as the base structure.
37
39
 
38
40
  Save to `.beads/artifacts/<bead-id>/spec.md`:
39
41
 
40
- 1. **Files to change:** Identify affected code
41
- 2. **Testing strategy:** How to verify fix
42
- 3. **Risks/edge cases:** What could go wrong
42
+ ```markdown
43
+ # [Issue Title]
44
+
45
+ **Bead:** <bead-id>
46
+ **Created:** [date]
47
+ **Status:** To Do
48
+ **GitHub Issue:** #$ARGUMENTS
49
+
50
+ ## Goal
51
+
52
+ [What exactly are we fixing/building and why?]
53
+
54
+ ## Scope
55
+
56
+ ### In-Scope:
57
+
58
+ - [Files to change]
59
+ - [Specific functionality to fix/add]
43
60
 
44
- ## Action Plan
61
+ ### Out-of-Scope:
45
62
 
46
- 1. Create branch: `git checkout -b issue-$ARGUMENTS`
47
- 2. Implementation steps (ordered)
48
- 3. Testing approach
49
- 4. Documentation updates
63
+ - [What we are NOT touching]
50
64
 
51
- ## Acceptance Criteria
65
+ ## User Flow
52
66
 
53
- - [ ] Concrete deliverables
54
- - [ ] Test cases to verify
55
- - [ ] Performance considerations
67
+ 1. [How user encounters the issue]
68
+ 2. [Expected behavior after fix]
69
+
70
+ ## Success Criteria
71
+
72
+ - [ ] [Specific fix verified]
73
+ - [ ] [Test cases pass]
74
+ - [ ] [No regression]
75
+
76
+ ## Dependencies
77
+
78
+ - [List any prerequisites or blocking tasks]
79
+
80
+ ## Notes
81
+
82
+ - **Risks/edge cases:** [What could go wrong]
83
+ - **Testing strategy:** [How to verify fix]
84
+ ```
56
85
 
57
86
  ## Discovered Work
58
87
 
@@ -17,9 +17,12 @@ Read artifacts:
17
17
  ```bash
18
18
  cat .beads/artifacts/<bead-id>/spec.md
19
19
  cat .beads/artifacts/<bead-id>/research.md
20
+ cat .beads/artifacts/<bead-id>/design.md 2>/dev/null
20
21
  ```
21
22
 
22
- If missing: "Run `/research <bead-id>` first."
23
+ If spec.md missing: "Run `/create <bead-id>` first."
24
+ If research.md missing: "Run `/research <bead-id>` first."
25
+ If design.md exists: Resume from saved design options.
23
26
 
24
27
  ## Phase 2: Generate Design Options
25
28
 
@@ -68,7 +71,77 @@ Present 2-3 approaches:
68
71
  **Recommendation:** Option [A/B] because [reason].
69
72
  ```
70
73
 
71
- ## Phase 3: Get Approval
74
+ ## Phase 3: Save Design Document
75
+
76
+ Save design options to `.beads/artifacts/<bead-id>/design.md`:
77
+
78
+ ```markdown
79
+ # Design Options: [Title]
80
+
81
+ **Bead:** <bead-id>
82
+ **Date:** <date>
83
+ **Status:** Pending Approval
84
+
85
+ ## Problem Statement
86
+
87
+ [What we're solving - from spec.md]
88
+
89
+ ## Options Considered
90
+
91
+ ### Option A: [Name]
92
+
93
+ **Approach:** [1-2 sentence description]
94
+
95
+ **Changes:**
96
+
97
+ - `src/foo.ts` - [what changes]
98
+ - `src/bar.ts` - [what changes]
99
+
100
+ **Pros:**
101
+
102
+ - [pro 1]
103
+ - [pro 2]
104
+
105
+ **Cons:**
106
+
107
+ - [con 1]
108
+
109
+ **Effort:** [S/M/L]
110
+
111
+ ---
112
+
113
+ ### Option B: [Name]
114
+
115
+ **Approach:** [1-2 sentence description]
116
+
117
+ **Changes:**
118
+
119
+ - `src/baz.ts` - [what changes]
120
+
121
+ **Pros:**
122
+
123
+ - [pro 1]
124
+
125
+ **Cons:**
126
+
127
+ - [con 1]
128
+ - [con 2]
129
+
130
+ **Effort:** [S/M/L]
131
+
132
+ ---
133
+
134
+ ## Recommendation
135
+
136
+ Option [A/B] because [reason].
137
+
138
+ ## Decision
139
+
140
+ **Chosen:** [To be filled after approval]
141
+ **Rationale:** [To be filled after approval]
142
+ ```
143
+
144
+ ## Phase 4: Get Approval
72
145
 
73
146
  **STOP and wait for human response.**
74
147
 
@@ -78,7 +151,15 @@ Pick an option (A/B/C), modify, or "none" to propose alternatives.
78
151
 
79
152
  Do not proceed until user confirms.
80
153
 
81
- ## Phase 4: Create Plan
154
+ ## Phase 5: Update Design Decision
155
+
156
+ After approval, update `.beads/artifacts/<bead-id>/design.md`:
157
+
158
+ - Change **Status:** to `Approved`
159
+ - Fill in **Chosen:** with selected option
160
+ - Fill in **Rationale:** with user's reasoning
161
+
162
+ ## Phase 6: Create Plan
82
163
 
83
164
  After approval, write `.beads/artifacts/<bead-id>/plan.md`:
84
165
 
@@ -136,7 +217,7 @@ After approval, write `.beads/artifacts/<bead-id>/plan.md`:
136
217
  - [Risk 1] - [mitigation]
137
218
  ```
138
219
 
139
- ## Phase 5: Update Bead
220
+ ## Phase 7: Update Bead
140
221
 
141
222
  ```bash
142
223
  bd edit <bead-id> --note "Plan approved: [option name]. [step count] steps."
@@ -0,0 +1,39 @@
1
+ # Observation Template
2
+
3
+ **Type:** [decision | bugfix | feature | pattern | discovery | learning | warning]
4
+ **Created:** [timestamp]
5
+ **Bead:** [optional bead-id]
6
+ **Concepts:** `tag1`, `tag2`, `tag3`
7
+ **Files:** `path/to/file1.ts`, `path/to/file2.ts`
8
+
9
+ ---
10
+
11
+ ## Context
12
+
13
+ [What situation prompted this observation? What were you working on?]
14
+
15
+ ## Observation
16
+
17
+ [The core insight, decision, or learning. Be specific and actionable.]
18
+
19
+ ## Rationale
20
+
21
+ [Why is this important? What alternatives were considered?]
22
+
23
+ ## Future Reference
24
+
25
+ [How should this inform future decisions? Any follow-up actions?]
26
+
27
+ ---
28
+
29
+ ## Type Definitions
30
+
31
+ | Type | Icon | Use For |
32
+ | --------- | ---- | ------------------------------------ |
33
+ | decision | 🎯 | Architectural or design choices made |
34
+ | bugfix | 🐛 | Bug root causes and solutions |
35
+ | feature | ✨ | Feature implementation notes |
36
+ | pattern | 🔄 | Recurring patterns or conventions |
37
+ | discovery | 💡 | Unexpected findings or insights |
38
+ | learning | 📚 | Lessons learned from experience |
39
+ | warning | ⚠️ | Pitfalls to avoid, gotchas |