clikit-plugin 0.3.10 → 0.3.11

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 (40) hide show
  1. package/AGENTS.md +38 -10
  2. package/README.md +20 -22
  3. package/command/create.md +104 -20
  4. package/command/discuss.md +111 -0
  5. package/command/handoff.md +7 -5
  6. package/command/init.md +2 -2
  7. package/command/pr.md +2 -4
  8. package/command/research.md +130 -28
  9. package/command/resume.md +2 -2
  10. package/command/ship.md +1 -1
  11. package/command/start.md +8 -9
  12. package/command/status.md +11 -9
  13. package/dist/.tsbuildinfo +1 -1
  14. package/dist/clikit.schema.json +0 -8
  15. package/dist/config.d.ts +0 -5
  16. package/dist/config.d.ts.map +1 -1
  17. package/dist/hooks/index.d.ts +0 -2
  18. package/dist/hooks/index.d.ts.map +1 -1
  19. package/dist/index.d.ts.map +1 -1
  20. package/dist/index.js +0 -72
  21. package/memory/_templates/discussion.md +91 -0
  22. package/memory/_templates/handoff.md +2 -2
  23. package/memory/_templates/plan.md +83 -176
  24. package/memory/_templates/research.md +33 -7
  25. package/memory/_templates/review.md +2 -2
  26. package/memory/discussions/.gitkeep +0 -0
  27. package/package.json +2 -2
  28. package/skill/requesting-code-review/SKILL.md +2 -2
  29. package/skill/ritual-workflow/SKILL.md +6 -4
  30. package/src/agents/AGENTS.md +13 -11
  31. package/src/agents/build.md +4 -4
  32. package/src/agents/explore.md +14 -14
  33. package/src/agents/plan.md +195 -57
  34. package/src/agents/research.md +41 -11
  35. package/src/agents/review.md +3 -3
  36. package/command/import-plan.md +0 -175
  37. package/command/issue.md +0 -109
  38. package/dist/hooks/tilth-first-guard.d.ts +0 -18
  39. package/dist/hooks/tilth-first-guard.d.ts.map +0 -1
  40. package/memory/_templates/spec.md +0 -128
package/AGENTS.md CHANGED
@@ -4,24 +4,27 @@ An OpenCode plugin that provides agents, commands, skills, hooks, and a memory s
4
4
 
5
5
  ## How It Works
6
6
 
7
- The plugin (`src/index.ts`) loads agents from `src/agents/*.md`, commands from `command/*.md`, and skills from `skill/*/SKILL.md`. Runtime hooks in `src/hooks/` intercept tool execution for safety (git guard, security scan) and quality (typecheck, formatting). Configuration lives in `clikit.config.json`.
7
+ The plugin (`src/index.ts`) loads agents from `src/agents/*.md`, commands from `command/*.md`, and skills from `skill/*/SKILL.md`. Runtime hooks in `src/hooks/` intercept tool execution for safety (git guard, security scan) and quality (typecheck, formatting). Configuration prefers `clikit.jsonc` or `clikit.json`; legacy `clikit.config.json` remains supported for backward compatibility.
8
8
 
9
9
  ## Workflow
10
10
 
11
11
  **Quick mode** (simple features):
12
12
  ```
13
- /create → /start → /verify → /ship
13
+ /discuss → /create → /start → /verify → /ship
14
14
  ```
15
15
 
16
16
  **Deep mode** (complex features, research, UI):
17
17
  ```
18
- /create → /research → /design → /start → /verify → /ship
18
+ /discuss → /create → /design → /start → /verify → /ship
19
19
  ```
20
20
 
21
- - `/create` produces both spec and plan `/start` works directly from this output
22
- - `/verify` is the pre-ship gate run before `/ship` finalizes and lands shared-checkout changes
23
- - `/research` = external docs, API comparison, library research
21
+ - `/discuss` captures user intent and writes a planning-ready discussion artifact
22
+ - `/create` reads discussion context, runs a mandatory pre-plan research pass, then produces a single XML-structured plan — `/start` works directly from this output
23
+ - `/start` executes packet-by-packet and embeds the execute + verify loop in compressed mode
24
+ - `/verify` is the deeper optional audit / pre-ship gate — run before `/ship` finalizes and lands shared-checkout changes
25
+ - `/research` = optional standalone research command — read discussion context, close decision gaps with external evidence, and write a planning-ready report
24
26
  - `/design` = UI/UX design and implementation (uses Vision agent)
27
+ - Execution happens one **Task Packet** at a time (1 concern, 1–3 files, one verify bundle)
25
28
 
26
29
  ## Where to Find Things
27
30
 
