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.
Files changed (72) hide show
  1. package/AGENTS.md +30 -32
  2. package/README.md +45 -26
  3. package/command/create.md +37 -122
  4. package/command/handoff.md +45 -69
  5. package/command/init.md +125 -48
  6. package/command/plan.md +101 -159
  7. package/command/research.md +1 -1
  8. package/command/resume.md +34 -55
  9. package/command/vision.md +132 -64
  10. package/dist/.tsbuildinfo +1 -0
  11. package/dist/agents/index.d.ts.map +1 -1
  12. package/dist/cli.d.ts.map +1 -1
  13. package/dist/cli.js +95 -11
  14. package/dist/clikit.schema.json +245 -0
  15. package/dist/commands/index.d.ts.map +1 -1
  16. package/dist/config.d.ts +43 -43
  17. package/dist/config.d.ts.map +1 -1
  18. package/dist/hooks/git-guard.test.d.ts +2 -0
  19. package/dist/hooks/git-guard.test.d.ts.map +1 -0
  20. package/dist/hooks/index.d.ts +3 -14
  21. package/dist/hooks/index.d.ts.map +1 -1
  22. package/dist/hooks/memory-digest.d.ts +27 -0
  23. package/dist/hooks/memory-digest.d.ts.map +1 -0
  24. package/dist/hooks/security-check.test.d.ts +2 -0
  25. package/dist/hooks/security-check.test.d.ts.map +1 -0
  26. package/dist/hooks/todo-beads-sync.d.ts +23 -0
  27. package/dist/hooks/todo-beads-sync.d.ts.map +1 -0
  28. package/dist/index.d.ts.map +1 -1
  29. package/dist/index.js +740 -909
  30. package/dist/skills/index.d.ts.map +1 -1
  31. package/dist/tools/beads-memory-sync.d.ts.map +1 -1
  32. package/dist/tools/context-summary.d.ts.map +1 -1
  33. package/dist/tools/memory-db.d.ts +12 -0
  34. package/dist/tools/memory-db.d.ts.map +1 -0
  35. package/dist/tools/memory.d.ts.map +1 -1
  36. package/dist/tools/observation.d.ts.map +1 -1
  37. package/memory/_templates/plan.md +18 -0
  38. package/package.json +7 -4
  39. package/src/agents/AGENTS.md +11 -39
  40. package/src/agents/build.md +152 -94
  41. package/src/agents/index.ts +31 -5
  42. package/src/agents/looker.md +5 -0
  43. package/src/agents/oracle.md +2 -0
  44. package/src/agents/plan.md +247 -44
  45. package/src/agents/review.md +1 -0
  46. package/src/agents/vision.md +251 -115
  47. package/dist/cli.test.d.ts +0 -2
  48. package/dist/cli.test.d.ts.map +0 -1
  49. package/dist/hooks/auto-format.d.ts +0 -30
  50. package/dist/hooks/auto-format.d.ts.map +0 -1
  51. package/dist/hooks/comment-checker.d.ts +0 -17
  52. package/dist/hooks/comment-checker.d.ts.map +0 -1
  53. package/dist/hooks/compaction.d.ts +0 -60
  54. package/dist/hooks/compaction.d.ts.map +0 -1
  55. package/dist/hooks/env-context.d.ts +0 -43
  56. package/dist/hooks/env-context.d.ts.map +0 -1
  57. package/dist/hooks/ritual-enforcer.d.ts +0 -29
  58. package/dist/hooks/ritual-enforcer.d.ts.map +0 -1
  59. package/dist/hooks/session-notification.d.ts +0 -23
  60. package/dist/hooks/session-notification.d.ts.map +0 -1
  61. package/dist/hooks/session-notification.test.d.ts +0 -2
  62. package/dist/hooks/session-notification.test.d.ts.map +0 -1
  63. package/dist/hooks/typecheck-gate.d.ts +0 -31
  64. package/dist/hooks/typecheck-gate.d.ts.map +0 -1
  65. package/memory/handoffs/2026-02-15-complete-audit.md +0 -136
  66. package/memory/handoffs/2026-02-15-complete-fix.md +0 -140
  67. package/memory/handoffs/2026-02-15-importmeta-fix.md +0 -121
  68. package/memory/handoffs/2026-02-15-installing.md +0 -90
  69. package/memory/handoffs/2026-02-15-plugin-install-fix.md +0 -140
  70. package/memory/handoffs/2026-02-15-runtime-fixes.md +0 -80
  71. package/memory/plans/2026-02-16-plugin-install.md +0 -195
  72. package/memory/research/2026-02-16-opencode-plugin-alignment.md +0 -128
