@ikieaneh/opencode-kit 0.5.2 → 0.5.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/.opencode/plugins/opencode-kit.js +12 -1
- package/docs/examples/extension-skill-template.md +108 -0
- package/package.json +1 -1
- package/skills/verification-before-completion/SKILL.md +15 -12
- package/src/init.sh +5 -5
- package/templates/contract.json +1 -0
- package/skills/java-developer/SKILL.md +0 -66
|
@@ -164,13 +164,24 @@ export const OpencodeKitPlugin = async ({ client, directory }) => {
|
|
|
164
164
|
fs.mkdirSync(path.join(globalConfigDir, 'rules'), { recursive: true });
|
|
165
165
|
|
|
166
166
|
return {
|
|
167
|
+
// Skill resolution order (first match wins):
|
|
168
|
+
// 1. .opencode/skills/<name>/ (user project — highest priority)
|
|
169
|
+
// 2. plugin skills/<name>/ (opencode-kit defaults — fallback)
|
|
167
170
|
config: async (config) => {
|
|
168
171
|
config.skills = config.skills || {};
|
|
169
172
|
config.skills.paths = config.skills.paths || [];
|
|
170
173
|
|
|
174
|
+
// Register user project skills FIRST (higher priority)
|
|
175
|
+
const userSkillsDir = path.join(projectDir, '.opencode/skills');
|
|
176
|
+
if (fs.existsSync(userSkillsDir) && !config.skills.paths.includes(userSkillsDir)) {
|
|
177
|
+
config.skills.paths.push(userSkillsDir);
|
|
178
|
+
log('info', `Registered user skills: ${userSkillsDir}`);
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
// Register plugin skills SECOND (fallback)
|
|
171
182
|
if (!config.skills.paths.includes(SKILLS_DIR)) {
|
|
172
183
|
config.skills.paths.push(SKILLS_DIR);
|
|
173
|
-
log('info', `Registered skills: ${SKILLS_DIR}`);
|
|
184
|
+
log('info', `Registered plugin skills: ${SKILLS_DIR}`);
|
|
174
185
|
}
|
|
175
186
|
|
|
176
187
|
// Register global config skills path
|
|
@@ -0,0 +1,108 @@
|
|
|
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`
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ikieaneh/opencode-kit",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.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",
|
|
@@ -12,36 +12,39 @@ For any code change, run in order:
|
|
|
12
12
|
|
|
13
13
|
### 1. Formatting
|
|
14
14
|
```bash
|
|
15
|
-
|
|
15
|
+
# Format code (e.g., spotless, prettier, black, gofmt)
|
|
16
16
|
```
|
|
17
|
+
Expected: zero files changed after formatting (idempotent).
|
|
17
18
|
|
|
18
19
|
### 2. Compilation
|
|
19
20
|
```bash
|
|
20
|
-
|
|
21
|
-
#
|
|
21
|
+
# Build/tests — check for compilation errors
|
|
22
|
+
# e.g., mvn compile, npm run build, cargo check, go build ./...
|
|
22
23
|
```
|
|
24
|
+
Expected: BUILD SUCCESS.
|
|
23
25
|
|
|
24
|
-
### 3. Architecture (if
|
|
26
|
+
### 3. Architecture Rules (if applicable)
|
|
25
27
|
```bash
|
|
26
|
-
|
|
27
|
-
# Expected: all 7 ArchUnit rules pass
|
|
28
|
+
# Architecture tests — e.g., ArchUnit, layered boundary checks
|
|
28
29
|
```
|
|
30
|
+
Expected: all architecture rules pass.
|
|
29
31
|
|
|
30
32
|
### 4. Unit Tests
|
|
31
33
|
```bash
|
|
32
|
-
mvn test
|
|
33
|
-
# Expected: 0 failures, 0 errors
|
|
34
|
+
# Run unit tests — e.g., mvn test, npm test, pytest, cargo test
|
|
34
35
|
```
|
|
36
|
+
Expected: 0 failures, 0 errors.
|
|
35
37
|
|
|
36
38
|
### 5. Full Verification
|
|
37
39
|
```bash
|
|
38
|
-
mvn verify
|
|
39
|
-
# Expected: BUILD SUCCESS
|
|
40
|
+
# Full suite — e.g., mvn verify, npm test -- --all
|
|
40
41
|
```
|
|
42
|
+
Expected: BUILD SUCCESS.
|
|
41
43
|
|
|
42
44
|
### 6. Static Analysis (if configured)
|
|
43
45
|
```bash
|
|
44
|
-
#
|
|
46
|
+
# Linting, security scan, duplicate detection
|
|
47
|
+
# e.g., SpotBugs, ESLint, Clippy, bandit
|
|
45
48
|
```
|
|
46
49
|
|
|
47
50
|
## Evidence Rules
|
|
@@ -53,7 +56,7 @@ mvn verify
|
|
|
53
56
|
|
|
54
57
|
## Checklist
|
|
55
58
|
|
|
56
|
-
- [ ] Formatting passes (
|
|
59
|
+
- [ ] Formatting passes (idempotent)
|
|
57
60
|
- [ ] Compiles without errors
|
|
58
61
|
- [ ] All tests pass (0 failures, 0 errors)
|
|
59
62
|
- [ ] No new warnings (or documented)
|
package/src/init.sh
CHANGED
|
@@ -180,29 +180,29 @@ if [ "$SAMPLE" = true ]; then
|
|
|
180
180
|
else
|
|
181
181
|
cat > opencode.json << 'SAMPLEEOF'
|
|
182
182
|
{
|
|
183
|
-
"model": "
|
|
183
|
+
"model": "your-model",
|
|
184
184
|
"plugin": [
|
|
185
185
|
"@ikieaneh/opencode-kit",
|
|
186
186
|
"superpowers"
|
|
187
187
|
],
|
|
188
188
|
"agent": {
|
|
189
189
|
"orchestrator": {
|
|
190
|
-
"model": "
|
|
190
|
+
"model": "your-model",
|
|
191
191
|
"skills": ["orchestration-template", "scoring-pipeline", "verification-before-completion"],
|
|
192
192
|
"steps": 50
|
|
193
193
|
},
|
|
194
194
|
"planner": {
|
|
195
|
-
"model": "
|
|
195
|
+
"model": "your-model",
|
|
196
196
|
"skills": ["brainstorming", "writing-plans", "system-analyst"],
|
|
197
197
|
"steps": 80
|
|
198
198
|
},
|
|
199
199
|
"task-manager": {
|
|
200
|
-
"model": "
|
|
200
|
+
"model": "your-model",
|
|
201
201
|
"skills": ["subagent-driven-development", "executing-plans", "test-driven-development"],
|
|
202
202
|
"steps": 100
|
|
203
203
|
},
|
|
204
204
|
"code-reviewer": {
|
|
205
|
-
"model": "
|
|
205
|
+
"model": "your-model",
|
|
206
206
|
"skills": ["qa-expert", "security-expert"],
|
|
207
207
|
"steps": 80
|
|
208
208
|
}
|
package/templates/contract.json
CHANGED
|
@@ -1,66 +0,0 @@
|
|
|
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
|