add issue-to-branch skill
Browse files
plugin/skills/github-issue-to-branch/SKILL.md
ADDED
|
@@ -0,0 +1,84 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
name: github-issue-to-branch
|
| 3 |
+
description: >
|
| 4 |
+
This skill should be used when the user asks to "turn this issue into a branch", "start work
|
| 5 |
+
on issue #42", "write a spec for this", "scaffold this feature", "spec then branch", "pick up
|
| 6 |
+
this ticket", or hands over an issue URL and asks to begin implementation. Also triggers on
|
| 7 |
+
"issue to PR", "create the branch for this", and "break this issue into tasks".
|
| 8 |
+
metadata:
|
| 9 |
+
version: "0.1.0"
|
| 10 |
+
---
|
| 11 |
+
|
| 12 |
+
# Issue β Spec β Branch
|
| 13 |
+
|
| 14 |
+
Convert an issue (or a raw request) into a written spec, then a branch and a draft PR, so implementation starts from an agreed contract instead of a guess.
|
| 15 |
+
|
| 16 |
+
## Step 1 β Read the whole issue
|
| 17 |
+
|
| 18 |
+
`issue_read` for the body, then `list_comments`. The comments usually contain the real requirement and the changed scope. Note linked issues and sub-issues. If the issue is one line of prose with no acceptance criteria, that is the finding β write the spec and get it confirmed before touching code.
|
| 19 |
+
|
| 20 |
+
## Step 2 β Write the spec
|
| 21 |
+
|
| 22 |
+
Keep it to one page. Longer means the issue should be split.
|
| 23 |
+
|
| 24 |
+
```markdown
|
| 25 |
+
## Problem
|
| 26 |
+
What is broken or missing, and who feels it. One paragraph.
|
| 27 |
+
|
| 28 |
+
## Proposed change
|
| 29 |
+
What will exist after this ships. Concrete, not aspirational.
|
| 30 |
+
|
| 31 |
+
## Out of scope
|
| 32 |
+
The adjacent things this will NOT do. This section prevents scope creep more
|
| 33 |
+
than any other.
|
| 34 |
+
|
| 35 |
+
## Acceptance criteria
|
| 36 |
+
- [ ] Testable statement, phrased so it can pass or fail.
|
| 37 |
+
- [ ] One per behavior. No compound criteria.
|
| 38 |
+
|
| 39 |
+
## Affected surfaces
|
| 40 |
+
| Layer | Files / modules | Risk |
|
| 41 |
+
|---|---|---|
|
| 42 |
+
| Contracts | | |
|
| 43 |
+
| API | | |
|
| 44 |
+
| Data / migrations | | |
|
| 45 |
+
| Frontend | | |
|
| 46 |
+
|
| 47 |
+
## Test plan
|
| 48 |
+
Unit, integration, and the one manual check a human must do.
|
| 49 |
+
|
| 50 |
+
## Rollback
|
| 51 |
+
How this is undone if it goes wrong in production.
|
| 52 |
+
```
|
| 53 |
+
|
| 54 |
+
Post the spec as a comment on the issue with `add_issue_comment` so it lives next to the work, and reference it from the PR later.
|
| 55 |
+
|
| 56 |
+
## Step 3 β Decide whether to split
|
| 57 |
+
|
| 58 |
+
Split into sub-issues (`sub_issue_write`) when any of these hold:
|
| 59 |
+
|
| 60 |
+
- More than one layer in "Affected surfaces" carries real risk.
|
| 61 |
+
- A database migration and application logic land together.
|
| 62 |
+
- The acceptance criteria exceed six items.
|
| 63 |
+
- Two people could work the parts in parallel without conflict.
|
| 64 |
+
|
| 65 |
+
A PR over roughly 400 changed lines will not get a real review. Plan the split before writing code, not after.
|
| 66 |
+
|
| 67 |
+
## Step 4 β Branch and scaffold
|
| 68 |
+
|
| 69 |
+
1. Confirm the repo's default branch β do not assume `main`.
|
| 70 |
+
2. `create_branch` named `<type>/<issue-number>-<short-slug>`, e.g. `feat/128-market-settlement-queue`.
|
| 71 |
+
3. Commit the scaffold only: file stubs, test files with failing placeholder assertions, migration skeleton. No speculative implementation.
|
| 72 |
+
4. `create_pull_request` as a **draft**, body containing `Closes #<issue>`, the spec, and the unchecked acceptance criteria as a task list. The checkboxes become the merge gate.
|
| 73 |
+
|
| 74 |
+
## Step 5 β Label and link
|
| 75 |
+
|
| 76 |
+
Apply labels that already exist in the repo (`list_issue_labels` first β inventing labels fragments the taxonomy). Set the issue type if the org defines them (`list_issue_types`). If the repo is on a project board, add the issue to it.
|
| 77 |
+
|
| 78 |
+
## Stack notes
|
| 79 |
+
|
| 80 |
+
Solidity work: scaffold the Foundry test file alongside the contract, and load `solidity-foundry`. Supabase work: the migration and its rollback go in the same commit, and RLS policy changes get their own acceptance criterion. Frontend work: the scaffold includes the loading, empty, and error states β those three are where specs go to die.
|
| 81 |
+
|
| 82 |
+
## Verification
|
| 83 |
+
|
| 84 |
+
Before reporting done: confirm the branch exists off the right base, the draft PR references the issue, and the acceptance criteria in the PR body match the spec comment on the issue. Return both URLs.
|