package/AGENTS.md CHANGED
@@ -1,21 +1,10 @@
1
1
  # CliKit
2
2
 
3
- OpenCode plugin with 10 agents, 19 commands, 48 skills, 14 hooks.
4
-
5
- ## Agents
6
-
7
- | Agent | Role |
8
- |-------|------|
9
- | @build | Primary executor |
10
- | @plan | Strategic planning |
11
- | @general | Multi-step tasks |
12
- | @oracle | Architecture advisor |
13
- | @librarian | Multi-repo analysis |
14
- | @explore | Fast navigation |
15
- | @looker | Deep inspection |
16
- | @scout | External research |
17
- | @review | Code review |
18
- | @vision | Design + visuals |
3
+ An OpenCode plugin that provides agents, commands, skills, hooks, and a memory system for AI-assisted development. Built with TypeScript and Bun.
4
+
5
+ ## How It Works
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`.
19
8
 
20
9
  ## Workflow
21
10
 
@@ -23,24 +12,33 @@ OpenCode plugin with 10 agents, 19 commands, 48 skills, 14 hooks.
23
12
  /create → /plan → /start → /verify → /ship
24
13
  ```
25
14
 
26
- ## Rules
15
+ Always verify before claiming done. Run typecheck + lint + test before commit.
27
16
 
28
- - Always verify before claiming done
29
- - Use TDD for new features
30
- - Check todos before session end
31
- - Run typecheck + lint + test before commit
32
- - Never force push without --force-with-lease
17
+ ## Where to Find Things
33
18
 
34
- ## Memory
19
+ - **Agent behavior**: Read the specific agent's `.md` file in `src/agents/` — each has full instructions in its prompt.
20
+ - **Commands**: `command/*.md` — each slash command's template and instructions.
21
+ - **Skills**: `skill/*/SKILL.md` — load relevant skills before tasks. List available skills with `ls skill/`.
22
+ - **Schemas**: `@.opencode/schemas.md` — canonical schemas for tasks, beads, delegation, artifacts.
23
+ - **Templates**: `memory/_templates/*.md` — templates for specs, plans, research, reviews, handoffs, PRDs.
24
+ - **Memory**: `memory/_digest.md` (auto-generated from SQLite observations on session start), plus `memory/specs/`, `memory/plans/`, `memory/research/`, `memory/handoffs/`.
25
+ - **Config**: `clikit.config.json` — enable/disable agents, hooks, override models.
26
+ - **Full docs**: `@.opencode/README.md` — complete reference for all agents, commands, skills, hooks, and config options.
35
27
 
36
- - Specs: `.opencode/memory/specs/`
37
- - Plans: `.opencode/memory/plans/`
38
- - Handoffs: `.opencode/memory/handoffs/`
28
+ ## Development
29
+
30
+ ```bash
31
+ bun install # dependencies
32
+ bun run build # compile plugin
33
+ bun run typecheck # type check
34
+ bun run dev # watch mode
35
+ ```
39
36
 
40
- ## Skills
37
+ ## Key Conventions
41
38
 
42
- Load relevant skills before tasks:
43
- - TDD: `test-driven-development`
44
- - Debugging: `systematic-debugging`
45
- - Planning: `brainstorming` `writing-plans`
46
- - Design: `frontend-aesthetics`
39
+ - Plugin entrypoint: `src/index.ts`
40
+ - Agents are parsed from markdown frontmatter (gray-matter): `src/agents/index.ts`
41
+ - Commands are parsed the same way: `src/commands/index.ts`
42
+ - Hooks export from `src/hooks/index.ts`, wired in `src/index.ts` event handlers
43
+ - Memory tools in `src/tools/` are library code used by hooks, not registered as agent tools
44
+ - Never force push without `--force-with-lease`
package/README.md CHANGED
@@ -7,10 +7,9 @@ Curated agents, commands, skills, and memory system for OpenCode.
7
7
  - **10 Specialized Agents**: build, general, oracle, librarian, explore, looker, plan, review, scout, vision
