Files
manual_slop/.claude/commands/conductor-implement.md
Ed_ a2a1447f58 checkpoint: Claude Code integration + implement missing MCP var tools
Add Claude Code conductor commands, MCP server, MMA exec scripts,
and implement py_get_var_declaration / py_set_var_declaration which
were registered in dispatch and tool specs but had no function bodies.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-28 10:47:42 -05:00

98 lines
3.2 KiB
Markdown

---
description: Execute a conductor track — follow TDD workflow, delegate to Tier 3/4 workers
---
# /conductor-implement
Execute a track's implementation plan. This is a Tier 2 (Tech Lead) operation.
You maintain PERSISTENT context throughout the track — do NOT lose state.
## Startup
1. Read `conductor/workflow.md` for the full task lifecycle protocol
2. Read `conductor/tech-stack.md` for technology constraints
3. Read the target track's `spec.md` and `plan.md`
4. Identify the current task: first `[ ]` or `[~]` in `plan.md`
If no track name is provided, run `/conductor-status` first and ask which track to implement.
## Task Lifecycle (per task)
Follow this EXACTLY per `conductor/workflow.md`:
### 1. Mark In Progress
Edit `plan.md`: change `[ ]``[~]` for the current task.
### 2. Research Phase (High-Signal)
Before touching code, use context-efficient tools:
- `py_get_code_outline` or `py_get_skeleton` (via MCP tools) to map architecture
- `get_git_diff` to understand recent changes
- `Grep`/`Glob` to locate symbols
- Only `Read` full files after identifying specific target ranges
### 3. Write Failing Tests (Red Phase — TDD)
**DELEGATE to Tier 3 Worker** — do NOT write tests yourself:
```powershell
uv run python scripts\claude_mma_exec.py --role tier3-worker "Write failing tests for: {TASK_DESCRIPTION}. Focus files: {FILE_LIST}. Spec: {RELEVANT_SPEC_EXCERPT}"
```
Run the tests. Confirm they FAIL. This is the Red phase.
### 4. Implement to Pass (Green Phase)
**DELEGATE to Tier 3 Worker**:
```powershell
uv run python scripts\claude_mma_exec.py --role tier3-worker "Implement minimum code to pass these tests: {TEST_FILE}. Focus files: {FILE_LIST}"
```
Run tests. Confirm they PASS. This is the Green phase.
### 5. Refactor (Optional)
With passing tests as safety net, refactor if needed. Rerun tests.
### 6. Verify Coverage
```powershell
uv run pytest --cov=. --cov-report=term-missing {TEST_FILE}
```
Target: >80% for new code.
### 7. Commit
Stage changes. Message format:
```
feat({scope}): {description}
```
### 8. Attach Git Notes
```powershell
$sha = git log -1 --format="%H"
git notes add -m "Task: {TASK_NAME}`nSummary: {CHANGES}`nFiles: {FILE_LIST}" $sha
```
### 9. Update plan.md
Change `[~]``[x]` and append first 7 chars of commit SHA:
```
[x] Task description. abc1234
```
Commit: `conductor(plan): Mark task '{TASK_NAME}' as complete`
### 10. Next Task or Phase Completion
- If more tasks in current phase: loop to step 1 with next task
- If phase complete: run `/conductor-verify`
## Error Handling
If tests fail with large output, delegate to Tier 4 QA:
```powershell
uv run python scripts\claude_mma_exec.py --role tier4-qa "Analyze this test failure: {ERROR_SUMMARY}. Test file: {TEST_FILE}"
```
Maximum 2 fix attempts. If still failing: STOP and ask the user.
## Deviations from Tech Stack
If implementation requires something not in `tech-stack.md`:
1. **STOP** implementation
2. Update `tech-stack.md` with justification
3. Add dated note
4. Resume
## Important
- You are Tier 2 — delegate heavy implementation to Tier 3
- Maintain persistent context across the entire track
- Use Research-First Protocol before reading large files
- The plan.md is the SOURCE OF TRUTH for task state