oh-my-claudecode-opencode 0.6.5 → 0.6.7
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/dist/agents/index.d.ts +32 -0
- package/dist/index.js +173 -0
- package/package.json +4 -2
- package/scripts/install-local.sh +25 -0
- package/scripts/postinstall.js +112 -0
package/dist/agents/index.d.ts
CHANGED
|
@@ -94,6 +94,38 @@ export declare const qaTesterAgent: AgentDefinition;
|
|
|
94
94
|
* QA Tester High (Opus) - Comprehensive Production QA Specialist
|
|
95
95
|
*/
|
|
96
96
|
export declare const qaTesterHighAgent: AgentDefinition;
|
|
97
|
+
/**
|
|
98
|
+
* Build Fixer (Sonnet) - Build and TypeScript error resolution specialist
|
|
99
|
+
*/
|
|
100
|
+
export declare const buildFixerAgent: AgentDefinition;
|
|
101
|
+
/**
|
|
102
|
+
* Build Fixer Low (Haiku) - Fast build error fixes
|
|
103
|
+
*/
|
|
104
|
+
export declare const buildFixerLowAgent: AgentDefinition;
|
|
105
|
+
/**
|
|
106
|
+
* Code Reviewer (Opus) - Expert code review specialist
|
|
107
|
+
*/
|
|
108
|
+
export declare const codeReviewerAgent: AgentDefinition;
|
|
109
|
+
/**
|
|
110
|
+
* Code Reviewer Low (Haiku) - Quick code checks
|
|
111
|
+
*/
|
|
112
|
+
export declare const codeReviewerLowAgent: AgentDefinition;
|
|
113
|
+
/**
|
|
114
|
+
* TDD Guide (Sonnet) - Test-Driven Development specialist
|
|
115
|
+
*/
|
|
116
|
+
export declare const tddGuideAgent: AgentDefinition;
|
|
117
|
+
/**
|
|
118
|
+
* TDD Guide Low (Haiku) - Quick test suggestions
|
|
119
|
+
*/
|
|
120
|
+
export declare const tddGuideLowAgent: AgentDefinition;
|
|
121
|
+
/**
|
|
122
|
+
* Security Reviewer (Opus) - Security vulnerability detection specialist
|
|
123
|
+
*/
|
|
124
|
+
export declare const securityReviewerAgent: AgentDefinition;
|
|
125
|
+
/**
|
|
126
|
+
* Security Reviewer Low (Haiku) - Quick security scans
|
|
127
|
+
*/
|
|
128
|
+
export declare const securityReviewerLowAgent: AgentDefinition;
|
|
97
129
|
/**
|
|
98
130
|
* Planner (Opus) - Strategic Planning Specialist
|
|
99
131
|
*/
|
package/dist/index.js
CHANGED
|
@@ -21262,6 +21262,171 @@ tmux kill-session -t <name>
|
|
|
21262
21262
|
5. **PRODUCTION-READY verdict** - Only give if ALL categories pass
|
|
21263
21263
|
</Critical_Rules>`
|
|
21264
21264
|
};
|
|
21265
|
+
var buildFixerSystemPrompt = `You are an expert build error resolution specialist focused on fixing TypeScript, compilation, and build errors quickly and efficiently.
|
|
21266
|
+
|
|
21267
|
+
## Core Responsibilities
|
|
21268
|
+
- TypeScript Error Resolution - Fix type errors, inference issues, generic constraints
|
|
21269
|
+
- Build Error Fixing - Resolve compilation failures, module resolution
|
|
21270
|
+
- Dependency Issues - Fix import errors, missing packages, version conflicts
|
|
21271
|
+
- Configuration Errors - Resolve tsconfig.json, webpack, build config issues
|
|
21272
|
+
- Minimal Diffs - Make smallest possible changes to fix errors
|
|
21273
|
+
- No Architecture Changes - Only fix errors, don't refactor or redesign
|
|
21274
|
+
|
|
21275
|
+
## Error Resolution Workflow
|
|
21276
|
+
1. Run full type check: npx tsc --noEmit --pretty
|
|
21277
|
+
2. Capture ALL errors, categorize by type
|
|
21278
|
+
3. For each error: Read error, find minimal fix, verify, run tsc again
|
|
21279
|
+
4. Track progress (X/Y errors fixed)
|
|
21280
|
+
|
|
21281
|
+
## Minimal Diff Strategy
|
|
21282
|
+
DO: Add type annotations, null checks, fix imports, add missing dependencies
|
|
21283
|
+
DON'T: Refactor unrelated code, change architecture, rename variables, add features
|
|
21284
|
+
|
|
21285
|
+
**Remember**: Fix errors quickly with minimal changes. Don't refactor, don't optimize, don't redesign.`;
|
|
21286
|
+
var buildFixerAgent = {
|
|
21287
|
+
name: "build-fixer",
|
|
21288
|
+
description: "Build and TypeScript error resolution specialist. Fixes build/type errors with minimal diffs, no architectural edits.",
|
|
21289
|
+
model: "sonnet",
|
|
21290
|
+
systemPrompt: buildFixerSystemPrompt
|
|
21291
|
+
};
|
|
21292
|
+
var buildFixerLowAgent = {
|
|
21293
|
+
name: "build-fixer-low",
|
|
21294
|
+
description: "Fast build error fixer for simple TypeScript and compilation errors",
|
|
21295
|
+
model: "haiku",
|
|
21296
|
+
systemPrompt: buildFixerSystemPrompt
|
|
21297
|
+
};
|
|
21298
|
+
var codeReviewerSystemPrompt = `You are a senior code reviewer ensuring high standards of code quality and security.
|
|
21299
|
+
|
|
21300
|
+
## Two-Stage Review Process (MANDATORY)
|
|
21301
|
+
**Iron Law: Spec compliance BEFORE code quality. Both are LOOPS.**
|
|
21302
|
+
|
|
21303
|
+
### Stage 1: Spec Compliance (FIRST - MUST PASS)
|
|
21304
|
+
| Check | Question |
|
|
21305
|
+
|-------|----------|
|
|
21306
|
+
| Completeness | Does implementation cover ALL requirements? |
|
|
21307
|
+
| Correctness | Does it solve the RIGHT problem? |
|
|
21308
|
+
| Nothing Missing | Are all requested features present? |
|
|
21309
|
+
| Nothing Extra | Is there unrequested functionality? |
|
|
21310
|
+
|
|
21311
|
+
**Stage 1 Outcome:**
|
|
21312
|
+
- PASS \u2192 Proceed to Stage 2
|
|
21313
|
+
- FAIL \u2192 Document gaps \u2192 FIX \u2192 RE-REVIEW Stage 1 (loop)
|
|
21314
|
+
|
|
21315
|
+
### Stage 2: Code Quality (ONLY after Stage 1 passes)
|
|
21316
|
+
- Security Checks (CRITICAL): Hardcoded credentials, SQL injection, XSS, input validation
|
|
21317
|
+
- Code Quality (HIGH): Large functions, deep nesting, missing error handling
|
|
21318
|
+
- Performance (MEDIUM): Inefficient algorithms, N+1 queries
|
|
21319
|
+
- Best Practices (LOW): TODO comments, missing JSDoc, magic numbers
|
|
21320
|
+
|
|
21321
|
+
## Severity Levels
|
|
21322
|
+
| Severity | Action |
|
|
21323
|
+
|----------|--------|
|
|
21324
|
+
| CRITICAL | Must fix before merge |
|
|
21325
|
+
| HIGH | Should fix before merge |
|
|
21326
|
+
| MEDIUM | Fix when possible |
|
|
21327
|
+
| LOW | Consider fixing |
|
|
21328
|
+
|
|
21329
|
+
## Approval Criteria
|
|
21330
|
+
- APPROVE: No CRITICAL or HIGH issues
|
|
21331
|
+
- REQUEST CHANGES: CRITICAL or HIGH issues found`;
|
|
21332
|
+
var codeReviewerAgent = {
|
|
21333
|
+
name: "code-reviewer",
|
|
21334
|
+
description: "Expert code review specialist. Reviews code for quality, security, and maintainability with severity-rated feedback.",
|
|
21335
|
+
model: "opus",
|
|
21336
|
+
readOnly: true,
|
|
21337
|
+
systemPrompt: codeReviewerSystemPrompt
|
|
21338
|
+
};
|
|
21339
|
+
var codeReviewerLowAgent = {
|
|
21340
|
+
name: "code-reviewer-low",
|
|
21341
|
+
description: "Quick code reviewer for simple quality checks and obvious issues",
|
|
21342
|
+
model: "haiku",
|
|
21343
|
+
readOnly: true,
|
|
21344
|
+
systemPrompt: codeReviewerSystemPrompt
|
|
21345
|
+
};
|
|
21346
|
+
var tddGuideSystemPrompt = `You are a Test-Driven Development (TDD) specialist who ensures all code is developed test-first with comprehensive coverage.
|
|
21347
|
+
|
|
21348
|
+
## The Iron Law
|
|
21349
|
+
**NO PRODUCTION CODE WITHOUT A FAILING TEST FIRST**
|
|
21350
|
+
|
|
21351
|
+
Write code before test? DELETE IT. Start over.
|
|
21352
|
+
|
|
21353
|
+
| Violation | Consequence |
|
|
21354
|
+
|-----------|-------------|
|
|
21355
|
+
| Code written before test | Delete the code. Write test first. |
|
|
21356
|
+
| "I'll add tests after" | No. Stop. Write test now. |
|
|
21357
|
+
| "Just this once" | No exceptions. Ever. |
|
|
21358
|
+
|
|
21359
|
+
## TDD Workflow
|
|
21360
|
+
1. Write Test First (RED) - Start with a failing test
|
|
21361
|
+
2. Run Test - Verify it FAILS
|
|
21362
|
+
3. Write Minimal Implementation (GREEN) - Make test pass
|
|
21363
|
+
4. Run Test - Verify it PASSES
|
|
21364
|
+
5. Refactor (IMPROVE) - Clean up code
|
|
21365
|
+
6. Verify Coverage - Ensure 80%+
|
|
21366
|
+
|
|
21367
|
+
## Test Types You Must Write
|
|
21368
|
+
1. Unit Tests (Mandatory) - Test individual functions
|
|
21369
|
+
2. Integration Tests (Mandatory) - Test API endpoints and database
|
|
21370
|
+
3. E2E Tests (For Critical Flows) - Test complete user journeys
|
|
21371
|
+
|
|
21372
|
+
## Edge Cases You MUST Test
|
|
21373
|
+
Null/Undefined, Empty arrays/strings, Invalid types, Boundaries, Errors, Race conditions, Large data, Special characters
|
|
21374
|
+
|
|
21375
|
+
**Remember**: No code without tests. Tests are not optional.`;
|
|
21376
|
+
var tddGuideAgent = {
|
|
21377
|
+
name: "tdd-guide",
|
|
21378
|
+
description: "Test-Driven Development specialist enforcing write-tests-first methodology. Ensures 80%+ test coverage.",
|
|
21379
|
+
model: "sonnet",
|
|
21380
|
+
systemPrompt: tddGuideSystemPrompt
|
|
21381
|
+
};
|
|
21382
|
+
var tddGuideLowAgent = {
|
|
21383
|
+
name: "tdd-guide-low",
|
|
21384
|
+
description: "Quick TDD guide for simple test suggestions and coverage checks",
|
|
21385
|
+
model: "haiku",
|
|
21386
|
+
systemPrompt: tddGuideSystemPrompt
|
|
21387
|
+
};
|
|
21388
|
+
var securityReviewerSystemPrompt = `You are an expert security specialist focused on identifying and remediating vulnerabilities in web applications.
|
|
21389
|
+
|
|
21390
|
+
## Core Responsibilities
|
|
21391
|
+
1. Vulnerability Detection - Identify OWASP Top 10 and common security issues
|
|
21392
|
+
2. Secrets Detection - Find hardcoded API keys, passwords, tokens
|
|
21393
|
+
3. Input Validation - Ensure all user inputs are properly sanitized
|
|
21394
|
+
4. Authentication/Authorization - Verify proper access controls
|
|
21395
|
+
5. Dependency Security - Check for vulnerable npm packages
|
|
21396
|
+
|
|
21397
|
+
## OWASP Top 10 Checklist
|
|
21398
|
+
1. Injection (SQL, NoSQL, Command) - Are queries parameterized?
|
|
21399
|
+
2. Broken Authentication - Are passwords hashed? Is JWT validated?
|
|
21400
|
+
3. Sensitive Data Exposure - Is HTTPS enforced? Secrets in env vars?
|
|
21401
|
+
4. XML External Entities (XXE) - Is external entity processing disabled?
|
|
21402
|
+
5. Broken Access Control - Is authorization checked on every route?
|
|
21403
|
+
6. Security Misconfiguration - Are security headers set?
|
|
21404
|
+
7. Cross-Site Scripting (XSS) - Is output escaped/sanitized?
|
|
21405
|
+
8. Insecure Deserialization - Is user input deserialized safely?
|
|
21406
|
+
9. Using Components with Known Vulnerabilities - Is npm audit clean?
|
|
21407
|
+
10. Insufficient Logging & Monitoring - Are security events logged?
|
|
21408
|
+
|
|
21409
|
+
## Critical Patterns to Detect
|
|
21410
|
+
- Hardcoded Secrets: const apiKey = "sk-proj-xxxxx" \u2192 Use env vars
|
|
21411
|
+
- SQL Injection: \`SELECT * FROM users WHERE id = \${userId}\` \u2192 Parameterize
|
|
21412
|
+
- Command Injection: exec(\`ping \${userInput}\`) \u2192 Use libraries
|
|
21413
|
+
- XSS: element.innerHTML = userInput \u2192 Use textContent
|
|
21414
|
+
|
|
21415
|
+
**Remember**: Security is not optional. One vulnerability can cost users real financial losses.`;
|
|
21416
|
+
var securityReviewerAgent = {
|
|
21417
|
+
name: "security-reviewer",
|
|
21418
|
+
description: "Security vulnerability detection specialist. Detects OWASP Top 10, secrets, and unsafe patterns.",
|
|
21419
|
+
model: "opus",
|
|
21420
|
+
readOnly: true,
|
|
21421
|
+
systemPrompt: securityReviewerSystemPrompt
|
|
21422
|
+
};
|
|
21423
|
+
var securityReviewerLowAgent = {
|
|
21424
|
+
name: "security-reviewer-low",
|
|
21425
|
+
description: "Quick security scanner for obvious vulnerabilities and secret detection",
|
|
21426
|
+
model: "haiku",
|
|
21427
|
+
readOnly: true,
|
|
21428
|
+
systemPrompt: securityReviewerSystemPrompt
|
|
21429
|
+
};
|
|
21265
21430
|
var plannerAgent = {
|
|
21266
21431
|
name: "planner",
|
|
21267
21432
|
description: "Strategic planning specialist for creating comprehensive implementation plans and roadmaps",
|
|
@@ -21577,6 +21742,14 @@ var HARDCODED_AGENTS = {
|
|
|
21577
21742
|
writer: writerAgent,
|
|
21578
21743
|
"qa-tester": qaTesterAgent,
|
|
21579
21744
|
"qa-tester-high": qaTesterHighAgent,
|
|
21745
|
+
"build-fixer": buildFixerAgent,
|
|
21746
|
+
"build-fixer-low": buildFixerLowAgent,
|
|
21747
|
+
"code-reviewer": codeReviewerAgent,
|
|
21748
|
+
"code-reviewer-low": codeReviewerLowAgent,
|
|
21749
|
+
"tdd-guide": tddGuideAgent,
|
|
21750
|
+
"tdd-guide-low": tddGuideLowAgent,
|
|
21751
|
+
"security-reviewer": securityReviewerAgent,
|
|
21752
|
+
"security-reviewer-low": securityReviewerLowAgent,
|
|
21580
21753
|
planner: plannerAgent,
|
|
21581
21754
|
analyst: analystAgent,
|
|
21582
21755
|
critic: criticAgent,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "oh-my-claudecode-opencode",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.7",
|
|
4
4
|
"description": "OpenCode port of oh-my-claudecode - Multi-agent orchestration plugin (omco)",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -12,7 +12,8 @@
|
|
|
12
12
|
"files": [
|
|
13
13
|
"dist",
|
|
14
14
|
"assets",
|
|
15
|
-
"bin"
|
|
15
|
+
"bin",
|
|
16
|
+
"scripts"
|
|
16
17
|
],
|
|
17
18
|
"exports": {
|
|
18
19
|
".": {
|
|
@@ -26,6 +27,7 @@
|
|
|
26
27
|
"build:watch": "bun build src/index.ts --outdir dist --target bun --format esm --watch",
|
|
27
28
|
"clean": "rm -rf dist",
|
|
28
29
|
"prepublishOnly": "bun run clean && bun run build",
|
|
30
|
+
"postinstall": "node scripts/postinstall.js || true",
|
|
29
31
|
"typecheck": "tsc --noEmit",
|
|
30
32
|
"test": "bun test",
|
|
31
33
|
"test:e2e": "vitest run --config tests/e2e/vitest.config.ts",
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
# Install local development build to OpenCode plugin directory
|
|
3
|
+
|
|
4
|
+
set -e
|
|
5
|
+
|
|
6
|
+
PLUGIN_DIR="$HOME/.config/opencode/node_modules/oh-my-claudecode-opencode"
|
|
7
|
+
|
|
8
|
+
echo "Building..."
|
|
9
|
+
bun run build
|
|
10
|
+
|
|
11
|
+
echo "Copying to $PLUGIN_DIR..."
|
|
12
|
+
cp -r dist/ "$PLUGIN_DIR/dist/"
|
|
13
|
+
cp -r assets/ "$PLUGIN_DIR/assets/"
|
|
14
|
+
cp package.json "$PLUGIN_DIR/package.json"
|
|
15
|
+
|
|
16
|
+
echo "Verifying..."
|
|
17
|
+
SKILL_COUNT=$(ls "$PLUGIN_DIR/assets/skills/" | wc -l)
|
|
18
|
+
VERSION=$(grep '"version"' "$PLUGIN_DIR/package.json" | head -1 | sed 's/.*: "\(.*\)".*/\1/')
|
|
19
|
+
|
|
20
|
+
echo ""
|
|
21
|
+
echo "=== Installation Complete ==="
|
|
22
|
+
echo "Version: $VERSION"
|
|
23
|
+
echo "Skills: $SKILL_COUNT"
|
|
24
|
+
echo ""
|
|
25
|
+
echo "Restart OpenCode to apply changes."
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* OMCO Post-Install Script
|
|
5
|
+
*
|
|
6
|
+
* Adds github-copilot provider to global opencode.json if not present.
|
|
7
|
+
* This ensures OMCO's tier-mapped agents (planner, critic, architect) work out of the box.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
import { readFileSync, writeFileSync, existsSync, mkdirSync } from 'fs';
|
|
11
|
+
import { join } from 'path';
|
|
12
|
+
import { homedir } from 'os';
|
|
13
|
+
|
|
14
|
+
const GITHUB_COPILOT_PROVIDER = {
|
|
15
|
+
"name": "GitHub Copilot",
|
|
16
|
+
"models": {
|
|
17
|
+
"claude-opus-4.5": {
|
|
18
|
+
"name": "Claude Opus 4.5",
|
|
19
|
+
"attachment": true,
|
|
20
|
+
"limit": {
|
|
21
|
+
"context": 200000,
|
|
22
|
+
"output": 32000
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
"claude-sonnet-4": {
|
|
26
|
+
"name": "Claude Sonnet 4",
|
|
27
|
+
"attachment": true,
|
|
28
|
+
"limit": {
|
|
29
|
+
"context": 200000,
|
|
30
|
+
"output": 16000
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
"claude-haiku-4": {
|
|
34
|
+
"name": "Claude Haiku 4",
|
|
35
|
+
"attachment": true,
|
|
36
|
+
"limit": {
|
|
37
|
+
"context": 200000,
|
|
38
|
+
"output": 8000
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
function getOpencodeConfigPath() {
|
|
45
|
+
return join(homedir(), '.config', 'opencode', 'opencode.json');
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
function ensureConfigDir() {
|
|
49
|
+
const configDir = join(homedir(), '.config', 'opencode');
|
|
50
|
+
if (!existsSync(configDir)) {
|
|
51
|
+
mkdirSync(configDir, { recursive: true });
|
|
52
|
+
console.log('[omco] Created config directory:', configDir);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
function main() {
|
|
57
|
+
const configPath = getOpencodeConfigPath();
|
|
58
|
+
|
|
59
|
+
try {
|
|
60
|
+
ensureConfigDir();
|
|
61
|
+
|
|
62
|
+
let config = {};
|
|
63
|
+
let configExists = false;
|
|
64
|
+
|
|
65
|
+
if (existsSync(configPath)) {
|
|
66
|
+
configExists = true;
|
|
67
|
+
const content = readFileSync(configPath, 'utf-8');
|
|
68
|
+
config = JSON.parse(content);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
// Initialize provider section if not present
|
|
72
|
+
if (!config.provider) {
|
|
73
|
+
config.provider = {};
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
// Check if github-copilot already exists
|
|
77
|
+
if (config.provider['github-copilot']) {
|
|
78
|
+
console.log('[omco] github-copilot provider already configured in opencode.json');
|
|
79
|
+
return;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
// Add github-copilot provider
|
|
83
|
+
config.provider['github-copilot'] = GITHUB_COPILOT_PROVIDER;
|
|
84
|
+
|
|
85
|
+
// Add plugin if not present
|
|
86
|
+
if (!config.plugin) {
|
|
87
|
+
config.plugin = [];
|
|
88
|
+
}
|
|
89
|
+
if (!config.plugin.includes('oh-my-claudecode-opencode')) {
|
|
90
|
+
config.plugin.push('oh-my-claudecode-opencode');
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
// Write back
|
|
94
|
+
writeFileSync(configPath, JSON.stringify(config, null, 2));
|
|
95
|
+
|
|
96
|
+
if (configExists) {
|
|
97
|
+
console.log('[omco] ✅ Added github-copilot provider to opencode.json');
|
|
98
|
+
} else {
|
|
99
|
+
console.log('[omco] ✅ Created opencode.json with github-copilot provider');
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
console.log('[omco] Config path:', configPath);
|
|
103
|
+
console.log('[omco] Available models: claude-opus-4.5, claude-sonnet-4, claude-haiku-4');
|
|
104
|
+
|
|
105
|
+
} catch (error) {
|
|
106
|
+
// Don't fail install on config errors - just warn
|
|
107
|
+
console.warn('[omco] ⚠️ Could not update opencode.json:', error.message);
|
|
108
|
+
console.warn('[omco] You may need to manually add github-copilot provider for tier mapping to work.');
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
main();
|