8
8
  - **19 Slash Commands**: /create, /start, /plan, /ship, /verify, /review, /debug, /pr, and more
9
9
  - **48 Workflow Skills**: TDD, debugging, design, UI/UX, integrations, ritual-workflow, and more
10
- - **6 Custom Tools**: memory (6), observation, swarm, beads-memory-sync, quick-research, context-summary
11
- - **14 Runtime Hooks**: git guard, security check, auto-format, typecheck gate, truncator, compaction, ritual enforcer, session notifications, and more
10
+ - **6 Internal Utilities**: memory (read/search/get/timeline/update/admin), observation, swarm, beads-memory-sync, quick-research, context-summary (used by hooks, not directly registered as agent tools)
11
+ - **10 Runtime Hooks**: todo enforcer, empty output sanitizer, git guard, security check, subagent blocker, truncator, swarm enforcer, memory digest, and todo→beads sync
12
12
  - **Memory System**: Templates, specs, plans, research artifacts with FTS5 search
13
- - **Ritual Workflow**: Enforces DISCOVER → PLAN → IMPLEMENT → VERIFY → COMPLETE phases
14
13
  - **Extended Permissions**: doom_loop, external_directory controls
15
14
  - **Configurable**: Enable/disable agents, override models, customize behavior
16
15
 
@@ -25,6 +24,18 @@ bun x clikit-plugin install
25
24
 
26
25
  That's it! The plugin will be registered in `~/.config/opencode/opencode.json`.
27
26
 
27
+ Installer also adds default MCP servers if missing:
28
+
29
+ - `beads-village` (`npx beads-village`)
30
+ - `context7` (`https://mcp.context7.com/mcp`)
31
+ - `grep` (`https://mcp.grep.app`)
32
+ - `human-mcp` (`npx @goonnguyen/human-mcp`)
33
+
34
+ Recommended environment variables:
35
+
36
+ - `CONTEXT7_API_KEY` for Context7
37
+ - `GOOGLE_GEMINI_API_KEY` for Human MCP
38
+
28
39
  ## Quick Start
29
40
 
30
41
  After installation, use these commands:
@@ -35,12 +46,14 @@ After installation, use these commands:
35
46
 
36
47
  ## Configuration
37
48
 
38
- Create `clikit.config.json` in one of these locations:
49
+ Create `clikit.jsonc` (preferred) or `clikit.json` in one of these locations:
39
50
 
40
51
  - **User (global)**:
41
- - Linux/macOS: `~/.config/opencode/clikit.config.json`
42
- - Windows: `%APPDATA%\opencode\clikit.config.json`
43
- - **Project**: `.opencode/clikit.config.json`
52
+ - Linux/macOS: `~/.config/opencode/clikit.jsonc` (or `clikit.json`)
53
+ - Windows: `%APPDATA%\opencode\clikit.jsonc` (or `clikit.json`)
54
+ - **Project**: `.opencode/clikit.jsonc` (or `clikit.json`)
55
+
56
+ Legacy `clikit.config.json` is still supported for backward compatibility.
44
57
 
45
58
  Project config overrides user config.
46
59
 
@@ -48,9 +61,14 @@ Project config overrides user config.
48
61
 
49
62
  ```json
50
63
  {
51
- "$schema": "https://unpkg.com/clikit-plugin/schema.json",
64
+ "$schema": "https://unpkg.com/clikit-plugin@latest/schema.json",
52
65
  "disabled_agents": ["scout"],
53
66
  "disabled_commands": ["security"],
67
+ "disabled_skills": ["playwright"],
68
+ "skills": {
69
+ "enable": ["test-driven-development", "systematic-debugging"],
70
+ "disable": ["sharing-skills"]
71
+ },
54
72
  "agents": {
55
73
  "oracle": {
56
74
  "model": "openai/gpt-4o"
@@ -65,21 +83,17 @@ Project config overrides user config.
65
83
  }
66
84
  },
67
85
  "hooks": {
68
- "session_logging": true,
86
+ "session_logging": false,
69
87
  "tool_logging": false,
70
88
  "todo_enforcer": { "enabled": true },
71
89
  "empty_message_sanitizer": { "enabled": true },
72
90
  "git_guard": { "enabled": true },
73
91
  "security_check": { "enabled": true },
74
92
  "subagent_question_blocker": { "enabled": true },
75
- "comment_checker": { "enabled": true, "threshold": 0.3 },
76
- "env_context": { "enabled": true },
77
- "auto_format": { "enabled": false },
78
- "typecheck_gate": { "enabled": false },
79
- "session_notification": { "enabled": true },
80
93
  "truncator": { "enabled": true },
81
- "compaction": { "enabled": true },
82
- "swarm_enforcer": { "enabled": true }
94
+ "swarm_enforcer": { "enabled": true },
95
+ "memory_digest": { "enabled": true },
96
+ "todo_beads_sync": { "enabled": true }
83
97
  }
84
98
  }
85
99
  ```
