Skip to content
Back to skills

Features

ASecurity

A targeted repair skill for fixing test failures and PR review blockers. Invoked by the user directly or automatically by `/do-build` at lifecycle failure points.

  • 26 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added September 2, 2026
ai-agentspythonbashgit

Security analysis

A100/100

Pro scans all 20 files and shows the line behind each finding

Scanned September 2, 2026

npx -y skills add tomcounsell/ai --skill features --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Features?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Features
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/tomcounsell-features/badge)](https://www.skillsdirectory.com/skills/tomcounsell-features)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
# /do-patch Skill

A targeted repair skill for fixing test failures and PR review blockers. Invoked by the user directly or automatically by `/do-build` at lifecycle failure points.

## /do-patch vs /do-build

| | `/do-patch` | `/do-build` |
|--|--|--|
| Input | Description of what's broken | Plan document |
| Scope | Targeted fix to existing code | Full implementation from scratch |
| Worktree | Uses existing worktree or CWD | Creates new worktree |
| Agents | Single focused agent | Heavy orchestration (multiple) |
| Caller | User or `do-build` | User |
| Creates PRs? | Never | Yes |
| Commits? | Never | Builders do |
| Use case | Fixing test failures or review blockers | Shipping a feature |

## User Invocation

```
/do-patch "3 tests failing in test_bridge.py — connection timeout"
/do-patch "review blocker: race condition in session lock"
/do-patch  # no args — reads most recent failure from session context
```

Trigger phrases: `"patch this"`, `"fix the failures"`, `"fix the blockers"`, `"do-patch"`

## Model-Invocable Lifecycle

`/do-build` calls `/do-patch` automatically at two lifecycle points:

### 1. Test Failure (no iteration cap)

```
Implement → test → FAIL → /do-patch → test → FAIL → /do-patch → ...
                                                           ↓
                                                         PASS → Review
```

No iteration cap at this stage. The loop continues until tests pass or a human intervenes.

### 2. Review Blockers (capped at 3)

```
Review → blockers → /do-patch → test → re-review → blockers → /do-patch → ...
                                                                      ↓ (3rd time)
                                                               PATCH STUCK → human
```

Capped at **3 patch→test→review iterations**. After 3 cycles, emits a structured "PATCH STUCK" report and waits for human input. The asymmetry is intentional — test failures have an objective signal automation can chase; review blockers are subjective.

## Flow

1. Accept failure description (or read last failure from session context)
2. For multi-component bugs or non-obvious root causes, apply the [Trace & Verify](trace-and-verify.md) protocol: trace actual data at each component boundary, write a failing test, identify the fix from the divergence point, and verify forward. Skip for single-component bugs with obvious fixes.
3. Read the failing test output or review comment in full
4. Deploy a **single builder agent** to make targeted edits
5. Run `pytest` + `ruff check` + `ruff format` directly to verify the fix (no `/do-test` dispatch)
6. If pass: report success, update pipeline state to next stage
   - Test failure context → advance to `review`
   - Review blocker context → advance to `document`
7. If fail: retry up to caller's iteration cap, then report stuck with details

## Annotate Rather Than Skip

When a review finding is genuinely not worth fixing (e.g., a style nit in older code, a suggestion that contradicts the plan), the builder adds an inline code comment instead of silently skipping:

```python
# NOTE: [finding summary] -- left as-is because [rationale]
```

This creates a paper trail so the next reviewer does not re-flag the same issue. The finding is "addressed" (annotated), not "skipped." See [PM SDLC Decision Rules](pm-sdlc-decision-rules.md) for how the PM interprets these outcomes.

## What /do-patch Never Does

- Never creates a PR
- Never commits changes to git
- Never touches the Document or PR pipeline stages
- Never creates new worktrees
- Never modifies pipeline state directly on failure — only `/do-build` advances the pipeline

## Pipeline State on Success

When `/do-patch` fixes a test failure:
```bash
python -c "from agent.build_pipeline import advance_stage; advance_stage('{slug}', 'review')"
```

When `/do-patch` fixes review blockers:
```bash
python -c "from agent.build_pipeline import advance_stage; advance_stage('{slug}', 'document')"
```

## Related

- [PM SDLC Decision Rules](pm-sdlc-decision-rules.md) — how the PM interprets review outcomes and routes to PATCH
- [Trace & Verify Protocol](trace-and-verify.md) — root cause analysis methodology used in Step 2
- [SDLC Enforcement](sdlc-enforcement.md) — the quality gate system this skill operates within
- `.claude/skills/do-patch/SKILL.md` — full skill definition
- `.claude/skills/do-build/SKILL.md` — the pipeline orchestrator that invokes this skill

Files in this skill

  • README.md57.2 KB
  • adding-reflection-tasks.md9.8 KB
  • agent-definition-fallback.md4.5 KB
  • agent-judgment-catchup.md19.9 KB
  • agent-message-delivery.md28 KB
  • agent-reply-terminus.md13.5 KB
  • agent-session-fenced-execution-record.md32.6 KB
  • agent-session-health-monitor.md41.3 KB
  • agent-session-liveness-authorship.md13.7 KB
  • agent-session-model.md29.8 KB
  • agent-session-queue.md23.2 KB
  • agent-session-scheduling.md7.3 KB
  • agent-teams-headless-policy.md6.6 KB
  • agentsession-index-drift-detection.md8.6 KB
  • agentsession-pending-index-leak.md6.5 KB
  • archived/README.md885 B
  • archived/system-overview.md22.6 KB
  • archived/telegram.md7.2 KB
  • audit-skills.md11.6 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.