opencodekit 0.2.7 → 0.3.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.
package/README.md CHANGED
@@ -82,10 +82,16 @@ build (Primary Orchestrator - 70% of work)
82
82
  ├→ @orchestrator (Multi-agent coordination)
83
83
  └→ @general (Fallback)
84
84
 
85
+ Background Plugins:
86
+ • enforcer (TODO completion enforcement)
87
+ • compactor (Context usage warnings at 70/85/95%)
88
+ • truncator (Dynamic output truncation)
89
+
85
90
  Supporting:
86
91
  • 24 Skills (loaded via commands: 8 core, 7 stack, 9 specialized)
87
92
  • 45+ Commands (workflow shortcuts, includes /handoff)
88
93
  • 5 MCP Services (context7, exa, gkg, gh_grep, figma*) + augment-context-engine
94
+ • Custom Tools (memory-*, observation, ast-grep)
89
95
  • Beads task tracking (`bd` CLI for multi-session workflows)
90
96
  • Manual Handoffs (clean phase transitions)
91
97
  ```
@@ -227,6 +233,8 @@ You've successfully set up OpenCodeKit when:
227
233
  - ✅ Delegation is clear (build → specialized subagents)
228
234
  - ✅ `/handoff` creates portable bundles (.opencode/memory/handoffs/)
229
235
  - ✅ MCP services configured (6 total: 5 enabled, 1 optional)
236
+ - ✅ Background plugins active (enforcer, compactor, truncator)
237
+ - ✅ Custom tools available (memory-\*, observation, ast-grep)
230
238
  - ✅ Environment variables set (.opencode/.env with API keys)
231
239
 
232
240
  ---
@@ -235,13 +243,13 @@ You've successfully set up OpenCodeKit when:
235
243
 
236
244
  - [OpenCode Docs](https://opencode.ai/docs/)
237
245
  - [Multi-Agent Pattern](https://github.com/disler/opencode-hooks-multi-agent-observability)
238
- - [Handoff Workflow Guide](.opencode/INTEGRATION_OVERVIEW.md)
246
+ - [Handoff Workflow Guide](.opencode/command/handoff.md)
239
247
  - [MCP Services Setup](.opencode/README.md)
240
248
 
241
249
  ## 📚 Documentation
242
250
 
243
251
  - **CLI Tool**: [CLI.md](./CLI.md) - `ock` command reference (init, setup, agent, skill)
244
- - **Architecture Guide**: `.opencode/INTEGRATION_OVERVIEW.md` - Two-layer system (Memory + Backlog + Git)
252
+ - **Architecture Guide**: `.opencode/AGENTS.md` - Global rules and tool priority
245
253
  - **MCP Services Setup**: `.opencode/README.md` - Complete environment setup
246
254
  - **Handoff Bundles**: `.opencode/command/handoff.md` - Clean phase transitions
247
255
  - **Custom Commands**: `.opencode/command/` - All 45+ workflow commands
@@ -252,9 +260,9 @@ You've successfully set up OpenCodeKit when:
252
260
 
253
261
  ---
254
262
 
255
- **OpenCodeKit v2.0**
256
- **Architecture**: Two-layer (Memory + Backlog + Git)
257
- **New**: Manual handoff workflow + 6 MCP services + 24 skills system + semantic memory search
263
+ **OpenCodeKit v0.3.0**
264
+ **Architecture**: Two-layer (Memory + Beads + Git)
265
+ **New in v0.3.0**: Background plugins (enforcer, compactor, truncator) + ast-grep semantic code tool
258
266
  **Ready for**: Daily production use
259
267
 
260
268
  Enjoy your streamlined agent system with clean phase transitions! 🚀
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.7",
753
+ version: "0.3.0",
754
754
  description: "CLI tool for bootstrapping and managing OpenCodeKit projects",
755
755
  type: "module",
756
756
  repository: {
@@ -63,32 +63,44 @@
63
63
 
64
64
  ## Tool Priority
65
65
 
66
- **GKG tools → Built-in tools**
66
+ **GKG tools → AST tools → Built-in tools**
67
67
 
68
- | Priority | Tools | Use For |
69
- | -------- | --------------------------------- | -------------------------------- |
70
- | 1 | `gkg_search_codebase_definitions` | Find symbols by name |
71
- | 1 | `gkg_get_references` | Find all usages |
72
- | 1 | `gkg_repo_map` | API-level overview |
73
- | 2 | `grep`, `glob` | Pattern matching, file discovery |
74
- | 2 | `read`, `edit`, `write` | File operations |
68
+ | Priority | Tools | Use For |
69
+ | -------- | --------------------------------- | ---------------------------------- |
70
+ | 1 | `gkg_search_codebase_definitions` | Find symbols by name |
71
+ | 1 | `gkg_get_references` | Find all usages |
72
+ | 1 | `gkg_repo_map` | API-level overview |
73
+ | 2 | `ast-grep` | Semantic code search/replace (AST) |
74
+ | 3 | `grep`, `glob` | Pattern matching, file discovery |
75
+ | 3 | `read`, `edit`, `write` | File operations |
75
76
 
76
77
  **Rule**: Always `read` before `edit` to verify content.
77
78
 
78
- ## Research Tools
79
+ ### AST-Grep Usage
80
+
81
+ Semantic code operations - smarter than regex:
82
+
83
+ ```bash
84
+ # Search patterns
85
+ ast-grep pattern="console.log($$$)" # Find all console.log
86
+ ast-grep pattern="async function $NAME($$$) { $$$ }" # Find async functions
87
+ ast-grep pattern="const [$S, $SET] = useState($$$)" # Find React hooks
88
+
89
+ # Replace (dry run by default)
90
+ ast-grep pattern="oldFunc($$$)" rewrite="newFunc($$$)" dryRun=true
91
+ ast-grep pattern="fetch($URL)" rewrite="await fetch($URL)" dryRun=false
92
+ ```
79
93
 
80
- | Tool | Use For | Performance Notes |
81
- | ------------------------------------------- | ------------------------------------------------------ | ---------------------------------- |
82
- | `augment-context-engine_codebase-retrieval` | Codebase understanding, architecture analysis | ~74s avg, 200K context, 67% CCEval |
83
- | `context7` | Library docs (try first) | Fast, external APIs |
84
- | `websearch` | Docs not in Context7, recent releases, troubleshooting | General web search |
85
- | `codesearch` | Real implementation patterns from GitHub | Public repo examples |
86
- | `webfetch` | Specific URL user provided | Direct URL fetch |
94
+ **Pattern syntax**: `$NAME` = single node, `$$$` = zero or more nodes
87
95
 
88
- **Augment Context Engine Best Practices**:
96
+ ## Research Tools
89
97
 
90
- - **When to use**: Complex queries like "How does authentication work?", "What's the architecture?", "Where is X implemented?"
91
- - **When NOT to use**: Simple lookups ("find function foo"), specific file reads, known symbol references
98
+ | Tool | Use For | Performance Notes |
99
+ | ------------ | ------------------------------------------------------ | -------------------- |
100
+ | `context7` | Library docs (try first) | Fast, external APIs |
101
+ | `websearch` | Docs not in Context7, recent releases, troubleshooting | General web search |
102
+ | `codesearch` | Real implementation patterns from GitHub | Public repo examples |
103
+ | `webfetch` | Specific URL user provided | Direct URL fetch |
92
104
 
93
105
  ## Error Handling
94
106
 
@@ -149,6 +161,22 @@ memory-search(query: "session", type: "handoffs")
149
161
 
150
162
  - Task tracking uses Beads (`bd` CLI)
151
163
 
164
+ ## Active Plugins
165
+
166
+ Plugins run automatically in the background:
167
+
168
+ | Plugin | What it does |
169
+ | ------------- | ----------------------------------------------------------- |
170
+ | **enforcer** | OS notification when session idles with incomplete TODOs |
171
+ | **compactor** | Warns at 70%, 85%, 95% context usage - prevents rushed work |
172
+ | **truncator** | Dynamic output truncation based on context remaining |
173
+
174
+ **Compactor thresholds**:
175
+
176
+ - 70% - Gentle reminder, still plenty of room
177
+ - 85% - Consider pruning or summarizing
178
+ - 95% - Critical: prune immediately or start new session
179
+
152
180
  ## Session Management
153
181
 
154
182
  **Philosophy**: Short sessions (<150k tokens) beat long bloated ones. Agents get worse with too much context. Cost is exponential.
@@ -38,12 +38,12 @@ opencode
38
38
  ├── README.md # This file
39
39
  ├── opencode.json # OpenCode configuration
40
40
  ├── AGENTS.md # Global agent rules
41
- ├── INTEGRATION_OVERVIEW.md # Architecture docs
42
41
 
43
42
  ├── agent/ # Custom agents (5 total)
44
43
  ├── command/ # Custom commands (26 workflows)
45
44
  ├── superpowers/skills/ # Domain expertise (16 skills)
46
- ├── tool/ # Custom MCP tools
45
+ ├── tool/ # Custom MCP tools (memory-*, observation, ast-grep)
46
+ ├── plugin/ # Background plugins (enforcer, compactor, truncator)
47
47
  └── memory/ # Persistent context
48
48
  ```