@@ -90,9 +104,11 @@ Project config overrides user config.
90
104
  |--------|------|---------|-------------|
91
105
  | `disabled_agents` | `string[]` | `[]` | Agent names to disable |
92
106
  | `disabled_commands` | `string[]` | `[]` | Command names to disable |
107
+ | `disabled_skills` | `string[]` | `[]` | Skill names to disable |
93
108
  | `agents` | `object` | `{}` | Per-agent overrides (model, temperature, etc.) |
94
109
  | `commands` | `object` | `{}` | Per-command overrides |
95
- | `hooks.session_logging` | `boolean` | `true` | Session lifecycle logging |
110
+ | `skills` | `object \| string[]` | `{}` | Skill enable/disable and per-skill overrides |
111
+ | `hooks.session_logging` | `boolean` | `false` | Session lifecycle logging |
96
112
  | `hooks.tool_logging` | `boolean` | `false` | Tool execution logging |
97
113
 
98
114
  ### Hooks
@@ -104,14 +120,10 @@ Project config overrides user config.
104
120
  | `git_guard` | on | Blocks dangerous git commands (force push, hard reset, rm -rf) |
105
121
  | `security_check` | on | Scans for secrets/credentials before git commits |
106
122
  | `subagent_question_blocker` | on | Prevents subagents from asking clarifying questions |
107
- | `comment_checker` | on | Detects excessive AI-generated comments in code |
108
- | `env_context` | on | Injects git branch, package info, project structure |
109
- | `auto_format` | **off** | Runs prettier/biome/dprint after file edits |
110
- | `typecheck_gate` | **off** | Runs tsc after TypeScript file edits |
111
- | `session_notification` | on | Desktop notifications on idle/error (Linux/macOS/Windows) |
112
123
  | `truncator` | on | Truncates large outputs to prevent context overflow |
113
- | `compaction` | on | Preserves beads state + memory during context compaction |
114
124
  | `swarm_enforcer` | on | Enforces task isolation in multi-agent swarms |
125
+ | `memory_digest` | on | Generates `memory/_digest.md` from SQLite observations |
126
+ | `todo_beads_sync` | on | Mirrors OpenCode todos into Beads issues |
115
127
 
116
128
  ## Agents
117
129
 
@@ -154,7 +166,7 @@ Run with `/command-name` in OpenCode:
154
166
 
155
167
  ## Skills
156
168
 
157
- 47 workflow skills organized into 8 categories:
169
+ 48 workflow skills organized into 8 categories:
158
170
 
159
171
  ### Design & Planning (4)
160
172
  | Skill | Use When |
@@ -247,6 +259,12 @@ bun run build
247
259
  # Type check
248
260
  bun run typecheck
249
261
 
262
+ # Unit tests
263
+ bun run test
264
+
265
+ # Full local verification
266
+ bun run verify
267
+
250
268
  # Watch mode
251
269
  bun run dev
252
270
  ```
@@ -261,7 +279,8 @@ bun run dev
261
279
  │ ├── types.ts # Type definitions
262
280
  │ ├── agents/ # Agent loaders
263
281
  │ ├── skills/ # Skill loaders
264
- └── hooks/ # Runtime hooks (13 modules)
282
+ ├── tools/ # Internal utilities (memory, swarm, etc.)
283
+ │ └── hooks/ # Runtime hooks (10 modules)
265
284
  ├── skill/ # Skill definitions (*.md)
266
285
  ├── command/ # Command definitions (*.md)
267
286
  ├── memory/ # Memory system
@@ -273,7 +292,7 @@ bun run dev
273
292
  │ ├── handoffs/ # Session handoffs
274
293
  │ ├── beads/ # Beads task artifacts
275
294
  │ └── prds/ # Product requirements
276
- └── clikit.config.json
295
+ └── clikit.jsonc
277
296
  ```
