Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

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от 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

  1. Confirm DDEV web container context (hostname && pwd).
  2. Verify pb-codegraph reachable: mcp__pb-codegraph__list_repos returns non-empty. If down, fall back to grep but warn output is shallower.
  3. Verify Playwright present: which yarn && test -d tests/m2-hyva-playwright.
  4. 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

Полный SKILL.md на GitHub

Установить 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), без исполняемых скриптов.

Похожие скиллы

Сравнить workflow-investigate-bug с