issue-driven
npx skills add https://github.com/hamsterider-m/issue-driven-skill --skill issue-driven
Agent 安装分布
Skill 文档
Issue-Driven Development Workflow
Manage the full lifecycle of development tasks through GitHub Issues.
Prerequisites
Before any subcommand, verify:
- Current directory is a Git repository (
git rev-parse --is-inside-work-tree) ghCLI is authenticated (gh auth status)- A remote origin exists (
git remote get-url origin)
If check 1 or 2 fails, inform the user and stop.
If check 3 fails (no remote), suggest the user create a remote repository first (e.g. gh repo create), but do NOT stop â let the user decide whether to proceed or set up remote first.
Proactive Trigger Rules
- æ remote ç Git 项ç®ï¼å½ç¨æ·å¼å§ feature/bug/refactor 任塿¶ï¼é»è®¤èµ° issue-driven æµç¨ãæ éç¨æ·æ¾å¼è°ç¨
/issueï¼ä¸»å¨æç¤ºå¹¶å¼å¯¼ã - æ remote ç Git 项ç®ï¼å»ºè®®ç¨æ·å建 remoteï¼
gh repo createï¼ï¼ä½ä¸å¼ºå¶é»æãç¨æ·å¯éæ©å å建 remote åèµ° issue æµç¨ï¼æè·³è¿ issue æµç¨ç´æ¥å¼åã - é Git 项ç®ï¼ä¸è§¦å issue-driven æµç¨ã
Usage
/issue <subcommand>
| Subcommand | Description |
|---|---|
create |
Create a new GitHub Issue with labels |
update |
Update Issue body with current plan |
worktree |
Create worktree + branch for an Issue |
review code |
Send code diff to Codex for review |
pr |
Create PR linked to Issue |
status |
Show open Issues with branches/PRs |
Integration with CC Plan Mode
Issue çå½å¨ææ¥éª¤å¿ é¡»ç¼æè¿ CC plan çæ§è¡æ¥éª¤ä¸ï¼å©ç¨æ¶é´ç¸ä½å·®æ¶é¤è¡æ¥ç©ºéã
æ å plan 模æ¿ï¼plan ä¸å¿ é¡»å å« issue æ¥éª¤ï¼ï¼
## Plan: {task title}
### Step 1 â Create Issue
- `/issue create` â å建 GitHub Issueï¼è®°å½ä»»å¡èæ¯åç®æ
### Step 2 â Design & Plan
- å¨ plan æä»¶ä¸å®ææ¹æ¡è®¾è®¡
- `/issue update` â å°æ¹æ¡åæ¥å° Issue body
### Step 3 â Setup Worktree
- `/issue worktree` â å建 worktree + branchï¼label èªå¨åæ¢å° in-progress
### Step 4 â Implementation
- å¨ worktree ä¸å®æå¼å
### Step 5 â Code Review
- `/issue review code` â åé diff ç» reviewer
### Step 6 â Create PR
- `/issue pr` â å建 PR å¹¶å
³è Issue
å ³é®ååï¼
- Plan 审æ¹ï¼CC plan mode ç ExitPlanModeï¼å Issue å建æ¯ä¸¤ä¸ªç¬ç«å¨ä½ï¼plan è·æ¹åææ¥éª¤é¡ºåºæ§è¡
planning â in-progressç´æ¥è¿æ¸¡ï¼æ éé¢å¤ç plan review ç¯èï¼plan review ç± CCB Peer Review Framework å¨ CLAUDE.md ä¸ç»ä¸ç®¡çï¼- Issue æ¯ SSOTï¼Single Source of Truthï¼ï¼plan å
容éè¿
/issue updateåæ¥å° Issue body
Label Convention
Ensure these labels exist in the repo (create if missing via gh label create):
| Label | Description |
|---|---|
status/planning |
Issue is being planned |
status/in-progress |
Development in progress |
type/feature |
New feature |
type/bug |
Bug fix |
type/refactor |
Refactoring |
type/docs |
Documentation |
Branch Naming
- Pattern:
issue-{N}-{slug}(e.g.issue-42-add-auth) - Slug: title converted to kebab-case, truncated to 30 chars
- One Issue can have multiple branches (1:N)
Subcommand Details
/issue create
- Run prerequisite checks (Git repo, gh auth, remote).
- Ask the user for:
- Task type:
feature/bug/refactor/docs - Title (concise, imperative)
- Background description (what and why)
- Task type:
- Generate Issue body using this template:
## èæ¯
{user-provided background}
## ç®æ
{inferred from background, confirm with user}
## æ¹æ¡
_å¾
è§å_
## éªæ¶æ å
_å¾
å®ä¹_
- Display the full Issue preview to the user and wait for confirmation.
- Ensure required labels exist:
gh label create "status/planning" --forceandgh label create "type/{type}" --force. - Create the Issue:
gh issue create -t "{title}" -b "{body}" -l "status/planning,type/{type}". - Record the Issue number for subsequent commands in this session.
/issue update
- If no Issue number in session context, ask the user for it.
- Find the current plan file â search in order:
ls -t .claude/plans/*.md 2>/dev/null | head -1ls -t docs/plans/*.md 2>/dev/null | head -1- If no plan file exists in either location, ask the user to provide plan content directly.
- Read the plan content.
- Fetch current Issue body:
gh issue view {N} --json body -q .body. - Replace the
## æ¹æ¡and## éªæ¶æ åsections with plan content. - Update the Issue:
gh issue edit {N} -b "{updated_body}". - Confirm success to the user.
/issue worktree
- If no Issue number in session context, ask the user for it.
- Fetch Issue title:
gh issue view {N} --json title -q .title. - Generate slug: convert title to kebab-case, truncate to 30 chars.
- Branch name:
issue-{N}-{slug}. - Determine base branch:
git symbolic-ref refs/remotes/origin/HEAD 2>/dev/null | sed 's@^refs/remotes/origin/@@'(fallback tomain). - Create worktree:
git worktree add -b {branch} ../{branch} {base}. - Update label:
gh issue edit {N} --remove-label "status/planning" --add-label "status/in-progress". - Inform user of the worktree path and suggest
cd ../{branch}.
/issue review code
- If no Issue number in session context, ask the user for it.
- Determine base branch (same logic as worktree).
- Generate diff:
git diff {base}...HEAD. - If diff is empty, inform user there are no changes to review.
- Construct the review request message:
[CODE REVIEW REQUEST]
Issue #{N}: {title}
Branch: {current branch}
--- CHANGES START ---
{diff output}
--- CHANGES END ---
- Send to reviewer via
/ask codexwith the above message. - Follow the Async Guardrail â if output contains
[CCB_ASYNC_SUBMITTED, end turn immediately. - When Codex response arrives, parse the JSON scores.
- Display scores as a summary table with pass/fail status.
/issue pr
- If no Issue number in session context, ask the user for it.
- Get current branch name:
git branch --show-current. - Verify branch follows
issue-{N}-*pattern. - Determine base branch (same logic as worktree).
- Ask user: “Is this the final PR for Issue #{N}?” (yes/no).
- Yes â PR body includes
Closes #{N} - No â PR body includes
Refs #{N}
- Yes â PR body includes
- Generate PR title from branch name or ask user.
- Create PR:
gh pr create -B {base} -t "{title}" -b "{body}". - Display the PR URL to the user.
/issue status
- Run prerequisite checks.
- List open issues with status labels:
gh issue list --label "status/planning" --json number,title,labels --limit 20gh issue list --label "status/in-progress" --json number,title,labels --limit 20- Merge results.
- For each issue, find associated branches:
git branch -a --list "*/issue-{N}-*". - For each issue, find associated PRs:
gh pr list --search "issue-{N}" --json number,title,state,url. - Display a formatted table:
# | Title | Status | Branch(es) | PR(s)
Issue Granularity Rules
- Small tasks (single change): Plan = Issue, 1:1 mapping. One Issue, one branch, one PR.
- Large tasks (multiple independent steps): Create an epic Issue as the parent.
- Epic Issue body contains a task list with checkboxes tracking sub-issues.
- Each step becomes a sub-issue with its own worktree/branch/PR.
- Sub-issue PRs use
Refs #{epic}, the final one usesCloses #{epic}. - All sub-issues completed â close the epic.
Non-Git Projects
If the current directory is not a Git repository, inform the user:
“Issue-driven workflow requires a Git repository. Current directory is not a Git repo.”
Do not proceed with any subcommand.