agentleFS
kdoddy36615kdoddy36615/bug-reviewer/.claude/skills/bug-capture/SKILL.md

bug-capture

Skill0 starsChanged 6 months agoMITView on GitHub

Run capture.js to take a before/after screenshot of a bug fix and build the bug-reviewer payload entry — including issue-tracker screenshots, computed styles, and a parsed git diff. Use when the user says "capture the bug", "take before/after screenshots", "build the payload for bug X", or when the orchestrator runs current/fixed captures during the fix loop.

2 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

2 rules. About 0 are common, 1 is distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Write a config file (e.g. /tmp/bug-<ID>-config.json):

    line 17
  2. Distinctive:

    Capture CURRENT before applying the fix: Never reverse the order.

    line 102

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Bug Capture

Wraps capture.js to produce one entry in bugs.json. Each bug is captured twice — once before the fix (current/broken), once after (fixed). The two payloads are merged into a single entry.

The dev server must be running at $PREVIEW_BASE_URL before any capture.


Capture config schema

Write a config file (e.g. /tmp/bug-<ID>-config.json):

{
  "id": 12345,
  "title": "Bug title from issue tracker",
  "description": "<p>HTML from issue tracker description</p>",
  "adoScreenshots": ["/tmp/bug-12345-issue-1.png"],
  "currentUrl": "https://localhost:3000/dev/bugs/bugfix-component-12345?secret=$DRAFT_SECRET_TOKEN&slug=pages%2Fdev%2Fbugs%2Fbugfix-component-12345",
  "fixedUrl":   "https://localhost:3000/dev/bugs/bugfix-component-12345?secret=$DRAFT_SECRET_TOKEN&slug=pages%2Fdev%2Fbugs%2Fbugfix-component-12345",
  "selector":   "[data-c='my-component']",
  "styles":     ["background-color", "border-color"],
  "repoPath":   "$TARGET_REPO_PATH"
}

Always set selector — target the specific component, not the full page. Full-page screenshots are noisy and hide the diff.


Capture order — strict

The CURRENT screenshot must be captured before the fix is applied. Once the code changes, the broken state can't be recovered.

1. CURRENT (broken) — code unfixed

Set currentUrl only. Omit fixedUrl.

node ~/projects/bug-reviewer/capture.js /tmp/bug-12345-config-current.json /tmp/bug-12345-payload-current.json

2. Implement the fix in the target repo.

3. FIXED — code patched

Set fixedUrl only. Omit currentUrl.

node ~/projects/bug-reviewer/capture.js /tmp/bug-12345-config-fixed.json /tmp/bug-12345-payload-fixed.json

The fixed pass also runs git diff --unified=3 in repoPath and parses it into the codeDiff field of the payload.

4. Merge the two payloads into bugs.json

Final entry shape (combine fields from both passes):

{
  "id": 12345,
  "title": "Bug title from issue tracker",
  "description": "<p>HTML from issue tracker</p>",
  "problem": "One sentence: what the user was seeing",
  "fix": "One sentence: what changed in the code, with `backtick` references",
  "adoScreenshots": ["/tmp/bug-12345-issue-1.png"],
  "currentScreenshot": "/tmp/bug-12345-current.png",
  "fixedScreenshot": "/tmp/bug-12345-fixed.png",
  "codeDiff": {
    "path": "packages/ui/src/components/Button/Button.tsx",
    "hunk": "@@ -42,7 +42,7 @@",
    "lines": [
      { "type": "ctx", "oldNo": 42, "newNo": 42, "content": "  const base = cva(..." },
      { "type": "del", "oldNo": 43, "newNo": null, "content": "    'bg-blue-600'" },
      { "type": "add", "oldNo": null, "newNo": 43, "content": "    'bg-blue-700'" }
    ]
  }
}

problem and fix are written by Claude (one sentence each) — capture.js leaves them empty.

problem, fix, and codeDiff are optional — the reviewer UI has graceful fallbacks. Legacy currentStyles/fixedStyles still render if present but are deprecated in favor of codeDiff.


Output paths

capture.js always writes screenshots to /tmp/bug-<id>-current.png and /tmp/bug-<id>-fixed.png. You can rely on those paths in the merged payload.


Hard rules

  • The dev server must be running at $PREVIEW_BASE_URL before any capture. Verify with curl -sk $PREVIEW_BASE_URL | head -5.
  • Capture CURRENT before applying the fix. Never reverse the order.
  • Always set selector. Full-page captures are too noisy.
  • No _storyblok= query param in capture URLs (see storyblok-bugfix-story).

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.