Files
ECC/.opencode/commands/tdd.md
Gaurav Dubey 9d1ecb0754 fix(opencode): resolve command agent ids to registered opencode agents (#2477)
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
2026-07-10 09:46:40 +05:30

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
  1. RED: Write a failing test FIRST
  2. GREEN: Write minimal code to pass the test
  3. REFACTOR: Improve code while keeping tests green
  4. 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.