新規 Issue を作成し、GitHub Projects に追加
Create a new GitHub issue and add it to a Project with auto-detected fields like priority and complexity. Use this when you need to formally track work items with proper categorization.
/plugin marketplace add B16B1RD/cc-zen-workflow/plugin install b16b1rd-zen-workflow@B16B1RD/cc-zen-workflowissue/新規 Issue を作成し、GitHub Projects に追加する
このコマンドを実行したら、以下のフェーズを順番に実行してください。
| 引数 | 説明 |
|---|---|
<title or description> | Issue のタイトルまたは作業内容の説明(必須) |
現在のリポジトリの owner と name を取得:
gh repo view --json owner,name
以下の優先順位で使用する Project を決定:
zen-config.yml に project_number が設定されている場合: その Project を使用# zen-config.yml を読み取り、github.projects.project_number を確認
project_number が設定されている場合はその値を使用。
gh api graphql -f query='
query($owner: String!, $repo: String!) {
repository(owner: $owner, name: $repo) {
projectsV2(first: 10) {
nodes {
id
number
title
}
}
}
}' -f owner="{owner}" -f repo="{repo}"
重要: 複数の Project が見つかった場合は、Project 名とリポジトリ名が一致するもの、または最も関連性の高いものを選択。
警告: GitHub Projects が設定されていません。
Issue は作成しますが、Projects への追加はスキップします。
Projects を使用するには /zen:init を実行してください。
ユーザーの入力を分析し、以下の要素を抽出:
| 要素 | 説明 | 例 |
|---|---|---|
| What | 何をするか | 「ログイン機能を追加」 |
| Why | なぜ必要か | 「ユーザー認証のため」 |
| Where | どこを変更するか | 「src/auth/ 配下」 |
| Scope | 影響範囲 | 「フロントエンドとバックエンド」 |
| Constraints | 制約条件 | 「既存APIとの互換性維持」 |
以下のような曖昧な表現を検出:
既存の Issue から関連する情報を収集:
gh issue list --state all --limit 20 --json number,title,body,labels
類似タイトルや関連ラベルがある Issue を特定し、背景情報として活用。
情報が不足している場合は AskUserQuestion で確認:
以下の点を明確にしてください:
質問: この Issue で達成したいゴールは何ですか?
オプション:
- 新機能の追加
- 既存機能のバグ修正
- ドキュメントの更新
- リファクタリング
- その他
変更内容から複雑度を推定:
| 複雑度 | 判断基準 | 例 |
|---|---|---|
| XS | 1行変更、誤字修正 | typo 修正、定数値変更 |
| S | 単一ファイルの内容更新 | 関数の修正、スタイル調整 |
| M | 複数ファイル(5ファイル以下) | 小規模機能追加 |
| L | 複数ファイル(10ファイル以上)、判断を伴う | 中規模機能、設計変更 |
| XL | 大規模変更、設計判断 | アーキテクチャ変更、大規模リファクタ |
| 種別 | 判断基準 |
|---|---|
| Feature | 新しい機能・能力の追加 |
| Bug Fix | 既存機能の不具合修正 |
| Documentation | ドキュメントの追加・更新 |
| Refactor | 機能変更なしのコード改善 |
| Chore | ビルド、依存関係、設定の更新 |
| 優先度 | 判断基準 |
|---|---|
| High | ブロッカー、セキュリティ、本番障害 |
| Medium | 通常の機能追加・改善(デフォルト) |
| Low | nice-to-have、将来の改善 |
作成前に AskUserQuestion で最終確認:
以下の内容で Issue を作成します:
タイトル: {generated-title}
種別: {work-type}
複雑度: {complexity}
優先度: {priority}
説明:
{generated-body}
よろしいですか?
オプション:
- はい、作成する
- タイトルを変更
- 説明を編集
- キャンセル
gh issue create --title "{title}" --body "{body}"
Issue 本文のフォーマット:
## 概要
{what} を行う。
## 背景・目的
{why}
## 変更内容
{where} に対して以下の変更を行う:
- {change-1}
- {change-2}
## 影響範囲
{scope}
## 制約条件
{constraints}
## 複雑度
{complexity}
## チェックリスト
- [ ] 実装完了
- [ ] テスト追加/更新
- [ ] ドキュメント更新(必要な場合)
事前準備で特定した Project に Issue を追加:
# {project-number} と {owner} は事前準備で取得した値を使用
gh project item-add {project-number} --owner {owner} --url {issue-url}
注意:
{project-number} は事前準備で特定した Project の番号{owner} はリポジトリの owner(ユーザーまたは Organization)事前準備で特定した Project のアイテム ID を取得:
gh api graphql -f query='
query($owner: String!, $projectNumber: Int!, $issueNumber: Int!) {
user(login: $owner) {
projectV2(number: $projectNumber) {
id
items(last: 20) {
nodes {
id
content {
... on Issue {
number
}
}
}
}
fields(first: 20) {
nodes {
... on ProjectV2SingleSelectField {
id
name
options {
id
name
}
}
}
}
}
}
}' -f owner="{owner}" -F projectNumber={project-number} -F issueNumber={issue-number}
注意: owner が Organization の場合は user を organization に変更する。
フィールドを設定:
# Status を "Todo" に設定
gh project item-edit --project-id {project-id} --id {item-id} --field-id {status-field-id} --single-select-option-id {todo-option-id}
# Priority を設定
gh project item-edit --project-id {project-id} --id {item-id} --field-id {priority-field-id} --single-select-option-id {priority-option-id}
# Complexity を設定
gh project item-edit --project-id {project-id} --id {item-id} --field-id {complexity-field-id} --single-select-option-id {complexity-option-id}
作成結果を報告:
Issue #{number} を作成しました
タイトル: {title}
URL: {issue-url}
Projects 設定:
- Status: Todo
- Priority: {priority}
- Complexity: {complexity}
次のステップ:
1. `/zen:issue:start {number}` で作業を開始
2. 作業完了後 `/zen:pr:create` で PR 作成
zen-config.yml から以下の設定を参照:
github:
projects:
enabled: true
project_number: {number} # 使用する Project の番号(必須)
owner: "{owner}" # Project の owner(省略時はリポジトリ owner)
fields:
status:
options:
- { name: "Todo", default: true }
priority:
options:
- { name: "Medium", default: true }
complexity:
options:
- { name: "M", default: true }
zen-config.yml の github.projects.project_number が設定されている → その Project を使用gh コマンド実行