49
49
 
@@ -135,7 +135,55 @@ Memory (Permanent) → Beads (Multi-session) → Git (Audit Trail)
135
135
  **Beads:** Multi-session tasks with spec/research/plan/review artifacts
136
136
  **Git:** Automatic execution history
137
137
 
138
- **See:** `INTEGRATION_OVERVIEW.md` for complete architecture
138
+ **See:** `AGENTS.md` for global rules and tool priority
139
+
140
+ ---
141
+
142
+ ## Active Plugins (Background)
143
+
144
+ Plugins run automatically in every session:
145
+
146
+ | Plugin | What it does |
147
+ | ------------- | ----------------------------------------------------------- |
148
+ | **enforcer** | OS notification when session idles with incomplete TODOs |
149
+ | **compactor** | Warns at 70%, 85%, 95% context usage - prevents rushed work |
150
+ | **truncator** | Dynamic output truncation based on context remaining |
151
+
152
+ **Compactor thresholds**:
153
+
154
+ - 70% - Gentle reminder, still plenty of room
155
+ - 85% - Consider pruning or summarizing
156
+ - 95% - Critical: prune immediately or start new session
157
+
158
+ ---
159
+
160
+ ## Custom Tools
161
+
162
+ | Tool | Purpose |
163
+ | ----------------- | ---------------------------------------- |
164
+ | **memory-read** | Load previous context, templates |
165
+ | **memory-update** | Save learnings, handoffs |
166
+ | **memory-search** | Search across all memory files |
167
+ | **observation** | Create structured observations |
168
+ | **ast-grep** | Semantic code search/replace (AST-based) |
169
+
170
+ ### AST-Grep Usage
171
+
172
+ Semantic code operations - smarter than regex:
173
+
174
+ ```bash
175
+ # Search patterns
176
+ ast-grep pattern="console.log($$$)" # Find all console.log
177
+ ast-grep pattern="async function $NAME($$$) { $$$ }" # Find async functions
178
+ ast-grep pattern="const [$S, $SET] = useState($$$)" # Find React hooks
179
+
180
+ # Replace (dry run by default)
181
+ ast-grep pattern="oldFunc($$$)" rewrite="newFunc($$$)" dryRun=true
182
+ ```
183
+
184
+ **Pattern syntax**: `$NAME` = single node, `$$$` = zero or more nodes
185
+
186
+ **Requires**: `brew install ast-grep` or `cargo install ast-grep --locked`
139
187
 
