This is a bare minimum version to test the core concept:
needs dependencies)plugin.ts (duplicate implementation)sdk.ts (not needed for testing)when)src/
types/index.ts (~120 lines - minimal types)
loader/index.ts (unchanged - already simple)
validator/index.ts (unchanged - already simple)
executor/
index.ts (~240 lines - script steps only)
execution-manager.ts (~50 lines - single execution)
opencode-plugin.ts (~200 lines - minimal hooks)
index.ts (exports)
examples/
test/ability.yaml (3-step test ability)
Total: ~600 lines (down from ~2000+)
Create test ability directory:
mkdir -p .opencode/abilities
cp examples/test/ability.yaml .opencode/abilities/
Configure OpenCode to use plugin:
// .opencode/opencode.json
{
"plugin": [
"file://./packages/plugin-abilities/src/opencode-plugin.ts"
]
}
Goal: Verify steps execute sequentially
User: ability.run({ name: "test" })
Expected:
✅ Step 1 executes
✅ Step 2 executes (after step 1)
✅ Step 3 executes (after step 2)
✅ Status = completed
Goal: Verify tools are blocked during script execution
User: ability.run({ name: "test" })
[While step 1 is running]
User: bash({ command: "ls" })
Expected:
❌ Error: Tool 'bash' blocked during script step 'step1'
Goal: Verify ability context appears in chat
User: ability.run({ name: "test" })
[Send any message while running]
User: What's happening?
Expected:
🔄 Active Ability: test
Progress: 1/3 steps completed
Current Step: step2
⚠️ ENFORCEMENT ACTIVE
Goal: Verify status tool works
User: ability.run({ name: "test" })
User: ability.status()
Expected:
{
"status": "running",
"ability": "test",
"currentStep": "step2",
"progress": "1/3"
}
Goal: Verify inputs are validated
User: ability.run({ name: "test", inputs: { message: "Custom message" } })
Expected:
✅ Step 1 output contains "Custom message"
All 5 tests pass = Core concept proven
Then you can add back:
# Build
cd packages/plugin-abilities
bun run build
# Run minimal test (if you have test runner)
bun test tests/minimal.test.ts
If these 4 things work, the architecture is sound.
But test the minimal version first before adding complexity.