From f4b5c1a6598e3524ad97707d61b59629e71b7466 Mon Sep 17 00:00:00 2001 From: Ed_ Date: Sat, 16 May 2026 02:19:10 -0400 Subject: [PATCH] fix(agents): Add TDD phase enforcement to tier3-worker --- .opencode/agents/tier3-worker.md | 50 +++++++++++++------------------- 1 file changed, 20 insertions(+), 30 deletions(-) diff --git a/.opencode/agents/tier3-worker.md b/.opencode/agents/tier3-worker.md index e1e04b74..09ae30de 100644 --- a/.opencode/agents/tier3-worker.md +++ b/.opencode/agents/tier3-worker.md @@ -84,40 +84,30 @@ Before implementing: 3. [ ] Verify target file and line range exists 4. [ ] Announce: "Implementing: [task description]" -## Task Execution Protocol +## Task Execution Protocol (MANDATORY TDD) -### 1. Understand the Task +### Phase 1: RED - Write Failing Test +- Write a test that defines the expected behavior +- Run: `manual-slop_run_powershell` with `uv run pytest tests/path/test.py -v` +- Confirm: Test MUST fail before proceeding +- DO NOT skip this phase -Read the task prompt carefully. It specifies: +### Phase 2: GREEN - Implement to Pass +- Implement the minimal code to make the test pass +- Run tests again +- Confirm: Test MUST pass +- DO NOT skip this phase -- **WHERE**: Exact file and line range to modify -- **WHAT**: The specific change required -- **HOW**: Which API calls, patterns, or data structures to use -- **SAFETY**: Thread-safety constraints if applicable +### Phase 3: REFACTOR - Optional +- With passing tests, improve code quality +- DO NOT change behavior +- Re-run tests to confirm still passing -### 2. Research (If Needed) - -Use MCP tools to understand the context: - -- `manual-slop_read_file` - Read specific file sections -- `manual-slop_py_find_usages` - Search for patterns -- `manual-slop_search_files` - Find files by pattern - -### 3. Implement - -- Follow the exact specifications provided -- Use the patterns and APIs specified in the task -- Use 1-space indentation for Python code -- DO NOT add comments unless explicitly requested -- Use type hints where appropriate - -### 4. Verify - -- Run tests if specified: `manual-slop_run_powershell` with `uv run pytest ...` -- Check for syntax errors: `manual-slop_py_check_syntax` -- Verify the change matches the specification - -### 5. Report +### Commit Protocol (ATOMIC PER TASK) +After each task completion: +1. `manual-slop_run_powershell` with `git add .` +2. `git commit -m "feat(scope): description"` +3. DO NOT batch commits across tasks Return a concise summary: