issue-driven
SKILL.md
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.
Weekly Installs
4
Repository
hamsterider-m/i…en-skillFirst Seen
Feb 28, 2026
Security Audits
Installed on
gemini-cli4
github-copilot4
codex4
kimi-cli4
amp4
cline4