clikit-plugin 0.3.9 → 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.
- package/AGENTS.md +38 -10
- package/README.md +21 -20
- package/command/create.md +104 -20
- package/command/discuss.md +111 -0
- package/command/handoff.md +7 -5
- package/command/init.md +2 -2
- package/command/pr.md +2 -4
- package/command/research.md +130 -28
- package/command/resume.md +2 -2
- package/command/ship.md +1 -1
- package/command/start.md +8 -9
- package/command/status.md +11 -9
- package/dist/.tsbuildinfo +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +31 -0
- package/memory/_digest.md +1 -1
- package/memory/_templates/discussion.md +91 -0
- package/memory/_templates/handoff.md +2 -2
- package/memory/_templates/plan.md +83 -176
- package/memory/_templates/research.md +33 -7
- package/memory/_templates/review.md +2 -2
- package/memory/discussions/.gitkeep +0 -0
- package/package.json +3 -3
- package/skill/requesting-code-review/SKILL.md +2 -2
- package/skill/ritual-workflow/SKILL.md +6 -4
- package/src/agents/AGENTS.md +13 -10
- package/src/agents/build.md +4 -4
- package/src/agents/explore.md +14 -13
- package/src/agents/plan.md +195 -57
- package/src/agents/research.md +41 -11
- package/src/agents/review.md +3 -3
- package/command/import-plan.md +0 -175
- package/command/issue.md +0 -109
- 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
|
|
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
|
-
/
|
|
18
|
+
/discuss → /create → /design → /start → /verify → /ship
|
|
19
19
|
```
|
|
20
20
|
|
|
21
|
-
- `/
|
|
22
|
-
- `/
|
|
23
|
-
- `/
|
|
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
|
|
33
|
-
- **Memory**: `memory/_digest.md` (auto-generated from SQLite observations on session start), plus `memory/
|
|
34
|
-
- **Config**: `clikit.config.json`
|
|
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 →
|
|
127
|
+
beads-village_init → status/inbox → ls(ready) → show → add (if needed) → claim → reservations → 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
|
-
- **
|
|
9
|
-
- **
|
|
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
|
-
- **Memory System**: Templates,
|
|
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
|
-
/
|
|
92
|
+
/discuss → /create → /design → /start → /verify → /ship
|
|
93
93
|
```
|
|
94
94
|
|
|
95
95
|
Workflow notes:
|
|
96
|
-
- All
|
|
97
|
-
- `/
|
|
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`
|
|
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)
|
|
@@ -194,15 +195,16 @@ Project config overrides user config.
|
|
|
194
195
|
| `todo_beads_sync` | off | Legacy todo→Beads mirror; disabled in compressed workflow |
|
|
195
196
|
| `beads_context` | on | Injects active Beads task state into prompts |
|
|
196
197
|
| `cass_memory` | on | Loads embedded memory context on session start and runs idle reflection (`cassMemoryContext`, `cassMemoryReflect`) |
|
|
198
|
+
| `tilth_reading` | on | Enhances `read` tool output via tilth when available for smarter file reads |
|
|
197
199
|
|
|
198
200
|
## Agents
|
|
199
201
|
|
|
200
202
|
| Agent | Mode | Description |
|
|
201
203
|
|-------|------|-------------|
|
|
202
204
|
| `build` | primary | Primary code executor, implements plans |
|
|
203
|
-
| `plan` | primary |
|
|
205
|
+
| `plan` | primary | Handles `/discuss` intent locking and `/create` planning, producing discussion artifacts and XML-structured plans |
|
|
204
206
|
| `oracle` | subagent | Deep code inspection + architecture trade-off analysis |
|
|
205
|
-
| `research` | subagent | External
|
|
207
|
+
| `research` | subagent | External evidence specialist; writes research artifacts for `/research` and Plan's pre-plan pass |
|
|
206
208
|
| `explore` | subagent | Fast codebase exploration |
|
|
207
209
|
| `review` | subagent | Code review & quality gate |
|
|
208
210
|
| `vision` | subagent | Design direction + visual implementation |
|
|
@@ -211,13 +213,14 @@ Default active roles in compressed workflow: `build`, `plan`, `review`, plus coo
|
|
|
211
213
|
|
|
212
214
|
## Commands
|
|
213
215
|
|
|
214
|
-
Run with `/command-name` in OpenCode. **All
|
|
216
|
+
Run with `/command-name` in OpenCode. **All 14 commands work standalone** — the pipeline is a recommended flow, not a requirement.
|
|
215
217
|
|
|
216
218
|
### Workflow pipeline
|
|
217
219
|
| Command | Standalone? | One-liner |
|
|
218
220
|
|---------|-------------|-----------|
|
|
219
|
-
| `/
|
|
220
|
-
| `/
|
|
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 |
|
|
221
224
|
| `/design` | ✅ | UI/UX design + implementation — variant exploration, a11y, responsive (Vision agent) |
|
|
222
225
|
| `/start` | ✅ | Execute plan packets — creates minimal inline plan if none exists |
|
|
223
226
|
| `/ship` | ✅ | Commit + land shared-checkout changes on the default branch — self-review built in, `/verify` recommended |
|
|
@@ -227,14 +230,12 @@ Run with `/command-name` in OpenCode. **All 15 commands work standalone** — th
|
|
|
227
230
|
| Command | One-liner |
|
|
228
231
|
|---------|-----------|
|
|
229
232
|
| `/debug` | Reproduce → 5-Whys root cause → fix → regression test |
|
|
230
|
-
| `/issue` | Instantly capture a task, bug, or idea as a Beads issue |
|
|
231
233
|
| `/status` | Workspace snapshot — Beads tasks, git state, active artifacts |
|
|
232
234
|
| `/init` | Bootstrap CliKit — scaffold dirs + write tailored AGENTS.md |
|
|
233
235
|
| `/handoff` | Auto-capture session state for graceful pause |
|
|
234
236
|
| `/resume` | Pick up cold from latest handoff, no warm-up questions |
|
|
235
237
|
| `/commit` | Auto-detect type/scope → perfect Conventional Commit message |
|
|
236
238
|
| `/pr` | Optional PR flow for explicit branch-based review exceptions |
|
|
237
|
-
| `/import-plan` | Import Jira/Notion/Linear tasks → Beads issues + plan |
|
|
238
239
|
|
|
239
240
|
## Skills
|
|
240
241
|
|
|
@@ -315,14 +316,14 @@ bun run dev
|
|
|
315
316
|
│ ├── config.ts # Config loader
|
|
316
317
|
│ ├── types.ts # Type definitions
|
|
317
318
|
│ ├── agents/ # Agent loaders
|
|
318
|
-
│ ├──
|
|
319
|
+
│ ├── skill/ # Skill loaders
|
|
319
320
|
│ ├── tools/ # Internal utilities (memory, context-summary, cass-memory)
|
|
320
|
-
│ └── hooks/ # Runtime hooks (
|
|
321
|
+
│ └── hooks/ # Runtime hooks (11 modules + index)
|
|
321
322
|
├── skill/ # Skill definitions (*.md)
|
|
322
323
|
├── command/ # Command definitions (*.md)
|
|
323
324
|
├── memory/ # Memory system
|
|
324
|
-
│ ├── _templates/ # Document templates
|
|
325
|
-
│ ├──
|
|
325
|
+
│ ├── _templates/ # Document templates (discussion, plan, research, handoff, review, PRD)
|
|
326
|
+
│ ├── discussions/ # Discussion artifacts
|
|
326
327
|
│ ├── plans/ # Implementation plans
|
|
327
328
|
│ ├── research/ # Research artifacts
|
|
328
329
|
│ ├── reviews/ # Code reviews
|
package/command/create.md
CHANGED
|
@@ -1,23 +1,36 @@
|
|
|
1
1
|
---
|
|
2
|
-
description:
|
|
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
|
-
##
|
|
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
|
|
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.
|
|
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
|
-
|
|
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
|
-
|
|
60
|
+
Before finalizing the plan, you MUST run a research pass via `@research`.
|
|
40
61
|
|
|
41
|
-
|
|
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
|
|
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
|
|
178
|
+
### 8. Approval, Create Beads, & Guide
|
|
99
179
|
|
|
100
|
-
1.
|
|
101
|
-
2.
|
|
102
|
-
3.
|
|
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
|
|
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.
|
package/command/handoff.md
CHANGED
|
@@ -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/
|
|
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
|
|
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:
|
|
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
|
-
-
|
|
51
|
+
- Discussion: `<path>` (if exists)
|
|
51
52
|
- Plan: `<path>` (if exists)
|
|
53
|
+
- Research: `<path>` (if exists)
|
|
52
54
|
|
|
53
|
-
##
|
|
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/
|
|
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 /
|
|
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
|
|
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
|
|
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
|