بنقرة واحدة
fix-scrub
Remediate findings from bug-scrub report — auto-fixes, agent-assisted fixes, and quality verification
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
القائمة
Remediate findings from bug-scrub report — auto-fixes, agent-assisted fixes, and quality verification
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
استنادا إلى تصنيف SOC المهني
Generate throughput and quality reports from coordinator audit data and episodic memory
Orchestrate the full plan-review-implement-validate-PR lifecycle with multi-vendor review convergence
Comprehensive project health diagnostic — collects signals from CI tools, existing reports, deferred issues, and code markers into a prioritized finding report
Generate changelog entries and suggest semantic version bumps from git history
Ingest raw session transcripts from coding-agent harnesses via vendor-specific adapters, normalize to a common event schema, triage for struggle signals, and write structured findings to episodic memory
Readiness gate for sync-point operations — inspect validation, rework, and active-agent state before merge
| name | fix-scrub |
| description | Remediate findings from bug-scrub report — auto-fixes, agent-assisted fixes, and quality verification |
| category | Git Workflow |
| tags | ["quality","remediation","auto-fix","code-markers","deferred-issues"] |
| triggers | ["fix scrub","run fix scrub","fix findings","remediate"] |
Consume the bug-scrub report and apply fixes with clean separation from the diagnostic phase. Classifies findings into three tiers (auto/agent/manual), applies fixes, verifies quality, and commits.
$ARGUMENTS - Optional flags:
--report <path> (default: docs/bug-scrub/bug-scrub-report.json)--tier <list> (comma-separated; default: auto,agent; values: auto, agent, manual)--severity <level> (minimum severity; default: medium)--dry-run (plan fixes without applying — skips branch creation)--max-agent-fixes <N> (default: 10)--worktree (create an isolated git worktree for the fix-scrub branch; auto-enabled when running inside an existing worktree)Scripts live in <agent-skills-dir>/fix-scrub/scripts/. Each agent runtime substitutes <agent-skills-dir> with its config directory:
.claude/skills.codex/skills.gemini/skillsInstalled skill copies are expected to include these scripts. If they are missing, reinstall the skill from its canonical distribution rather than invoking a repo-local path.
/bug-scrub first)Skip this step if --dry-run is active.
Create an isolated branch for fix-scrub changes. All fixes go through PR review before reaching main.
# Pull latest main
git checkout main
git pull origin main
# Determine branch name (date-based, with collision suffix)
BRANCH_DATE=$(date +%Y-%m-%d)
BRANCH_NAME="fix-scrub/${BRANCH_DATE}"
SUFFIX=1
while git show-ref --verify --quiet "refs/heads/${BRANCH_NAME}"; do
SUFFIX=$((SUFFIX + 1))
BRANCH_NAME="fix-scrub/${BRANCH_DATE}-${SUFFIX}"
done
# Create and switch to the fix-scrub branch
git checkout -b "$BRANCH_NAME"
echo "Created branch: $BRANCH_NAME"
Create a worktree when --worktree is passed or when already inside a git worktree (auto-detection). This prevents fix-scrub from modifying an active implementation worktree.
# Detect if worktree isolation is needed
eval "$(python3 "<skill-base-dir>/../worktree/scripts/worktree.py" detect)"
if [[ "$IN_WORKTREE" == "true" ]] || [[ "<--worktree flag passed>" == "true" ]]; then
# Agent-id for worktree disambiguation
FIX_AGENT_ID="${AGENT_ID:-fix-$(date +%s)}"
# Setup fix-scrub worktree (creates .git-worktrees/fix-scrub/<agent-id>/)
eval "$(python3 "<skill-base-dir>/../worktree/scripts/worktree.py" setup "${BRANCH_DATE}" --branch "${BRANCH_NAME}" --prefix fix-scrub --agent-id "${FIX_AGENT_ID}")"
cd "$WORKTREE_PATH"
echo "Working directory: $(pwd)"
fi
After the fix-scrub is complete and changes are pushed, tear down the worktree:
# Teardown fix-scrub worktree
python3 "<skill-base-dir>/../worktree/scripts/worktree.py" teardown "${BRANCH_DATE}" --prefix fix-scrub --agent-id "${FIX_AGENT_ID}"
python3 <agent-skills-dir>/fix-scrub/scripts/main.py \
--report <report-path> \
--tier <tiers> \
--severity <level> \
--dry-run
Review the dry-run output before applying.
python3 <agent-skills-dir>/fix-scrub/scripts/main.py \
--report <report-path> \
--tier <tiers> \
--severity <level> \
--max-agent-fixes <N>
This will:
docs/bug-scrub/agent-fix-prompts.jsonIf agent-fix prompts were generated, resolve the implementer archetype and dispatch as parallel Task() agents:
import json
import sys
from pathlib import Path
bridge_scripts = Path("<skill-base-dir>").parent / "coordination-bridge" / "scripts"
sys.path.insert(0, str(bridge_scripts))
import coordination_bridge
resolved = coordination_bridge.try_resolve_archetype_for_phase("IMPL_FIX", {})
resolved_model = resolved["model"] if resolved else None
with open("docs/bug-scrub/agent-fix-prompts.json") as f:
prompts = json.load(f)
# Launch parallel agents — one per file group
for entry in prompts:
Task(
subagent_type="general-purpose",
model=resolved_model, # archetype: implementer (sonnet, or opus if escalated)
description=f"Fix issues in {entry['file']}",
prompt=entry["prompt"],
run_in_background=True,
)
Wait for all agents to complete, then verify.
After all fixes (auto + agent) are applied, the orchestrator runs pytest, mypy, ruff, and openspec validate. If regressions are detected, review before committing.
git add .
git commit -m "$(cat <<'EOF'
fix(scrub): apply <N> fixes from bug-scrub report
Auto-fixes: <count> (ruff)
Agent-fixes: <count> (mypy, markers, deferred)
Manual-only: <count> (reported, not fixed)
Source report: <report-path>
Co-Authored-By: Claude <noreply@anthropic.com>
EOF
)"
Skip if no fixes were applied (dry-run or all findings were manual-only).
# Push the fix-scrub branch
git push -u origin "$BRANCH_NAME"
# Create PR with fix-scrub report as body
gh pr create \
--title "fix(scrub): apply fixes from bug-scrub report $(date +%Y-%m-%d)" \
--body "$(cat <<'EOF'
## Summary
Automated fix-scrub remediation from bug-scrub report.
### Fix Summary
<!-- Paste from docs/bug-scrub/fix-scrub-report.md -->
- Auto-fixes: <count> (ruff)
- Agent-fixes: <count> (mypy, markers, deferred)
- Manual-only: <count> (reported, not fixed)
### Quality Checks
- [ ] pytest passing
- [ ] mypy passing
- [ ] ruff passing
- [ ] openspec validate passing
Source report: `docs/bug-scrub/bug-scrub-report.json`
---
🤖 Generated with Claude Code
EOF
)"
Check docs/bug-scrub/fix-scrub-report.md for the full summary including:
| Tier | Criteria | Action |
|---|---|---|
| auto | ruff with fixable rules | ruff check --fix |
| agent | mypy type errors, markers with 10+ chars context, deferred items with proposed fix | Task() agent with file scope |
| manual | architecture, security, deferred without fix, markers with insufficient context | Reported only |
python3 -m pytest <agent-skills-dir>/fix-scrub/tests -q