278
297
 
279
298
  ## License
package/command/create.md CHANGED
@@ -1,5 +1,5 @@
1
1
  ---
2
- description: Start a new bead. Gather requirements and create specification.
2
+ description: Start a new bead. Explore codebase, gather requirements, create specification.
3
3
  agent: plan
4
4
  ---
5
5
 
@@ -9,142 +9,57 @@ You are the **Plan Agent**. Execute the `/create` command.
9
9
 
10
10
  Use template at: `@.opencode/memory/_templates/spec.md`
11
11
 
12
- ## Your Task
12
+ ## Execution Rules
13
13
 
14
- Create a new specification and bead for the user's goal/idea.
14
+ - **DO NOT** start with generic questions — explore the codebase FIRST
15
+ - **DO NOT** end turns passively — always end with a specific question or action
16
+ - Auto-transition to spec generation when self-clearance passes
15
17
 
16
18
  ## Process
17
19
 
18
- 1. **Interview** the user using 5 core dimensions:
19
- - **Problem & Context** — Why is this needed? Who is affected?
20
- - **Outcomes** — What changes if successful?
21
- - **Scope** — What's in/out of boundaries?
22
- - **Users** — Primary and secondary users?
23
- - **Constraints** — Performance, security, timeline?
20
+ ### 1. Proactive Exploration (BEFORE asking questions)
24
21
 
25
- 2. **Paraphrase and confirm**: "Is anything missing or wrong?"
22
+ Fire Explore agents in parallel immediately:
23
+ - Find similar implementations, patterns, and conventions in the codebase
24
+ - Find test infrastructure (framework, coverage, examples)
25
+ - Find related code that this feature will integrate with
26
26
 
27
- 3. **Generate `spec.md`** at `.opencode/memory/specs/YYYY-MM-DD-<descriptor>.md` using the canonical template
27
+ ### 2. Informed Interview
28
28
 
29
- 4. **Create bead** via `mcp__beads_village__add()` with title, description, and priority
29
+ Use exploration results to ask SPECIFIC questions across 5 dimensions:
30
+ - **Problem & Context** — Why is this needed? (reference what you found in codebase)
31
+ - **Outcomes** — What measurable changes?
32
+ - **Scope** — In/out boundaries? (suggest based on codebase patterns)
33
+ - **Users** — Primary/secondary users?
34
+ - **Constraints** — Technical, business, timeline?
30
35
 
31
- ## Spec Structure (follows `_templates/spec.md`)
36
+ Max 3 questions per turn. Update draft after each exchange.
32
37
 
33
- The spec MUST include:
38
+ ### 3. Self-Clearance Check
34
39
 