@@ -29,9 +32,9 @@ The plugin (`src/index.ts`) loads agents from `src/agents/*.md`, commands from `
29
32
  - **Commands**: `command/*.md` — each slash command's template and instructions.
30
33
  - **Skills**: `skill/*/SKILL.md` — load relevant skills before tasks. List available skills with `ls skill/`.
31
34
  - **Schemas**: `@.opencode/schemas.md` — canonical schemas for tasks, beads, delegation, artifacts, and Task Packets.
32
- - **Templates**: `memory/_templates/*.md` — templates for specs, plans, research, reviews, handoffs, PRDs.
33
- - **Memory**: `memory/_digest.md` (auto-generated from SQLite observations on session start), plus `memory/specs/`, `memory/plans/`, `memory/research/`, `memory/handoffs/`.
34
- - **Config**: `clikit.config.json` enable/disable agents, hooks, override models.
35
+ - **Templates**: `memory/_templates/*.md` — templates for discussions, plans, research, reviews, handoffs, PRDs.
36
+ - **Memory**: `memory/_digest.md` (auto-generated from SQLite observations on session start), plus `memory/discussions/`, `memory/plans/`, `memory/research/`, `memory/handoffs/`, `memory/reviews/`, `memory/prds/`.
37
+ - **Config**: `.opencode/clikit.jsonc` or `.opencode/clikit.json` (preferred); `clikit.config.json` remains a legacy fallback.
35
38
  - **Full docs**: `@.opencode/README.md` — complete reference for all agents, commands, skills, hooks, and config options.
36
39
 
37
40
  ## Context Management (DCP Beta)
@@ -74,6 +77,8 @@ Load `session-management` skill for full threshold handling (including handoff t
74
77
  bun install # dependencies
75
78
  bun run build # compile plugin
76
79
  bun run typecheck # type check
80
+ bun run test # unit tests
81
+ bun run verify # full local verification
77
82
  bun run dev # watch mode
78
83
  ```
79
84
 
@@ -86,6 +91,23 @@ bun run dev # watch mode
86
91
  - Memory tools in `src/tools/` are library code used by hooks, not registered as agent tools
87
92
  - Never force push without `--force-with-lease`
88
93
 
94
+ ## Tilth Navigation Policy
95
+
96
+ When agents navigate files or search the codebase, use **tilth CLI first**.
97
+
98
+ Fallback order:
99
+
100
+ ```text
101
+ tilth CLI → read → grep → glob
102
+ ```
103
+
104
+ - Use `read` once the target file is narrowed and you need raw content
105
+ - Use `grep` for text-pattern fallback when tilth did not answer the question
106
+ - Use `glob` only for explicit path enumeration
107
+ - Use LSP after navigation when semantic confirmation is required
108
+
109
+ This is a documented agent rule, not a hard runtime block.
110
+
89
111
  ## Issue Tracking with bd (beads)
90
112
 
91
113
  **IMPORTANT**: This project uses **bd (beads)** for ALL issue tracking. Do NOT use markdown TODOs, task lists, or other tracking methods.
@@ -102,7 +124,7 @@ bun run dev # watch mode
102
124
  ### Agent Core Cycle
103
125
 
104
126
  ```
105
- beads-village_init → inspect shared git statebeads-village_addbeads-village_claim → reserve → work → done
127
+ beads-village_init → status/inbox ls(ready) show add (if needed) claimreservations → reserve → work → verify → done → sync
106
128
  ```
107
129
 
108
130
  In compressed workflow, the execution unit is a **Task Packet**:
@@ -145,3 +167,9 @@ In compressed workflow, the execution unit is a **Task Packet**:
145
167
  - Use `beads-village_reserve` to surface conflicts early in the shared workspace
146
168
  - Always `reserve` files before editing in multi-agent contexts
147
169
  - Call `done` before ending a completed session; for mid-task handoff, leave the issue open and hand off without `done`
170
+
171
+ ### Nested Repository Note
172
+
173
+ - In this workspace, `.opencode/` is treated as its own nested git repository
174
+ - The outer repo often only shows `.opencode` as modified, while detailed diffs live inside the nested `.opencode` repo
175
+ - It is not currently configured as a normal `.gitmodules` submodule, so inspect both git layers when auditing docs or code changes
package/README.md CHANGED
@@ -5,11 +5,11 @@ Curated agents, commands, skills, and memory system for OpenCode.
5
5
  ## Features
6
6
 
7
7
  - **7 Specialized Agents**: build, plan, explore, review, vision, oracle, research
8
- - **15 Slash Commands**: /create, /start, /ship, /verify, /debug, /design, /research, /commit, /pr, and more
9
- - **22 Workflow Skills**: TDD, debugging, research, integrations, ritual-workflow, and more
8
+ - **14 Slash Commands**: /discuss, /create, /start, /ship, /verify, /debug, /design, /research, /commit, /pr, and more
9
+ - **26 Workflow Skills**: TDD, debugging, research, integrations, ritual-workflow, and more
10
10
  - **7 Internal Utilities**: memory (read/search/get/timeline/update/admin), observation, context-summary, cass-memory (used by hooks, not directly registered as agent tools)
11
- - **12 Runtime Hooks/Modules**: todo enforcer, empty output sanitizer, git guard, security check, subagent blocker, tilth-first guard, truncator, memory digest, todo→beads sync, beads-context, cass-memory, and tilth-reading
12
- - **Memory System**: Templates, specs, plans, research artifacts with FTS5 search
11
+ - **11 Runtime Hooks/Modules**: todo enforcer, empty output sanitizer, git guard, security check, subagent blocker, truncator, memory digest, todo→beads sync, beads-context, cass-memory, and tilth-reading
12
+ - **Memory System**: Templates, discussions, plans, research artifacts with FTS5 search
13
13
  - **Extended Permissions**: doom_loop, external_directory controls
14
14
  - **Configurable**: Enable/disable agents, override models, customize behavior
15
15
 
@@ -84,21 +84,22 @@ After installation, use these commands:
84
84
 
85
85
  **Quick mode** (simple features):
86
86
  ```
87
- /create → /start → /verify → /ship
87
+ /discuss → /create → /start → /verify → /ship
88
88
  ```
89
89
 
90
90
  **Deep mode** (complex features, research, UI):
91
91
  ```
92
- /create → /research → /design → /start → /verify → /ship
92
+ /discuss → /create → /design → /start → /verify → /ship
93
93
  ```
94
94
 
95
95
  Workflow notes:
96
- - All 15 commands work **standalone** — the pipeline is recommended, not required
97
- - `/create` explores codebase first, then produces both spec and plan
96
+ - All 14 commands work **standalone** — the pipeline is recommended, not required
97
+ - `/discuss` runs a pre-create discussion phase clarify intent, confirm assumptions, and save a planning-ready discussion artifact
98
+ - `/create` explores codebase first, consumes discussion context, runs a mandatory pre-plan research pass, then produces a single XML-structured plan
98
99
  - `/start` executes the plan, one Task Packet at a time — creates a minimal inline plan if none exists
99
100
  - `/verify` runs all 4 gates (typecheck, tests, lint, build) + deep review — use anytime, not just pre-ship
100
101
  - `/ship` finalizes work in the shared checkout — commit, sync, and land on the repo default branch; `/pr` is optional and only for explicit PR-based exceptions
101
- - `/research` conducts external research — use standalone before any complex implementation
102
+ - `/research` is an optional standalone research command it reads discussion context first, closes decision gaps with external evidence, and saves a planning-ready report
102
103
  - `/design` implements UI/UX with variant exploration and a11y — uses Vision agent
103
104
  - Beads is the live execution source of truth
104
105
  - Plans decompose work into **Task Packets** (1 concern, 1–3 files, one verify bundle)
@@ -149,7 +150,6 @@ Project config overrides user config.
149
150
  "git_guard": { "enabled": true },
150
151
  "security_check": { "enabled": true },
151
152
  "subagent_question_blocker": { "enabled": true },
152
- "tilth_first_guard": { "enabled": true, "log": false },
153
153
  "truncator": { "enabled": true, "packet_friendly": true },
154
154
  "memory_digest": { "enabled": true, "compact_mode": true },
155
155
  "todo_beads_sync": { "enabled": false, "mode": "disabled" },
@@ -190,7 +190,6 @@ Project config overrides user config.
190
190
  | `git_guard` | on | Blocks dangerous git commands (force push, hard reset, rm -rf) |
191
191
  | `security_check` | on | Scans for secrets/credentials before git commits |
192
192
  | `subagent_question_blocker` | on | Prevents subagents from asking clarifying questions |
193
- | `tilth_first_guard` | on | Requires `@explore` to make an explicit `tilth` CLI attempt before `read` / `grep` / `glob` fallback |
194
193
  | `truncator` | on | Truncates large outputs to prevent context overflow |
195
194
  | `memory_digest` | on | Generates `memory/_digest.md` index + topic files (`decision.md`, `learning.md`, etc.) from SQLite observations |
196
195
  | `todo_beads_sync` | off | Legacy todo→Beads mirror; disabled in compressed workflow |
@@ -203,9 +202,9 @@ Project config overrides user config.
203
202
  | Agent | Mode | Description |
204
203
  |-------|------|-------------|
205
204
  | `build` | primary | Primary code executor, implements plans |
206
- | `plan` | primary | Creates implementation plans from specs |
205
+ | `plan` | primary | Handles `/discuss` intent locking and `/create` planning, producing discussion artifacts and XML-structured plans |
207
206
  | `oracle` | subagent | Deep code inspection + architecture trade-off analysis |
208
- | `research` | subagent | External docs + GitHub evidence research |
207
+ | `research` | subagent | External evidence specialist; writes research artifacts for `/research` and Plan's pre-plan pass |
209
208
  | `explore` | subagent | Fast codebase exploration |
210
209
  | `review` | subagent | Code review & quality gate |
211
210
  | `vision` | subagent | Design direction + visual implementation |
@@ -214,13 +213,14 @@ Default active roles in compressed workflow: `build`, `plan`, `review`, plus coo
214
213
 
215
214
  ## Commands
216
215
 
217
- Run with `/command-name` in OpenCode. **All 15 commands work standalone** — the pipeline is a recommended flow, not a requirement.
216
+ Run with `/command-name` in OpenCode. **All 14 commands work standalone** — the pipeline is a recommended flow, not a requirement.
218
217
 
219
218
  ### Workflow pipeline
220
219
  | Command | Standalone? | One-liner |
221
220
  |---------|-------------|-----------|
222
- | `/create` | ✅ | Explore codebase interview requirements produce spec + plan |
223
- | `/research` | ✅ | Deep-dive any library, API, or pattern with saved report |
221
+ | `/discuss` | ✅ | Pre-create discussion phase lock intent, confirm assumptions, save planning-ready artifact |
222
+ | `/create` | ✅ | Explore codebase → load discussion context → run mandatory pre-plan research produce a single XML-structured plan |
223
+ | `/research` | ✅ | Optional standalone research pass — read discussion context, gather evidence, save planning-ready report |
224
224
  | `/design` | ✅ | UI/UX design + implementation — variant exploration, a11y, responsive (Vision agent) |
225
225
  | `/start` | ✅ | Execute plan packets — creates minimal inline plan if none exists |
226
226
  | `/ship` | ✅ | Commit + land shared-checkout changes on the default branch — self-review built in, `/verify` recommended |
@@ -230,14 +230,12 @@ Run with `/command-name` in OpenCode. **All 15 commands work standalone** — th
230
230
  | Command | One-liner |
231
231
  |---------|-----------|
232
232
  | `/debug` | Reproduce → 5-Whys root cause → fix → regression test |
233
- | `/issue` | Instantly capture a task, bug, or idea as a Beads issue |
234
233
  | `/status` | Workspace snapshot — Beads tasks, git state, active artifacts |
235
234
  | `/init` | Bootstrap CliKit — scaffold dirs + write tailored AGENTS.md |
236
235
  | `/handoff` | Auto-capture session state for graceful pause |
237
236
  | `/resume` | Pick up cold from latest handoff, no warm-up questions |
238
237
  | `/commit` | Auto-detect type/scope → perfect Conventional Commit message |
239
238
  | `/pr` | Optional PR flow for explicit branch-based review exceptions |
240
- | `/import-plan` | Import Jira/Notion/Linear tasks → Beads issues + plan |
241
239
 
242
240
  ## Skills
243
241
 
@@ -318,14 +316,14 @@ bun run dev
318
316
  │ ├── config.ts # Config loader
319
317
  │ ├── types.ts # Type definitions
320
318
  │ ├── agents/ # Agent loaders
321
- │ ├── skills/ # Skill loaders
319
+ │ ├── skill/ # Skill loaders
322
320
  │ ├── tools/ # Internal utilities (memory, context-summary, cass-memory)
323
- │ └── hooks/ # Runtime hooks (10 modules)
321
+ │ └── hooks/ # Runtime hooks (11 modules + index)
324
322
  ├── skill/ # Skill definitions (*.md)
325
323
  ├── command/ # Command definitions (*.md)
326
324
  ├── memory/ # Memory system
327
- │ ├── _templates/ # Document templates
328
- │ ├── specs/ # Specifications
325
+ │ ├── _templates/ # Document templates (discussion, plan, research, handoff, review, PRD)
326
+ │ ├── discussions/ # Discussion artifacts
329
327
  │ ├── plans/ # Implementation plans
330
328
  │ ├── research/ # Research artifacts
331
329
  │ ├── reviews/ # Code reviews
package/command/create.md CHANGED
@@ -1,23 +1,36 @@
1
1
  ---
2
- description: Kick off any feature — explore codebase, interview requirements, produce spec + implementation plan. Use standalone or as the first step of the workflow.
2
+ description: Turn clarified intent into an execution-ready XML-structured plan — explore codebase, synthesize discussion context, fill remaining gaps, and write a single implementation plan.
3
3
  agent: plan
4
4
  ---
5
5
 
6
6
  You are the **Plan Agent**. Execute the `/create` command.
7
7
 
8
- ## Templates
8
+ ## Template
9
9
 
10
- - Spec: `@.opencode/memory/_templates/spec.md`
11
10
  - Plan: `@.opencode/memory/_templates/plan.md`
12
11
 
12
+ ## Inputs
13
+
14
+ Prefer discussion-first workflow when available:
15
+ - Discussion: `.opencode/memory/discussions/YYYY-MM-DD-<topic>.md`
16
+ - Research: `.opencode/memory/research/YYYY-MM-DD-<topic>.md`
17
+
13
18
  ## Execution Rules
14
19
 
15
20
  - **DO NOT** start with generic questions — explore the codebase FIRST
21
+ - **DO** read any relevant discussion artifact before re-eliciting requirements or triggering research
16
22
  - **DO NOT** end turns passively — always end with a specific question or action
17
- - Auto-transition to spec + plan generation when self-clearance passes
23
+ - Auto-transition to plan generation when self-clearance passes
18
24
 
19
25
  ## Process
20
26
 
27
+ ### 0. Load Discussion Context First
28
+
29
+ - Read any relevant discussion artifact under `.opencode/memory/discussions/`
30
+ - Treat `Locked Decisions` as planning constraints, not suggestions
31
+ - Treat `Open Questions` as the only discussion leftovers worth re-asking
32
+ - If no discussion artifact exists, continue normally — `/create` must remain standalone-compatible
33
+
21
34
  ### 1. Proactive Exploration (BEFORE asking questions)
22
35
 
23
36
  Fire Explore agents in parallel immediately:
@@ -25,7 +38,7 @@ Fire Explore agents in parallel immediately:
25
38
  - Find test infrastructure (framework, coverage, examples)
26
39
  - Find related code that this feature will integrate with
27
40
 
28
- ### 2. Informed Interview
41
+ ### 2. Focused Follow-Up
29
42
 
30
43
  Use exploration results to ask SPECIFIC questions across 5 dimensions:
31
44
  - **Problem & Context** — Why is this needed? (reference what you found in codebase)
@@ -34,28 +47,45 @@ Use exploration results to ask SPECIFIC questions across 5 dimensions:
34
47
  - **Users** — Primary/secondary users?
35
48
  - **Constraints** — Technical, business, timeline?
36
49
 
37
- Max 3 questions per turn. Update draft after each exchange.
50
+ Rules:
51
+ - Max 3 questions per turn
52
+ - Do **not** re-ask anything already locked by `/discuss`
53
+ - Prefer resolving only the gaps that still block plan generation
54
+ - If ambiguity remains high and no discussion artifact exists, you may recommend `/discuss` for a cleaner first pass, but `/create` must still work standalone
55
+
56
+ Update draft after each exchange.
57
+
58
+ ### 3. Mandatory Pre-Plan Research Pass
38
59
 
39
- ### 3. Self-Clearance Check
60
+ Before finalizing the plan, you MUST run a research pass via `@research`.
40
61
 
41
- When ALL of these are true, auto-transition to spec + plan generation:
62
+ Treat this as a `/research`-style contract, not an optional side lookup.
63
+
64
+ Research pass requirements:
65
+ - Provide the active discussion artifact (or note that none exists)
66
+ - Ask `@research` to read discussion context first, then gather only the external evidence that materially affects planning
67
+ - Require `@research` to save or update a research artifact under `.opencode/memory/research/`
68
+ - Treat the resulting research artifact as a planning input, not an optional appendix
69
+
70
+ If the research pass finds no meaningful external gap, it should still produce a short artifact that records that conclusion so planning remains auditable.
71
+
72
+ ### 4. Self-Clearance Check
73
+
74
+ When ALL of these are true, auto-transition to plan generation:
42
75
  - Core problem understood and confirmed
43
76
  - Scope boundaries defined
44
77
  - Enough info for acceptance criteria
45
78
  - Codebase patterns identified
79
+ - Locked decisions from discussion artifact preserved
80
+ - Research artifact created or updated by the mandatory pre-plan research pass
46
81
  - No critical open questions
47
82
 
48
- ### 4. Generate Spec
49
-
50
- Write to `.opencode/memory/specs/YYYY-MM-DD-<descriptor>.md` using the spec template.
51
-
52
- **Acceptance criteria MUST be agent-executable** — commands with expected outputs, not "user manually verifies."
53
-
54
83
  ### 5. Memory & History Mining (parallel with plan generation)
55
84
 
56
85
  **Memory mining** (Plan reads directly — has file read access):
57
86
  ```
58
87
  Read: ".opencode/memory/_digest.md" — Compact index of memory topics and highlights
88
+ Read: ".opencode/memory/discussions/" — Any related discussion artifacts
59
89
  Read: ".opencode/memory/decision.md" — Architectural decisions
60
90
  Read: ".opencode/memory/learning.md" — Learnings and gotchas
61
91
  Read: ".opencode/memory/blocker.md" — Past blockers and mitigations
@@ -76,18 +106,68 @@ Explore: "Mine git log for conventions. Return:
76
106
 
77
107
  Write to `.opencode/memory/plans/YYYY-MM-DD-<feature>.md` using the plan template.
78
108
 
109
+ The plan file is the single pre-implementation artifact. It must stay in Markdown with YAML frontmatter plus XML-style sections.
110
+
111
+ The plan must use this structure:
112
+
113
+ ```markdown
114
+ ---
115
+ phase: XX-name
116
+ plan: NN
117
+ type: execute
118
+ wave: N
119
+ depends_on: []
120
+ files_modified: []
121
+ autonomous: true
122
+ requirements: []
123
+ must_haves:
124
+ truths: []
125
+ artifacts: []
126
+ key_links: []
127
+ ---
128
+
129
+ <objective>
130
+ [What this plan accomplishes]
131
+ </objective>
132
+
133
+ <context>
134
+ [Relevant context files and source references]
135
+ </context>
136
+
137
+ <tasks>
138
+ <task type="auto">
139
+ <name>Task 1: [Action-oriented name]</name>
140
+ <files>path/to/file.ext</files>
141
+ <action>[Specific implementation]</action>
142
+ <verify>[Command or check]</verify>
143
+ <done>[Acceptance criteria]</done>
144
+ </task>
145
+ </tasks>
146
+
147
+ <verification>
148
+ [Overall phase checks]
149
+ </verification>
150
+
151
+ <success_criteria>
152
+ [Measurable completion]
153
+ </success_criteria>
154
+ ```
155
+
79
156
  **Task decomposition rules:**
80
157
  - Each task must contain a **Task Packet**
81
158
  - 1 packet = 1 concern = 1-3 files
82
159
  - Group tasks into parallel waves where possible
83
160
  - Every packet must define `files_in_scope`, `verification_commands`, and `escalate_if`
161
+ - Include relevant discussion artifacts in plan references and packet context when they materially constrain execution
84
162
 
85
163
  **File Impact = BUILD BOUNDARY:**
86
164
  Build Agent may ONLY touch files listed here. Missing a file = Build can't modify it.
87
165
 
88
166
  ### 7. Quality Self-Review
89
167
 
90
- Before presenting spec + plan, verify:
168
+ Before presenting the plan, run a verification loop and only stop when all conditions pass, a blocker requires escalation, or one focused user clarification is required.
169
+
170
+ Before presenting the plan, verify:
91
171
  - [ ] Every task has task_id, acceptance criteria, effort, priority
92
172
  - [ ] File Impact covers ALL files across ALL tasks
93
173
  - [ ] No dependency cycles
@@ -95,24 +175,27 @@ Before presenting spec + plan, verify:
95
175
  - [ ] All acceptance criteria are agent-executable
96
176
  - [ ] Top 2+ risks assessed
97
177
 
98
- ### 8. Create Bead & Guide
178
+ ### 8. Approval, Create Beads, & Guide
99
179
 
100
- 1. Call `mcp__beads_village__add()` with title, description, and priority
101
- 2. Present spec + plan to user
102
- 3. After approval: "Spec and plan ready. Use `/start` to begin execution."
180
+ 1. Present plan to user
181
+ 2. Wait for explicit approval
182
+ 3. Only after approval, call `beads-village_add()` with title, description, and priority
183
+ 4. Then say: "Plan ready. Use `/start` to begin execution."
103
184
 
104
185
  ## Rules
105
186
 
106
187
  - ✅ Explore codebase BEFORE asking user questions
107
188
  - ✅ Write agent-executable acceptance criteria
108
189
  - ✅ Tag assumptions as Confirmed/Unconfirmed
190
+ - ✅ Run a mandatory pre-plan research pass and persist its artifact before finalizing the plan
109
191
  - ✅ Auto-transition when clearance check passes
110
- - ✅ Always produce BOTH spec and plan before guiding to `/start`
192
+ - ✅ Always produce a single execution-ready plan before guiding to `/start`
111
193
  - ✅ Mine memory for past decisions, learnings, blockers
112
194
  - ✅ Delegate git history mining to Explore (Plan has bash: false)
113
195
  - ✅ Include Conventions & Past Decisions section in plan
114
196
  - ✅ Every task must include a Task Packet
115
197
  - ✅ File Impact is the build contract
198
+ - ✅ Create Beads issues only after explicit approval
116
199
  - ❌ NEVER ask generic questions without codebase context
117
200
  - ❌ NEVER skip acceptance criteria
118
201
  - ❌ NEVER end passively — always question or action
@@ -120,3 +203,4 @@ Before presenting spec + plan, verify:
120
203
  - ❌ NEVER write "user manually tests..." criteria
121
204
  - ❌ NEVER omit File Impact section
122
205
  - ❌ NEVER skip gap analysis
206
+ - ❌ NEVER skip the mandatory research pass, even when it only confirms that no extra external evidence is needed
@@ -0,0 +1,111 @@
1
+ ---
2
+ description: Pre-create discussion phase — clarify intent, lock preferences, confirm assumptions, and write a planning-ready discussion artifact.
3
+ agent: plan
4
+ ---
5
+
6
+ You are the **Plan Agent** operating in discussion mode. Execute the `/discuss` command and write only the discussion artifact.
7
+
8
+ ## Template
9
+
10
+ Use template at: `@.opencode/memory/_templates/discussion.md`
11
+
12
+ ## Purpose
13
+
14
+ Run a **pre-create discussion phase adapted for CliKit**.
15
+
16
+ This command exists to capture the decisions that `/create`, `/research`, and `/start` should not have to guess.
17
+
18
+ Use it to:
19
+ - clarify the intended outcome
20
+ - lock user-facing preferences and constraints
21
+ - confirm the highest-impact assumptions
22
+ - defer ideas that are intentionally out of scope
23
+ - produce a planning-ready artifact for `/create`
24
+
25
+ Keep the workflow compatible with the current kit:
26
+ - Save artifacts to `.opencode/memory/discussions/YYYY-MM-DD-<topic>.md`
27
+ - Do **not** create `.planning/*` artifacts
28
+ - Do **not** write plans, research artifacts, or source code
29
+ - Do **not** create Beads issues
30
+ - Produce an output that `/create` can consume directly
31
+
32
+ ## Inputs
33
+
34
+ Use whichever context is available:
35
+ - The explicit user request
36
+ - Prior discussion, PRD, plan, handoff, or research artifacts
37
+ - Relevant codebase files or patterns when they help clarify realistic options
38
+ - Known constraints: language, framework, runtime, platform, timeline, policy
39
+
40
+ If context is incomplete, capture the uncertainty in the artifact instead of blocking.
41
+
42
+ ## Process
43
+
44
+ 1. **Read available context first**
45
+ - Check the user request and recent conversation
46
+ - Read any relevant discussion, PRD, plan, handoff, or research artifacts
47
+ - Inspect the codebase only far enough to ground the conversation in real patterns
48
+
49
+ 2. **Frame the discussion goal**
50
+ - What outcome is the user trying to achieve?
51
+ - What part of the request is already clear?
52
+ - What ambiguity would cause `/create` or `/research` to guess?
53
+
54
+ 3. **Surface gray areas and assumptions**
55
+ Focus on ambiguity that materially affects:
56
+ - scope boundaries
57
+ - workflow or UX expectations
58
+ - integration direction
59
+ - constraints or non-goals
60
+ - sequencing between discuss/create/research/build
61
+
62
+ 4. **Run an adaptive discussion**
63
+ - Ask focused, high-signal questions
64
+ - Prefer decisions over open-ended brainstorming once enough context exists
65
+ - Avoid re-asking anything already confirmed by prior artifacts
66
+ - If the repository strongly suggests a sensible default, present it as an assumption for confirmation
67
+
68
+ 5. **Lock what is known and defer the rest**
69
+ - Record confirmed decisions explicitly
70
+ - Separate confirmed assumptions from unresolved questions
71
+ - Push non-critical ideas into a deferred section rather than expanding scope
72
+
73
+ 6. **Write the discussion artifact yourself**
74
+ - Create or update `.opencode/memory/discussions/YYYY-MM-DD-<topic>.md`
75
+ - You may write only inside `.opencode/memory/discussions/`
76
+ - Do not write anywhere else in the repository
77
+
78
+ 7. **Hand off to `/create`**
79
+ - End by telling the user the discussion artifact is ready
80
+ - Point them to `/create` as the next step for plan generation
81
+
82
+ ## Discussion Request Format
83
+
84
+ Use this request schema:
85
+
86
+ ```yaml
87
+ type: "discussion"
88
+ mode: "pre-create-phase"
89
+ topic: "[Feature or topic being clarified]"
90
+ goal: "[What outcome the user wants]"
91
+ ambiguities:
92
+ - "[Ambiguity 1]"
93
+ - "[Ambiguity 2]"
94
+ constraints:
95
+ product: "[User or business constraints]"
96
+ technical: "[Technical context if relevant]"
97
+ workflow: "[Any sequencing or approval constraints]"
98
+ format: "discussion-brief"
99
+ depth: "standard" # quick | standard | deep
100
+ ```
101
+
102
+ ## Rules
103
+
104
+ - Start from user intent, not technical implementation detail
105
+ - Clarify only what changes planning, sequencing, or execution direction
106
+ - Prefer concrete decisions over vague summaries
107
+ - Preserve unresolved items instead of guessing them away
108
+ - Write only the final discussion artifact under `.opencode/memory/discussions/`
109
+ - Save a report that `/create` can use without re-running the conversation
110
+
111
+ Begin by deriving the discussion goal from the user's request and available context, then proceed immediately.
@@ -21,18 +21,19 @@ Run these in parallel:
21
21
  - `git log --oneline -5` — recent commits
22
22
  - `git status --short` — uncommitted changes
23
23
  - `git diff --stat` — what changed
24
+ - Check `.opencode/memory/discussions/` for active discussion artifact
24
25
  - Check `.opencode/memory/plans/` for active plan
25
- - Check `.opencode/memory/specs/` for active spec
26
+ - Check `.opencode/memory/research/` for active research artifact
26
27
  - Check ritual state if exists
27
28
 
28
29
  ### 2. Write Handoff
29
30
 
30
- Create `.opencode/memory/handoffs/YYYY-MM-DD-handoff.md` with this structure:
31
+ Create `.opencode/memory/handoffs/YYYY-MM-DD-<phase>.md` with this structure:
31
32
 
32
33
  ```markdown
33
34
  ---
34
35
  date: YYYY-MM-DD
35
- phase: discover | plan | implement | verify | complete
36
+ phase: discussed | researched | planned | implementing | validating
36
37
  branch: <branch>
37
38
  ---
38
39
 
@@ -47,10 +48,11 @@ branch: <branch>
47
48
  - Uncommitted: <yes/no, list if yes>
48
49
 
49
50
  ## Active Artifacts
50
- - Spec: `<path>` (if exists)
51
+ - Discussion: `<path>` (if exists)
51
52
  - Plan: `<path>` (if exists)
53
+ - Research: `<path>` (if exists)
52
54
 
53
- ## What To Do Next
55
+ ## Next Steps
54
56
  1. <immediate next action — be specific>
55
57
  2. <following action>
56
58
  3. <after that>
package/command/init.md CHANGED
@@ -33,7 +33,7 @@ export default CliKitPlugin;
33
33
  ### 3) Create `.opencode` structure
34
34
 
35
35
  Ensure these exist:
36
- - `.opencode/memory/specs`
36
+ - `.opencode/memory/discussions`
37
37
  - `.opencode/memory/plans`
38
38
  - `.opencode/memory/research`
39
39
  - `.opencode/memory/reviews`
@@ -97,7 +97,7 @@ Return:
97
97
 
98
98
  ### Next
99
99
  1. Restart OpenCode
100
- 2. Run /create to begin work
100
+ 2. Run /discuss to begin work
101
101
  ```
102
102
 
103
103
  ## Important behavior
package/command/pr.md CHANGED
@@ -1,5 +1,5 @@
1
1
  ---
2
- description: Optional branch-based utility. Generate a complete PR description from git diff — summary, file changes, test evidence, linked spec/plan — then create it via gh when the user or repo policy explicitly requires a PR.
2
+ description: Optional branch-based utility. Generate a complete PR description from git diff — summary, file changes, test evidence, linked plan — then create it via gh when the user or repo policy explicitly requires a PR.
3
3
  agent: build
4
4
  ---
5
5
 
@@ -37,7 +37,6 @@ If you are still on the shared default branch, stop and ask before proceeding
37
37
 
38
38
  ### 2. Load Artifacts
39
39
 
40
- - `spec.md` — Link requirements
41
40
  - `plan.md` — Link implementation plan
42
41
  - `review.md` — Link review results (if exists)
43
42
  - Bead info — Get from beads village
@@ -67,7 +66,6 @@ gh pr create \
67
66
 
68
67
  ### Related
69
68
  - **Bead:** [ID]
70
- - **Spec:** `.opencode/memory/specs/YYYY-MM-DD-feature.md`
71
69
  - **Plan:** `.opencode/memory/plans/YYYY-MM-DD-feature.md`
72
70
 
73
71
  ---
@@ -172,7 +170,7 @@ pnpm lint
172
170
 
173
171
  ## Rules
174
172
 
175
- - ✅ ALWAYS link to spec/plan/bead
173
+ - ✅ ALWAYS link to plan/bead
176
174
  - ✅ ALWAYS include testing info
177
175
  - ✅ ALWAYS run checks before PR
178
176
  - ✅ ALWAYS self-review first