140
188
  ---
141
189
 
@@ -208,6 +256,23 @@ Result: Dashboard with shadcn/ui
208
256
 
209
257
  ## Troubleshooting
210
258
 
259
+ **"Notifications not working" (WSL/Windows):**
260
+
261
+ If running OpenCode in WSL, notifications require additional setup:
262
+
263
+ ```bash
264
+ # 1. Install dependencies
265
+ sudo apt install -y libnotify-bin dunst
266
+
267
+ # 2. Start dunst (run each time you open WSL terminal)
268
+ dunst >/dev/null 2>&1 &
269
+
270
+ # 3. Or add to ~/.bashrc for auto-start:
271
+ if ! pgrep -x dunst >/dev/null; then
272
+ dunst >/dev/null 2>&1 &
273
+ fi
274
+ ```
275
+
211
276
  **"API key not found":**
212
277
 
213
278
  - Check .env location (.opencode/.env or ~/.config/opencode/.env)
@@ -260,10 +325,11 @@ Result: Dashboard with shadcn/ui
260
325
  - **Context7 API:** https://context7.com
261
326
  - **Exa API:** https://exa.ai
262
327
  - **Skills Documentation:** `superpowers/skills/`
263
- - **Architecture Guide:** `INTEGRATION_OVERVIEW.md`
328
+ - **Architecture Guide:** `AGENTS.md`
264
329
 
