bugfix
Fix a bug from a GitHub issue, following the reproduce-first
git clone --depth 1 https://github.com/QwenLM/qwen-code /tmp/bugfix && cp -r /tmp/bugfix/.qwen/skills/bugfix ~/.claude/skills/bugfixSKILL.md
# Bugfix Workflow
Follow this workflow for GitHub issue bugfixes. Do not skip reproduction; fixing
without first reproducing the bug tends to produce incomplete fixes and
regressions.
## Input
A GitHub issue URL or number. Slash-command arguments are appended to this skill
body by Qwen Code.
## Artifact Path
Use `.qwen/issues/` in this repo. In the steps below, `<issue-file>` means the
selected issue markdown file.
## Step 1: Read The Issue
Create the artifact directory if needed, then pipe the issue directly into a
markdown file using `gh`:
```bash
mkdir -p .qwen/issues
gh issue view <number> \
--json number,title,body \
-t '# Issue #{{.number}}: {{.title}}
{{.body}}
---
## Reproduction report
_Pending - to be filled by the test engineer._
## Verification report
_Pending - to be filled by the test engineer._
' > .qwen/issues/issue-<number>.md
```
## Step 2: Reproduce
Spawn the `test-engineer` agent and point it at `<issue-file>`. State only the
goal: reproduce the bug. Keep the prompt minimal; the test engineer owns the
reproduction strategy.
Wait for the test engineer to finish. Then read `<issue-file>` to get the
reproduction report. If the status is `NOT_REPRODUCED`, report that and stop.
## Step 3: Fix
Read the relevant code and make the fix. Use the reproduction report for
context; it should contain observed behavior, expected behavior, and useful code
paths.
If the bug is complex enough that the first attempt does not work, use the
`structured-debugging` skill and work through hypotheses systematically.
## Step 4: Verify
Build and bundle your changes:
```bash
npm run build && npm run bundle
```
Spawn the `test-engineer` agent again, pointing it at the same issue file. State
the goal: verify the fix using `node dist/cli.js`.
If the verification status is `STILL_BROKEN`, read the updated issue file, go
back to Step 3, and iterate. Do not proceed until verification returns
`VERIFIED_FIXED`.
## Step 5: Tests
Run unit tests for any packages you modified. If the test engineer wrote a
failing test during reproduction, make sure it passes after the fix. Otherwise,
add focused regression coverage for the failure scenario.
## Step 6: Self-Audit and Code Review
First self-audit the full diff per the self-audit step in AGENTS.md's General
workflow (open-ended passes plus presume-wrong verification, until two
consecutive clean passes; one clean pass suffices for a trivial fix). If the
audit changes source, re-run Step 4 before resuming it. Skip the review below
only for a plain one-line or trivial config fix. For anything else, run
`/review` with a review task listing all changed files. Triage each comment
with a verdict:
- **Valid**: real bug or meaningful improvement. Fix it.
- **False positive**: reviewer missed context. Skip it.
- **Overthinking**: technically plausible but not worth the complexity. Skip
it.
After fixing valid issues, re-run unit tests and a quick verification sanity
check.
## Iteration Rules
- If Step 4 fails, go back to Step 3, then re-run Step 4.
- If Step 6 finds valid issues, fix them, re-run Step 4 as a sanity check,
and re-run the self-audit.
- Do not loop more than 3 times between Steps 3-6 without asking the user.Use after a Codex or Claude Code feature has been implemented in Qwen Code to run the selected reference agent and Qwen Code under the same scenario, capture HTTP and terminal traces, compare request bodies, tool/function schemas, outputs, and iterate until the reproduced behavior is close enough.
Use when reproducing an existing Codex or Claude Code feature in Qwen Code or another agent CLI by choosing a reference agent, capturing HTTP request bodies, prompts, tool/function schemas, terminal output, and then implementing the matching behavior in the target repo.
Review and repair current local changes until they converge, or run Qwen Code Autofix issue and review workflows from GitHub Actions.
Classify a bounded batch of stale PR CI failures and choose the safest response.
Analyze indexed codebases via graph database (neug) and vector index (zvec). Covers call graphs, dependencies, dead code, hotspots, module coupling, architecture reports, semantic search, impact analysis, bug root cause from GitHub issues, class diagrams (UML), and PR review (risk scoring, conflict detection, auto-merge candidates, labeling). Also covers creating, inspecting, and repairing a CodeScope index. Use for: code structure, who calls what, why something changed, similar functions, module boundaries, bug tracing, class relationships, PR risk/conflicts, or any question benefiting from a code knowledge graph. Applies when a `.codegraph` index exists in the workspace, or when the user wants to create one.
Draft and submit a GitHub issue from a user idea or bug description, with bilingual body and correct labels.
Stabilize a flaky test with a minimal, assertion-preserving fix — never by weakening or deleting the check.
Audit the repository's docs/ content against the current codebase,