opencodekit 0.8.0 → 0.9.1

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.
@@ -16,7 +16,6 @@ tools:
16
16
  task: true
17
17
  todowrite: true
18
18
  todoread: true
19
- gkg*: true
20
19
  context7*: true
21
20
  codesearch: true
22
21
  gh_grep*: true
@@ -57,12 +56,10 @@ Comprehensive analysis with actionable recommendations.
57
56
  **Use when:** Design review, accessibility audit, system consistency check
58
57
  **Skills:** Combine multiple skills based on task:
59
58
 
60
- | Task | Primary Skill | Supporting Skills |
61
- | --------------- | --------------------- | --------------------- |
62
- | UI/UX Review | `ui-ux-research` | `frontend-aesthetics` |
63
- | Accessibility | `accessibility-audit` | `visual-analysis` |
64
- | Design System | `design-system-audit` | `frontend-aesthetics` |
65
- | Mockup Analysis | `mockup-to-code` | `visual-analysis` |
59
+ - **UI/UX Review**: Primary `ui-ux-research`, supporting `frontend-aesthetics`
60
+ - **Accessibility**: Primary `accessibility-audit`, supporting `visual-analysis`
61
+ - **Design System**: Primary `design-system-audit`, supporting `frontend-aesthetics`
62
+ - **Mockup Analysis**: Primary `mockup-to-code`, supporting `visual-analysis`
66
63
 
