@aramassa/ai-rules 0.9.3 → 0.9.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,10 +1,10 @@
1
1
  ---
2
2
  type: prompt
3
- category: workflow
4
- focus: plan-to-implementation
3
+ name: plan-fix
4
+ description: "VS Code Plan モードから Agent Coding への移行を自動化。計画完成後の Git/GitHub 操作を簡略化し、効率的な開発ワークフローを実現。"
5
+ agent: agent
5
6
  ---
6
-
7
- ## prompt plan-fix ワークフロー
7
+ # prompt plan-fix ワークフロー
8
8
 
9
9
  ### 概要
10
10
 
@@ -21,8 +21,7 @@ VS Code の Plan モードで作成した計画が完成したら、この promp
21
21
 
22
22
  ### 前提条件
23
23
 
24
- - VS Code の Plan モードで `todo_plans/` に計画ファイルが作成済み
25
- - 計画の内容が十分に詳細化されている
24
+ - 計画の内容が十分に詳細化されている(まだファイル化していなくてもよい)
26
25
  - Git リポジトリが初期化されている
27
26
 
28
27
  ### ワークフロー
@@ -42,25 +41,95 @@ git pull origin main
42
41
  - [ ] ローカルが最新の状態である
43
42
  - [ ] コンフリクトが発生していない
44
43
 
45
- #### Step 2: 計画の最終確認
46
-
47
- `todo_plans/` ディレクトリ内の計画ファイルを確認します。
44
+ #### Step 2: 仮の GitHub Issue を起票して IssueNumber を取得
48
45
 
49
- **チェック項目**:
50
- - [ ] ファイル名が `YYYYMMDD_[機能名].md` 形式である
51
- - [ ] 背景、やること、実装計画が明確に記載されている
52
- - [ ] Phase 分けがされている
53
- - [ ] 受け入れ基準が記載されている
46
+ このフローでは `todo_plans/${IssueNumber}/index.md` を正とし、**Issue 本文は必ず `index.md` と一致**させます。
47
+ そのため、まず仮の内容で Issue を作成して IssueNumber を取得します。
54
48
 