265
330
  ---
266
331
 
267
- **OpenCodeKit Template v2.2**
332
+ **OpenCodeKit v0.3.0**
268
333
  **Architecture:** Two-Layer (Memory + Beads + Git)
269
- **Last Updated:** December 4, 2025
334
+ **New in v0.3.0:** Background plugins (enforcer, compactor, truncator) + ast-grep tool
335
+ **Last Updated:** December 17, 2025
@@ -15,10 +15,13 @@ tools:
15
15
  websearch: true
16
16
  codesearch: true
17
17
  gkg*: true
18
+ ast-grep*: true
18
19
  context7*: true
19
20
  gh_grep*: true
20
21
  memory-read: true
21
22
  memory-update: true
23
+ memory-search: true
24
+ observation: true
22
25
  ---
23
26
 
24
27
  # Build Agent
@@ -44,8 +47,9 @@ Primary orchestrator. Execute-first. Autonomous task completion until resolved.
44
47
  ## Tool Priority
45
48
 
46
49
  1. **GKG tools** for code search (definitions, references, repo map)
47
- 2. **Built-in tools** for pattern matching (grep, glob, read)
48
- 3. **Bash** for running tests, builds, commands
50
+ 2. **AST-Grep** for semantic code search/replace
51
+ 3. **Built-in tools** for pattern matching (grep, glob, read)
52
+ 4. **Bash** for running tests, builds, commands
49
53
 
50
54
  ## Anti-Hallucination
51
55
 
@@ -14,11 +14,14 @@ tools:
14
14
  webfetch: true
15
15
  websearch: true
16
16
  gkg*: true
17
+ ast-grep*: true
17
18
  context7*: true
18
19
  gh_grep*: true
19
20
  codesearch: true
20
21
  memory-read: true
21
22
  memory-update: true
23
+ memory-search: true
24
+ observation: true
22
25
  ---
23
26
 
24
27
  # Rush Agent
@@ -42,14 +45,15 @@ Fast execute-first agent. Speed over depth. Delegate anything complex.
42
45
 
43
46
  ## Tool Priority
44
47
 
45
- **GKG tools FIRST for code search, then built-in tools.**
48
+ **GKG tools FIRST, then AST-Grep, then built-in tools.**
46
49
 
47
- | Tool | Use For |
48
- | --------------------------------- | --------------------------- |
49
- | `gkg_search_codebase_definitions` | Find symbols by name |
50
- | `gkg_get_references` | Find all usages |
51
- | `grep` | Text strings, config values |
52
- | `glob` | Find files by pattern |
50
+ | Tool | Use For |
51
+ | --------------------------------- | ---------------------------- |
52
+ | `gkg_search_codebase_definitions` | Find symbols by name |
53
+ | `gkg_get_references` | Find all usages |
54
+ | `ast-grep` | Semantic code search/replace |
55
+ | `grep` | Text strings, config values |
56
+ | `glob` | Find files by pattern |
53
57
 
54
58
  ## Pre-Action Checks
55
59
 
@@ -1,11 +1,13 @@
1
1
  ---
2
- description: Brainstorm ideas into designs
2
+ description: Brainstorm and explore ideas with code
3
3
  argument-hint: "[topic]"
4
- agent: review
4
+ agent: build
5
5
  ---
6
6
 
7
7
  # Brainstorm: $ARGUMENTS
8
8
 
9
9
  use_skill("brainstorming")
10
10
 
