wtf.report-bug
Report Bug
File a structured Bug issue from a QA finding. Core value: the Gherkin scenario that failed becomes the reproducible test evidence, and the originating Task and Feature are linked automatically so nothing loses its context.
Fast path (for wtf.hotfix)
When invoked from wtf.hotfix, skip the Gherkin-derivation and Ubiquitous-Language mapping work — the goal is to file the issue fast so the fix can start. Run only:
- Step 0 — GitHub CLI setup (skip if already confirmed this session).
- Step 1 — Identify the source (one-sentence bug, impact, optional task link).
- Step 3 — Gather bug details, but only
a. Observed behavior,b. Expected behavior, andc. Reproduction steps. Skip contract violation / regression risk / suggested fix questions — the hotfix will uncover those. - Step 6 — Draft the Bug report with only the sections the fast path produced (leave Contracts Violated, Regression Risk, Suggested Fix blank or marked "Fast path — to be captured during hotfix").
- Step 7 — Review briefly (or skip if the caller signalled non-interactive).
- Step 8 — Create the issue.
Return the bug issue number to the caller. Do not run the offer-next-steps prompt in step 9.
Process
0. GitHub CLI setup
Run steps 1–2 of ../references/gh-setup.md (install check and auth check). Stop if gh is not installed or not authenticated. Extensions are not required for this skill.
Skip this step if invoked from wtf.verify-task or another skill that already ran gh-setup this session.
1. Identify the source
If called from wtf.verify-task: the task number and failing scenario(s) are already in context — skip to step 2. Do not ask the questions below.
If invoked directly:
Ask in a single message:
- "What is the bug? (one sentence)"
- "Which Task does this trace back to? (issue number, or 'unknown')"
If a task number is known, walk Task → Feature per ../references/spec-hierarchy.md to extract Gherkin, Contracts, ACs, DoD (Task) and ACs / user stories (Feature) for expected-behavior context.
2. Identify the failing scenario(s)
If the Task has Gherkin, present the full scenario list and call AskUserQuestion (per ../references/questioning-style.md):
- question: "Which scenarios failed?"
- header: "Failing scenarios"
- options:
- One option per scenario name from the Task
- New — not covered by existing scenarios — this bug isn't covered by the current Gherkin
For each failing scenario, note:
- The scenario name
- The file path of the automated test (if it exists) or "manual"
- The failing step (the first Then / When that did not hold)
If no Gherkin exists for this bug, skip this step and rely on step 3.
3. Gather bug details
If called from wtf.verify-task and all six details below are already in context, skip this step entirely.
Otherwise, for each unknown item below (omitting any already known), call AskUserQuestion (per ../references/questioning-style.md):
- a. Observed behavior — question: "What was the exact behavior you observed?" / header: "Actual behavior" / options: from plausible failure descriptions inferred from the scenario context.
- b. Expected behavior — question: "What did you expect to happen instead?" / header: "Expected behavior" / options: from the relevant Gherkin
Thenstep or AC text if available. - c. Reproduction steps — question: "What are the reproduction steps?" / header: "Repro steps" / options: I'll type them out — enter numbered steps.
- d. Contract violation — question: "Is any contract violated?" / header: "Contract" / options: candidates from contract names in the Task; None identified.
- e. Regression risk — question: "What else might break if we fix this?" / header: "Regression risk" / options: from adjacent areas found in the codebase or related Aggregates.
- f. Suggested fix — question: "Do you have a suggested fix in mind?" / header: "Suggested fix" / options: No suggestion — leave blank.
4. Map to Ubiquitous Language
Review the bug description and reproduction steps. If implementation vocabulary has crept in (e.g. "the database returned null", "the HTTP 500 response", "the JSON field"), restate in domain terms that match the Task's Ubiquitous Language (e.g. "the Order could not be found", "the Payment Settlement failed", "the Shipment Reference was missing").
Confirm the restatement with the user before proceeding.
When called from
wtf.verify-taskwith multiple failures to file: apply the restatement silently — do NOT ask for confirmation. Note the language changes made in the draft instead of asking the user to approve them. This prevents an interrogation when processing multiple bugs in sequence.
5. Find linked test files
Use the Grep tool to locate:
- Automated test files that cover the failing Gherkin scenario (search by scenario name or feature area)
- Any existing test for the contract section violated
List each file found with a one-line description of what it covers. These become the Test Evidence in the bug report.
6. Draft the Bug report
Load the BUG template per ../references/issue-template-loading.md (verify existence, halt-or-setup if missing, read body below the second --- delimiter). Fill in all sections:
Related
- Feature: #<feature_number> (if known)
- Task: #<task_number> (if known)
- Failing test(s): list each file path (or "manual" with reproduction steps)
Expected Behavior
Quote the relevant Gherkin Then step or Feature AC verbatim, then add a plain-language restatement.
Actual Behavior Describe in domain terms what happened instead. Include any observable symptom (error message, wrong state, missing event).
Steps to Reproduce Concrete numbered steps — exact inputs, routes, or actions. If from a Gherkin scenario, map Given → setup, When → action, Then → the failing assertion.
Contracts Violated Paste the relevant contract section from the Task (API schema, event schema, invariant). If none, write "None identified."
Suggested Fix Fill if the QA engineer or developer has a hypothesis. Otherwise leave blank.
Regression Risk List other behaviors, Aggregates, or integration points that touch the same code path and could be affected by a fix.
7. Review with user
Show the draft. Then call AskUserQuestion (per ../references/questioning-style.md):
- question: "Does this accurately capture the bug and its impact?"
- header: "Review"
- options:
- Yes — create the issue → proceed with bug creation
- I have changes → adjust first
Apply edits, then proceed.
8. Create the issue
Note: the commands below are pseudo-code. Write each body to a temp file with the Write tool, then use
--body-fileto avoid shell quoting issues with multi-line content.
Title generation: Spawn a subagent using the claude-haiku-4-5-20251001 model to generate a concise title from the bug's one-sentence description. Pass in the description and ask for a short title (no prefix emoji/label needed — that is added below). If the subagent returns nothing usable, derive the title directly from the one-sentence description.
BUG_TMP=/tmp/wtf.bug-$(date +%s)-body.md
gh issue create --title "🐞 Bug: <title>" --body-file "$BUG_TMP" --label "bug"
If the originating Task is known, add a comment to it linking the bug:
gh issue comment <task_number> --body "🐞 Bug reported: #<bug_number> — <one-line summary>"
Print the Bug issue URL and number.
rm "$BUG_TMP"
Note: if the
buglabel does not exist on the repo, create it first withgh label create bug --color d73a4abefore runninggh issue create.
9. Offer next steps
Call AskUserQuestion (per ../references/questioning-style.md):
-
question: "What's next?"
-
header: "Next step"
-
options:
- Report another bug → file another bug from this QA session (default if more failures remain)
- Mark Task blocked → reopen the Task and mark it blocked by this bug
- Done → exit, no further action (default if no more failures remain)
-
Report another bug → restart from step 2 with the same Task context. Use as default only when the caller (e.g.
wtf.verify-taskstep 8) has indicated more failures are pending. -
Mark Task blocked → reopen the Task and add a blocking comment:
gh issue reopen <task_number> gh issue comment <task_number> --body "Blocked by #<bug_number>." -
Done (default when no more failures remain) → exit.
More from xiduzo/wtf
wtf.write-feature
This skill should be used when a user wants to create a GitHub Feature issue, break down an Epic into user-facing capabilities, write user stories in domain language, or capture what a domain actor can do — for example "create a feature", "write a feature for this epic", "add a feature to an epic", "break this epic into features", "write user stories for this feature", or "describe what this actor can do". Use this skill to write a single Feature; use `wtf.epic-to-features` to generate the full set of Features for an Epic at once. Not applicable to Tasks, Epics, or bug reports.
38wtf.write-task
This skill should be used when a user wants to create a task, write a ticket, decompose a feature into implementable work, break down a story, define a vertical slice for development, or write Gherkin scenarios — for example "create a task", "write a task for this feature", "break this feature into tasks", "define implementation work", or "add a sub-issue to this feature". Guides creation of a GitHub Task issue linked to a parent Feature and Epic, derives Gherkin acceptance scenarios from the Feature's ACs, enforces DDD ubiquitous language in scenarios, and checks for vertical-slice integrity and task dependencies.
38wtf.write-epic
This skill should be used when a user wants to create, draft, or plan a GitHub Epic issue — for example "write an epic", "I want to define a new initiative", "scope out this strategic project", "turn this idea into an epic", "plan work that spans multiple features", or "start from a bounded context". Also use when the user asks to define domain outcomes, capture a large initiative before breaking it into features, or describe work in terms of business goals rather than technical tasks.
38wtf.steer-design
This skill should be used when a team wants to create or refine the design guidelines document — for example "create the design steering doc", "document our design system", "write the design principles", "document our component patterns", "set up the design guidelines", or "update the design doc". Generates docs/steering/DESIGN.md as a living document capturing design principles, the design system, tokens, component patterns, and accessibility standards. Generated once and refined — not regenerated from scratch.
37wtf.reflect
This skill should be used when a developer wants to capture learnings from a difficult session, record what Claude got wrong, save implementation gotchas, or update the steering docs with hard-won knowledge — for example "let's reflect", "capture what we learned", "that was painful, save this", "update the steering docs with what went wrong", "I need to debrief", "what went wrong today", "log this lesson", "save this gotcha", "document this mistake", "I want to write this down before I forget", "add this to the steering docs", or when prompted by the intervention tracker after multiple corrections. Routes each learning into the right steering doc (TECH, QA, DESIGN, or VISION) under a "Hard-Won Lessons" section.
37wtf.verify-task
This skill should be used when a QA engineer wants to test or verify a completed task, run through acceptance criteria, check Gherkin scenarios against the implementation, record pass/fail results, or sign off on a ticket before merge. Triggers on phrases like "verify task #42", "run QA on this issue", "test the acceptance criteria", "sign off on task", "check if this task is ready to merge", "does this task meet its acceptance criteria", "run acceptance tests for task #X", "walk through the Gherkin for task #X", or "I want to test this task".
37