55
- **計画の例**:
56
- ```
57
- todo_plans/
58
- └── 20250115_cli_feature_implementation.md
49
+ ```bash
50
+ # 仮の本文(後で index.md に置き換える)
51
+ TEMP_BODY="(placeholder)\n\n※この Issue の本文は todo_plans/${IssueNumber}/index.md と同期する" \
52
+
53
+ # Issue を作成して URL を取得(例: https://github.com/ORG/REPO/issues/123)
54
+ ISSUE_URL=$(gh issue create \
55
+ --title "[機能名]: [機能概要]" \
56
+ --body "$TEMP_BODY" \
57
+ --label "enhancement")
58
+
59
+ # URL 末尾から Issue 番号を取り出す
60
+ ISSUE_NUMBER=$(basename "$ISSUE_URL")
61
+ echo "$ISSUE_NUMBER"
59
62
  ```
60
63
 
61
- #### Step 3: GitHub Issue を起票
64
+ **確認ポイント**:
65
+ - [ ] Issue が正しく作成された
66
+ - [ ] Issue 番号(`ISSUE_NUMBER`)が取得できた
67
+
68
+ #### Step 3: `todo_plans/${IssueNumber}/` を作成し、index.md を作る(Issue 本文と同期)
69
+
70
+ Issue 番号を使って、計画ディレクトリを作成します。
71
+
72
+ **作成するファイル**:
73
+ - `todo_plans/${ISSUE_NUMBER}/index.md`(必須:人間が読む用。要点のみ。Issue 本文と必ず一致させる)
74
+ - `todo_plans/${ISSUE_NUMBER}/details.md`(任意:補足情報の例。長くてよい)
75
+ - `todo_plans/${ISSUE_NUMBER}/*.md`(任意:補足は分割して複数ファイルを作ってよい。例: `testing.md`, `risks.md`, `notes.md`)
76
+
77
+ ```bash
78
+ mkdir -p "todo_plans/${ISSUE_NUMBER}"
79
+
80
+ # まずテンプレを作る(必要なら手で編集)
81
+ cat > "todo_plans/${ISSUE_NUMBER}/index.md" <<'EOF'
82
+ # 変更概要(3行)
83
+ -
84
+ -
85
+ -
86
+
87
+ ## 対象
88
+ - パッケージ/モジュール:
89
+
90
+ ## 動作確認
91
+ -
92
+
93
+ ## 稼働中システムへの影響
94
+ -
62
95
 
63
- 計画ファイルを元に GitHub Issue を作成します。
96
+ ## 破壊的変更
97
+ - なし / あり(内容: )
98
+
99
+ ## 計画ファイル一覧
100
+ - `index.md`: この Issue 本文(要点のみ)
101
+ - `details.md`: 実装の詳細(背景、実装方針、Phase、受け入れ基準など)
102
+ - その他の補足ファイル(必要に応じて作成):
103
+ - `testing.md`: テスト戦略・テストケース
104
+ - `risks.md`: リスク評価と対策
105
+ - `notes.md`: 設計メモ・その他補足
106
+ EOF
107
+
108
+ cat > "todo_plans/${ISSUE_NUMBER}/details.md" <<'EOF'
109
+ # 補足(自由記述)
110
+
111
+ ※補足はこのファイルに「全部」書く必要はありません。
112
+ `todo_plans/${ISSUE_NUMBER}/` 配下に、用途別にファイルを増やしてOKです(例: `testing.md`, `risks.md`, `notes.md`)。
113
+
114
+ ## 背景
115
+
116
+ ## 実装方針
117
+
118
+ ## 実装計画(Phase)
119
+
120
+ ## 受け入れ基準
121
+
122
+ ## ロールバック/切り戻し
123
+ EOF
124
+
125
+ # Issue 本文を index.md に必ず一致させる
126
+ gh issue edit "$ISSUE_NUMBER" --body-file "todo_plans/${ISSUE_NUMBER}/index.md"
127
+ ```
128
+
129
+ **チェック項目**:
130
+ - [ ] `todo_plans/${ISSUE_NUMBER}/index.md` が「要点のみ」で読める分量になっている
131
+ - [ ] `index.md` から、(1) どんな変更か(3行) (2) 対象パッケージ/モジュール (3) 動作確認計画 (4) 稼働中影響 (5) 破壊的変更の有無 (6) 計画ファイル一覧 が分かる
132
+ - [ ] Issue 本文が `index.md` と一致している(差分がない)
64
133
 
65
134
  **Issue 作成のポイント**:
66
135
  - タイトル: `[機能名]: [機能概要]` の形式に統一
@@ -111,7 +180,7 @@ git branch --show-current
111
180
 
112
181
  ```bash
113
182
  # 計画ファイルをステージング
114
- git add todo_plans/YYYYMMDD_[機能名].md
183
+ git add todo_plans/${ISSUE_NUMBER}/index.md todo_plans/${ISSUE_NUMBER}/details.md
115
184
 
116
185
  # コミット
117
186
  git commit -m "Add implementation plan for [機能名]
@@ -192,18 +261,29 @@ git checkout main
192
261
  git pull origin main
193
262
 
194
263
  # Step 2: 計画ファイルを確認(手動)
195
- # todo_plans/YYYYMMDD_[機能名].md を確認
264
+ # このフローでは Issue 本文 = todo_plans/${ISSUE_NUMBER}/index.md を保証する
196
265
 
197
- # Step 3: GitHub Issue を作成(Web UIまたはCopilot Chat経由)
266
+ # Step 2: 仮の Issue を作って Issue 番号を取得
267
+ TEMP_BODY="(placeholder)\n\n※この Issue の本文は todo_plans/${IssueNumber}/index.md と同期する"
268
+ ISSUE_URL=$(gh issue create \
269
+ --title "[機能名]: [機能概要]" \
270
+ --body "$TEMP_BODY" \
271
+ --label "enhancement")
272
+ ISSUE_NUMBER=$(basename "$ISSUE_URL")
198
273
 
199
- # Issue 番号を設定(例: #123)
200
- ISSUE_NUMBER=123
274
+ # Step 3: todo_plans/${ISSUE_NUMBER}/ を作って index.md & details.md を作成
275
+ mkdir -p "todo_plans/${ISSUE_NUMBER}"
276
+ ${EDITOR:-vi} "todo_plans/${ISSUE_NUMBER}/index.md"
277
+ ${EDITOR:-vi} "todo_plans/${ISSUE_NUMBER}/details.md" # 任意。必要なら、他の *.md を追加してよい
278
+
279
+ # Step 3.1: Issue 本文を index.md と同期
280
+ gh issue edit "$ISSUE_NUMBER" --body-file "todo_plans/${ISSUE_NUMBER}/index.md"
201
281
 
202
282
  # Step 4: plan ブランチを作成
203
283
  git checkout -b plan/${ISSUE_NUMBER}
204
284
 
205
285
  # Step 5: 計画ファイルをコミット
206
- git add todo_plans/YYYYMMDD_[機能名].md
286
+ git add todo_plans/${ISSUE_NUMBER}/index.md todo_plans/${ISSUE_NUMBER}/details.md
207
287
  git commit -m "Add implementation plan for [機能名]
208
288
 
209
289
  - [変更内容1]
@@ -224,7 +304,8 @@ echo "Next: Start Agent Coding with base branch plan/${ISSUE_NUMBER}"
224
304
 
225
305
  #### 計画ファイルの準備
226
306
 
227
- - **詳細度**: Agent が迷わず実装できるレベルの詳細度を確保
307
+ - **index.md**: 人間が読む前提で、要点だけに絞る(Issue 本文と一致させる正本)
308
+ - **補足ファイル**: 長い背景/Phase/受け入れ基準などは `todo_plans/${ISSUE_NUMBER}/` 配下に分割して置く(`details.md` はその一例)
228
309
  - **Phase 分け**: 1つの Phase が 2-3時間で完了する規模に分割
229
310
  - **受け入れ基準**: 検証可能な形で明記
230
311
 
@@ -308,9 +389,12 @@ git push -u origin plan/${ISSUE_NUMBER}
308
389
  ```bash
309
390
  git checkout plan/${ISSUE_NUMBER}
310
391
  # 計画ファイルを修正
311
- git add todo_plans/YYYYMMDD_[機能名].md
392
+ git add todo_plans/${ISSUE_NUMBER}/index.md todo_plans/${ISSUE_NUMBER}/details.md
312
393
  git commit -m "Update implementation plan: [変更内容]"
313
394
  git push
395
+
396
+ # Issue 本文を index.md に再同期
397
+ gh issue edit "$ISSUE_NUMBER" --body-file "todo_plans/${ISSUE_NUMBER}/index.md"
314
398
  ```
315
399
 
316
400
  #### Q4: 複数の Agent タスクを並行して実行したい場合は?
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aramassa/ai-rules",
3
- "version": "0.9.3",
3
+ "version": "0.9.4",
4
4
  "description": "This repository collects guidelines and instructions for developing AI agents. It contains documents covering communication rules, coding standards, testing strategies, and general operational practices.",
5
5
  "workspaces": [
6
6
  "packages/extract",