Skip to content

oliver-kriska/claude-elixir-phoenix / targets/amp/skills/phx-work

phx-work

Verified

Execute Elixir/Phoenix plan tasks with progress tracking. Use after phx-plan to implement features with mix compile and mix test verification after each step, or --continue to resume interrupted work.

references/error-recovery.md

View on GitHub
# Error Recovery

## Verification Rules

Verification is tiered to balance speed and safety:

**Per-task** (after each task):

| Change Type | Verification Steps |
|-------------|-------------------|
| Any .ex/.exs | `mix format` + `mix compile --warnings-as-errors` |
| Schema/migration | Above + `mix ecto.migrate` (dev) |

**Per-phase** (after all tasks in a phase):

| Scope | Verification Steps |
|-------|-------------------|
| Always | `mix compile --warnings-as-errors` |
| Always | `mix test <affected_test_files>` |
| Always | `mix credo --strict` |

**Final gate** (after all phases): `mix test` (full suite)

## When Verification Fails

1. **Compile error**: Read error, fix, retry
2. **Test failure**: Analyze failure, fix code or test
3. **Credo warning**: Auto-fix if possible, else flag
4. **After 3 retries**: Mark the blocker in both plan and progress, write the scratchpad DEAD-END, and stop. Skip and continue only with explicit `--skip-blockers`

## BLOCKER Format

```markdown
## BLOCKER: P2-T3 — Task could not be completed

**Plan task**: `- [ ] [P2-T3][ecto] [BLOCKED] Implement register_user/1`
**Task**: Implement register_user/1
**Attempts**: 3
**Last Error**: Test assertion failed - expected {:ok, user} got {:error, changeset}
**Files**: lib/my_app/accounts.ex:45

**Action Required**: Human review needed
**Resume**: `phx-work plan.md --from P2-T3`
```

**Also write a DEAD-END entry** to the scratchpad so future
sessions don't re-try the same failed approach:

```markdown
### [HH:MM] DEAD-END: {task description}
Tried: {approach attempted}. Failed because: {root cause}.
Attempts: 3. See BLOCKER in progress.md for full error.
```

Append to `.claude/plans/{slug}/scratchpad.md`.

By default, return control after recording this state. Only `--skip-blockers` may advance to a later task.

## Recovery After BLOCKER

When user resolves a blocker and resumes:

1. Re-read the plan file for current checkbox state
2. Start from the previously blocked task
3. Verify the fix compiles and tests pass
4. Mark checkbox and continue
finishing-a-development-branchobra/superpowersUse when implementation is complete, all tests pass, and you need to decide how to integrate the workStars: 322kUpdated Claude CodeCodexVerifiedInstall
systematic-debuggingobra/superpowersUse when encountering any bug, test failure, or unexpected behavior, before proposing fixesStars: 322kUpdated Claude CodeCodexVerifiedInstall
test-driven-developmentobra/superpowersUse when implementing any feature or bugfix, before writing implementation codeStars: 322kUpdated Claude CodeCodexVerifiedInstall
skill-creatoranthropics/skillsCreate new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an existing skill, run evals to test a skill, benchmark skill performance with variance analysis, or optimize a skill's description for better triggering accuracy.Stars: 198kUpdated Claude CodeCodexVerifiedInstall