clikit-plugin 0.2.36 → 0.2.38

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 (48) hide show
  1. package/README.md +12 -13
  2. package/command/plan.md +9 -4
  3. package/command/research.md +5 -5
  4. package/command/ship.md +51 -59
  5. package/command/verify.md +74 -50
  6. package/dist/.tsbuildinfo +1 -1
  7. package/dist/agents/index.d.ts.map +1 -1
  8. package/dist/cli.js +6 -0
  9. package/dist/cli.test.d.ts +2 -0
  10. package/dist/cli.test.d.ts.map +1 -0
  11. package/dist/clikit.schema.json +154 -136
  12. package/dist/commands/index.d.ts.map +1 -1
  13. package/dist/config.d.ts +13 -0
  14. package/dist/config.d.ts.map +1 -1
  15. package/dist/config.test.d.ts +2 -0
  16. package/dist/config.test.d.ts.map +1 -0
  17. package/dist/hooks/error-logger.d.ts +10 -0
  18. package/dist/hooks/error-logger.d.ts.map +1 -0
  19. package/dist/hooks/index.d.ts +1 -1
  20. package/dist/hooks/index.d.ts.map +1 -1
  21. package/dist/hooks/memory-digest.d.ts +2 -0
  22. package/dist/hooks/memory-digest.d.ts.map +1 -1
  23. package/dist/index.d.ts.map +1 -1
  24. package/dist/index.js +764 -154
  25. package/dist/skills/index.d.ts +9 -0
  26. package/dist/skills/index.d.ts.map +1 -1
  27. package/dist/tools/cass-memory.d.ts +61 -0
  28. package/dist/tools/cass-memory.d.ts.map +1 -0
  29. package/dist/tools/index.d.ts +1 -0
  30. package/dist/tools/index.d.ts.map +1 -1
  31. package/package.json +2 -2
  32. package/skill/cass-village/SKILL.md +217 -0
  33. package/src/agents/AGENTS.md +2 -1
  34. package/src/agents/build.md +17 -16
  35. package/src/agents/index.ts +33 -4
  36. package/src/agents/oracle.md +49 -68
  37. package/src/agents/plan.md +14 -15
  38. package/src/agents/research.md +76 -0
  39. package/src/agents/review.md +1 -1
  40. package/src/agents/vision.md +1 -1
  41. package/dist/hooks/git-guard.test.d.ts +0 -2
  42. package/dist/hooks/git-guard.test.d.ts.map +0 -1
  43. package/dist/hooks/security-check.test.d.ts +0 -2
  44. package/dist/hooks/security-check.test.d.ts.map +0 -1
  45. package/src/agents/general.md +0 -92
  46. package/src/agents/librarian.md +0 -116
  47. package/src/agents/looker.md +0 -112
  48. package/src/agents/scout.md +0 -84
package/README.md CHANGED
@@ -4,11 +4,11 @@ Curated agents, commands, skills, and memory system for OpenCode.
4
4
 
5
5
  ## Features
6
6
 
