workflow-investigate-bug
БесплатноБез исполняемых скриптовНе проверенForensic-only bug investigation workflow. Use when a bug is reported but you don't yet know the root cause. Strictly READ-ONLY: reproduces the bug with…
от ProxiBlue★ 17 звёзд на GitHubОб этом скилле
/proxiblue-skills:workflow-investigate-bug
Forensic investigation. Read-only. Produces an evidence-backed root-cause analysis document; doesn't fix.
Per the mandatory investigation protocol in ~/claude-skills-central/rules/investigation.md: enumerate own blast radius first, read ALL failure artefacts (not a sample), compare to prior passing state, only THEN form a hypothesis. This workflow makes that protocol concrete.
Inputs
Ask user for:
- Ticket number (optional but recommended for output naming + GH cross-link)
- Bug description — what's broken, observed behaviour
- Expected behaviour — what should happen instead
- Reproduction URL / steps — at least one path that reliably reproduces
Pre-flight
- Confirm DDEV web container context (
hostname && pwd). - Verify pb-codegraph reachable:
mcp__pb-codegraph__list_reposreturns non-empty. If down, fall back to grep but warn output is shallower. - Verify Playwright present:
which yarn && test -d tests/m2-hyva-playwright. - Verify clean working tree (
git status --short). If dirty, refuse — investigation needs a known-good base to diff against.
Visible todo list
1. Capture environmental facts (branch, commit, recent migrations, container uptime)
2. Reproduce the bug with Playwright + record video, screenshots, console, network
3. Scan var/log/ for errors in the reproduction window
4. Identify affected files from the reproduction (network requests, log file paths, error stack traces)
5. For each affected symbol, mcp__pb-codegraph__impact → enumerate callers / dependents
6. git log + git blame on the affected files — identify candidate regression commits
7. For each candidate regression commit, summarise the diff + correlation to the bug
8. [OPTIONAL] If security implications suspected: invoke /proxiblue-skills:workflow-security-audit on the affected scope
9. Rank candidate root causes by evidence strength
10. Write the investigation doc to .claude/investigations/<ticket>-<YYYYMMDD>.md
11. Recommend handoff workflow (build-feature / hotfix / escalate)
Step details
Step 1 — environment snapshot
echo "Branch: $(git rev-parse --abbrev-ref HEAD)"
echo "Commit: $(git rev-parse HEAD) ($(git log -1 --format='%cd' --date=short))"
echo "Composer status: $(composer diagnose 2>&1 | head -5)"
echo "DDEV uptime: $(uptime)"
echo "Recent migrations: $(bin/magento setup:db:status 2>&1 | tail -5)"
echo "Cache state: $(bin/magento cache:status 2>&1)"
Save to investigation log. This is the "WHAT I CHANGED THIS SESSION" / context from the investigation protocol.
Step 2 — Playwright reproduction
First, review the client's evidence. If the ticket has a screen recording
(.mov/.mp4/.webm), you cannot skip it — it shows the exact click-path and
failure state. Download it and extract frames with ffmpeg (installed in the web
container), then Read the frames — see github-analysis Step 1b for the exact
commands (gh issue view … | grep the asset URL → curl → ffmpeg -vf fps=1).
Let the observed path drive the reproduction spec below.
Write a spec at tests/m2-hyva-playwright/src/apps/<APP_NAME>/tests/_investigations/<ticket>-repro.spec.ts that:
- Navigates to the reproduction URL
- Captures full-page video (
use video: 'on') - Screenshots at each step (
page.screenshot()) - Captures console messages (
page.on('console', msg => ...)) - Captures network requests (
page.on('request', ...)+page.on('response', ...)) - Captures uncaught exceptions (
page.on('pageerror', err => ...)) - Asserts the BROKEN state (test should currently fail / show the bug)
Run it: cd tests/m2-hyva-playwright/src/apps/<APP_NAME>/ && yarn playwright test _investigations/<ticket>-repro.spec.ts. Capture all artifacts (video, screenshots, trace).
If reproduction fails to fire the bug → flag the bug as "non-reproducible in current env" + document conditions tried. STOP — can't investigate what we can't reproduce.
Step 3 — log scan
Scan logs for the reproduction window:
WINDOW_START="$(date -d '5 minutes ago' '+%Y-%m-%d %H:%M:%S')"
for log in var/log/system.log var/log/exception.log var/log/debug.log var/log/payment.log; do
echo "=== $log ==="
[ -f "$log" ] && awk -v start="$WINDOW_START" '$0 >= start' "$log" 2>/dev/null | tail -30
done
Plus docker exec ddev-<project>-web grep -i "<keyword from bug>" /var/log/php-fpm.log if needed.
Extract: error messages, stack traces, file:line references, any class names mentioned.
Step 4 — identify affected files
From the network requests + stack traces, derive a list of PHP files involved. For URL-based: trace through app/code/*/etc/routes.xml → controller class. Trace controller → models → blocks → templates.
For each: also check if there are recent commits touching it.
Step 5 — pb-codegraph impact propagation
For each affected symbol, run mcp__pb-codegraph__impact <symbol>. The returned caller
Установить workflow-investigate-bug в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл workflow-investigate-bug?
Forensic-only bug investigation workflow. Use when a bug is reported but you don't yet know the root cause. Strictly READ-ONLY: reproduces the bug with Playwright, captures video + screenshots + console + network logs, runs git log/blame to identify candidate regression commits, uses mcp__pb-codegraph__impact to enumerate everything that touches the suspect code path, scans var/log/ for related errors, optionally chains workflow-security-audit if security implications suspected. Output: a comprehensive .claude/investigations/<ticket>-<date>.md doc with reproduction steps, log evidence, candidate root causes ranked by likelihood, and a recommended fix-workflow handoff. Does NOT write a fix. After investigation completes, user decides whether to invoke workflow-build-feature (treats fix as a feature plan), do a hotfix, or escalate.
Как установить скилл workflow-investigate-bug?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл workflow-investigate-bug запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
doc-coauthoring
Guide users through a structured workflow for co-authoring documentation. Use when user wants to write documentation, proposals, technical specs, decision…
от Anthropicacademy-guide
Stop and check this skill before finishing any reply to a question about how to use Claude or a Claude product — it recommends matching courses, tutorials…
от Anthropicinternal-comms
A set of resources to help me write all kinds of internal communications, using the formats that my company likes to use. Claude should use this skill…
от Anthropicskill-development
This skill should be used when the user wants to "create a skill", "add a skill to plugin", "write a new skill", "improve skill description", "organize skill…
от Anthropic