opencodekit 0.16.10 → 0.16.13
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/dist/index.js +1 -1
- package/dist/template/.opencode/AGENTS.md +85 -32
- package/dist/template/.opencode/agent/build.md +24 -2
- package/dist/template/.opencode/command/handoff.md +37 -0
- package/dist/template/.opencode/command/start.md +6 -0
- package/dist/template/.opencode/command/status.md +33 -7
- package/dist/template/.opencode/dcp.jsonc +79 -79
- package/dist/template/.opencode/memory.db-shm +0 -0
- package/dist/template/.opencode/memory.db-wal +0 -0
- package/dist/template/.opencode/opencode.json +905 -885
- package/dist/template/.opencode/plugin/compaction.ts +52 -51
- package/dist/template/.opencode/plugin/memory.ts +22 -551
- package/dist/template/.opencode/plugin/skill-mcp.ts +514 -486
- package/dist/template/.opencode/plugin/swarm-enforcer.ts +43 -119
- package/dist/template/.opencode/skill/agent-teams/SKILL.md +242 -0
- package/dist/template/.opencode/skill/compaction/SKILL.md +338 -0
- package/dist/template/.opencode/skill/jira/SKILL.md +177 -50
- package/dist/template/.opencode/skill/jira/mcp.json +2 -10
- package/package.json +1 -1
- package/dist/template/.opencode/plugin/env-ctx.ts +0 -34
- package/dist/template/.opencode/plugin/lsp.ts +0 -301
- package/dist/template/.opencode/plugin/truncator.ts +0 -59
|
@@ -1,20 +1,21 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Session Continuity Plugin (Compaction-Time Context Injection)
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
4
|
+
* Complements DCP plugin (which handles context management rules via
|
|
5
|
+
* experimental.chat.system.transform). This plugin fires ONLY during
|
|
6
|
+
* compaction events (experimental.session.compacting) and handles:
|
|
7
|
+
*
|
|
8
|
+
* 1. Load session-context.md (CONTINUITY.md pattern) — highest priority
|
|
9
|
+
* 2. Load project memory files (user prefs, tech stack, gotchas)
|
|
10
|
+
* 3. Inject beads in-progress state (active task IDs)
|
|
8
11
|
* 4. Load most recent handoff file for session resumption
|
|
9
|
-
* 5. Append
|
|
12
|
+
* 5. Append post-compaction recovery protocol
|
|
10
13
|
*
|
|
11
|
-
*
|
|
12
|
-
* -
|
|
13
|
-
*
|
|
14
|
-
* -
|
|
15
|
-
* -
|
|
16
|
-
* - Open Questions: Uncertainties marked UNCONFIRMED
|
|
17
|
-
* - Working Set: Files, bead IDs, branch
|
|
14
|
+
* Division of responsibility:
|
|
15
|
+
* - DCP plugin: context budget zones, distill/compress/prune rules,
|
|
16
|
+
* prunable-tools list, nudge system (always-on via system.transform)
|
|
17
|
+
* - This plugin: session state preservation, post-compaction recovery,
|
|
18
|
+
* memory persistence reminders (compaction-time only)
|
|
18
19
|
*/
|
|
19
20
|
|
|
20
21
|
import type { Plugin } from "@opencode-ai/plugin";
|
|
@@ -101,51 +102,51 @@ export const CompactionPlugin: Plugin = async ({ $, directory }) => {
|
|
|
101
102
|
output.context.push(`## Session Context\n${allContext}\n`);
|
|
102
103
|
}
|
|
103
104
|
|
|
104
|
-
// Append
|
|
105
|
+
// Append post-compaction recovery protocol
|
|
106
|
+
// NOTE: Context management rules (distill/compress/prune, tool guidance)
|
|
107
|
+
// are handled by DCP plugin via experimental.chat.system.transform (always present).
|
|
108
|
+
// This plugin ONLY handles session continuity and post-compaction recovery.
|
|
105
109
|
output.prompt = `${output.prompt}
|
|
106
110
|
|
|
107
|
-
##
|
|
111
|
+
## Post-Compaction Recovery Protocol
|
|
112
|
+
|
|
113
|
+
### IMMEDIATE: Restore Session State (Do This First)
|
|
114
|
+
1. Read session-context.md via \`memory-read({ file: "session-context" })\`
|
|
115
|
+
2. If missing or stale, reconstruct from the compaction summary above
|
|
116
|
+
3. Resume work from the "Now" item — do NOT restart from scratch
|
|
117
|
+
4. Ask 1-3 targeted questions ONLY if critical gaps remain (don't interrogate)
|
|
118
|
+
|
|
119
|
+
### Session Continuity Document
|
|
120
|
+
Maintain session-context.md via memory-update tool. This is your lifeline after compaction.
|
|
108
121
|
|
|
109
|
-
### Session Continuity
|
|
110
|
-
Maintain session-context.md via memory-update tool. Format:
|
|
111
122
|
\`\`\`
|
|
112
|
-
Goal: [What + success criteria]
|
|
113
|
-
Constraints: [
|
|
114
|
-
Decisions: [Key choices this session]
|
|
123
|
+
Goal: [What + measurable success criteria]
|
|
124
|
+
Constraints: [Hard limits. Mark UNCONFIRMED if inferred, never assume]
|
|
125
|
+
Decisions: [Key choices made this session + WHY]
|
|
115
126
|
State:
|
|
116
|
-
Done: [Completed]
|
|
117
|
-
Now: [Current focus - ONE thing]
|
|
118
|
-
Next: [Queued]
|
|
119
|
-
Open Questions: [Uncertainties - mark UNCONFIRMED]
|
|
120
|
-
Working Set: [
|
|
127
|
+
Done: [Completed items with verification status]
|
|
128
|
+
Now: [Current focus - ONE thing only]
|
|
129
|
+
Next: [Queued items in priority order]
|
|
130
|
+
Open Questions: [Uncertainties - mark UNCONFIRMED, note what would resolve each]
|
|
131
|
+
Working Set: [Exact file paths, bead IDs, branch name, worktree path if applicable]
|
|
121
132
|
\`\`\`
|
|
122
133
|
|
|
123
|
-
Update session-context.md when:
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
-
|
|
137
|
-
-
|
|
138
|
-
|
|
139
|
-
### Memory System
|
|
140
|
-
If you discover:
|
|
141
|
-
- Gotchas/edge cases → Save to .opencode/memory/project/gotchas.md
|
|
142
|
-
- Build/test commands → Save to .opencode/memory/project/commands.md
|
|
143
|
-
- Code patterns/conventions → Save to .opencode/memory/project/conventions.md
|
|
144
|
-
- Architecture insights → Save to .opencode/memory/project/architecture.md
|
|
145
|
-
|
|
146
|
-
### Preservation Priorities
|
|
147
|
-
- PRESERVE: File paths (file:line_number), user constraints, decisions, UNCONFIRMED items
|
|
148
|
-
- DROP: Failed attempts, superseded info, verbose tool outputs, exploration dead-ends
|
|
134
|
+
Update session-context.md when: goal changes, key decision made, state shifts, or uncertainty discovered.
|
|
135
|
+
|
|
136
|
+
### Preservation Priorities (Compaction-Specific)
|
|
137
|
+
These items MUST survive compaction — if they appeared in conversation, include in summary:
|
|
138
|
+
- **Bead state**: IDs (br-xxx), status, in-progress tasks, dependencies
|
|
139
|
+
- **Todo items**: Exact IDs, statuses, priorities, content
|
|
140
|
+
- **File paths**: Exact paths with line numbers where relevant
|
|
141
|
+
- **User constraints**: Verbatim. Never paraphrase.
|
|
142
|
+
- **Decisions + rationale**: Both WHAT and WHY
|
|
143
|
+
- **UNCONFIRMED items**: Keep uncertainty markers intact
|
|
144
|
+
|
|
145
|
+
### Memory Persistence (Before Compaction Loses It)
|
|
146
|
+
Save discoveries to persistent memory so they survive:
|
|
147
|
+
- Gotchas/edge cases → observation({ type: "warning", ... })
|
|
148
|
+
- Architecture insights → observation({ type: "pattern", ... })
|
|
149
|
+
- Key decisions → observation({ type: "decision", ... })
|
|
149
150
|
`;
|
|
150
151
|
},
|
|
151
152
|
};
|