35
- ```markdown
36
- # Specification: [Title]
40
+ When ALL of these are true, auto-transition to spec generation:
41
+ - Core problem understood and confirmed
42
+ - Scope boundaries defined
43
+ - Enough info for acceptance criteria
44
+ - Codebase patterns identified
45
+ - No critical open questions
37
46
 
38
- **Date:** YYYY-MM-DD
39
- **Author:** [Name]
40
- **Status:** Draft | Confirmed
41
- **bead_id:** [ID]
47
+ ### 4. Generate Spec
42
48
 
43
- ---
44
-
45
- ## Problem & Context
46
-
47
- ### Problem Statement
48
- [Why is this needed?]
49
+ Write to `.opencode/memory/specs/YYYY-MM-DD-<descriptor>.md` using full template structure.
49
50
 
50
- ### Background
51
- [Context and history]
52
-
53
- ### Who is Affected
54
- [Stakeholders and users impacted]
55
-
56
- ---
57
-
58
- ## Outcomes
59
-
60
- ### Success Criteria
61
- 1. [Measurable outcome 1]
62
- 2. [Measurable outcome 2]
63
-
64
- ### Key Results
65
- | Outcome | Metric | Target |
66
- |---------|--------|--------|
67
- | [Outcome] | [How to measure] | [Target value] |
68
-
69
- ---
51
+ **Acceptance criteria MUST be agent-executable** — commands with expected outputs, not "user manually verifies."
70
52
 
71
- ## Scope
72
-
73
- ### In Scope
74
- - [Feature/capability 1]
75
-
76
- ### Out of Scope
77
- - [Excluded item 1]
78
-
79
- ### Boundaries
80
- [Clear boundaries of what this spec covers]
81
-
82
- ---
83
-
84
- ## Users
85
-
86
- ### Primary Users
87
- | User Type | Description | Needs |
88
- |-----------|-------------|-------|
89
- | [Type] | [Who they are] | [What they need] |
90
-
91
- ### Secondary Users
92
- | User Type | Description | Needs |
93
- |-----------|-------------|-------|
94
-
95
- ---
53
+ ### 5. Create Bead
96
54
 
97
- ## Constraints
98
-
99
- ### Technical Constraints
100
- - [Constraint 1]
101
-
102
- ### Business Constraints
103
- - [Timeline, budget, etc.]
104
-
105
- ### Dependencies
106
- | Dependency | Type | Status |
107
- |------------|------|--------|
108
- | [Dependency] | Blocking/Soft | Ready/Pending |
109
-
110
- ---
111
-
112
- ## Acceptance Criteria
113
-
114
- | ID | Criteria | Verification |
115
- |----|----------|--------------|
116
- | AC-01 | [Criteria] | [How to verify] |
117
- | AC-02 | [Criteria] | [How to verify] |
118
-
119
- ---
120
-
121
- ## Assumptions
122
-
123
- | ID | Assumption | Status | Notes |
124
- |----|------------|--------|-------|
125
- | A-01 | [Assumption] | Confirmed/Unconfirmed | [Notes] |
126
-
127
- ---
128
-
129
- ## Open Questions
130
-
131
- - [ ] [Question 1]
132
- - [ ] [Question 2]
133
-
134
- ---
135
-
136
- ## References
137
-
138
- - [Link to related docs]
139
- ```
55
+ Call `mcp__beads_village__add()` with title, description, and priority.
140
56
 
141
57
  ## Rules
142
58
 
143
- - ✅ ALWAYS use the full template structure from `_templates/spec.md`
144
- - ✅ ALWAYS include frontmatter (Date, Author, Status, bead_id)
145
- - ✅ ALWAYS ask clarifying questions if goal is vague
146
- - ✅ ALWAYS tag assumptions clearly as "Confirmed" vs "Unconfirmed"
147
- - ALWAYS get user confirmation before finalizing
148
- - ❌ NEVER skip the Acceptance Criteria section
149
-
150
- Now, ask the user about their goal/idea to begin the interview process.
59
+ - ✅ Explore codebase BEFORE asking user questions
60
+ - ✅ Write agent-executable acceptance criteria
61
+ - ✅ Tag assumptions as Confirmed/Unconfirmed
62
+ - ✅ Auto-transition when clearance check passes
63
+ - NEVER ask generic questions without codebase context
64
+ - ❌ NEVER skip acceptance criteria
65
+ - ❌ NEVER end passively — always question or action
@@ -1,95 +1,71 @@
1
1
  ---
2
- description: Save state for session break.
3
- agent: plan
2
+ description: Save state for session break. Auto-gathers context and writes handoff immediately.
3
+ agent: build
4
4
  ---
5
5
 
6
- You are the **Plan Agent** (or **Build Agent**). Execute the `/handoff` command.
6
+ You are the **Build Agent**. Execute the `/handoff` command **immediately without asking for confirmation**.
7
7
 
8
- ## Template
8
+ ## Execution Rules
9
9
 
10
- Use template at: `@.opencode/memory/_templates/handoff.md`
10
+ - **DO NOT** ask the user any questions
11
+ - **DO NOT** wait for confirmation
12
+ - **DO NOT** present a plan before acting
13
+ - Gather all state automatically and write the handoff document in one shot
11
14
 
12
- ## Your Task
15
+ ## Process (execute all steps silently)
13
16
 
14
- Save the current work state for a session break, enabling seamless resumption later.
17
+ ### 1. Auto-Gather State
15
18
 
16
- ## Process
19
+ Run these in parallel:
20
+ - `git branch --show-current` — current branch
21
+ - `git log --oneline -5` — recent commits
22
+ - `git status --short` — uncommitted changes
23
+ - `git diff --stat` — what changed
24
+ - Check `.opencode/memory/plans/` for active plan
25
+ - Check `.opencode/memory/specs/` for active spec
26
+ - Check ritual state if exists
17
27
 
