clikit-plugin 0.2.28 → 0.2.30
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/AGENTS.md +30 -32
- package/README.md +45 -26
- package/command/create.md +37 -122
- package/command/handoff.md +45 -69
- package/command/init.md +125 -48
- package/command/plan.md +101 -159
- package/command/research.md +1 -1
- package/command/resume.md +34 -55
- package/command/vision.md +132 -64
- package/dist/.tsbuildinfo +1 -0
- package/dist/agents/index.d.ts.map +1 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +95 -11
- package/dist/clikit.schema.json +245 -0
- package/dist/commands/index.d.ts.map +1 -1
- package/dist/config.d.ts +43 -43
- package/dist/config.d.ts.map +1 -1
- package/dist/hooks/git-guard.test.d.ts +2 -0
- package/dist/hooks/git-guard.test.d.ts.map +1 -0
- package/dist/hooks/index.d.ts +3 -14
- package/dist/hooks/index.d.ts.map +1 -1
- package/dist/hooks/memory-digest.d.ts +27 -0
- package/dist/hooks/memory-digest.d.ts.map +1 -0
- package/dist/hooks/security-check.test.d.ts +2 -0
- package/dist/hooks/security-check.test.d.ts.map +1 -0
- package/dist/hooks/todo-beads-sync.d.ts +23 -0
- package/dist/hooks/todo-beads-sync.d.ts.map +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +740 -909
- package/dist/skills/index.d.ts.map +1 -1
- package/dist/tools/beads-memory-sync.d.ts.map +1 -1
- package/dist/tools/context-summary.d.ts.map +1 -1
- package/dist/tools/memory-db.d.ts +12 -0
- package/dist/tools/memory-db.d.ts.map +1 -0
- package/dist/tools/memory.d.ts.map +1 -1
- package/dist/tools/observation.d.ts.map +1 -1
- package/memory/_templates/plan.md +18 -0
- package/package.json +7 -4
- package/src/agents/AGENTS.md +11 -39
- package/src/agents/build.md +152 -94
- package/src/agents/index.ts +31 -5
- package/src/agents/looker.md +5 -0
- package/src/agents/oracle.md +2 -0
- package/src/agents/plan.md +247 -44
- package/src/agents/review.md +1 -0
- package/src/agents/vision.md +251 -115
- package/dist/cli.test.d.ts +0 -2
- package/dist/cli.test.d.ts.map +0 -1
- package/dist/hooks/auto-format.d.ts +0 -30
- package/dist/hooks/auto-format.d.ts.map +0 -1
- package/dist/hooks/comment-checker.d.ts +0 -17
- package/dist/hooks/comment-checker.d.ts.map +0 -1
- package/dist/hooks/compaction.d.ts +0 -60
- package/dist/hooks/compaction.d.ts.map +0 -1
- package/dist/hooks/env-context.d.ts +0 -43
- package/dist/hooks/env-context.d.ts.map +0 -1
- package/dist/hooks/ritual-enforcer.d.ts +0 -29
- package/dist/hooks/ritual-enforcer.d.ts.map +0 -1
- package/dist/hooks/session-notification.d.ts +0 -23
- package/dist/hooks/session-notification.d.ts.map +0 -1
- package/dist/hooks/session-notification.test.d.ts +0 -2
- package/dist/hooks/session-notification.test.d.ts.map +0 -1
- package/dist/hooks/typecheck-gate.d.ts +0 -31
- package/dist/hooks/typecheck-gate.d.ts.map +0 -1
- package/memory/handoffs/2026-02-15-complete-audit.md +0 -136
- package/memory/handoffs/2026-02-15-complete-fix.md +0 -140
- package/memory/handoffs/2026-02-15-importmeta-fix.md +0 -121
- package/memory/handoffs/2026-02-15-installing.md +0 -90
- package/memory/handoffs/2026-02-15-plugin-install-fix.md +0 -140
- package/memory/handoffs/2026-02-15-runtime-fixes.md +0 -80
- package/memory/plans/2026-02-16-plugin-install.md +0 -195
- package/memory/research/2026-02-16-opencode-plugin-alignment.md +0 -128
package/command/init.md
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
-
description: Initialize CliKit plugin
|
|
2
|
+
description: Initialize CliKit plugin and generate a well-crafted AGENTS.md for the project.
|
|
3
3
|
agent: build
|
|
4
4
|
---
|
|
5
5
|
|
|
@@ -7,20 +7,15 @@ You are the **Build Agent**. Execute the `/init` command.
|
|
|
7
7
|
|
|
8
8
|
## Your Task
|
|
9
9
|
|
|
10
|
-
Set up the
|
|
10
|
+
Set up CliKit AND generate a high-quality `AGENTS.md` file. The AGENTS.md is the highest-leverage file in the project — it goes into every single session. Craft it carefully.
|
|
11
11
|
|
|
12
12
|
## Process
|
|
13
13
|
|
|
14
14
|
### 1. Check Prerequisites
|
|
15
15
|
|
|
16
16
|
```bash
|
|
17
|
-
# Check if .opencode/ already exists
|
|
18
17
|
ls -la .opencode/ 2>/dev/null
|
|
19
|
-
|
|
20
|
-
# Check if package.json exists
|
|
21
18
|
ls package.json 2>/dev/null
|
|
22
|
-
|
|
23
|
-
# Check package manager
|
|
24
19
|
ls bun.lockb pnpm-lock.yaml yarn.lock 2>/dev/null
|
|
25
20
|
```
|
|
26
21
|
|
|
@@ -29,7 +24,6 @@ If `.opencode/` already exists with CliKit files, warn user and ask before overw
|
|
|
29
24
|
### 2. Install Plugin
|
|
30
25
|
|
|
31
26
|
```bash
|
|
32
|
-
# Detect package manager and install
|
|
33
27
|
bun add -d clikit-plugin 2>/dev/null || \
|
|
34
28
|
pnpm add -D clikit-plugin 2>/dev/null || \
|
|
35
29
|
npm install -D clikit-plugin 2>/dev/null
|
|
@@ -46,67 +40,150 @@ export default CliKitPlugin;
|
|
|
46
40
|
|
|
47
41
|
### 4. Create Default Configuration
|
|
48
42
|
|
|
49
|
-
Create `.opencode/clikit.config.json
|
|
50
|
-
|
|
51
|
-
```json
|
|
52
|
-
{
|
|
53
|
-
"$schema": "https://unpkg.com/clikit-plugin/schema.json",
|
|
54
|
-
"disabled_agents": [],
|
|
55
|
-
"disabled_commands": [],
|
|
56
|
-
"hooks": {
|
|
57
|
-
"session_logging": true,
|
|
58
|
-
"todo_enforcer": {
|
|
59
|
-
"enabled": true,
|
|
60
|
-
"warn_on_incomplete": true
|
|
61
|
-
},
|
|
62
|
-
"empty_message_sanitizer": {
|
|
63
|
-
"enabled": true
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
```
|
|
43
|
+
Create `.opencode/clikit.config.json` with sensible defaults (see existing template).
|
|
68
44
|
|
|
69
45
|
### 5. Create Memory Directory Structure
|
|
70
46
|
|
|
71
47
|
```bash
|
|
72
|
-
mkdir -p .opencode/memory/{specs,plans,research,reviews,handoffs,prds,beads}
|
|
48
|
+
mkdir -p .opencode/memory/{specs,plans,research,reviews,handoffs,prds,beads,_templates}
|
|
73
49
|
```
|
|
74
50
|
|
|
75
|
-
### 6.
|
|
51
|
+
### 6. Generate AGENTS.md
|
|
52
|
+
|
|
53
|
+
**This is the most important step.** The AGENTS.md file goes into EVERY session. Follow these principles:
|
|
54
|
+
|
|
55
|
+
#### 6a. Explore the Project First (parallel)
|
|
56
|
+
|
|
57
|
+
Fire these immediately to understand the project:
|
|
58
|
+
|
|
59
|
+
```
|
|
60
|
+
Explore: "Identify: 1) Language/runtime (check package.json, Cargo.toml, go.mod, pyproject.toml, etc.) 2) Framework (Next.js, Express, FastAPI, etc.) 3) Package manager (bun, pnpm, npm, yarn, cargo, pip) 4) Build command 5) Test command 6) Lint command"
|
|
61
|
+
Explore: "Map top-level structure. What are the main directories? Is this a monorepo? What are the apps vs packages vs shared code?"
|
|
62
|
+
Explore: "Find entry points, main config files, and any existing AGENTS.md/CLAUDE.md/CONTRIBUTING.md/README.md with project conventions."
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
#### 6b. Write AGENTS.md Following Best Practices
|
|
66
|
+
|
|
67
|
+
Write to `AGENTS.md` in the project root. Follow these rules strictly:
|
|
68
|
+
|
|
69
|
+
**TARGET: Under 60 lines. Every line must be universally applicable to every session.**
|
|
70
|
+
|
|
71
|
+
**Structure — WHAT / WHY / HOW:**
|
|
72
|
+
|
|
73
|
+
```markdown
|
|
74
|
+
# [Project Name]
|
|
75
|
+
|
|
76
|
+
[1-2 sentences: WHAT this project is and WHY it exists. Be specific — not "a web app" but "a real-time collaboration platform for design teams using WebSocket sync".]
|
|
77
|
+
|
|
78
|
+
## Stack
|
|
79
|
+
|
|
80
|
+
[Language, runtime, framework, key libraries. One line each, no fluff.]
|
|
81
|
+
|
|
82
|
+
## Project Structure
|
|
83
|
+
|
|
84
|
+
[Map the top-level directories. For monorepos, explain what each app/package does. Use a compact tree — max 10-15 lines. Focus on WHERE things are, not what every file does.]
|
|
85
|
+
|
|
86
|
+
## Development
|
|
87
|
+
|
|
88
|
+
[Only the commands an agent needs for ANY task. Build, test, typecheck, lint, dev server. Nothing task-specific.]
|
|
89
|
+
|
|
90
|
+
```bash
|
|
91
|
+
[package-manager] install
|
|
92
|
+
[package-manager] run build
|
|
93
|
+
[package-manager] run test
|
|
94
|
+
[package-manager] run lint
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
## Where to Find More
|
|
98
|
+
|
|
99
|
+
[Progressive disclosure — point to files, don't inline their contents. Only include files that actually exist in the project.]
|
|
100
|
+
|
|
101
|
+
- Architecture decisions: [path or "ask the team"]
|
|
102
|
+
- API patterns: [path]
|
|
103
|
+
- Testing conventions: [path]
|
|
104
|
+
- Contributing guide: [path]
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
#### 6c. What NOT to Include
|
|
108
|
+
|
|
109
|
+
Applying the blog's principles strictly:
|
|
110
|
+
|
|
111
|
+
- ❌ **No code style rules** — that's what linters and formatters do. Hooks handle auto-format and typecheck.
|
|
112
|
+
- ❌ **No task-specific instructions** — "how to create a database migration" doesn't belong. Put that in a separate doc and point to it.
|
|
113
|
+
- ❌ **No model/agent details** — agents know their own config. Don't list all 10 agents and their models.
|
|
114
|
+
- ❌ **No inline code snippets** — they go stale. Use `file:line` pointers instead.
|
|
115
|
+
- ❌ **No exhaustive command lists** — agent can discover commands. Only include the core workflow.
|
|
116
|
+
- ❌ **No "rules" that are just good engineering** — "write clean code" wastes instruction budget. The agent already knows.
|
|
117
|
+
- ❌ **No skill recommendations** — that's task-specific. Skills are discovered at task time.
|
|
118
|
+
|
|
119
|
+
#### 6d. What TO Include (universally applicable)
|
|
120
|
+
|
|
121
|
+
- ✅ **What the project IS** — 1-2 sentences, specific.
|
|
122
|
+
- ✅ **Tech stack** — language, runtime, framework, key deps.
|
|
123
|
+
- ✅ **Project map** — where things live (especially monorepos).
|
|
124
|
+
- ✅ **Essential commands** — build, test, lint, dev server.
|
|
125
|
+
- ✅ **Progressive disclosure pointers** — "Read X for Y" references to existing docs.
|
|
126
|
+
- ✅ **Non-obvious conventions** — only things the agent would get WRONG without being told (e.g., "We use Bun, not Node" or "Database migrations use Drizzle push, not migrate").
|
|
127
|
+
- ✅ **Verification commands** — how to confirm changes work.
|
|
128
|
+
|
|
129
|
+
### 7. If AGENTS.md Already Exists
|
|
130
|
+
|
|
131
|
+
If the project already has an `AGENTS.md` or `CLAUDE.md`:
|
|
132
|
+
|
|
133
|
+
1. Read it first
|
|
134
|
+
2. Audit it against the blog principles (concise? universally applicable? progressive disclosure?)
|
|
135
|
+
3. Propose improvements to the user — don't overwrite without asking
|
|
136
|
+
4. If user approves, rewrite following the principles above
|
|
137
|
+
|
|
138
|
+
### 8. Verify Setup
|
|
76
139
|
|
|
77
140
|
- Check that plugin loads correctly
|
|
78
141
|
- Verify agents are available
|
|
79
|
-
- Verify
|
|
142
|
+
- Verify AGENTS.md exists and is under 60 lines
|
|
143
|
+
- Count instructions in AGENTS.md — warn if over 30 (LLMs reliably follow ~150 instructions, Claude Code's system prompt already uses ~50)
|
|
80
144
|
|
|
81
|
-
###
|
|
145
|
+
### 9. Report
|
|
82
146
|
|
|
83
147
|
```
|
|
84
148
|
## CliKit Initialized
|
|
85
149
|
|
|
86
|
-
✅ Plugin installed
|
|
150
|
+
✅ Plugin installed
|
|
87
151
|
✅ Entry point: .opencode/index.ts
|
|
88
152
|
✅ Config: .opencode/clikit.config.json
|
|
89
153
|
✅ Memory directories created
|
|
154
|
+
✅ AGENTS.md generated ([N] lines, [M] instructions)
|
|
90
155
|
|
|
91
|
-
###
|
|
92
|
-
[
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
[
|
|
156
|
+
### AGENTS.md Quality
|
|
157
|
+
- Lines: [N] (target: <60)
|
|
158
|
+
- Instructions: [M] (target: <30, budget shared with system prompt)
|
|
159
|
+
- Progressive disclosure: [Y/N]
|
|
160
|
+
- Task-specific content: [none found / WARNING: found N task-specific items]
|
|
96
161
|
|
|
97
162
|
### Next Steps
|
|
98
|
-
1.
|
|
99
|
-
2.
|
|
100
|
-
3.
|
|
163
|
+
1. Review AGENTS.md — every line matters, it affects every session
|
|
164
|
+
2. Run `/create` to start a new feature
|
|
165
|
+
3. Customize `.opencode/clikit.config.json` as needed
|
|
101
166
|
```
|
|
102
167
|
|
|
103
|
-
##
|
|
168
|
+
## AGENTS.md Quality Principles (from humanlayer.dev)
|
|
104
169
|
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
170
|
+
1. **Less is more** — frontier models follow ~150 instructions reliably. System prompt uses ~50. Your AGENTS.md gets ~100 max. Each unnecessary instruction degrades ALL instructions uniformly.
|
|
171
|
+
2. **Universally applicable only** — if it doesn't matter for EVERY session, it doesn't belong here.
|
|
172
|
+
3. **Progressive disclosure** — point to detailed docs, don't inline them. The agent reads them only when relevant.
|
|
173
|
+
4. **Not a linter** — never put code style in AGENTS.md. Use formatters, hooks, and tooling.
|
|
174
|
+
5. **Pointers over copies** — reference `file:line`, not code snippets. Snippets go stale.
|
|
175
|
+
6. **Carefully crafted** — this is the highest leverage point. Every line either helps or hurts.
|
|
176
|
+
|
|
177
|
+
## Rules
|
|
111
178
|
|
|
112
|
-
|
|
179
|
+
- ✅ ALWAYS explore the project before generating AGENTS.md
|
|
180
|
+
- ✅ ALWAYS keep AGENTS.md under 60 lines
|
|
181
|
+
- ✅ ALWAYS use WHAT/WHY/HOW structure
|
|
182
|
+
- ✅ ALWAYS use progressive disclosure (pointers, not copies)
|
|
183
|
+
- ✅ ALWAYS verify the final instruction count
|
|
184
|
+
- ✅ ALWAYS check for existing AGENTS.md before overwriting
|
|
185
|
+
- ❌ NEVER put code style rules in AGENTS.md
|
|
186
|
+
- ❌ NEVER put task-specific instructions in AGENTS.md
|
|
187
|
+
- ❌ NEVER inline code snippets (they go stale)
|
|
188
|
+
- ❌ NEVER generate more than 30 instructions
|
|
189
|
+
- ❌ NEVER overwrite existing AGENTS.md without asking
|
package/command/plan.md
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
-
description: Convert
|
|
2
|
+
description: Convert spec into execution plan with parallel waves, file impact, and executable acceptance criteria.
|
|
3
3
|
agent: plan
|
|
4
4
|
---
|
|
5
5
|
|
|
@@ -10,196 +10,138 @@ You are the **Plan Agent**. Execute the `/plan` command.
|
|
|
10
10
|
Use template at: `@.opencode/memory/_templates/plan.md`
|
|
11
11
|
|
|
12
12
|
## Prerequisites
|
|
13
|
-
|
|
13
|
+
|
|
14
|
+
- `spec.md` MUST exist in `.opencode/memory/specs/`
|
|
14
15
|
- `research.md` recommended if external knowledge needed
|
|
15
16
|
|
|
16
|
-
##
|
|
17
|
+
## Execution Rules
|
|
17
18
|
|
|
18
|
-
|
|
19
|
+
- **DO NOT** generate a plan without exploring the codebase first
|
|
20
|
+
- **DO NOT** write acceptance criteria that require human manual testing
|
|
21
|
+
- Auto-generate the plan after gap analysis — don't ask "should I create the plan now?"
|
|
19
22
|
|
|
20
23
|
## Process
|
|
21
24
|
|
|
22
|
-
1.
|
|
23
|
-
|
|
24
|
-
2. **Understand codebase** using:
|
|
25
|
-
- `finder` for semantic search
|
|
26
|
-
- Delegate to Explore Agent for file discovery
|
|
27
|
-
|
|
28
|
-
3. **Consult Oracle** for non-trivial architecture decisions
|
|
29
|
-
|
|
30
|
-
4. **Decompose into tasks** following Task Schema (see `.opencode/schemas.md` §1)
|
|
31
|
-
|
|
32
|
-
5. **Generate File Impact section** (REQUIRED)
|
|
33
|
-
|
|
34
|
-
6. **Create `plan.md`** at `.opencode/memory/plans/YYYY-MM-DD-<feature>.md`
|
|
35
|
-
|
|
36
|
-
7. **Update bead** with plan reference
|
|
37
|
-
|
|
38
|
-
8. **Get user approval**
|
|
39
|
-
|
|
40
|
-
## Plan Structure (follows `_templates/plan.md`)
|
|
41
|
-
|
|
42
|
-
The plan MUST include:
|
|
43
|
-
|
|
44
|
-
```markdown
|
|
45
|
-
# Implementation Plan: [Feature]
|
|
46
|
-
|
|
47
|
-
**Date:** YYYY-MM-DD
|
|
48
|
-
**Author:** [Name]
|
|
49
|
-
**Status:** Draft | Approved
|
|
50
|
-
**bead_id:** [ID]
|
|
51
|
-
|
|
52
|
-
---
|
|
25
|
+
### 1. Load Artifacts
|
|
53
26
|
|
|
54
|
-
|
|
27
|
+
Load spec.md and research.md (if exists) from `.opencode/memory/`.
|
|
55
28
|
|
|
56
|
-
|
|
29
|
+
### 2. Memory & History Mining (parallel with step 3)
|
|
57
30
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
- **Spec:** `.opencode/memory/specs/YYYY-MM-DD-descriptor.md`
|
|
61
|
-
- **PRD:** `.opencode/memory/prds/YYYY-MM-DD-feature.md` (if applicable)
|
|
62
|
-
- **Research:** `.opencode/memory/research/YYYY-MM-DD-topic.md` (if applicable)
|
|
63
|
-
|
|
64
|
-
---
|
|
65
|
-
|
|
66
|
-
## Tasks
|
|
67
|
-
|
|
68
|
-
### Task 1: [Title]
|
|
69
|
-
|
|
70
|
-
| Field | Value |
|
|
71
|
-
|-------|-------|
|
|
72
|
-
| **task_id** | T-001 |
|
|
73
|
-
| **type** | task \| bug \| feature \| chore |
|
|
74
|
-
| **assignee** | build \| fe \| be \| mobile \| devops |
|
|
75
|
-
| **effort** | S \| M \| L \| XL |
|
|
76
|
-
| **priority** | P0 \| P1 \| P2 |
|
|
77
|
-
| **status** | not_started \| in_progress \| blocked \| done |
|
|
78
|
-
| **dependencies** | [T-xxx] or none |
|
|
79
|
-
|
|
80
|
-
**Description:**
|
|
81
|
-
[What needs to be done]
|
|
82
|
-
|
|
83
|
-
**Input:**
|
|
84
|
-
- [Required artifacts/context]
|
|
85
|
-
|
|
86
|
-
**Output:**
|
|
87
|
-
- [Expected deliverables]
|
|
88
|
-
- [Files to create/modify]
|
|
89
|
-
|
|
90
|
-
**Acceptance Criteria:**
|
|
91
|
-
- [ ] AC-01: [Criteria]
|
|
92
|
-
- [ ] AC-02: [Criteria]
|
|
93
|
-
|
|
94
|
-
**Boundaries:**
|
|
95
|
-
- [What NOT to do]
|
|
96
|
-
|
|
97
|
-
---
|
|
31
|
+
Fire these immediately alongside codebase exploration:
|
|
98
32
|
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
**Files to CREATE:**
|
|
108
|
-
- `path/to/new-file.ts` — [Purpose]
|
|
109
|
-
|
|
110
|
-
**Files to MODIFY:**
|
|
111
|
-
- `path/to/existing.ts` — [Reason]
|
|
112
|
-
|
|
113
|
-
**Files to DELETE:**
|
|
114
|
-
- (none)
|
|
33
|
+
**Memory mining** (Plan reads directly — has file read access):
|
|
34
|
+
```
|
|
35
|
+
Read: ".opencode/memory/_digest.md" — Auto-generated from SQLite (decisions, learnings, blockers, handoffs)
|
|
36
|
+
Read: ".opencode/memory/research/" — List files, read any related to the feature
|
|
37
|
+
Read: ".opencode/memory/handoffs/" — Read recent handoffs for prior session context
|
|
38
|
+
Read: ".opencode/memory/reviews/" — Check past review findings on related code
|
|
39
|
+
Read: ".opencode/memory/specs/" — Check for prior/related specs
|
|
40
|
+
```
|
|
115
41
|
|
|
116
|
-
|
|
42
|
+
> `_digest.md` is generated by the Memory Digest hook on session start. Contains past decisions, learnings, blockers, and handoffs from the SQLite observations DB.
|
|
117
43
|
|
|
118
|
-
|
|
44
|
+
Surface from memory files:
|
|
45
|
+
- Past decisions that constrain this plan
|
|
46
|
+
- Learnings and gotchas from related work
|
|
47
|
+
- Blockers encountered on similar features
|
|
48
|
+
- Patterns that worked or failed
|
|
119
49
|
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
50
|
+
**Git history mining** (delegate to Explore — Plan has bash: false):
|
|
51
|
+
```
|
|
52
|
+
Explore: "Mine git log for conventions. Return:
|
|
53
|
+
1. Commit message format (git log --oneline -n 20)
|
|
54
|
+
2. Branch naming (git branch -a | head -20)
|
|
55
|
+
3. Recent commits on related files (git log --oneline -n 20 -- [paths from spec])
|
|
56
|
+
4. Gotcha markers (git log --grep='HACK\|TODO\|FIXME\|workaround' --oneline -n 10)"
|
|
125
57
|
```
|
|
126
58
|
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
## Effort Summary
|
|
130
|
-
|
|
131
|
-
| Task | Effort | Priority |
|
|
132
|
-
|------|--------|----------|
|
|
133
|
-
| T-001 | S | P0 |
|
|
134
|
-
| T-002 | M | P0 |
|
|
135
|
-
| T-003 | S | P1 |
|
|
59
|
+
### 3. Deep Codebase Exploration (parallel with step 2)
|
|
136
60
|
|
|
137
|
-
|
|
61
|
+
Fire Explore agents immediately:
|
|
62
|
+
```
|
|
63
|
+
Explore: "Find all files that will be affected by this feature. Map integration points."
|
|
64
|
+
Explore: "Find existing patterns for similar features — structure, naming, testing."
|
|
65
|
+
Explore: "Find test infrastructure and conventions — framework, helpers, fixtures."
|
|
66
|
+
```
|
|
138
67
|
|
|
139
|
-
|
|
68
|
+
For complex features, also fire:
|
|
69
|
+
```
|
|
70
|
+
Scout: "Find docs and production patterns for [relevant libraries/APIs]."
|
|
71
|
+
Oracle: "Analyze architecture trade-offs for [key decisions]."
|
|
72
|
+
```
|
|
140
73
|
|
|
141
|
-
|
|
74
|
+
### 4. Gap Analysis (before writing anything)
|
|
142
75
|
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
76
|
+
Review spec + exploration results + memory findings + git conventions. Classify gaps:
|
|
77
|
+
- **CRITICAL**: Needs user decision → ask immediately
|
|
78
|
+
- **MINOR**: Self-resolvable → fix and note as "Auto-Resolved"
|
|
79
|
+
- **AMBIGUOUS**: Has reasonable default → apply and disclose
|
|
146
80
|
|
|
147
|
-
|
|
81
|
+
Cross-reference memory findings against the plan:
|
|
82
|
+
- Past decisions that conflict → flag as risk
|
|
83
|
+
- Past learnings that suggest an approach → incorporate into tasks
|
|
84
|
+
- Past blockers → add preventive acceptance criteria
|
|
85
|
+
- Git conventions → document in Conventions section
|
|
148
86
|
|
|
149
|
-
|
|
87
|
+
### 5. Generate Plan
|
|
150
88
|
|
|
151
|
-
|
|
152
|
-
- [ ] T-001 (S, ≤3 files, no security/db/api)
|
|
89
|
+
Write to `.opencode/memory/plans/YYYY-MM-DD-<feature>.md`.
|
|
153
90
|
|
|
154
|
-
|
|
91
|
+
**Task decomposition rules:**
|
|
92
|
+
- Each task = 1 module/concern = 1-3 files max
|
|
93
|
+
- Group into parallel waves (3-5 tasks per wave)
|
|
94
|
+
- Every acceptance criterion = executable command + expected output
|
|
155
95
|
|
|
156
|
-
|
|
96
|
+
**File Impact = BUILD BOUNDARY:**
|
|
97
|
+
Build Agent may ONLY touch files listed here. Missing a file = Build can't modify it.
|
|
157
98
|
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
99
|
+
**Parallel wave structure:**
|
|
100
|
+
```
|
|
101
|
+
Wave 1 (parallel): Foundation tasks with no dependencies
|
|
102
|
+
Wave 2 (parallel): Tasks depending on Wave 1
|
|
103
|
+
Wave 3 (sequential): Integration and verification
|
|
104
|
+
```
|
|
162
105
|
|
|
163
|
-
|
|
106
|
+
### 6. Quality Self-Review
|
|
164
107
|
|
|
165
|
-
|
|
108
|
+
Before presenting, verify:
|
|
109
|
+
- [ ] Every task has task_id, acceptance criteria, effort, priority
|
|
110
|
+
- [ ] File Impact covers ALL files across ALL tasks
|
|
111
|
+
- [ ] No dependency cycles
|
|
112
|
+
- [ ] Parallel waves maximized
|
|
113
|
+
- [ ] No task touches > 3 files
|
|
114
|
+
- [ ] All acceptance criteria are agent-executable
|
|
115
|
+
- [ ] Top 2+ risks assessed
|
|
116
|
+
- [ ] Conventions & Past Decisions section is populated (even if "none found")
|
|
117
|
+
- [ ] Memory/git findings are cross-referenced against plan
|
|
166
118
|
|
|
167
|
-
|
|
168
|
-
- [ ] User approved
|
|
169
|
-
- [ ] Ready for implementation
|
|
170
|
-
```
|
|
119
|
+
Fix any failures before presenting.
|
|
171
120
|
|
|
172
|
-
|
|
121
|
+
### 7. Present and Guide
|
|
173
122
|
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
- `status` (not_started | in_progress | blocked | done)
|
|
179
|
-
- `assignee` (build | fe | be | mobile | devops)
|
|
180
|
-
- `priority` (P0 | P1 | P2)
|
|
181
|
-
- `effort` (S | M | L | XL)
|
|
182
|
-
- `dependencies` (list or none)
|
|
183
|
-
- `description`, `input`, `output`, `boundaries`
|
|
184
|
-
- `acceptance_criteria` (list)
|
|
123
|
+
Present the plan. After user approval:
|
|
124
|
+
1. Delete draft file if exists
|
|
125
|
+
2. Update bead with plan reference
|
|
126
|
+
3. Guide: "Plan approved. Use `/start` to begin implementation."
|
|
185
127
|
|
|
186
|
-
##
|
|
128
|
+
## Task Schema
|
|
187
129
|
|
|
188
|
-
|
|
189
|
-
- `effort: "S"`
|
|
190
|
-
- 3 files or fewer affected
|
|
191
|
-
- No security/auth/db in boundaries
|
|
192
|
-
- No new API endpoints
|
|
130
|
+
Every task MUST follow Task Schema in `.opencode/schemas.md` §1.
|
|
193
131
|
|
|
194
132
|
## Rules
|
|
195
133
|
|
|
196
|
-
- ✅
|
|
197
|
-
- ✅
|
|
198
|
-
- ✅
|
|
199
|
-
- ✅
|
|
200
|
-
- ✅
|
|
201
|
-
- ✅
|
|
202
|
-
- ✅
|
|
203
|
-
-
|
|
204
|
-
|
|
205
|
-
|
|
134
|
+
- ✅ Explore codebase deeply before planning
|
|
135
|
+
- ✅ Mine memory for past decisions, learnings, blockers
|
|
136
|
+
- ✅ Delegate git history mining to Explore (Plan has bash: false)
|
|
137
|
+
- ✅ Include Conventions & Past Decisions section
|
|
138
|
+
- ✅ Agent-executable acceptance criteria ONLY
|
|
139
|
+
- ✅ File Impact is the build contract
|
|
140
|
+
- ✅ Maximize parallel waves
|
|
141
|
+
- ✅ Self-review quality before presenting
|
|
142
|
+
- ❌ NEVER create tasks touching > 3 files
|
|
143
|
+
- ❌ NEVER write "user manually tests..." criteria
|
|
144
|
+
- ❌ NEVER omit File Impact section
|
|
145
|
+
- ❌ NEVER skip gap analysis
|
|
146
|
+
- ❌ NEVER skip memory/git mining phase
|
|
147
|
+
- ❌ NEVER ignore past decisions that conflict with current plan
|
package/command/research.md
CHANGED
|
@@ -100,4 +100,4 @@ bead_id: [optional]
|
|
|
100
100
|
- `mcp__gh_grep__searchGitHub` — Real-world code patterns
|
|
101
101
|
- `librarian` — Deep repository analysis
|
|
102
102
|
|
|
103
|
-
|
|
103
|
+
Identify the research questions from the user's request or the active spec, then begin research immediately.
|
package/command/resume.md
CHANGED
|
@@ -1,80 +1,59 @@
|
|
|
1
1
|
---
|
|
2
|
-
description:
|
|
3
|
-
agent:
|
|
2
|
+
description: Resume from handoff. Auto-loads state and starts working immediately.
|
|
3
|
+
agent: build
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
You are the **
|
|
6
|
+
You are the **Build Agent**. Execute the `/resume` command **immediately without asking for confirmation**.
|
|
7
7
|
|
|
8
|
-
##
|
|
8
|
+
## Execution Rules
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
- **DO NOT** ask "Ready to continue?" or any confirmation
|
|
11
|
+
- **DO NOT** present a summary and wait — load state and propose the next action in one shot
|
|
12
|
+
- If drift is detected, note it briefly and continue — don't block on it
|
|
11
13
|
|
|
12
|
-
## Process
|
|
14
|
+
## Process (execute all steps, then present result)
|
|
13
15
|
|
|
14
|
-
1.
|
|
16
|
+
### 1. Load Latest Handoff
|
|
15
17
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
- research.md (if exists)
|
|
18
|
+
- Find the most recent `.md` file in `.opencode/memory/handoffs/`
|
|
19
|
+
- Parse its frontmatter and content
|
|
20
|
+
- If no handoff found, say so and suggest `/create` or `/start`
|
|
20
21
|
|
|
21
|
-
|
|
22
|
-
- Run `git status` and `git diff`
|
|
23
|
-
- Compare with handoff's file list
|
|
22
|
+
### 2. Load Related Artifacts
|
|
24
23
|
|
|
25
|
-
|
|
24
|
+
In parallel:
|
|
25
|
+
- Load spec from `.opencode/memory/specs/` (if referenced or latest)
|
|
26
|
+
- Load plan from `.opencode/memory/plans/` (if referenced or latest)
|
|
27
|
+
- Run `git status --short` and `git log --oneline -3`
|
|
26
28
|
|
|
27
|
-
|
|
29
|
+
### 3. Detect Drift
|
|
28
30
|
|
|
29
|
-
|
|
31
|
+
Compare current git state with handoff's recorded state:
|
|
32
|
+
- New commits since handoff? Note them briefly.
|
|
33
|
+
- File conflicts? Flag which tasks may be affected.
|
|
34
|
+
- No drift? Skip this section entirely.
|
|
30
35
|
|
|
31
|
-
|
|
32
|
-
1. Find latest handoff.md
|
|
33
|
-
2. Load spec.md, plan.md
|
|
34
|
-
3. Check git status for drift
|
|
35
|
-
4. If drift detected:
|
|
36
|
-
- Summarize changes
|
|
37
|
-
- Mark affected tasks for re-evaluation
|
|
38
|
-
- Ask user to reconcile
|
|
39
|
-
5. If no drift:
|
|
40
|
-
- Present status summary
|
|
41
|
-
- Propose next task
|
|
42
|
-
```
|
|
36
|
+
### 4. Present and Act
|
|
43
37
|
|
|
44
|
-
|
|
38
|
+
Output this format, then **immediately begin the first next step**:
|
|
45
39
|
|
|
46
|
-
```
|
|
47
|
-
##
|
|
48
|
-
|
|
49
|
-
**Previous Session:** YYYY-MM-DD
|
|
50
|
-
**Phase:** [current phase]
|
|
51
|
-
**Branch:** [branch name]
|
|
40
|
+
```
|
|
41
|
+
## Resumed from <handoff date>
|
|
52
42
|
|
|
53
|
-
|
|
54
|
-
[Summary from handoff]
|
|
43
|
+
**Branch:** `<branch>` | **Phase:** <phase>
|
|
55
44
|
|
|
56
|
-
|
|
57
|
-
- [ ] No changes detected outside session
|
|
58
|
-
- [ ] Changes detected: [list files]
|
|
45
|
+
**Where we left off:** <1-2 sentences from handoff>
|
|
59
46
|
|
|
60
|
-
|
|
61
|
-
- **Completed:** X tasks
|
|
62
|
-
- **In Progress:** Y tasks
|
|
63
|
-
- **Remaining:** Z tasks
|
|
47
|
+
**Drift:** <none | brief note of changes>
|
|
64
48
|
|
|
65
|
-
|
|
66
|
-
[Specific next step to take]
|
|
49
|
+
**Next:** <first action from handoff's "What To Do Next">
|
|
67
50
|
|
|
68
51
|
---
|
|
69
|
-
|
|
52
|
+
Starting now.
|
|
70
53
|
```
|
|
71
54
|
|
|
72
|
-
|
|
55
|
+
Then begin executing the first next step from the handoff.
|
|
73
56
|
|
|
74
|
-
|
|
75
|
-
1. List changed files
|
|
76
|
-
2. Identify which tasks are affected
|
|
77
|
-
3. Mark those tasks for re-evaluation
|
|
78
|
-
4. Ask user: "Code changed outside session. Should I re-evaluate affected tasks?"
|
|
57
|
+
## Philosophy
|
|
79
58
|
|
|
80
|
-
|
|
59
|
+
Resume is not a status report — it's a running start. Load context, orient briefly, then **get to work**.
|