67
64
  ```
68
65
  Load skill(s) → Systematic analysis → Structured findings → Recommendations
@@ -89,22 +86,19 @@ Load skill(s) → Systematic analysis → Structured findings → Recommendation
89
86
 
90
87
  ## Skill Selection Guide
91
88
 
92
- | User Request | Load This Skill |
93
- | ----------------------------- | --------------------- |
94
- | "Review this mockup" | `visual-analysis` |
95
- | "Check accessibility" | `accessibility-audit` |
96
- | "Audit our design system" | `design-system-audit` |
97
- | "Convert this design to code" | `mockup-to-code` |
98
- | "Is this too AI-looking?" | `frontend-aesthetics` |
99
- | "Deep UI/UX analysis" | `ui-ux-research` |
89
+ - "Review this mockup" `visual-analysis`
90
+ - "Check accessibility" `accessibility-audit`
91
+ - "Audit our design system" `design-system-audit`
92
+ - "Convert this design to code" `mockup-to-code`
93
+ - "Is this too AI-looking?" `frontend-aesthetics`
94
+ - "Deep UI/UX analysis" `ui-ux-research`
100
95
 
101
96
  ## Tool Priority
102
97
 
103
98
  1. **Skills** (`use_skill`) - Load appropriate skill for the task
104
99
  2. **Read/Glob** - Inspect existing components and styles
105
- 3. **GKG tools** - Find design-related code definitions
106
- 4. **Webfetch/Websearch** - Design inspiration and references
107
- 5. **Context7** - UI library documentation
100
+ 3. **Webfetch/Websearch** - Design inspiration and references
101
+ 4. **Context7** - UI library documentation
108
102
 
109
103
  ## Output Format
110
104
 
@@ -138,12 +132,10 @@ All analyses should follow this structure:
138
132
 
139
133
  ## Delegation
140
134
 
141
- | Need | Delegate To |
142
- | --------------------- | ----------- |
143
- | Implement changes | @build |
144
- | Research UI libraries | @scout |
145
- | Review implementation | @review |
146
- | Plan large redesign | @planner |
135
+ - Implement changes @build
136
+ - Research UI libraries → @scout
137
+ - Review implementation @review
138
+ - Plan large redesign @planner
147
139
 
148
140
  ## Anti-Patterns to Flag
149
141
 
@@ -47,12 +47,10 @@ Write `.beads/artifacts/<bead-id>/handoffs/<timestamp>.md`:
47
47
 
48
48
  ## Provenance
49
49
 
50
- | Key | Value |
51
- | ------ | ---------------- |
52
- | Repo | [git remote URL] |
53
- | Branch | [branch name] |
54
- | Commit | [commit hash] |
55
- | Clean | [yes/no] |
50
+ - **Repo:** [git remote URL]
51
+ - **Branch:** [branch name]
52
+ - **Commit:** [commit hash]
53
+ - **Clean:** [yes/no]
56
54
 
57
55
  ## Session Context
58
56
 
@@ -68,12 +66,10 @@ read_session("last", project="current")
68
66
 
69
67
  ## Bead State
70
68
 
71
- | Key | Value |
72
- | -------- | ---------- |
73
- | ID | <bead-id> |
74
- | Title | [title] |
75
- | Status | [status] |
76
- | Priority | [priority] |
69
+ - **ID:** <bead-id>
70
+ - **Title:** [title]
71
+ - **Status:** [status]
72
+ - **Priority:** [priority]
77
73
 
78
74
  ## Progress
79
75
 
@@ -43,11 +43,11 @@ Extract:
43
43
 
44
44
  Run these **in parallel** using batch tool calls:
45
45
 
46
- ### Internal Codebase (GKG)
46
+ ### Internal Codebase
47
47
 
48
- - `gkg_search_codebase_definitions` - Find related functions/classes
49
- - `gkg_get_references` - See how existing code connects
50
- - `gkg_repo_map` - Map relevant directories
48
+ - `grep` - Find related functions/classes by pattern
49
+ - `ast-grep` - Semantic code search for patterns
50
+ - `glob` - Map relevant directories
51
51
 
52
52
  ### External Docs (Context7)
53
53
 
@@ -68,12 +68,12 @@ Run these **in parallel** using batch tool calls:
68
68
 
69
69
  For each finding:
70
70
 
71
- | Check | Pass/Fail |
72
- | -------------------------- | --------- |
73
- | Within spec scope? | |
74
- | Follows constraints? | |
75
- | Uses allowed libs? | |
76
- | Matches existing patterns? | |
71
+ **Validation checklist:**
72
+
73
+ - Within spec scope?
74
+ - Follows constraints?
75
+ - Uses allowed libs?
76
+ - Matches existing patterns?
77
77
 
78
78
  **Discard anything that fails.**
79
79
 
@@ -79,12 +79,10 @@ For `bd_ls({ status: "in_progress" })`:
79
79
 
80
80
  ## Required Actions
81
81
 
82
- | State | Action |
83
- | --------------- | ---------------------- |
84
- | Missing spec | `/create` |
85
- | Has spec | `/start <bead-id>` |
86
- | In Progress | `/implement <bead-id>` |
87
- | Ready to finish | `/finish <bead-id>` |
82
+ - Missing spec → `/create`
83
+ - Has spec `/start <bead-id>`
84
+ - In Progress `/implement <bead-id>`
85
+ - Ready to finish → `/finish <bead-id>`
88
86
 
89
87
  ## Session Insights
90
88
 
@@ -72,17 +72,6 @@
72
72
  "session_compact": "ctrl+k"
73
73
  },
74
74
  "mcp": {
75
- "Framelink MCP for Figma": {
76
- "command": [
77
- "npx",
78
- "-y",
79
- "figma-developer-mcp",
80
- "--figma-api-key={env:FIGMA_API_KEY}",
81
- "--stdio"
82
- ],
83
- "enabled": false,
84
- "type": "local"
85
- },
86
75
  "context7": {
87
76
  "command": [
88
77
  "npx",
@@ -98,16 +87,6 @@
98
87
  "enabled": true,
99
88
  "type": "remote",
100
89
  "url": "https://mcp.grep.app"
101
- },
102
- "gkg": {
103
- "enabled": true,
104
- "type": "remote",
105
- "url": "http://localhost:27495/mcp"
106
- },
107
- "playwright": {
108
- "command": ["npx", "@playwright/mcp@latest"],
109
- "enabled": false,
110
- "type": "local"
111
90
  }
112
91
  },
113
92
  "model": "github-copilot/claude-haiku-4.5",
@@ -475,8 +454,7 @@
475
454
  "tools": {
476
455
  "beads-village*": false,
477
456
  "context7*": true,
478
- "gh_grep*": true,
479
- "gkg*": true
457
+ "gh_grep*": true
480
458
  },
481
459
  "tui": {
482
460
  "diff_style": "auto",
@@ -11,7 +11,7 @@
11
11
  "author": "",
12
12
  "license": "ISC",
13
13
  "dependencies": {
14
- "@opencode-ai/plugin": "1.0.222"
14
+ "@opencode-ai/plugin": "1.0.223"
15
15
  },
16
16
  "devDependencies": {
17
17
  "@types/node": "^25.0.3",
@@ -1,16 +1,93 @@
1
+ import * as fs from "fs";
2
+ import * as path from "path";
1
3
  import type { Plugin } from "@opencode-ai/plugin";
2
4
 
3
5
  /**
4
- * Compaction Plugin - Customizes session compaction for context continuity
6
+ * Memory & Compaction Plugin
5
7
  *
6
- * This plugin injects additional context into the compaction process,
7
- * including beads state and memory file references.
8
+ * Combines memory auto-loading with session compaction customization:
9
+ * 1. Auto-load memory on session start (session.start hook)
10
+ * 2. Inject memory + beads context into compaction
11
+ * 3. Custom compaction prompt for context continuity
8
12
  */
13
+
14
+ // Memory paths
15
+ const getGlobalUserMemoryPath = () =>
16
+ path.join(process.env.HOME || "~", ".config/opencode/memory/user.md");
17
+
18
+ const getProjectMemoryPath = (directory: string) =>
19
+ path.join(directory, ".opencode/memory");
20
+
21
+ // Load memory files for injection
22
+ const loadMemoryContext = async (directory: string): Promise<string[]> => {
23
+ const context: string[] = [];
24
+
25
+ // 1. Global user memory (cross-project preferences)
26
+ const globalUserPath = getGlobalUserMemoryPath();
27
+ if (fs.existsSync(globalUserPath)) {
28
+ try {
29
+ const content = fs.readFileSync(globalUserPath, "utf-8");
30
+ if (content.trim() && !content.includes("<!-- ")) {
31
+ context.push(`## User Profile (Global)\n${content}`);
32
+ }
33
+ } catch {}
34
+ }
35
+
36
+ // 2. Project memory files
37
+ const projectMemoryPath = getProjectMemoryPath(directory);
38
+ if (fs.existsSync(projectMemoryPath)) {
39
+ const files = [
40
+ "project/commands.md",
41
+ "project/conventions.md",
42
+ "project/gotchas.md",
43
+ "project/architecture.md",
44
+ ];
45
+ for (const file of files) {
46
+ const filePath = path.join(projectMemoryPath, file);
47
+ if (fs.existsSync(filePath)) {
48
+ try {
49
+ const content = fs.readFileSync(filePath, "utf-8");
50
+ // Only include if has actual content (not just template)
51
+ if (content.trim() && !content.includes("<!-- ")) {
52
+ const name = path.basename(file, ".md");
53
+ context.push(`## Project ${name}\n${content}`);
54
+ }
55
+ } catch {}
56
+ }
57
+ }
58
+ }
59
+
60
+ return context;
61
+ };
62
+
9
63
  export const CompactionPlugin: Plugin = async (ctx) => {
10
64
  const { $, directory } = ctx;
11
65
 
12
66
  return {
67
+ // 1. Auto-load memory context on session start
68
+ "session.start": async (
69
+ _input: unknown,
70
+ output: { additionalContext?: string },
71
+ ) => {
72
+ const memoryContext = await loadMemoryContext(directory);
73
+
74
+ if (memoryContext.length > 0) {
75
+ output.additionalContext = `
76
+ # Memory Context (Auto-loaded)
77
+
78
+ ${memoryContext.join("\n\n")}
79
+ `;
80
+ console.log(
81
+ `[compaction] Injected ${memoryContext.length} memory contexts into session`,
82
+ );
83
+ }
84
+ },
85
+
86
+ // 2. Inject context into compaction
13
87
  "experimental.session.compacting": async (input, output) => {
88
+ // Load memory context for compaction
89
+ const memoryContext = await loadMemoryContext(directory);
90
+
14
91
  // Inject beads state if available
15
92
  let beadsContext = "";
16
93
  try {
@@ -26,9 +103,15 @@ export const CompactionPlugin: Plugin = async (ctx) => {
26
103
  // Beads not available, skip
27
104
  }
28
105
 
29
- // Inject custom context
106
+ // Inject custom context with memory
107
+ const memorySection =
108
+ memoryContext.length > 0
109
+ ? `\n## Persistent Memory\n${memoryContext.join("\n\n")}\n`
110
+ : "";
111
+
30
112
  output.context.push(`## Session Context
31
113
  ${beadsContext}
114
+ ${memorySection}
32
115
  ## Memory Files to Check
33
116
  - .opencode/memory/project/gotchas.md - Non-obvious behaviors discovered
34
117
  - .opencode/memory/project/commands.md - Build/test commands learned