@ikieaneh/opencode-kit 0.5.0 → 0.5.2
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/README.md +25 -9
- package/docs/examples/QUICKSTART.md +123 -0
- package/docs/examples/model-configs.md +117 -0
- package/docs/images/logo.svg +9 -0
- package/docs/plans/2026-06-11-plugin-architecture.md +55 -0
- package/package.json +5 -4
- package/skills/java-developer/SKILL.md +66 -0
- package/src/init.sh +52 -3
- package/templates/agents/code-reviewer.md +3 -3
- package/templates/agents/fixer.md +5 -5
- package/templates/agents/orchestrator.md +5 -5
- package/templates/agents/task-manager.md +6 -6
- package/templates/opencode-kit.schema.json +59 -11
package/README.md
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
<br />
|
|
12
12
|
<div align="center">
|
|
13
13
|
<a href="https://github.com/RizkiRachman/opencode-kit">
|
|
14
|
-
<img src="docs/images/logo.
|
|
14
|
+
<img src="docs/images/logo.svg" alt="Logo" width="80" height="80">
|
|
15
15
|
</a>
|
|
16
16
|
|
|
17
17
|
<h3 align="center">opencode-kit</h3>
|
|
@@ -28,6 +28,7 @@
|
|
|
28
28
|
</p>
|
|
29
29
|
|
|
30
30
|
<p>
|
|
31
|
+
<b>npm:</b> <code>@ikieaneh/opencode-kit</code> ·
|
|
31
32
|
<b>macOS M-Series</b> — Apple Silicon (arm64)
|
|
32
33
|
</p>
|
|
33
34
|
</div>
|
|
@@ -123,14 +124,14 @@ git --version # any recent version
|
|
|
123
124
|
|
|
124
125
|
### Installation
|
|
125
126
|
|
|
126
|
-
#### Option 1: Install as plugin (recommended
|
|
127
|
+
#### Option 1: Install as plugin (recommended)
|
|
127
128
|
|
|
128
129
|
Add to your project's `opencode.json`:
|
|
129
130
|
|
|
130
131
|
```json
|
|
131
132
|
{
|
|
132
133
|
"plugin": [
|
|
133
|
-
"opencode-kit", ← MUST be first
|
|
134
|
+
"@ikieaneh/opencode-kit", ← MUST be first
|
|
134
135
|
"other-plugins..."
|
|
135
136
|
]
|
|
136
137
|
}
|
|
@@ -139,10 +140,12 @@ Add to your project's `opencode.json`:
|
|
|
139
140
|
Then install:
|
|
140
141
|
|
|
141
142
|
```sh
|
|
142
|
-
npm install opencode-kit
|
|
143
|
+
npm install @ikieaneh/opencode-kit
|
|
143
144
|
```
|
|
144
145
|
|
|
145
|
-
The plugin auto-loads on next session.
|
|
146
|
+
The plugin auto-loads on next session. All 8 skills become available. The orchestration contract is injected into every session automatically.
|
|
147
|
+
|
|
148
|
+
> **Plugin ordering**: opencode-kit MUST be first in the plugin array. Its system prompt transform is foundational — other plugins may add behavior, but opencode-kit enforces the workflow.
|
|
146
149
|
|
|
147
150
|
> **Plugin ordering**: opencode-kit MUST be first in the plugin array. Its system prompt transform is foundational — other plugins may add behavior, but opencode-kit enforces the workflow.
|
|
148
151
|
|
|
@@ -370,10 +373,17 @@ After every subagent delegation, scoring runs automatically:
|
|
|
370
373
|
- [x] Integration tests (7/7 passing)
|
|
371
374
|
- [x] CI integration test job
|
|
372
375
|
|
|
373
|
-
### v0.6 —
|
|
374
|
-
- [
|
|
375
|
-
- [
|
|
376
|
-
- [
|
|
376
|
+
### v0.6 — Polish ✅
|
|
377
|
+
- [x] README updated for @ikieaneh/opencode-kit plugin mode
|
|
378
|
+
- [x] Updated agent config schema (fallback_models, explorer, librarian, architect)
|
|
379
|
+
- [x] End-to-end tests (9 tests, plugin lifecycle + auto-init)
|
|
380
|
+
- [x] Quickstart example (`docs/examples/QUICKSTART.md`)
|
|
381
|
+
- [x] npm published as `@ikieaneh/opencode-kit`
|
|
382
|
+
- [x] CI: integration + e2e test jobs
|
|
383
|
+
|
|
384
|
+
### Future
|
|
385
|
+
- [ ] Web UI for contract overview (deferred — no current need)
|
|
386
|
+
- [ ] Plugin hardening: `experimental.chat.messages.transform` API is marked experimental — monitor OpenCode updates
|
|
377
387
|
|
|
378
388
|
See the [open issues](https://github.com/RizkiRachman/opencode-kit/issues) for full list.
|
|
379
389
|
|
|
@@ -398,6 +408,12 @@ Distributed under the MIT License. See `LICENSE` for more information.
|
|
|
398
408
|
<!-- CONTACT -->
|
|
399
409
|
## Contact
|
|
400
410
|
|
|
411
|
+
## Known Limitations
|
|
412
|
+
|
|
413
|
+
- **Plugin hook API**: The `experimental.chat.messages.transform` hook is marked as experimental in the OpenCode plugin SDK. It may change in future versions. If it breaks, the plugin falls back to per-project agent .md files (`.opencode/agents/*.md`), which remain functional.
|
|
414
|
+
- **Package name**: Currently published as `@ikieaneh/opencode-kit` (scoped). Requires `npm install @ikieaneh/opencode-kit`.
|
|
415
|
+
- **Contract auto-init**: Requires a git repository. Non-git projects use absolute path as hash fallback.
|
|
416
|
+
|
|
401
417
|
Rizki Rachman — [GitHub](https://github.com/RizkiRachman)
|
|
402
418
|
|
|
403
419
|
Project Link: [https://github.com/RizkiRachman/opencode-kit](https://github.com/RizkiRachman/opencode-kit)
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
# Quickstart: Using opencode-kit as a Plugin
|
|
2
|
+
|
|
3
|
+
This guide creates a new project from scratch with opencode-kit as an OpenCode plugin.
|
|
4
|
+
|
|
5
|
+
## Step 1: Create a project
|
|
6
|
+
|
|
7
|
+
```sh
|
|
8
|
+
mkdir my-agent-project
|
|
9
|
+
cd my-agent-project
|
|
10
|
+
git init
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Step 2: Install the plugin
|
|
14
|
+
|
|
15
|
+
```sh
|
|
16
|
+
npm install @ikieaneh/opencode-kit
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Step 3: Configure OpenCode
|
|
20
|
+
|
|
21
|
+
Create `opencode.json`:
|
|
22
|
+
|
|
23
|
+
```json
|
|
24
|
+
{
|
|
25
|
+
"model": "your-model",
|
|
26
|
+
"plugin": [
|
|
27
|
+
"@ikieaneh/opencode-kit",
|
|
28
|
+
"superpowers"
|
|
29
|
+
],
|
|
30
|
+
"agent": {
|
|
31
|
+
"orchestrator": {
|
|
32
|
+
"model": "your-model",
|
|
33
|
+
"skills": [
|
|
34
|
+
"orchestration-template",
|
|
35
|
+
"scoring-pipeline",
|
|
36
|
+
"verification-before-completion"
|
|
37
|
+
],
|
|
38
|
+
"steps": 50,
|
|
39
|
+
"fallback_models": ["your-fallback-model"]
|
|
40
|
+
},
|
|
41
|
+
"planner": {
|
|
42
|
+
"model": "your-model",
|
|
43
|
+
"skills": ["brainstorming", "writing-plans", "system-analyst"],
|
|
44
|
+
"steps": 80,
|
|
45
|
+
"fallback_models": ["your-fallback-model"]
|
|
46
|
+
},
|
|
47
|
+
"task-manager": {
|
|
48
|
+
"model": "your-model",
|
|
49
|
+
"skills": ["subagent-driven-development", "executing-plans", "test-driven-development"],
|
|
50
|
+
"steps": 100,
|
|
51
|
+
"fallback_models": ["your-fallback-model"]
|
|
52
|
+
},
|
|
53
|
+
"code-reviewer": {
|
|
54
|
+
"model": "your-model",
|
|
55
|
+
"skills": ["qa-expert", "security-expert"],
|
|
56
|
+
"steps": 80,
|
|
57
|
+
"fallback_models": ["your-fallback-model"]
|
|
58
|
+
},
|
|
59
|
+
"explorer": {
|
|
60
|
+
"model": "your-model",
|
|
61
|
+
"steps": 30,
|
|
62
|
+
"tools": { "postgres_*": false, "memory_*": false, "context7_*": false }
|
|
63
|
+
},
|
|
64
|
+
"librarian": {
|
|
65
|
+
"model": "your-model",
|
|
66
|
+
"steps": 30,
|
|
67
|
+
"tools": { "postgres_*": false, "memory_*": false, "graphify_*": false }
|
|
68
|
+
},
|
|
69
|
+
"leaner": {
|
|
70
|
+
"model": "your-model",
|
|
71
|
+
"skills": ["verification-before-completion", "qa-expert"]
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
## Step 4: Start working
|
|
78
|
+
|
|
79
|
+
Open the project in OpenCode. The plugin auto-loads:
|
|
80
|
+
|
|
81
|
+
1. 8 skills registered automatically
|
|
82
|
+
2. Orchestration contract injected into every session
|
|
83
|
+
3. Pre-flight enforcement active (branch check, contract load)
|
|
84
|
+
4. Scoring pipeline available after every delegation
|
|
85
|
+
5. ADR generator for architectural decisions
|
|
86
|
+
6. Telemetry tracking elapsed time per phase
|
|
87
|
+
|
|
88
|
+
## Step 5: Set a goal
|
|
89
|
+
|
|
90
|
+
Edit `.opencode/orchestration/contract.json`:
|
|
91
|
+
|
|
92
|
+
```json
|
|
93
|
+
{
|
|
94
|
+
"state": "INIT",
|
|
95
|
+
"requirements": {
|
|
96
|
+
"goal": "Add user authentication with JWT",
|
|
97
|
+
"acceptance_criteria": ["Users can register", "Users can login", "Tokens expire after 24h"]
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
## Step 6: Workflow runs itself
|
|
103
|
+
|
|
104
|
+
```
|
|
105
|
+
INIT → PLAN → PLAN_SCORED → EXECUTE → EXECUTE_SCORED → REVIEW → REVIEW_SCORED → COMPLETE
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
Each phase transition requires score ≥ 70. Score < 50 → BLOCKED.
|
|
109
|
+
|
|
110
|
+
## What you get
|
|
111
|
+
|
|
112
|
+
| Feature | Provider |
|
|
113
|
+
|---------|----------|
|
|
114
|
+
| Contract protocol | orchestration-template skill |
|
|
115
|
+
| Scoring pipeline | scoring-pipeline skill |
|
|
116
|
+
| ADR records | adr-generator skill |
|
|
117
|
+
| QA standards | qa-expert skill |
|
|
118
|
+
| Impact analysis | system-analyst skill |
|
|
119
|
+
| Token optimization | token-optimize skill |
|
|
120
|
+
| Verification gates | verification-before-completion skill |
|
|
121
|
+
| Post-task learning | learner skill |
|
|
122
|
+
| Telemetry | src/telemetry.sh |
|
|
123
|
+
| Rules enforcement | rules.json + validation.sh |
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
# Model Provider Configurations
|
|
2
|
+
|
|
3
|
+
Add these to your `opencode.json` to configure AI models for opencode-kit agents.
|
|
4
|
+
|
|
5
|
+
## DeepSeek (via Sumopod)
|
|
6
|
+
|
|
7
|
+
```json
|
|
8
|
+
{
|
|
9
|
+
"model": "sumopod/deepseek-v4-flash",
|
|
10
|
+
"provider": {
|
|
11
|
+
"sumopod": {
|
|
12
|
+
"npm": "@ai-sdk/openai-compatible",
|
|
13
|
+
"name": "Sumopod AI",
|
|
14
|
+
"options": {
|
|
15
|
+
"baseURL": "https://ai.sumopod.com/v1",
|
|
16
|
+
"apiKey": "sk-your-key"
|
|
17
|
+
},
|
|
18
|
+
"models": {
|
|
19
|
+
"deepseek-v4-flash": {
|
|
20
|
+
"name": "DeepSeek V4 Flash",
|
|
21
|
+
"options": {
|
|
22
|
+
"reasoningEffort": "high",
|
|
23
|
+
"textVerbosity": "low"
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## OpenAI
|
|
33
|
+
|
|
34
|
+
```json
|
|
35
|
+
{
|
|
36
|
+
"model": "gpt-4o",
|
|
37
|
+
"provider": {
|
|
38
|
+
"openai": {
|
|
39
|
+
"npm": "@ai-sdk/openai",
|
|
40
|
+
"models": {
|
|
41
|
+
"gpt-4o": { "name": "GPT-4o" },
|
|
42
|
+
"gpt-4o-mini": { "name": "GPT-4o Mini" }
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
## Anthropic (Claude)
|
|
50
|
+
|
|
51
|
+
```json
|
|
52
|
+
{
|
|
53
|
+
"model": "claude-sonnet-4-20250514",
|
|
54
|
+
"provider": {
|
|
55
|
+
"anthropic": {
|
|
56
|
+
"npm": "@ai-sdk/anthropic",
|
|
57
|
+
"models": {
|
|
58
|
+
"claude-sonnet-4-20250514": { "name": "Claude Sonnet 4" },
|
|
59
|
+
"claude-haiku-3-5-20241022": { "name": "Claude Haiku 3.5" }
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
## Google (Gemini)
|
|
67
|
+
|
|
68
|
+
```json
|
|
69
|
+
{
|
|
70
|
+
"model": "gemini-2.5-flash",
|
|
71
|
+
"provider": {
|
|
72
|
+
"google": {
|
|
73
|
+
"npm": "@ai-sdk/google",
|
|
74
|
+
"models": {
|
|
75
|
+
"gemini-2.5-flash": { "name": "Gemini 2.5 Flash" },
|
|
76
|
+
"gemini-2.5-pro": { "name": "Gemini 2.5 Pro" }
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
## Agent Assignment Strategy
|
|
84
|
+
|
|
85
|
+
Use **cheaper models** for simple agents, **better models** for complex reasoning:
|
|
86
|
+
|
|
87
|
+
| Agent | Recommended Model | Why |
|
|
88
|
+
|-------|------------------|-----|
|
|
89
|
+
| orchestrator | Cheaper (orchestration, not deep thinking) | Delegates most work |
|
|
90
|
+
| planner | Better (architecture, impact analysis) | Needs deep reasoning |
|
|
91
|
+
| task-manager | Better (implementation, code quality) | Needs to write correct code |
|
|
92
|
+
| code-reviewer | Better (security, edge cases) | Needs sharp analysis |
|
|
93
|
+
| explorer | Cheaper (just searches) | Simple grep/glob |
|
|
94
|
+
| librarian | Cheaper (fetches docs) | Simple fetch operations |
|
|
95
|
+
| learner | Cheaper (analysis after the fact) | Post-processing only |
|
|
96
|
+
| fixer | Cheaper (bounded edits) | Well-defined scope |
|
|
97
|
+
|
|
98
|
+
Example with mixed models:
|
|
99
|
+
|
|
100
|
+
```json
|
|
101
|
+
{
|
|
102
|
+
"agent": {
|
|
103
|
+
"orchestrator": {
|
|
104
|
+
"model": "sumopod/deepseek-v4-flash",
|
|
105
|
+
"fallback_models": ["gpt-4o-mini"]
|
|
106
|
+
},
|
|
107
|
+
"planner": {
|
|
108
|
+
"model": "gpt-4o",
|
|
109
|
+
"fallback_models": ["sumopod/deepseek-v4-flash"]
|
|
110
|
+
},
|
|
111
|
+
"task-manager": {
|
|
112
|
+
"model": "gpt-4o",
|
|
113
|
+
"fallback_models": ["sumopod/deepseek-v4-flash"]
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
```
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 80 80" fill="none">
|
|
2
|
+
<rect width="80" height="80" rx="16" fill="#1a1a2e"/>
|
|
3
|
+
<path d="M20 25h40v30H20z" stroke="#e94560" stroke-width="2" fill="none"/>
|
|
4
|
+
<path d="M20 40h40" stroke="#e94560" stroke-width="2"/>
|
|
5
|
+
<circle cx="30" cy="35" r="3" fill="#0f3460"/>
|
|
6
|
+
<circle cx="50" cy="35" r="3" fill="#0f3460"/>
|
|
7
|
+
<path d="M25 48l10-10M45 48l10-10" stroke="#16213e" stroke-width="2"/>
|
|
8
|
+
<text x="40" y="62" text-anchor="middle" font-size="8" fill="#e94560" font-family="monospace">KIT</text>
|
|
9
|
+
</svg>
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
# Plugin Architecture — Implementation Plan
|
|
2
|
+
|
|
3
|
+
> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development
|
|
4
|
+
|
|
5
|
+
**Goal:** Convert opencode-kit from a per-project scaffold to a global OpenCode plugin with local-override config
|
|
6
|
+
|
|
7
|
+
**Architecture:** Pure JS plugin (superpowers pattern) using `@opencode-ai/plugin` SDK. Global config at `~/.config/opencode-kit/`, project override at `.opencode/`. Plugin registers skills + system prompt transform.
|
|
8
|
+
|
|
9
|
+
**Tech Stack:** Node.js, @opencode-ai/plugin SDK, shell scripts
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
### Task 1: Plugin Entry Point
|
|
14
|
+
|
|
15
|
+
**Files:**
|
|
16
|
+
- Create: `.opencode/plugins/opencode-kit.js` — main plugin JS
|
|
17
|
+
- Create: `.claude-plugin/plugin.json` — metadata
|
|
18
|
+
- Modify: `package.json` — add plugin entry, `@opencode-ai/plugin` dependency
|
|
19
|
+
|
|
20
|
+
- [ ] Create `.opencode/plugins/opencode-kit.js` — system prompt transform hook that injects contract loading + preflight
|
|
21
|
+
- [ ] Create `.claude-plugin/plugin.json` — name, description, version, author
|
|
22
|
+
- [ ] Update `package.json` — `"main": ".opencode/plugins/opencode-kit.js"`, add `@opencode-ai/plugin` dep
|
|
23
|
+
|
|
24
|
+
### Task 2: Global Config Resolution
|
|
25
|
+
|
|
26
|
+
**Files:**
|
|
27
|
+
- Create: `src/global-config.sh` — resolve config from local → global → plugin default
|
|
28
|
+
|
|
29
|
+
- [ ] Write resolution chain: `.opencode/` → `~/.config/opencode-kit/` → plugin `templates/`
|
|
30
|
+
- [ ] Add `init-global` command to copy plugin defaults to `~/.config/opencode-kit/`
|
|
31
|
+
|
|
32
|
+
### Task 3: Plugin Schema
|
|
33
|
+
|
|
34
|
+
**Files:**
|
|
35
|
+
- Create: `templates/opencode-kit.schema.json` — validate opencode.json agent config
|
|
36
|
+
|
|
37
|
+
- [ ] Schema defines default agents (orchestrator, planner, task-manager, etc.)
|
|
38
|
+
- [ ] Documents plugin ordering requirement (must be first in plugin array)
|
|
39
|
+
|
|
40
|
+
### Task 4: Init Coexistence
|
|
41
|
+
|
|
42
|
+
**Files:**
|
|
43
|
+
- Modify: `src/init.sh` — detect plugin, skip plugin-handled tasks
|
|
44
|
+
|
|
45
|
+
- [ ] If plugin detected (via `.opencode/plugins/opencode-kit.js`), skip skill/agent scaffolding
|
|
46
|
+
- [ ] Only scaffold per-project data: contract.json goal/scope, STATE.md, PROJECT.md
|
|
47
|
+
|
|
48
|
+
### Task 5: Documentation
|
|
49
|
+
|
|
50
|
+
**Files:**
|
|
51
|
+
- Modify: `README.md` — plugin installation, ordering requirement
|
|
52
|
+
- Modify: `CHANGELOG.md`
|
|
53
|
+
|
|
54
|
+
- [ ] Add "Install as plugin" section to README
|
|
55
|
+
- [ ] Document global vs local resolution
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ikieaneh/opencode-kit",
|
|
3
|
-
"version": "0.5.
|
|
4
|
-
"description": "Standardized OpenCode orchestration framework
|
|
3
|
+
"version": "0.5.2",
|
|
4
|
+
"description": "Standardized OpenCode orchestration framework — contract-based, rules-enforced, zero-touch agent workflow. Install as plugin.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "RizkiRachman",
|
|
7
7
|
"type": "module",
|
|
@@ -20,7 +20,8 @@
|
|
|
20
20
|
"src/",
|
|
21
21
|
"rules/",
|
|
22
22
|
"templates/",
|
|
23
|
-
"skills/"
|
|
23
|
+
"skills/",
|
|
24
|
+
"docs/"
|
|
24
25
|
],
|
|
25
26
|
"publishConfig": {
|
|
26
27
|
"access": "public"
|
|
@@ -44,4 +45,4 @@
|
|
|
44
45
|
"url": "https://github.com/RizkiRachman/opencode-kit/issues"
|
|
45
46
|
},
|
|
46
47
|
"homepage": "https://github.com/RizkiRachman/opencode-kit#readme"
|
|
47
|
-
}
|
|
48
|
+
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Java/Spring Boot conventions for opencode-kit projects. Hexagonal architecture, ArchUnit, Maven build.
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# Java Developer
|
|
6
|
+
|
|
7
|
+
Load this skill if your project uses **Java + Spring Boot + Maven**.
|
|
8
|
+
|
|
9
|
+
## Build & Test
|
|
10
|
+
|
|
11
|
+
Replace generic `npm` commands with Maven equivalents:
|
|
12
|
+
|
|
13
|
+
| Generic | Java Equivalent |
|
|
14
|
+
|---------|-----------------|
|
|
15
|
+
| `npm test` | `mvn test` |
|
|
16
|
+
| `npm run build` | `mvn compile` |
|
|
17
|
+
| `npm run format` | `mvn spotless:apply` |
|
|
18
|
+
| `npm test -- --all` | `mvn verify` |
|
|
19
|
+
|
|
20
|
+
## Quality Gates (run in order)
|
|
21
|
+
|
|
22
|
+
```sh
|
|
23
|
+
mvn spotless:apply # Formatting (Google Java Style)
|
|
24
|
+
mvn test # ArchUnit (7 rules) + unit tests
|
|
25
|
+
mvn verify # SpotBugs + PMD CPD + full tests
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## Agent Permission Overrides
|
|
29
|
+
|
|
30
|
+
In `opencode.json`, add Maven permissions to agents:
|
|
31
|
+
|
|
32
|
+
```json
|
|
33
|
+
"bash": {
|
|
34
|
+
"mvn test*": "allow",
|
|
35
|
+
"mvn compile*": "allow",
|
|
36
|
+
"mvn verify": "allow",
|
|
37
|
+
"mvn spotless:apply": "allow",
|
|
38
|
+
"git diff*": "allow",
|
|
39
|
+
"git log*": "allow"
|
|
40
|
+
}
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
## Conventions
|
|
44
|
+
|
|
45
|
+
### Hexagonal Architecture
|
|
46
|
+
```
|
|
47
|
+
application/ → domain model, ports, domain services
|
|
48
|
+
infrastructure/ → web adapters, persistence, event handlers
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
### Writing Order
|
|
52
|
+
Port → Service → Mapper → Adapter → Constants → Events → Tests
|
|
53
|
+
|
|
54
|
+
### Domain Models
|
|
55
|
+
- `@Builder @Getter @Setter` — zero JPA annotations
|
|
56
|
+
- Ports return **nullable**, never `Optional<T>`
|
|
57
|
+
- No JPA relationship annotations (`@ManyToOne`, `@OneToMany`, etc.)
|
|
58
|
+
|
|
59
|
+
### ArchUnit Rules (7)
|
|
60
|
+
1. domainMustNotDependOnInfrastructure
|
|
61
|
+
2. domainModelsMustNotHaveJpaAnnotations
|
|
62
|
+
3. portsMustNotReturnOptional
|
|
63
|
+
4. entitiesMustNotUseJpaRelationshipAnnotations
|
|
64
|
+
5. layeredArchitectureShouldRespectHexagonalBoundaries
|
|
65
|
+
6. domainServicesMustBeAnnotatedWithService
|
|
66
|
+
7. repositoryAdaptersMustBeAnnotatedWithComponent
|
package/src/init.sh
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env bash
|
|
2
2
|
# opencode-kit init — scaffold orchestration framework into target project
|
|
3
|
-
# Usage: npx opencode-kit init [--force]
|
|
3
|
+
# Usage: npx opencode-kit init [--force] [--sample]
|
|
4
|
+
# --force Overwrite existing .opencode/ (backs up to .opencode.bak.<timestamp>)
|
|
5
|
+
# --sample Also create a sample opencode.json with @ikieaneh/opencode-kit plugin config
|
|
4
6
|
set -euo pipefail
|
|
5
7
|
|
|
6
8
|
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
|
|
@@ -14,7 +16,14 @@ YELLOW='\033[1;33m'
|
|
|
14
16
|
CYAN='\033[0;36m'
|
|
15
17
|
NC='\033[0m'
|
|
16
18
|
|
|
17
|
-
FORCE=
|
|
19
|
+
FORCE=false
|
|
20
|
+
SAMPLE=false
|
|
21
|
+
for arg in "$@"; do
|
|
22
|
+
case "$arg" in
|
|
23
|
+
--force) FORCE=true ;;
|
|
24
|
+
--sample) SAMPLE=true ;;
|
|
25
|
+
esac
|
|
26
|
+
done
|
|
18
27
|
TARGET_DIR="${PWD}"
|
|
19
28
|
TIMESTAMP=$(date +%Y%m%d%H%M%S)
|
|
20
29
|
|
|
@@ -64,7 +73,7 @@ fi
|
|
|
64
73
|
|
|
65
74
|
# --- Handle existing .opencode/ ---
|
|
66
75
|
if [ -d ".opencode" ]; then
|
|
67
|
-
if [ "$FORCE" =
|
|
76
|
+
if [ "$FORCE" = true ]; then
|
|
68
77
|
BACKUP=".opencode.bak.$TIMESTAMP"
|
|
69
78
|
echo ""
|
|
70
79
|
echo -e "${YELLOW}⚠️ --force: Backing up existing .opencode/ to $BACKUP${NC}"
|
|
@@ -163,3 +172,43 @@ else
|
|
|
163
172
|
echo -e "${RED}❌ Verification failed. Check errors above.${NC}"
|
|
164
173
|
exit 1
|
|
165
174
|
fi
|
|
175
|
+
|
|
176
|
+
# --- Sample opencode.json ---
|
|
177
|
+
if [ "$SAMPLE" = true ]; then
|
|
178
|
+
if [ -f "opencode.json" ]; then
|
|
179
|
+
echo -e "${YELLOW} ⚠️ opencode.json already exists. Skipping sample.${NC}"
|
|
180
|
+
else
|
|
181
|
+
cat > opencode.json << 'SAMPLEEOF'
|
|
182
|
+
{
|
|
183
|
+
"model": "sumopod/deepseek-v4-flash",
|
|
184
|
+
"plugin": [
|
|
185
|
+
"@ikieaneh/opencode-kit",
|
|
186
|
+
"superpowers"
|
|
187
|
+
],
|
|
188
|
+
"agent": {
|
|
189
|
+
"orchestrator": {
|
|
190
|
+
"model": "sumopod/deepseek-v4-flash",
|
|
191
|
+
"skills": ["orchestration-template", "scoring-pipeline", "verification-before-completion"],
|
|
192
|
+
"steps": 50
|
|
193
|
+
},
|
|
194
|
+
"planner": {
|
|
195
|
+
"model": "sumopod/deepseek-v4-flash",
|
|
196
|
+
"skills": ["brainstorming", "writing-plans", "system-analyst"],
|
|
197
|
+
"steps": 80
|
|
198
|
+
},
|
|
199
|
+
"task-manager": {
|
|
200
|
+
"model": "sumopod/deepseek-v4-flash",
|
|
201
|
+
"skills": ["subagent-driven-development", "executing-plans", "test-driven-development"],
|
|
202
|
+
"steps": 100
|
|
203
|
+
},
|
|
204
|
+
"code-reviewer": {
|
|
205
|
+
"model": "sumopod/deepseek-v4-flash",
|
|
206
|
+
"skills": ["qa-expert", "security-expert"],
|
|
207
|
+
"steps": 80
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
SAMPLEEOF
|
|
212
|
+
echo " ✅ Sample opencode.json created"
|
|
213
|
+
fi
|
|
214
|
+
fi
|
|
@@ -11,9 +11,9 @@ permission:
|
|
|
11
11
|
list: allow
|
|
12
12
|
bash:
|
|
13
13
|
"*": ask
|
|
14
|
-
"
|
|
15
|
-
"
|
|
16
|
-
"
|
|
14
|
+
"npm run format": allow
|
|
15
|
+
"npm test": allow
|
|
16
|
+
"npm run build": allow
|
|
17
17
|
"git diff*": allow
|
|
18
18
|
task:
|
|
19
19
|
"*": deny
|
|
@@ -36,7 +36,7 @@ permission:
|
|
|
36
36
|
## Permissions
|
|
37
37
|
- Read: All project files
|
|
38
38
|
- Write: Scoped to assigned task only
|
|
39
|
-
- Execute:
|
|
39
|
+
- Execute: test commands, git diff, format/lint
|
|
40
40
|
- Cannot: Spawn subagents, push to git, modify CI/CD
|
|
41
41
|
|
|
42
42
|
You are a **fast implementation specialist for well-defined bounded tasks**. You do NOT research, make decisions, or expand scope.
|
|
@@ -45,7 +45,7 @@ You are a **fast implementation specialist for well-defined bounded tasks**. You
|
|
|
45
45
|
1. Read assigned scope only
|
|
46
46
|
2. Follow project conventions (writing order, naming)
|
|
47
47
|
3. Make changes efficiently
|
|
48
|
-
4. Run
|
|
48
|
+
4. Run format + compile on affected modules
|
|
49
49
|
5. Do NOT expand scope or make unsolicited improvements
|
|
50
50
|
|
|
51
51
|
## Output Format
|
|
@@ -11,10 +11,10 @@ permission:
|
|
|
11
11
|
webfetch: allow
|
|
12
12
|
bash:
|
|
13
13
|
"*": ask
|
|
14
|
-
"
|
|
15
|
-
"
|
|
16
|
-
"
|
|
17
|
-
"
|
|
14
|
+
"npm test": allow
|
|
15
|
+
"npm run build": allow
|
|
16
|
+
"npm test": allow
|
|
17
|
+
"npm run format": allow
|
|
18
18
|
"git diff*": allow
|
|
19
19
|
"git log*": allow
|
|
20
20
|
task:
|
|
@@ -94,7 +94,7 @@ Delegate to @code-reviewer. After return → Scoring Pipeline → update contrac
|
|
|
94
94
|
3. **Tier 3 (Verdict)**: ≥70 PASS, 50-69 RETRY, <50 BLOCKED
|
|
95
95
|
|
|
96
96
|
### 5. Verify (loop)
|
|
97
|
-
Run quality gates (
|
|
97
|
+
Run quality gates (verification-before-completion skill)
|
|
98
98
|
If CRITICAL findings → BLOCK, fix, re-review. Max 3 iterations.
|
|
99
99
|
|
|
100
100
|
### 6. Ship
|
|
@@ -11,10 +11,10 @@ permission:
|
|
|
11
11
|
webfetch: allow
|
|
12
12
|
bash:
|
|
13
13
|
"*": ask
|
|
14
|
-
"
|
|
15
|
-
"
|
|
16
|
-
"
|
|
17
|
-
"
|
|
14
|
+
"npm test": allow
|
|
15
|
+
"npm run build": allow
|
|
16
|
+
"npm test": allow
|
|
17
|
+
"npm run format": allow
|
|
18
18
|
"git diff*": allow
|
|
19
19
|
"git log*": allow
|
|
20
20
|
task:
|
|
@@ -40,7 +40,7 @@ permission:
|
|
|
40
40
|
## Permissions
|
|
41
41
|
- Read: All project files
|
|
42
42
|
- Write: Source files, test files
|
|
43
|
-
- Execute:
|
|
43
|
+
- Execute: git diff/log, spotless
|
|
44
44
|
- Cannot: Push to git, modify .opencode/ config
|
|
45
45
|
|
|
46
46
|
You implement plans step by step. Follow conventions exactly.
|
|
@@ -76,7 +76,7 @@ For each file:
|
|
|
76
76
|
- Cover: happy path, empty, null, boundary, every error branch
|
|
77
77
|
|
|
78
78
|
### 5. Before Moving On
|
|
79
|
-
-
|
|
79
|
+
- Format code (spotless, prettier, etc.)
|
|
80
80
|
- Remove debug code, TODOs, commented-out code
|
|
81
81
|
|
|
82
82
|
### 6. Output Format
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json-schema.org/draft-07/schema#",
|
|
3
3
|
"title": "opencode-kit Plugin Config",
|
|
4
|
-
"description": "Configuration schema for opencode-kit plugin. Add to your opencode.json to enable orchestration agents.",
|
|
4
|
+
"description": "Configuration schema for @ikieaneh/opencode-kit plugin. Add to your opencode.json to enable orchestration agents.",
|
|
5
5
|
"type": "object",
|
|
6
6
|
"properties": {
|
|
7
7
|
"plugin": {
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"description": "opencode-kit MUST be listed FIRST in the plugin array to ensure its system prompt transform takes priority.",
|
|
10
10
|
"items": {
|
|
11
11
|
"type": "string",
|
|
12
|
-
"examples": ["opencode-kit", "superpowers", "oh-my-opencode-slim"]
|
|
12
|
+
"examples": ["@ikieaneh/opencode-kit", "superpowers", "oh-my-opencode-slim"]
|
|
13
13
|
},
|
|
14
14
|
"minItems": 1
|
|
15
15
|
},
|
|
@@ -23,11 +23,12 @@
|
|
|
23
23
|
"properties": {
|
|
24
24
|
"skills": {
|
|
25
25
|
"type": "array",
|
|
26
|
-
"description": "Recommended skills: orchestration-template, scoring-pipeline, adr-generator",
|
|
26
|
+
"description": "Recommended skills: orchestration-template, scoring-pipeline, adr-generator, verification-before-completion",
|
|
27
27
|
"items": { "type": "string" },
|
|
28
28
|
"default": ["orchestration-template", "scoring-pipeline", "verification-before-completion"]
|
|
29
29
|
},
|
|
30
|
-
"steps": { "type": "integer", "default": 50, "description": "Max agent steps" }
|
|
30
|
+
"steps": { "type": "integer", "default": 50, "description": "Max agent steps" },
|
|
31
|
+
"fallback_models": { "type": "array", "items": { "type": "string" }, "description": "Fallback models if primary fails" }
|
|
31
32
|
}
|
|
32
33
|
},
|
|
33
34
|
"planner": {
|
|
@@ -40,7 +41,8 @@
|
|
|
40
41
|
"items": { "type": "string" },
|
|
41
42
|
"default": ["brainstorming", "writing-plans", "system-analyst"]
|
|
42
43
|
},
|
|
43
|
-
"steps": { "type": "integer", "default": 80 }
|
|
44
|
+
"steps": { "type": "integer", "default": 80 },
|
|
45
|
+
"fallback_models": { "type": "array", "items": { "type": "string" } }
|
|
44
46
|
}
|
|
45
47
|
},
|
|
46
48
|
"task-manager": {
|
|
@@ -52,7 +54,8 @@
|
|
|
52
54
|
"items": { "type": "string" },
|
|
53
55
|
"default": ["subagent-driven-development", "executing-plans", "test-driven-development"]
|
|
54
56
|
},
|
|
55
|
-
"steps": { "type": "integer", "default": 100 }
|
|
57
|
+
"steps": { "type": "integer", "default": 100 },
|
|
58
|
+
"fallback_models": { "type": "array", "items": { "type": "string" } }
|
|
56
59
|
}
|
|
57
60
|
},
|
|
58
61
|
"code-reviewer": {
|
|
@@ -64,16 +67,61 @@
|
|
|
64
67
|
"items": { "type": "string" },
|
|
65
68
|
"default": ["qa-expert", "security-expert", "devops-expert"]
|
|
66
69
|
},
|
|
67
|
-
"steps": { "type": "integer", "default": 80 }
|
|
70
|
+
"steps": { "type": "integer", "default": 80 },
|
|
71
|
+
"fallback_models": { "type": "array", "items": { "type": "string" } }
|
|
68
72
|
}
|
|
69
73
|
},
|
|
70
74
|
"learner": {
|
|
71
75
|
"type": "object",
|
|
72
76
|
"description": "Post-execution learning. Extracts lessons, persists knowledge.",
|
|
73
|
-
"
|
|
74
|
-
"
|
|
75
|
-
|
|
76
|
-
|
|
77
|
+
"properties": {
|
|
78
|
+
"skills": {
|
|
79
|
+
"type": "array",
|
|
80
|
+
"items": { "type": "string" },
|
|
81
|
+
"default": ["verification-before-completion", "qa-expert"]
|
|
82
|
+
},
|
|
83
|
+
"fallback_models": { "type": "array", "items": { "type": "string" } }
|
|
84
|
+
}
|
|
85
|
+
},
|
|
86
|
+
"explorer": {
|
|
87
|
+
"type": "object",
|
|
88
|
+
"description": "Fast codebase search specialist. Read-only — no edits.",
|
|
89
|
+
"properties": {
|
|
90
|
+
"skills": { "type": "array", "items": { "type": "string" }, "default": [] },
|
|
91
|
+
"steps": { "type": "integer", "default": 30 },
|
|
92
|
+
"tools": {
|
|
93
|
+
"type": "object",
|
|
94
|
+
"description": "Disable write-heavy tools: context7, memory, postgres",
|
|
95
|
+
"default": { "postgres_*": false, "memory_*": false, "context7_*": false }
|
|
96
|
+
},
|
|
97
|
+
"fallback_models": { "type": "array", "items": { "type": "string" } }
|
|
98
|
+
}
|
|
99
|
+
},
|
|
100
|
+
"librarian": {
|
|
101
|
+
"type": "object",
|
|
102
|
+
"description": "External docs and API references. Read-only — no edits.",
|
|
103
|
+
"properties": {
|
|
104
|
+
"skills": { "type": "array", "items": { "type": "string" }, "default": [] },
|
|
105
|
+
"steps": { "type": "integer", "default": 30 },
|
|
106
|
+
"tools": {
|
|
107
|
+
"type": "object",
|
|
108
|
+
"description": "Disable tools not needed for docs research",
|
|
109
|
+
"default": { "postgres_*": false, "memory_*": false, "graphify_*": false }
|
|
110
|
+
},
|
|
111
|
+
"fallback_models": { "type": "array", "items": { "type": "string" } }
|
|
112
|
+
}
|
|
113
|
+
},
|
|
114
|
+
"architect": {
|
|
115
|
+
"type": "object",
|
|
116
|
+
"description": "Strategic technical advisor. Architecture trade-offs, system-level debugging, simplification.",
|
|
117
|
+
"properties": {
|
|
118
|
+
"skills": {
|
|
119
|
+
"type": "array",
|
|
120
|
+
"items": { "type": "string" },
|
|
121
|
+
"default": ["simplify", "systematic-debugging", "system-analyst"]
|
|
122
|
+
},
|
|
123
|
+
"steps": { "type": "integer", "default": 60 },
|
|
124
|
+
"fallback_models": { "type": "array", "items": { "type": "string" } }
|
|
77
125
|
}
|
|
78
126
|
}
|
|
79
127
|
}
|