Issue Management by constellos/claude-code-plugins
npx skills add https://github.com/constellos/claude-code-plugins --skill 'Issue Management'提供全面的 GitHub 问题生命周期管理,包含模板、元数据和智能上下文检测功能。
问题管理功能提供对 GitHub 问题操作的显式控制。虽然钩子(hooks)会在首次提示时自动创建问题,但此技能允许用户直接管理问题的创建、更新、标签分配、指派和关联,并完全控制模板和元数据。
使用结构化模板创建问题:
# 使用模板创建 Bug 报告
gh issue create --title "Auth fails on Safari" --body "$(cat <<'EOF'
## Bug Description
Authentication fails silently on Safari 17.2
## Steps to Reproduce
1. Open Safari 17.2
2. Navigate to /login
3. Enter credentials
4. Click Sign In
## Expected Behavior
User should be redirected to dashboard
## Actual Behavior
Page reloads with no error message
## Environment
- OS: macOS 14.2
- Browser: Safari 17.2
- Version: v1.5.0
EOF
)"
可用模板:
getBugTemplate() - 包含复现步骤的 Bug 报告模板getFeatureTemplate() - 包含问题陈述的功能请求模板广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
getEpicTemplate() - 包含子任务清单的史诗模板getTaskTemplate() - 包含验收标准的简单任务模板实用工具:
renderTemplate(template, vars) - 替换 {{varName}} 占位符getMinimalIssueBody(description, context?) - 不含模板的基本问题正文创建后更新问题元数据:
# 添加标签
gh issue edit 42 --add-label "bug,priority:high"
# 指派用户
gh issue edit 42 --add-assignee @me,@username
# 更新里程碑
gh issue edit 42 --milestone "v2.0"
# 更新正文
gh issue edit 42 --body-file updated-description.md
使用父子关系或相关关系关联问题:
# 父子关系(在问题正文中)
**Parent Issue:** #42
This issue implements the authentication flow from the parent epic.
# 相关问题(在正文中)
**Related Issues:** #40, #41, #43
# 关闭引用(合并时自动关联)
Closes #42
Fixes #43
实用工具:
addBranchReference(issueBody, branchName) - 向问题添加分支标记使用高级查询查找问题:
# 按标签搜索
gh issue list --label "bug"
# 按状态和指派人搜索
gh issue list --state open --assignee @me
# 使用文本查询搜索
gh issue list --search "authentication in:title,body"
# 按里程碑搜索
gh issue list --milestone "v2.0"
# 复杂搜索
gh issue list --search "is:open label:bug author:@me created:>2024-01-01"
此技能自动从以下来源检测上下文:
42-feature/name 格式中提取问题编号.claude/logs/branch-issues.json 以查找关联的问题detectWorkType() 从提示中检测,用于自动添加标签此技能是对自动钩子的补充:
| 钩子 | 自动行为 | 使用技能的时机 |
|---|---|---|
| create-issue-on-prompt | 在首次提示时创建问题 | 创建多个问题,使用特定模板 |
| sync-plan-to-issue | 将计划文件同步到问题 | 根据计划变更手动更新问题 |
状态文件:
.claude/logs/plan-issues.json - 计划 → 问题映射.claude/logs/branch-issues.json - 分支 → 问题映射自动对问题进行分类:
import { detectWorkType, formatWorkTypeLabel } from '../shared/hooks/utils/work-type-detector.js';
const workType = detectWorkType('fix the authentication bug');
// 返回: 'fix'
const label = formatWorkTypeLabel(workType);
// 返回: 'Bug Fix'
模式:
# 使用 getBugTemplate() 和 renderTemplate()
TEMPLATE=$(cat <<'EOF'
## Bug Description
{{description}}
## Steps to Reproduce
1. {{step1}}
2. {{step2}}
3. {{step3}}
## Expected Behavior
{{expected}}
## Actual Behavior
{{actual}}
## Environment
- OS: {{os}}
- Browser: {{browser}}
- Version: {{version}}
EOF
)
# 替换变量并创建问题
gh issue create \
--title "Safari auth failure" \
--label "bug,priority:high" \
--body "$TEMPLATE" # (变量替换后)
# 创建包含任务清单的史诗问题
PARENT=$(gh issue create \
--title "Implement authentication system" \
--label "epic" \
--body "$(cat <<'EOF'
## Epic Overview
Build complete authentication system with OAuth and email/password support.
## Goals
- OAuth integration (Google, GitHub)
- Email/password authentication
- Password reset flow
- Session management
## Success Criteria
- All auth flows tested
- Security audit passed
- Documentation complete
## Subtasks
- [ ] OAuth integration
- [ ] Email/password auth
- [ ] Password reset
- [ ] Session management
EOF
)" \
--json number -q .number)
# 从标题检测工作类型
TITLE="Fix authentication bug in Safari"
WORK_TYPE="fix" # 由 detectWorkType() 检测
# 添加适当的标签
gh issue edit 42 --add-label "bug,browser:safari,priority:high"
# 向问题正文添加分支引用
CURRENT_BODY=$(gh issue view 42 --json body -q .body)
UPDATED_BODY="$CURRENT_BODY
---
**Branch:** \`42-fix/safari-auth-bug\`"
echo "$UPDATED_BODY" | gh issue edit 42 --body-file -
# 创建多个相关问题
ISSUES=(
"Implement login form:feature"
"Add form validation:chore"
"Create auth API endpoints:feature"
"Write authentication tests:chore"
)
for item in "${ISSUES[@]}"; do
TITLE="${item%:*}"
TYPE="${item#*:}"
LABEL=$(echo "$TYPE" | sed 's/feature/enhancement/;s/fix/bug/')
gh issue create --title "$TITLE" --label "$LABEL" --body "Task for authentication epic"
done
.claude/logs/ 文件同步getBugTemplate() - Bug 报告模板getFeatureTemplate() - 功能请求模板getEpicTemplate(subtasks?) - 包含可选子任务的史诗模板getTaskTemplate() - 简单任务模板renderTemplate(template, vars) - 替换变量getMinimalIssueBody(description, context?) - 基本正文addBranchReference(body, branchName) - 添加分支标记detectWorkType(prompt, issueLabels?) - 从文本中检测工作类型formatWorkTypeLabel(workType) - 格式化为人类可读的标签.claude/logs/plan-issues.json - 计划 → 问题映射.claude/logs/branch-issues.json - 分支 → 问题映射# 读取计划文件
PLAN_CONTENT=$(cat .claude/plans/feature-auth.md)
# 从第一个标题中提取标题
TITLE=$(echo "$PLAN_CONTENT" | grep -m1 "^# " | sed 's/^# //')
# 使用计划内容创建问题
ISSUE_NUM=$(gh issue create \
--title "$TITLE" \
--label "planned" \
--body "$PLAN_CONTENT" \
--json number -q .number)
# 保存到状态文件
echo "{\"feature-auth\": {\"issueNumber\": $ISSUE_NUM}}" > .claude/logs/plan-issues.json
# 获取当前分支
BRANCH=$(git rev-parse --abbrev-ref HEAD)
# 提取问题编号
ISSUE_NUM=$(echo "$BRANCH" | grep -oE '^[0-9]+')
if [ -n "$ISSUE_NUM" ]; then
# 使用进度更新问题
gh issue comment $ISSUE_NUM --body "🚧 Currently working on this in branch \`$BRANCH\`"
fi
# 当史诗关闭时,关闭史诗中的所有问题
PARENT=42
CHILD_ISSUES=$(gh issue list --search "in:body \"Parent Issue: #$PARENT\"" --json number -q '.[].number')
for issue in $CHILD_ISSUES; do
gh issue close $issue --comment "Closing as part of completed epic #$PARENT"
done
每周安装次数
0
代码仓库
GitHub 星标数
5
首次出现
Jan 1, 1970
安全审计
Comprehensive GitHub issue lifecycle management with templates, metadata, and intelligent context detection.
Issue Management provides explicit control over GitHub issue operations. While hooks automatically create issues on first prompt, this skill allows users to directly manage issue creation, updates, labeling, assignment, and linking with full control over templates and metadata.
Create issues using structured templates:
# Bug report with template
gh issue create --title "Auth fails on Safari" --body "$(cat <<'EOF'
## Bug Description
Authentication fails silently on Safari 17.2
## Steps to Reproduce
1. Open Safari 17.2
2. Navigate to /login
3. Enter credentials
4. Click Sign In
## Expected Behavior
User should be redirected to dashboard
## Actual Behavior
Page reloads with no error message
## Environment
- OS: macOS 14.2
- Browser: Safari 17.2
- Version: v1.5.0
EOF
)"
Available Templates:
getBugTemplate() - Bug report with repro stepsgetFeatureTemplate() - Feature request with problem statementgetEpicTemplate() - Epic with subtasks checklistgetTaskTemplate() - Simple task with acceptance criteriaUtilities:
renderTemplate(template, vars) - Substitute {{varName}} placeholdersgetMinimalIssueBody(description, context?) - Basic issue without templateUpdate issue metadata after creation:
# Add labels
gh issue edit 42 --add-label "bug,priority:high"
# Assign users
gh issue edit 42 --add-assignee @me,@username
# Update milestone
gh issue edit 42 --milestone "v2.0"
# Update body
gh issue edit 42 --body-file updated-description.md
Link issues with parent-child or related relationships:
# Parent-child (in issue body)
**Parent Issue:** #42
This issue implements the authentication flow from the parent epic.
# Related issues (in body)
**Related Issues:** #40, #41, #43
# Closes references (auto-links on merge)
Closes #42
Fixes #43
Utilities:
addBranchReference(issueBody, branchName) - Add branch marker to issueFind issues with advanced queries:
# Search by label
gh issue list --label "bug"
# Search by state and assignee
gh issue list --state open --assignee @me
# Search with text query
gh issue list --search "authentication in:title,body"
# Search by milestone
gh issue list --milestone "v2.0"
# Complex search
gh issue list --search "is:open label:bug author:@me created:>2024-01-01"
The skill automatically detects context from:
42-feature/name format.claude/logs/branch-issues.json for linked issuesdetectWorkType() for auto-labelingThis skill complements the automatic hooks:
| Hook | Automatic Behavior | When to Use Skill |
|---|---|---|
| create-issue-on-prompt | Creates issue on first prompt | Create multiple issues, use specific templates |
| sync-plan-to-issue | Syncs plan files to issues | Manually update issue from plan changes |
State Files:
.claude/logs/plan-issues.json - Plan → Issue mapping.claude/logs/branch-issues.json - Branch → Issue mappingAutomatically categorize issues:
import { detectWorkType, formatWorkTypeLabel } from '../shared/hooks/utils/work-type-detector.js';
const workType = detectWorkType('fix the authentication bug');
// Returns: 'fix'
const label = formatWorkTypeLabel(workType);
// Returns: 'Bug Fix'
Patterns:
# Use getBugTemplate() and renderTemplate()
TEMPLATE=$(cat <<'EOF'
## Bug Description
{{description}}
## Steps to Reproduce
1. {{step1}}
2. {{step2}}
3. {{step3}}
## Expected Behavior
{{expected}}
## Actual Behavior
{{actual}}
## Environment
- OS: {{os}}
- Browser: {{browser}}
- Version: {{version}}
EOF
)
# Substitute variables and create issue
gh issue create \
--title "Safari auth failure" \
--label "bug,priority:high" \
--body "$TEMPLATE" # (after variable substitution)
# Create epic issue with task checklist
PARENT=$(gh issue create \
--title "Implement authentication system" \
--label "epic" \
--body "$(cat <<'EOF'
## Epic Overview
Build complete authentication system with OAuth and email/password support.
## Goals
- OAuth integration (Google, GitHub)
- Email/password authentication
- Password reset flow
- Session management
## Success Criteria
- All auth flows tested
- Security audit passed
- Documentation complete
## Subtasks
- [ ] OAuth integration
- [ ] Email/password auth
- [ ] Password reset
- [ ] Session management
EOF
)" \
--json number -q .number)
# Detect work type from title
TITLE="Fix authentication bug in Safari"
WORK_TYPE="fix" # Detected by detectWorkType()
# Add appropriate labels
gh issue edit 42 --add-label "bug,browser:safari,priority:high"
# Add branch reference to issue body
CURRENT_BODY=$(gh issue view 42 --json body -q .body)
UPDATED_BODY="$CURRENT_BODY
---
**Branch:** \`42-fix/safari-auth-bug\`"
echo "$UPDATED_BODY" | gh issue edit 42 --body-file -
# Create multiple related issues
ISSUES=(
"Implement login form:feature"
"Add form validation:chore"
"Create auth API endpoints:feature"
"Write authentication tests:chore"
)
for item in "${ISSUES[@]}"; do
TITLE="${item%:*}"
TYPE="${item#*:}"
LABEL=$(echo "$TYPE" | sed 's/feature/enhancement/;s/fix/bug/')
gh issue create --title "$TITLE" --label "$LABEL" --body "Task for authentication epic"
done
.claude/logs/ files synced when creating issues manuallygetBugTemplate() - Bug report templategetFeatureTemplate() - Feature request templategetEpicTemplate(subtasks?) - Epic with optional subtasksgetTaskTemplate() - Simple task templaterenderTemplate(template, vars) - Substitute variablesgetMinimalIssueBody(description, context?) - Basic bodyaddBranchReference(body, branchName) - Add branch markerdetectWorkType(prompt, issueLabels?) - Detect work type from textformatWorkTypeLabel(workType) - Format as human-readable label.claude/logs/plan-issues.json - Plan → Issue mapping.claude/logs/branch-issues.json - Branch → Issue mapping# Read plan file
PLAN_CONTENT=$(cat .claude/plans/feature-auth.md)
# Extract title from first heading
TITLE=$(echo "$PLAN_CONTENT" | grep -m1 "^# " | sed 's/^# //')
# Create issue with plan content
ISSUE_NUM=$(gh issue create \
--title "$TITLE" \
--label "planned" \
--body "$PLAN_CONTENT" \
--json number -q .number)
# Save to state file
echo "{\"feature-auth\": {\"issueNumber\": $ISSUE_NUM}}" > .claude/logs/plan-issues.json
# Get current branch
BRANCH=$(git rev-parse --abbrev-ref HEAD)
# Extract issue number
ISSUE_NUM=$(echo "$BRANCH" | grep -oE '^[0-9]+')
if [ -n "$ISSUE_NUM" ]; then
# Update issue with progress
gh issue comment $ISSUE_NUM --body "🚧 Currently working on this in branch \`$BRANCH\`"
fi
# Close all issues in epic when epic closes
PARENT=42
CHILD_ISSUES=$(gh issue list --search "in:body \"Parent Issue: #$PARENT\"" --json number -q '.[].number')
for issue in $CHILD_ISSUES; do
gh issue close $issue --comment "Closing as part of completed epic #$PARENT"
done
Weekly Installs
0
Repository
GitHub Stars
5
First Seen
Jan 1, 1970
Security Audits
agent-browser 浏览器自动化工具 - Vercel Labs 命令行网页操作与测试
144,300 周安装