@aramassa/ai-rules 0.9.3 → 0.9.5

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