mirror of
https://github.com/affaan-m/ECC.git
synced 2026-08-20 06:25:43 +02:00
The `.opencode/commands/*.md` frontmatter referenced agents with the Claude Code plugin namespace (`agent: everything-claude-code:<name>`), but ECC's opencode integration registers its agents unscoped in `opencode.json`'s `agent` map (`code-reviewer`, `planner`, ...), and that file's own `command` section already references them unscoped. The `everything-claude-code:` scope resolves under no opencode config (the opencode plugin package is `ecc-universal`, and inline-config agents are bare), so subtask commands like `/code-review` hard-fail with `Agent not found: everything-claude-code:code-reviewer`. Non-subtask commands fall back to the default agent and appear to work — which is why only some commands failed. Strip the `everything-claude-code:` prefix from all 30 command frontmatter agent ids so they match the registered agents, fix the MIGRATION.md example, and replace the test that enforced the broken scoped invariant with one that asserts each command agent id is a registered opencode agent (fails on the old scoped ids, passes on the fix). Fixes #2477
1.7 KiB
1.7 KiB
description, agent, subtask
| description | agent | subtask |
|---|---|---|
| Enforce TDD workflow with 80%+ coverage | tdd-guide | true |
TDD Command
Implement the following using strict test-driven development: $ARGUMENTS
TDD Cycle (MANDATORY)
RED → GREEN → REFACTOR → REPEAT
- RED: Write a failing test FIRST
- GREEN: Write minimal code to pass the test
- REFACTOR: Improve code while keeping tests green
- REPEAT: Continue until feature complete
Your Task
Step 1: Define Interfaces (SCAFFOLD)
- Define TypeScript interfaces for inputs/outputs
- Create function signature with
throw new Error('Not implemented')
Step 2: Write Failing Tests (RED)
- Write tests that exercise the interface
- Include happy path, edge cases, and error conditions
- Run tests - verify they FAIL
Step 3: Implement Minimal Code (GREEN)
- Write just enough code to make tests pass
- No premature optimization
- Run tests - verify they PASS
Step 4: Refactor (IMPROVE)
- Extract constants, improve naming
- Remove duplication
- Run tests - verify they still PASS
Step 5: Check Coverage
- Target: 80% minimum
- 100% for critical business logic
- Add more tests if needed
Coverage Requirements
| Code Type | Minimum |
|---|---|
| Standard code | 80% |
| Financial calculations | 100% |
| Authentication logic | 100% |
| Security-critical code | 100% |
Test Types to Include
- Unit Tests: Individual functions
- Edge Cases: Empty, null, max values, boundaries
- Error Conditions: Invalid inputs, network failures
- Integration Tests: API endpoints, database operations
MANDATORY: Tests must be written BEFORE implementation. Never skip the RED phase.