11
- Follow the skill exactly. If bead exists, use `.beads/artifacts/<bead-id>/spec.md` as constraints.
11
+ Follow the skill for ideation, then explore the codebase to validate feasibility. Create quick prototypes or code spikes if helpful.
12
+
13
+ If bead exists, use `.beads/artifacts/<bead-id>/spec.md` as constraints.
@@ -1,15 +1,17 @@
1
1
  ---
2
- description: Design with brainstorming
2
+ description: UI/UX visual design and aesthetics
3
3
  argument-hint: "[topic or task-id]"
4
4
  agent: designer
5
5
  ---
6
6
 
7
7
  # Design: $ARGUMENTS
8
8
 
9
- use_skill("brainstorming")
9
+ use_skill("frontend-aesthetics")
10
10
 
11
- **Quick design:** Follow skill, apply YAGNI ruthlessly.
11
+ Focus on visual design: typography, color, spacing, layout, accessibility. Avoid AI slop aesthetics.
12
12
 
13
- **Full design:** After brainstorming, save to `.opencode/memory/research/YYYY-MM-DD-$ARGUMENTS-design.md`
13
+ **Quick design:** Provide actionable design recommendations.
14
+
15
+ **Full design:** Save to `.opencode/memory/research/YYYY-MM-DD-$ARGUMENTS-design.md`
14
16
 
15
17
  If bead exists, design within `.beads/artifacts/<bead-id>/spec.md` constraints.
@@ -1,43 +1,43 @@
1
1
  {
2
- // Enable or disable the plugin
3
- "enabled": true,
4
- // Enable debug logging to ~/.config/opencode/logs/dcp/
5
- "debug": false,
6
- // Show toast when plugin updates are available
7
- "showUpdateToasts": true,
8
- // Summary display: "off", "minimal", or "detailed"
9
- // Note: "detailed" may cause issues with extended thinking models
10
- "pruningSummary": "off",
11
- "strategies": {
12
- // Deduplication runs automatically on every request
13
- "deduplication": {
14
- "enabled": true,
15
- "protectedTools": []
16
- },
17
- // Exposes prune tool to the LLM for manual context management
18
- "pruneTool": {
19
- "enabled": true,
20
- "protectedTools": [
21
- "task",
22
- "todowrite",
23
- "todoread",
24
- "prune",
25
- "batch",
26
- "write",
27
- "edit"
28
- ],
29
- // Nudge the AI to prune periodically
30
- "nudge": {
31
- "enabled": true,
32
- "frequency": 10
33
- }
34
- },
35
- // LLM-based semantic analysis on idle (legacy, resource intensive)
36
- "onIdle": {
37
- "enabled": false,
38
- "showModelErrorToasts": true,
39
- "strictModelSelection": false,
40
- "protectedTools": []
41
- }
42
- }
2
+ // Enable or disable the plugin
3
+ "enabled": true,
4
+ // Enable debug logging to ~/.config/opencode/logs/dcp/
5
+ "debug": false,
6
+ // Show toast when plugin updates are available
7
+ "showUpdateToasts": true,
8
+ // Summary display: "off", "minimal", or "detailed"
9
+ // Note: "detailed" may cause issues with extended thinking models
10
+ "pruningSummary": "off",
11
+ "strategies": {
12
+ // Deduplication runs automatically on every request
13
+ "deduplication": {
14
+ "enabled": true,
15
+ "protectedTools": [],
16
+ },
17
+ // Exposes prune tool to the LLM for manual context management
18
+ "pruneTool": {
19
+ "enabled": true,
20
+ "protectedTools": [
21
+ "task",
22
+ "todowrite",
23
+ "todoread",
24
+ "prune",
25
+ "batch",
26
+ "write",
27
+ "edit",
28
+ ],
29
+ // Nudge the AI to prune periodically
30
+ "nudge": {
31
+ "enabled": true,
32
+ "frequency": 10,
33
+ },
34
+ },
35
+ // LLM-based semantic analysis on idle (legacy, resource intensive)
36
+ "onIdle": {
37
+ "enabled": false,
38
+ "showModelErrorToasts": true,
39
+ "strictModelSelection": true,
40
+ "protectedTools": [],
41
+ },
42
+ },
43
43
  }