@ikieaneh/opencode-kit 0.6.2 → 0.6.3

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ikieaneh/opencode-kit",
3
- "version": "0.6.2",
3
+ "version": "0.6.3",
4
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",
@@ -16,12 +16,13 @@
16
16
  },
17
17
  "files": [
18
18
  ".opencode/plugins/",
19
- ".claude-plugin/",
20
- "src/",
21
- "rules/",
22
19
  "templates/",
23
20
  "skills/",
24
- "docs/"
21
+ "rules/",
22
+ "src/cli.js",
23
+ "src/init.sh",
24
+ "LICENSE",
25
+ "README.md"
25
26
  ],
26
27
  "publishConfig": {
27
28
  "access": "public"
@@ -42,8 +43,9 @@
42
43
  "url": "git+https://github.com/RizkiRachman/opencode-kit.git"
43
44
  },
44
45
  "scripts": {
45
- "lint": "eslint src/ test/",
46
- "format": "prettier --check src/ test/"
46
+ "postinstall": "git config core.hooksPath .githooks 2>/dev/null || true",
47
+ "lint": "shellcheck src/*.sh rules/*.sh 2>/dev/null || true",
48
+ "format": "echo 'Formatting: not configured yet'"
47
49
  },
48
50
  "bugs": {
49
51
  "url": "https://github.com/RizkiRachman/opencode-kit/issues"
@@ -3,6 +3,7 @@
3
3
  "title": "opencode-kit Plugin Config",
4
4
  "description": "Configuration schema for @ikieaneh/opencode-kit plugin. Add to your opencode.json to enable orchestration agents.",
5
5
  "type": "object",
6
+ "additionalProperties": false,
6
7
  "properties": {
7
8
  "plugin": {
8
9
  "type": "array",
@@ -1,5 +1,6 @@
1
1
  {
2
2
  "version": "0.1.0",
3
+ "template_version": "0.6.2",
3
4
  "description": "Superpowers & MCP registry for opencode-kit",
4
5
  "plugins": ["superpowers"],
5
6
  "mcps": ["gitnexus", "graphify", "lean-ctx", "context7"],
@@ -1,23 +0,0 @@
1
- {
2
- "name": "opencode-kit",
3
- "description": "Standardized orchestration framework — contract-based, rules-enforced, zero-touch agent workflow",
4
- "version": "0.6.2",
5
- "author": {
6
- "name": "Rizki Rachman",
7
- "url": "https://github.com/RizkiRachman"
8
- },
9
- "homepage": "https://github.com/RizkiRachman/opencode-kit",
10
- "repository": "https://github.com/RizkiRachman/opencode-kit",
11
- "license": "MIT",
12
- "keywords": [
13
- "opencode",
14
- "opencode-plugin",
15
- "orchestration",
16
- "workflow",
17
- "agents",
18
- "enforcement",
19
- "contract",
20
- "scoring",
21
- "adr"
22
- ]
23
- }
@@ -1,123 +0,0 @@
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
- "learner": {
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 |
@@ -1,108 +0,0 @@
1
- # Extension Skill Template
2
-
3
- Create project-specific skills in `.opencode/skills/` to extend opencode-kit.
4
-
5
- ## Resolution Order
6
-
7
- 1. `.opencode/skills/<name>/SKILL.md` — user project skill (highest priority)
8
- 2. `node_modules/@ikieaneh/opencode-kit/skills/<name>/SKILL.md` — plugin skill (fallback)
9
-
10
- If a user skill and plugin skill have the **same name**, the user's version takes priority.
11
-
12
- ## Example: Java/Spring Conventions
13
-
14
- Create `.opencode/skills/java-conventions/SKILL.md`:
15
-
16
- ```markdown
17
- ---
18
- description: Java 21 + Spring Boot 3.4 conventions for this project.
19
- ---
20
-
21
- # Java Conventions
22
-
23
- ## Build & Test
24
-
25
- | Command | Action |
26
- |---------|--------|
27
- | `mvn spotless:apply` | Format (Google Java Style) |
28
- | `mvn test` | ArchUnit + unit tests |
29
- | `mvn verify` | SpotBugs + PMD CPD |
30
-
31
- ## Hexagonal Architecture
32
-
33
- ```
34
- application/ → domain model, ports, services (no Spring/JPA)
35
- infrastructure/ → web adapters, persistence, events
36
- ```
37
-
38
- ## Writing Order
39
-
40
- Port → Service → Mapper → Adapter → Constants → Events → Tests
41
-
42
- ## Naming Rules
43
-
44
- | Concern | Suffix | Example |
45
- |---------|--------|---------|
46
- | API DTO | none | `Product` |
47
- | Domain Model | `Domain` | `ProductDomain` |
48
- | JPA Entity | `Entity` | `ProductEntity` |
49
-
50
- ## ArchUnit Rules (7)
51
-
52
- 1. domainMustNotDependOnInfrastructure
53
- 2. domainModelsMustNotHaveJpaAnnotations
54
- 3. portsMustNotReturnOptional
55
- 4. entitiesMustNotUseJpaRelationshipAnnotations
56
- 5. layeredArchitectureShouldRespectHexagonalBoundaries
57
- 6. domainServicesMustBeAnnotatedWithService
58
- 7. repositoryAdaptersMustBeAnnotatedWithComponent
59
- ```
60
-
61
- ## Example: Python/Django Conventions
62
-
63
- Create `.opencode/skills/python-conventions/SKILL.md`:
64
-
65
- ```markdown
66
- ---
67
- description: Django REST Framework conventions for this project.
68
- ---
69
-
70
- # Python Conventions
71
-
72
- ## Build & Test
73
-
74
- | Command | Action |
75
- |---------|--------|
76
- | `black .` | Format code |
77
- | `ruff check .` | Lint |
78
- | `pytest` | Run tests |
79
- | `mypy .` | Type check |
80
-
81
- ## Architecture
82
-
83
- Apps follow clean architecture:
84
- - `models/` — domain models with business logic
85
- - `serializers/` — input/output validation
86
- - `views/` — HTTP handlers (thin)
87
- - `services/` — business logic layer
88
- - `tests/` — mirrors app structure
89
- ```
90
-
91
- ## How to Load
92
-
93
- In `opencode.json`, add to any agent's skills array:
94
-
95
- ```json
96
- {
97
- "agent": {
98
- "task-manager": {
99
- "skills": [
100
- "verification-before-completion",
101
- "java-conventions"
102
- ]
103
- }
104
- }
105
- }
106
- ```
107
-
108
- Or load it ad-hoc with: `/skill java-conventions`
@@ -1,117 +0,0 @@
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
- ```
@@ -1,67 +0,0 @@
1
- # Contract Protocol
2
-
3
- The orchestrator contract (`contract.json`) is the single source of truth for every agent session.
4
-
5
- ## What it does
6
-
7
- - Tracks **state** — what phase the workflow is in (INIT → PLAN → ... → COMPLETE)
8
- - Stores **requirements** — the goal, acceptance criteria, and constraints
9
- - Logs **decisions** — Architecture Decision Records (ADRs)
10
- - Records **scores** — quality metrics from the scoring pipeline
11
- - Captures **telemetry** — elapsed time, phases completed, agents used
12
-
13
- ## State Machine
14
-
15
- ```
16
- INIT → PLAN → PLAN_SCORED → EXECUTE → EXECUTE_SCORED → REVIEW → REVIEW_SCORED → COMPLETE
17
-
18
- BLOCKED (any phase) → user intervention → retry
19
- ```
20
-
21
- **Transition rules:**
22
- - Each phase transition requires score ≥ 70
23
- - Score < 50 → BLOCKED
24
- - Max 3 retry attempts before escalation
25
-
26
- ## Key Fields
27
-
28
- ```json
29
- {
30
- "state": "INIT",
31
- "contract_version": "0.5.8",
32
- "requirements": {
33
- "goal": "What we're building",
34
- "acceptance_criteria": ["testable condition 1"],
35
- "constraints": ["must not..."]
36
- },
37
- "governance": {
38
- "active_agent": "orchestrator",
39
- "current_guidance": "Instructions for this session",
40
- "extension_skills": ["java-conventions"],
41
- "permissions": { "do": [], "dont": ["push to main"] }
42
- },
43
- "decisions": {
44
- "adr_log": [
45
- { "id": "ADR-001", "date": "2026-06-11", "title": "Use contract protocol", ... }
46
- ]
47
- },
48
- "score": {
49
- "combined": 85,
50
- "verdict": "PASS"
51
- },
52
- "metrics": {
53
- "phases_completed": ["INIT", "PLAN", "PLAN_SCORED"]
54
- }
55
- }
56
- ```
57
-
58
- ## Resolution Order
59
-
60
- 1. `.opencode/orchestration/contract.json` — project override
61
- 2. `~/.config/opencode-kit/contract.json` — global defaults
62
- 3. Plugin `templates/contract.json` — shipped defaults
63
-
64
- ## CLI
65
-
66
- View contract state: `bash .opencode/src/status.sh`
67
- Compare across branches: `bash .opencode/src/diff.sh [branch1] [branch2]`
@@ -1,60 +0,0 @@
1
- # Scoring Pipeline
2
-
3
- Every subagent output is scored before the next phase begins.
4
-
5
- ## Tier 1 — Rule Checks
6
-
7
- Automatic checks run by the orchestrator. Start at 100, deduct per violation:
8
-
9
- | Check | Deduction |
10
- |-------|:---------:|
11
- | Schema valid (required fields present) | -15 |
12
- | Permissions violated | -40 |
13
- | Blast radius HIGH/CRITICAL | -40 |
14
- | Writing order wrong | -15 |
15
- | Fields missing | -15 |
16
-
17
- If subtotal < 70 → skip Tier 2, use subtotal as combined score.
18
-
19
- ## Tier 2 — LLM Judge
20
-
21
- If Tier 1 score ≥ 70, the orchestrator runs a judge via `subtask()`.
22
-
23
- ```json
24
- {
25
- "score": 85,
26
- "rationale": "All requirements met. Writing order correct.",
27
- "missing_items": ["Test for null boundary case"]
28
- }
29
- ```
30
-
31
- **Dimensions:**
32
- | Dimension | Max | What it evaluates |
33
- |-----------|:---:|-------------------|
34
- | Requirements | 40 | Does output satisfy goal + acceptance criteria? |
35
- | Governance | 30 | Follows rules.json + writing order? |
36
- | Completeness | 20 | All files created? Edge cases documented? |
37
- | Edge cases | 10 | Nulls, errors, boundaries covered? |
38
-
39
- ## Tier 3 — Verdict
40
-
41
- | Combined Score | Verdict | Action |
42
- |:--------------:|:-------:|--------|
43
- | ≥ 70 | **PASS** | Advance to next phase |
44
- | 50–69 | **RETRY** | Increment retry count, re-delegate |
45
- | < 50 | **BLOCKED** | Escalate to user |
46
-
47
- ## Configuration
48
-
49
- Thresholds and deductions are in `rules.json` → `scoring`:
50
-
51
- ```json
52
- {
53
- "scoring": {
54
- "tier1": { "schema_valid_deduction": 15, ... },
55
- "thresholds": { "pass": 70, "retry": 50, "max_attempts": 3 }
56
- }
57
- }
58
- ```
59
-
60
- Projects can override rule severity via `contract.json` → `validation.rule_overrides`.
@@ -1,78 +0,0 @@
1
- # Troubleshooting Guide
2
-
3
- ## Common Issues
4
-
5
- ### Plugin doesn't load
6
-
7
- **Symptom**: Skills not available, contract not injected.
8
-
9
- **Checks:**
10
- 1. Is `@ikieaneh/opencode-kit` in `opencode.json` plugin array? Must be **first**.
11
- 2. Is it installed? `ls node_modules/@ikieaneh/opencode-kit`
12
- 3. Is the plugin array syntax correct? `"plugin": ["@ikieaneh/opencode-kit"]`
13
-
14
- ### Agent jumps straight to implementation
15
-
16
- **Symptom**: Agent starts working without loading contract.
17
-
18
- **Fix:** The plugin's `messages.transform` hook injects the bootstrap. Make sure:
19
- 1. Plugin is first in the array
20
- 2. No other plugin overrides the same hook
21
- 3. Run `bash .opencode/src/doctor.sh` to verify
22
-
23
- ### Contract not found
24
-
25
- **Symptom**: "Contract not found" error from preflight.
26
-
27
- **Solution:**
28
- ```sh
29
- bash .opencode/src/doctor.sh
30
- # Or manually:
31
- mkdir -p .opencode/orchestration
32
- cp node_modules/@ikieaneh/opencode-kit/templates/contract.json .opencode/orchestration/contract.json
33
- ```
34
-
35
- ### Score below threshold
36
-
37
- **Symptom**: Workflow keeps retrying or gets blocked.
38
-
39
- **Check:**
40
- - Tier 1 violations (blast radius, permissions)
41
- - Tier 2 judge feedback — read `judge.missing_items`
42
- - Retry count — max 3 attempts before BLOCKED
43
-
44
- ### ShellCheck fails in CI
45
-
46
- **Symptom**: GitHub Actions ShellCheck job fails.
47
-
48
- **Fix:** Run locally:
49
- ```sh
50
- shellcheck src/*.sh rules/*.sh
51
- ```
52
- Look for SC1091 (source path) or SC2001 (sed style) — most are info-level.
53
-
54
- ### Scaffold test fails in CI
55
-
56
- **Symptom**: init.sh exits with error.
57
-
58
- **Check:**
59
- - Are all `mkdir -p` paths created before `cp`?
60
- - Run locally: `cd /tmp && git init && bash /path/to/init.sh`
61
-
62
- ### Custom skill not loading
63
-
64
- **Symptom**: Skill referenced in opencode.json not available.
65
-
66
- **Solution:**
67
- 1. Place skill at `.opencode/skills/<name>/SKILL.md`
68
- 2. Verify frontmatter has `description:` field
69
- 3. Verify SKILL.md starts with `---` (YAML frontmatter)
70
- 4. Run `bash .opencode/src/doctor.sh` to verify
71
-
72
- ## Diagnostics
73
-
74
- ```sh
75
- bash .opencode/src/doctor.sh # Full health check
76
- bash .opencode/src/status.sh # Dashboard view
77
- bash .opencode/src/analytics.sh # Telemetry analysis
78
- ```
@@ -1,9 +0,0 @@
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>