$npx -y skills add apache/magpie --skill issue-fix-workflowFor a single triaged <issue-tracker> issue confirmed as a bug or feature, draft a fix against <upstream> on <default-branch>. Produces the failing test, the smallest production change, the targeted+module test runs, and the commit. The PR is NOT opened on autopilot; the hum
| 1 | <!-- SPDX-License-Identifier: Apache-2.0 |
| 2 | https://www.apache.org/licenses/LICENSE-2.0 --> |
| 3 | |
| 4 | <!-- Placeholder convention (see ../../AGENTS.md#placeholder-convention-used-in-skill-files): |
| 5 | <project-config> → adopter's project-config directory |
| 6 | <issue-tracker> → URL of the project's general-issue tracker |
| 7 | <issue-tracker-project> → project key within the tracker |
| 8 | <upstream> → adopter's public source repo |
| 9 | <default-branch> → upstream's default branch (master vs main) |
| 10 | <runtime> → recipe for invoking the project's runtime |
| 11 | Substitute these with concrete values from the adopting |
| 12 | project's <project-config>/ before running any command below. --> |
| 13 | |
| 14 | # issue-fix-workflow |
| 15 | |
| 16 | This skill drafts a code fix for a single `<issue-tracker>` issue |
| 17 | that has already been triaged as actionable (classification `BUG` |
| 18 | or `FEATURE-REQUEST` per [`issue-triage`](../issue-triage/SKILL.md)). |
| 19 | It produces the failing test, the smallest production change, the |
| 20 | targeted and module test-run results, and the commit — but **stops |
| 21 | before** opening a PR. The human committer reviews the hand-back |
| 22 | artefact and decides what happens next. |
| 23 | |
| 24 | This skill mirrors [`security-issue-fix`](../security-issue-fix/SKILL.md) |
| 25 | in the security family, adapted to the general-issue tracker. |
| 26 | Confidentiality and CVE-scrubbing concerns do not apply here; the |
| 27 | issue is already public. |
| 28 | |
| 29 | It composes with: |
| 30 | |
| 31 | - [`issue-triage`](../issue-triage/SKILL.md) — predecessor; |
| 32 | produces the classification this skill builds on. |
| 33 | - [`issue-reproducer`](../issue-reproducer/SKILL.md) — if the |
| 34 | triaged issue carries a `verdict.json`, the adapted reproducer |
| 35 | inside it is a regression-test starting point. |
| 36 | - [`issue-reassess`](../issue-reassess/SKILL.md) — campaign-level |
| 37 | caller; the `still-fails-*` tail of a reassess campaign feeds |
| 38 | directly into this skill. |
| 39 | |
| 40 | --- |
| 41 | |
| 42 | ## Golden rules |
| 43 | |
| 44 | **Golden rule 1 — every state-changing action is a proposal.** |
| 45 | Writing files in `<upstream>`, committing, pushing, opening a PR, |
| 46 | posting to `<issue-tracker>`, transitioning workflow state — all |
| 47 | require explicit user confirmation. The fact that the user invoked |
| 48 | the skill is **not** a blanket *"yes"*; each action gets its own |
| 49 | confirmation. |
| 50 | |
| 51 | **Golden rule 2 — never autopilot the PR.** Even when the fix is |
| 52 | complete and clean, the skill does **not** open a PR (draft or |
| 53 | otherwise), comment on the issue, self-assign, or transition |
| 54 | workflow state on autopilot. The hand-back contract (below) is |
| 55 | firm. With explicit instruction the skill *may* open a **draft** |
| 56 | PR after the user reviews the title, body, and diff — never |
| 57 | non-draft, never on autopilot. |
| 58 | |
| 59 | **Golden rule 3 — failing test first.** The project's fix-workflow |
| 60 | convention is *failing test on `<default-branch>` first, then the |
| 61 | smallest production change that turns it green*. If the issue |
| 62 | carries an adapted reproducer (a `verdict.json` from |
| 63 | [`issue-reproducer`](../issue-reproducer/SKILL.md)), the |
| 64 | reproducer is the starting point for the regression test — but |
| 65 | the **test** lives in the project's test tree, not in a scratch |
| 66 | file. The placement and naming conventions live in the project's |
| 67 | own contributing docs. |
| 68 | |
| 69 | **Golden rule 4 — smallest fix; scope discipline.** The diff is |
| 70 | the test, the production change, and any directly-required edit — |
| 71 | nothing else. No drive-by reformatting, no stray imports, no |
| 72 | speculative refactor. A two-minute diff beats a half-hour diff a |
| 73 | maintainer has to unpick. |
| 74 | |
| 75 | **Golden rule 5 — grounded identifiers only.** AI tooling reaches |
| 76 | for plausible method or flag names that don't exist or have been |
| 77 | renamed. `grep` the identifier in the working tree before |
| 78 | depending on it. If it isn't there, it isn't there. Hallucinated |
| 79 | identifiers are the most common failure mode for AI-drafted |
| 80 | patches. |
| 81 | |
| 82 | **Golden rule 6 — cause, not symptom.** The reproducer throws an |
| 83 | exception at line N; the patch adds a guard at line N. |
| 84 | *Sometimes* correct; often not — the symptom may indicate earlier |
| 85 | state the surrounding co |