7
- - **10 Specialized Agents**: build, general, oracle, librarian, explore, looker, plan, review, scout, vision
7
+ - **7 Specialized Agents**: build, plan, explore, review, vision, oracle, research
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 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
10
+ - **7 Internal Utilities**: memory (read/search/get/timeline/update/admin), observation, swarm, beads-memory-sync, quick-research, context-summary, cass-memory (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, todo→beads sync, and cass-memory
12
12
  - **Memory System**: Templates, specs, 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
@@ -24,7 +24,7 @@ bun x clikit-plugin install
24
24
 
25
25
  That's it! The plugin will be registered in `~/.config/opencode/opencode.json`.
26
26
 
27
- Installer also adds default MCP servers if missing:
27
+ CliKit injects default MCP server entries at runtime when missing:
28
28
 
29
29
  - `beads-village` (`npx beads-village`)
30
30
  - `context7` (`https://mcp.context7.com/mcp`)
@@ -62,7 +62,7 @@ Project config overrides user config.
62
62
  ```json
63
63
  {
64
64
  "$schema": "https://unpkg.com/clikit-plugin@latest/schema.json",
65
- "disabled_agents": ["scout"],
65
+ "disabled_agents": ["review"],
66
66
  "disabled_commands": ["security"],
67
67
  "disabled_skills": ["playwright"],
68
68
  "skills": {
@@ -70,7 +70,7 @@ Project config overrides user config.
70
70
  "disable": ["sharing-skills"]
71
71
  },
72
72
  "agents": {
73
- "oracle": {
73
+ "vision": {
74
74
  "model": "openai/gpt-4o"
75
75
  },
76
76
  "build": {
@@ -93,7 +93,8 @@ Project config overrides user config.
93
93
  "truncator": { "enabled": true },
94
94
  "swarm_enforcer": { "enabled": true },
95
95
  "memory_digest": { "enabled": true },
96
- "todo_beads_sync": { "enabled": true }
96
+ "todo_beads_sync": { "enabled": true },
97
+ "cass_memory": { "enabled": true }
97
98
  }
98
99
  }
99
100
  ```
@@ -122,21 +123,19 @@ Project config overrides user config.
122
123
  | `subagent_question_blocker` | on | Prevents subagents from asking clarifying questions |
123
124
  | `truncator` | on | Truncates large outputs to prevent context overflow |
124
125
  | `swarm_enforcer` | on | Enforces task isolation in multi-agent swarms |
125
- | `memory_digest` | on | Generates `memory/_digest.md` from SQLite observations |
126
+ | `memory_digest` | on | Generates `memory/_digest.md` index + topic files (`decision.md`, `learning.md`, etc.) from SQLite observations |
126
127
  | `todo_beads_sync` | on | Mirrors OpenCode todos into Beads issues |
128
+ | `cass_memory` | on | Loads embedded memory context on session start and runs idle reflection (`cassMemoryContext`, `cassMemoryReflect`) |
127
129
 
128
130
  ## Agents
129
131
 
130
132
  | Agent | Mode | Description |
131
133
  |-------|------|-------------|
132
134
  | `build` | primary | Primary code executor, implements plans |
133
- | `general` | subagent | General-purpose, multi-step tasks & complex questions |
134
135
  | `plan` | primary | Creates implementation plans from specs |
135
- | `oracle` | subagent | Expert advisor for architecture & debugging |
136
- | `librarian` | subagent | Multi-repo analysis, doc lookup |
136
+ | `oracle` | subagent | Deep code inspection + architecture trade-off analysis |
137
+ | `research` | subagent | External docs + GitHub evidence research |
137
138
  | `explore` | subagent | Fast codebase exploration |
138
- | `looker` | subagent | Deep code inspection & architecture analysis |
139
- | `scout` | subagent | External research & web search |
140
139
  | `review` | subagent | Code review & quality gate |
141
140
  | `vision` | subagent | Design direction + visual implementation |
142
141
 
package/command/plan.md CHANGED
@@ -32,14 +32,19 @@ Fire these immediately alongside codebase exploration:
32
32
 
33
33
  **Memory mining** (Plan reads directly — has file read access):
34
34
  ```
35
- Read: ".opencode/memory/_digest.md" — Auto-generated from SQLite (decisions, learnings, blockers, handoffs)
35
+ Read: ".opencode/memory/_digest.md" — Compact index of memory topics and highlights
36
+ Read: ".opencode/memory/decision.md" — Detailed architectural decisions
37
+ Read: ".opencode/memory/learning.md" — Detailed learnings and gotchas
38
+ Read: ".opencode/memory/blocker.md" — Past blockers and mitigations
39
+ Read: ".opencode/memory/progress.md" — Recent progress notes
40
+ Read: ".opencode/memory/handoff.md" — Session handoff observations
36
41
  Read: ".opencode/memory/research/" — List files, read any related to the feature
37
42
  Read: ".opencode/memory/handoffs/" — Read recent handoffs for prior session context
38
43
  Read: ".opencode/memory/reviews/" — Check past review findings on related code
39
44
  Read: ".opencode/memory/specs/" — Check for prior/related specs
40
45
  ```
41
46
 
42
- > `_digest.md` is generated by the Memory Digest hook on session start. Contains past decisions, learnings, blockers, and handoffs from the SQLite observations DB.
47
+ > `_digest.md` is an index generated by the Memory Digest hook. Use topic files (`decision.md`, `learning.md`, etc.) for full details.
43
48
 
44
49
  Surface from memory files:
45
50
  - Past decisions that constrain this plan
@@ -65,9 +70,9 @@ Explore: "Find existing patterns for similar features — structure, naming, tes
65
70
  Explore: "Find test infrastructure and conventions — framework, helpers, fixtures."
66
71
  ```
67
72
 
68
- For complex features, also fire:
73
+ For complex features, also delegate in parallel:
69
74
  ```
70
- Scout: "Find docs and production patterns for [relevant libraries/APIs]."
75
+ Research: "Find docs and production patterns for [relevant libraries/APIs]."
71
76
  Oracle: "Analyze architecture trade-offs for [key decisions]."
72
77
  ```
73
78
 
@@ -1,10 +1,10 @@
1
1
  ---
2
2
  description: Deep exploration and research before planning.
3
- agent: plan
3
+ agent: research
4
4
  subtask: true
5
5
  ---
6
6
 
7
- You are the **Plan Agent** delegating to **Scout Agent**. Execute the `/research` command.
7
+ You are the **Research Agent**. Execute the `/research` command.
8
8
 
9
9
  ## Template
10
10
 
@@ -18,7 +18,7 @@ Conduct deep research on a topic before planning implementation.
18
18
 
19
19
  1. **Identify research questions** from spec or user request
20
20
 
21
- 2. **Delegate to Scout Agent** with:
21
+ 2. **Run focused external research** with:
22
22
  - Question to research
23
23
  - Constraints (language, framework, versions)
24
24
  - Format: summary | comparison | deep-dive
@@ -30,7 +30,7 @@ Conduct deep research on a topic before planning implementation.
30
30
 
31
31
  ## Research Request Format
32
32
 
33
- When delegating, use:
33
+ Use this request schema:
34
34
  ```yaml
35
35
  type: "research"
36
36
  question: "[Research question]"
@@ -98,6 +98,6 @@ bead_id: [optional]
98
98
  - `mcp__context7__*` — Library documentation
99
99
  - `mcp__exa__*` — Code examples, recent content
100
100
  - `mcp__gh_grep__searchGitHub` — Real-world code patterns
101
- - `librarian` — Deep repository analysis
101
+ - `web_search` + source links Cross-check and evidence gathering
102
102
 
103
103
  Identify the research questions from the user's request or the active spec, then begin research immediately.
package/command/ship.md CHANGED
@@ -1,5 +1,5 @@
1
1
  ---
2
- description: Ship completed work. Final verification, PR creation, and cleanup.
2
+ description: Ship completed work. Enforce verify gate, create PR, and cleanup.
3
3
  agent: build
4
4
  ---
5
5
 
@@ -7,103 +7,95 @@ You are the **Build Agent**. Execute the `/ship` command.
7
7
 
8
8
  ## Your Task
9
9
 
10
- Finalize and ship the current work run all verification gates, create a PR, and clean up.
10
+ Finalize and ship the current work only after `/verify` passes with a ship-ready verdict.
11
11
 
12
12
  ## Process
13
13
 
14
- ### 1. Pre-Ship Verification
14
+ ### 1. Enforce Verify Gate (Mandatory)
15
15
 
16
- Run ALL hard gates before shipping:
16
+ Run `/verify` first and require:
17
+ - Overall Verdict: `PASS`
18
+ - Ship Recommendation: `SHIP_READY`
19
+ - No `Critical` or `High` findings
17
20
 
18
- ```bash
19
- # Type checking
20
- pnpm typecheck || npm run typecheck || yarn typecheck
21
-
22
- # Tests
23
- pnpm test || npm test || yarn test
24
-
25
- # Linting
26
- pnpm lint || npm run lint || yarn lint
27
-
28
- # Build
29
- pnpm build || npm run build || yarn build
30
- ```
31
-
32
- If ANY gate fails, stop and fix before continuing.
21
+ If `/verify` returns `FAIL`, `CHANGES_REQUIRED`, or `BLOCKED`:
22
+ - Stop shipping
23
+ - Present required fixes
24
+ - Ask user whether to fix now
33
25
 
34
- ### 2. Self-Review
26
+ ### 2. Final Self-Review
35
27
 
36
28
  Before creating PR:
37
- - Review all changed files (`git diff main`)
38
- - Check for debug code, console.logs, TODOs
39
- - Verify acceptance criteria from spec.md
40
- - Ensure no files outside plan's file impact were changed
29
+ - Review changed files (`git diff --name-only` and `git diff`)
30
+ - Confirm acceptance criteria from spec/plan are satisfied
31
+ - Confirm no debug artifacts (`console.log`, `TODO`, temporary hacks)
32
+ - Confirm changes stay within planned file impact
41
33
 
42
- ### 3. Request Review (Optional)
34
+ ### 3. Optional Formal Review
43
35
 
44
- Delegate to Review Agent for formal review:
45
- - Pass changed files list
46
- - Pass spec.md and plan.md references
47
- - Wait for verdict
48
-
49
- If verdict is `changes_required`, fix issues before continuing.
50
- If verdict is `blocked`, escalate to user.
36
+ If requested, run `/review` and apply verdict:
37
+ - `approved` continue
38
+ - `changes_required` stop and fix first
39
+ - `blocked` escalate to user
51
40
 
52
41
  ### 4. Git Preparation
53
42
 
54
43
  ```bash
55
- # Ensure clean state
44
+ # Ensure clean understanding of local state
56
45
  git status
57
46
 
58
- # Stage changes
59
- git add -A
47
+ # Stage only files related to this work (never blanket add)
48
+ git add <explicit-file-list>
60
49
 
61
- # Create commit with conventional format
50
+ # Commit using conventional format
62
51
  git commit -m "type(scope): description"
63
52
  ```
64
53
 
65
54
  ### 5. Create PR
66
55
 
67
- Delegate to `/pr` command flow:
68
- - Generate comprehensive PR description
69
- - Link spec, plan, review artifacts
56
+ Use `/pr` flow:
57
+ - Generate complete PR description
58
+ - Link spec, plan, verify, and review artifacts
70
59
  - Create PR via `gh pr create`
71
60
 
72
61
  ### 6. Post-Ship Cleanup
73
62
 
74
- - Update bead status to `done` or `validating`
75
- - Create handoff document for tracking
76
- - Report PR URL to user
63
+ - Update bead/task status
64
+ - Create handoff note if needed
65
+ - Report PR URL + final ship summary to user
77
66
 
78
67
  ## Ship Checklist
79
68
 
80
69
  ```
81
- Pre-Ship:
82
- - [ ] Typecheck passes
83
- - [ ] All tests pass
84
- - [ ] Lint passes
85
- - [ ] Build succeeds
70
+ Verify Gate:
71
+ - [ ] /verify executed
72
+ - [ ] Overall Verdict = PASS
73
+ - [ ] Ship Recommendation = SHIP_READY
74
+ - [ ] No Critical/High findings
75
+
76
+ Pre-PR:
86
77
  - [ ] Self-review completed
78
+ - [ ] Acceptance criteria verified
87
79
  - [ ] No debug/temporary code
88
80
 
89
81
  Ship:
90
- - [ ] Changes committed
91
- - [ ] PR created with full description
92
- - [ ] Artifacts linked
82
+ - [ ] Relevant files staged explicitly
83
+ - [ ] Commit created
84
+ - [ ] PR created with linked artifacts
93
85
 
94
86
  Post-Ship:
95
- - [ ] Bead status updated
87
+ - [ ] Status updated
96
88
  - [ ] PR URL reported
97
89
  ```
98
90
 
99
91
  ## Rules
100
92
 
101
- - ✅ ALWAYS run full verification before shipping
102
- - ✅ ALWAYS self-review changes
103
- - ✅ ALWAYS create proper commit messages
104
- - ✅ ALWAYS link artifacts in PR
105
- - ❌ NEVER ship with failing tests
106
- - ❌ NEVER ship without verification
107
- - ❌ NEVER skip self-review
93
+ - ✅ ALWAYS run `/verify` before shipping
94
+ - ✅ ALWAYS block ship when verify is not ship-ready
95
+ - ✅ ALWAYS stage explicit files only
96
+ - ✅ ALWAYS include verification artifacts in PR
97
+ - ❌ NEVER ship with failing gates
98
+ - ❌ NEVER bypass verify verdict
99
+ - ❌ NEVER use `git add -A` or `git add .`
108
100
 
109
- Now, let me verify and ship your work...
101
+ Now, enforcing verify gate before ship...
package/command/verify.md CHANGED
@@ -1,5 +1,5 @@
1
1
  ---
2
- description: Run full verification suite. Typecheck, tests, lint, build.
2
+ description: Deep verification gate before ship. Run required checks + structured review verdict.
3
3
  agent: build
4
4
  subtask: true
5
5
  ---
@@ -8,72 +8,96 @@ You are the **Build Agent**. Execute the `/verify` command.
8
8
 
9
9
  ## Your Task
10
10
 
11
- Run the full verification suite and report results.
11
+ Run a strict pre-ship verification gate and produce a ship recommendation.
12
12
 
13
13
  ## Process
14
14
 
15
- ### 1. Detect Project Tools
15
+ ### 1) Load Constraints First (Mandatory)
16
16
 
17
- Check which tools are available:
17
+ Before running checks:
18
+ 1. Read `AGENTS.md` and any directory-specific AGENTS guidance for changed files.
19
+ 2. Read `package.json` scripts.
20
+ 3. Inspect changed files (`git diff --name-only`) so the review can focus on actual impact.
18
21
 
19
- ```bash
20
- # Check package manager
21
- ls package.json && cat package.json | head -5
22
- ls bun.lockb && echo "bun" || ls pnpm-lock.yaml && echo "pnpm" || ls yarn.lock && echo "yarn" || echo "npm"
23
- ```
22
+ ### 2) Detect Runtime + Command Strategy
23
+
24
+ - Detect package manager from lockfiles (`bun.lock`, `bun.lockb`, `pnpm-lock.yaml`, `yarn.lock`, else npm).
25
+ - Prefer project scripts from `package.json`.
26
+ - If script is missing, use safe fallback command.
27
+ - Do **not** skip a required gate.
24
28
 
25
- Read `package.json` scripts to determine available commands.
29
+ ### 3) Run Required Verification Gates (All 4)
26
30
 
27
- ### 2. Run Verification Gates
31
+ Run all gates even if earlier gates fail. Record status and key output for each.
28
32
 
29
- Execute in order, collecting results:
33
+ | Gate | Preferred | Fallbacks | Required |
34
+ |------|-----------|-----------|----------|
35
+ | Typecheck | `<pm> run typecheck` | `tsc --noEmit` | Yes |
36
+ | Tests | `<pm> test` or `<pm> run test` | `bun test` | Yes |
37
+ | Lint | `<pm> run lint` | `eslint .` | Yes |
38
+ | Build | `<pm> run build` | `bun run build` | Yes |
30
39
 
31
- | Gate | Commands (try in order) | Required |
32
- |------|------------------------|----------|
33
- | **Typecheck** | `pnpm typecheck`, `npm run typecheck`, `tsc --noEmit` | Yes |
34
- | **Tests** | `pnpm test`, `npm test`, `bun test` | Yes |
35
- | **Lint** | `pnpm lint`, `npm run lint`, `eslint .` | Yes |
36
- | **Build** | `pnpm build`, `npm run build`, `bun run build` | Yes |
40
+ ### 4) Deep Review Pass (After Commands)
37
41
 
38
- Run each gate. If a gate fails, continue to the next but record the failure.
42
+ Review changed files and report findings by severity:
43
+ - **Critical**: security/data-loss/corruption risk
44
+ - **High**: correctness bug, broken acceptance criteria, major regression risk
45
+ - **Medium**: edge-case gap, weak test coverage, maintainability risk
46
+ - **Low**: clarity/style/doc polish
39
47
 
40
- ### 3. Report Results
48
+ Review checklist:
49
+ - Requirements and acceptance criteria alignment
50
+ - Risky logic paths and edge cases
51
+ - Security/privacy concerns
52
+ - Missing or weak tests for changed behavior
53
+ - Debug leftovers / temporary code
41
54
 
42
- Format results clearly:
55
+ ### 5) Output Format (Strict)
43
56
 
44
57
  ```
45
58
  ## Verification Report
46
59
 
47
- | Gate | Status | Details |
48
- |------------|--------|------------------|
49
- | Typecheck | ✅/❌ | [error count] |
50
- | Tests | ✅/❌ | [pass/fail/skip] |
51
- | Lint | ✅/❌ | [warning/error] |
52
- | Build | ✅/❌ | [output] |
53
-
54
- ### Overall: PASS / FAIL
55
-
56
- ### Failures (if any)
57
- [Detailed error output for each failing gate]
58
-
59
- ### Recommended Fixes
60
- 1. [Fix suggestion]
60
+ ### Context
61
+ - Changed files: [...]
62
+ - Constraints loaded: [AGENTS.md, ...]
63
+ - Package manager: <pm>
64
+
65
+ | Gate | Status | Command Used | Details |
66
+ |------------|--------|--------------------|---------|
67
+ | Typecheck | ✅/❌ | ... | ... |
68
+ | Tests | ✅/❌ | ... | ... |
69
+ | Lint | ✅/❌ | ... | ... |
70
+ | Build | ✅/❌ | ... | ... |
71
+
72
+ ### Review Findings
73
+ #### Critical
74
+ - ...
75
+ #### High
76
+ - ...
77
+ #### Medium
78
+ - ...
79
+ #### Low
80
+ - ...
81
+
82
+ ### Overall Verdict
83
+ - PASS | FAIL
84
+
85
+ ### Ship Recommendation
86
+ - SHIP_READY | CHANGES_REQUIRED | BLOCKED
87
+
88
+ ### Required Fixes (if not SHIP_READY)
89
+ 1. ...
90
+ 2. ...
61
91
  ```
62
92
 
63
- ### 4. Fix Mode (Optional)
64
-
65
- If the user asks to fix issues:
66
- - Fix typecheck errors first (most foundational)
67
- - Then lint errors
68
- - Then test failures
69
- - Re-run verification after fixes
70
-
71
- ## Rules
93
+ ## Gate Rules
72
94
 
73
- - ✅ ALWAYS run all 4 gates even if one fails
74
- - ✅ ALWAYS report detailed error output
75
- - ✅ ALWAYS suggest fixes for failures
76
- - NEVER auto-fix without user confirmation
77
- - ❌ NEVER report passing if any gate fails
95
+ - ✅ ALWAYS run all 4 required gates
96
+ - ✅ ALWAYS read constraints before checks
97
+ - ✅ ALWAYS include command used + key output per gate
98
+ - ALWAYS include severity-ranked review findings
99
+ - ❌ NEVER auto-fix unless user explicitly asks
100
+ - ❌ NEVER mark PASS if any required gate fails
101
+ - ❌ NEVER mark SHIP_READY when Critical/High findings exist
78
102
 
79
- Now, running verification...
103
+ Now, running deep verification...