From agent-dashboard
Diagnose and fix a bug in an isolated git worktree with reproduce-first, test-first methodology
npx claudepluginhub bjornjee/agent-dashboard --plugin agent-dashboardThis skill uses the workspace's default tool permissions.
Diagnose and fix a bug.
Creates isolated Git worktrees for feature branches with prioritized directory selection, gitignore safety checks, auto project setup for Node/Python/Rust/Go, and baseline verification.
Executes implementation plans in current session by dispatching fresh subagents per independent task, with two-stage reviews: spec compliance then code quality.
Dispatches parallel agents to independently tackle 2+ tasks like separate test failures or subsystems without shared state or dependencies.
Diagnose and fix a bug.
Bug description: $ARGUMENTS
Follow these phases in order. Each phase has a gate — do not proceed until the gate is satisfied. Apply all project rules and conventions that are in your context.
basename $(git rev-parse --show-toplevel)git checkout maingit pull origin mainfix/<name> and worktree ../worktrees/<app>/<name> from main:
mkdir -p ../worktrees/<app> && git worktree add ../worktrees/<app>/<name> -b fix/<name> main
find . -name '.env*' -not -path './.git/*' -not -path './node_modules/*'./.env → ../worktrees/<app>/<name>/.env./services/api/.env.local → ../worktrees/<app>/<name>/services/api/.env.localfor f in $(find . -name '.env*' -not -path './.git/*' -not -path './node_modules/*'); do mkdir -p "../worktrees/<app>/<name>/$(dirname "$f")" && cp "$f" "../worktrees/<app>/<name>/$f"; done.claude/settings.local.json exists: mkdir -p ../worktrees/<app>/<name>/.claude && cp .claude/settings.local.json ../worktrees/<app>/<name>/.claude/pwd and git branch --show-currentfind command in both directories and diff the file lists. If any files are missing in the worktree, halt and report failure. If the source repo had no .env* files, note that explicitly.Gate: Working directory is the new worktree on the correct branch, based on latest main. If .env* files existed in the source repo, they are all present in the worktree.
Start two tracks in parallel:
Background — Environment setup: Launch a background agent (run_in_background: true) to set up the dev environment. The agent must:
Auto-detect project type from project files (highest match wins):
| Priority | Signal | Type |
|---|---|---|
| 1 | react-native in package.json dependencies | Mobile |
| 2 | next, vite, or webpack in package.json | Web |
| 3 | requirements.txt, pyproject.toml, or setup.py | Python |
| 4 | go.mod | Go |
| 5 | Dockerfile or docker-compose.yml | Containerized |
Ask the user only if no signal matches.
Install dependencies appropriate for the project type (e.g. pip install, npm install, go mod download). Configure ports, create emulators/simulators as needed.
Symlink large data directories (data/, datasets/, evals/, models/, artifacts/) from the source repo rather than copying.
On success, write a sentinel file: touch .env-setup-done
On failure, write the error: echo "<error message>" > .env-setup-failed
Foreground — Evidence gathering:
Before touching code, collect grounded evidence from observable sources. Do not guess from reading code alone.
git log --oneline --since="2 weeks ago" -- <affected files> — what changed recently in the area?Gate: At least one source of grounded evidence (log, trace, metric, or reproducible steps) is collected. Do not proceed on hypothesis alone.
Pre-gate: Check for .env-setup-done in the worktree root.
node_modules/ exists, pip list succeeds, go env GOPATH works) and data symlinks resolve correctly..env-setup-failed exists: surface the error and halt.make test and confirm the new test fails.Gate: A test exists that fails, reproducing the bug. The failure matches the observed evidence.
Root cause analysis must be grounded in the evidence and the failing test, not speculation from reading code.
git log -S "<relevant term>" and git bisect if the bug is a regression.Gate: User agrees with the root cause analysis. Diagnosis cites observable evidence.
make test — the previously failing test must now pass.make test — no regressions.Gate: The reproducing test passes. The full test suite passes. No unrelated changes.
make test to confirm tests still pass.Gate: Tests pass via make test. Code is clean.
fix: conventional commit message that describes what was fixed and why.Gate: Clean commit with conventional message. No critical or high-severity review issues.
Triggered when the user indicates the fix has been merged upstream.
.env-setup-done/.env-setup-failed sentinel files