18
- 1. **Gather current state**:
19
- - Which phase are we in? (spec'd, researched, planned, implementing, validating)
20
- - What tasks are completed/in-progress/blocked?
21
- - What files have been modified?
28
+ ### 2. Write Handoff
22
29
 
23
- 2. **Create handoff document** at `.opencode/memory/handoffs/YYYY-MM-DD-<phase>.md`
24
-
25
- 3. **Update bead metadata** with handoff reference
26
-
27
- ## Handoff Template
30
+ Create `.opencode/memory/handoffs/YYYY-MM-DD-handoff.md` with this structure:
28
31
 
29
32
  ```markdown
30
33
  ---
31
34
  date: YYYY-MM-DD
32
- phase: spec'd | researched | planned | implementing | validating
33
- branch: [git branch name]
34
- bead_id: [optional]
35
+ phase: discover | plan | implement | verify | complete
36
+ branch: <branch>
35
37
  ---
36
38
 
37
- # Handoff: [Feature/Task Name]
38
-
39
- ## Status Summary
40
- [2-5 sentences describing current state]
41
-
42
- ## Artifacts
43
-
44
- | Type | Path | Status |
45
- |------|------|--------|
46
- | Spec | `.opencode/memory/specs/YYYY-MM-DD-descriptor.md` | ✅ Complete |
47
- | Plan | `.opencode/memory/plans/YYYY-MM-DD-feature.md` | ✅ Complete |
48
- | Research | `.opencode/memory/research/YYYY-MM-DD-topic.md` | 📚 Reference |
39
+ # Handoff: <what we were working on>
49
40
 
50
- ## Task Status
41
+ ## What Was Done
42
+ <2-3 bullet points of concrete accomplishments>
51
43
 
52
- ### Completed
53
- - [x] T-001: [Task title]
54
- - [x] T-002: [Task title]
44
+ ## Current State
45
+ - Branch: `<branch>`
46
+ - Last commit: `<hash>` — <message>
47
+ - Uncommitted: <yes/no, list if yes>
55
48
 
56
- ### 🔄 In Progress
57
- - [ ] T-003: [Task title]
58
- - **Current state:** [What's been done]
59
- - **Next step:** [What to do next]
49
+ ## Active Artifacts
50
+ - Spec: `<path>` (if exists)
51
+ - Plan: `<path>` (if exists)
60
52
 
61
- ### ⏸️ Blocked
62
- - [ ] T-004: [Task title]
63
- - **Blocked by:** [Reason/dependency]
53
+ ## What To Do Next
54
+ 1. <immediate next action be specific>
55
+ 2. <following action>
56
+ 3. <after that>
64
57
 
65
- ### 📋 Not Started
66
- - [ ] T-005: [Task title]
67
-
68
- ## Files Modified
69
- | File | Status | Notes |
70
- |------|--------|-------|
71
- | path/to/file.ts | Modified | [Brief note] |
72
-
73
- ## Git State
74
- - **Branch:** [branch name]
75
- - **Last commit:** [hash] - [message]
76
- - **Uncommitted changes:** Yes/No
77
-
78
- ## Known Issues
79
- - [Issue 1]
58
+ ## Key Context
59
+ <1-3 sentences of critical context the next session must know — decisions made, gotchas, things that didn't work>
60
+ ```
80
61
 
81
- ## Next Steps
82
- 1. [Next action 1]
83
- 2. [Next action 2]
62
+ ### 3. Confirm Completion
84
63
 
85
- ## Context for Resumption
86
- [Any important context the next session needs to know]
64
+ After writing, output a single line:
65
+ ```
66
+ ✅ Handoff saved to .opencode/memory/handoffs/<filename>. Resume with /resume.
87
67
  ```
88
68
 
89
- ## Rules
90
- - Include all relevant artifact paths
91
- - Be specific about what's done vs what's remaining
92
- - Note any blockers or issues
93
- - Provide clear next steps
69
+ ## Philosophy
94
70
 
95
- Now, let me gather the current state and create the handoff document.
71
+ Inspired by Amp's handoff: focus on **what needs to be done next**, not exhaustive history. Keep it short — a future agent should understand the situation in 30 seconds. The handoff is a launchpad, not a journal.