@aramassa/ai-rules 0.6.0 → 0.8.0
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.
- package/artifact/agents/agent-creation.agent.md +372 -0
- package/artifact/agents/e2e-test-executor.agent.md +230 -0
- package/artifact/instructions/planning-workflow.md +828 -0
- package/artifact/prompts/development/plan-fix.prompt.md +366 -0
- package/package.json +1 -1
- package/presets/agents.yaml +26 -0
- package/presets/github-actions/test.yaml +18 -0
- package/presets/prompts/plan-fix.yaml +15 -0
|
@@ -0,0 +1,366 @@
|
|
|
1
|
+
---
|
|
2
|
+
type: prompt
|
|
3
|
+
category: workflow
|
|
4
|
+
focus: plan-to-implementation
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## prompt plan-fix ワークフロー
|
|
8
|
+
|
|
9
|
+
### 概要
|
|
10
|
+
|
|
11
|
+
VS Code の Plan モードで作成した計画が完成したら、この prompt を使用して GitHub Issue、ブランチ、PR の作成を一括で実行します。手動での Git 操作や Issue 起票を省略し、効率的に Agent Coding へ移行できます。
|
|
12
|
+
|
|
13
|
+
### 目的
|
|
14
|
+
|
|
15
|
+
計画完成後の定型的な操作を自動化し、以下を実現します:
|
|
16
|
+
|
|
17
|
+
- Git ブランチ操作の簡略化
|
|
18
|
+
- GitHub Issue 起票の効率化
|
|
19
|
+
- PR 作成とベースブランチ設定の自動化
|
|
20
|
+
- Agent Coding へのスムーズな移行
|
|
21
|
+
|
|
22
|
+
### 前提条件
|
|
23
|
+
|
|
24
|
+
- VS Code の Plan モードで `todo_plans/` に計画ファイルが作成済み
|
|
25
|
+
- 計画の内容が十分に詳細化されている
|
|
26
|
+
- Git リポジトリが初期化されている
|
|
27
|
+
|
|
28
|
+
### ワークフロー
|
|
29
|
+
|
|
30
|
+
#### Step 1: main ブランチに切り替えて最新化
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
# main ブランチに切り替え
|
|
34
|
+
git checkout main
|
|
35
|
+
|
|
36
|
+
# 最新の変更を取得
|
|
37
|
+
git pull origin main
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
**確認ポイント**:
|
|
41
|
+
- [ ] main ブランチに切り替わっている
|
|
42
|
+
- [ ] ローカルが最新の状態である
|
|
43
|
+
- [ ] コンフリクトが発生していない
|
|
44
|
+
|
|
45
|
+
#### Step 2: 計画の最終確認
|
|
46
|
+
|
|
47
|
+
`todo_plans/` ディレクトリ内の計画ファイルを確認します。
|
|
48
|
+
|
|
49
|
+
**チェック項目**:
|
|
50
|
+
- [ ] ファイル名が `YYYYMMDD_[機能名].md` 形式である
|
|
51
|
+
- [ ] 背景、やること、実装計画が明確に記載されている
|
|
52
|
+
- [ ] Phase 分けがされている
|
|
53
|
+
- [ ] 受け入れ基準が記載されている
|
|
54
|
+
|
|
55
|
+
**計画の例**:
|
|
56
|
+
```
|
|
57
|
+
todo_plans/
|
|
58
|
+
└── 20250115_cli_feature_implementation.md
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
#### Step 3: GitHub Issue を起票
|
|
62
|
+
|
|
63
|
+
計画ファイルを元に GitHub Issue を作成します。
|
|
64
|
+
|
|
65
|
+
**Issue 作成のポイント**:
|
|
66
|
+
- タイトル: `[機能名]: [機能概要]` の形式に統一
|
|
67
|
+
- 本文: 計画ファイルの内容を含める
|
|
68
|
+
- ラベル: 機能種別(`enhancement`, `bug`, `documentation`)とカテゴリを設定
|
|
69
|
+
|
|
70
|
+
**Issue タイトルの例**:
|
|
71
|
+
```
|
|
72
|
+
[mastra-tool-mcp-docs]: CLI機能の追加
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
**ラベルの例**:
|
|
76
|
+
- `enhancement`: 新機能
|
|
77
|
+
- `bug`: バグ修正
|
|
78
|
+
- `documentation`: ドキュメント更新
|
|
79
|
+
- カテゴリ固有のラベル(例: `mastra-tool`, `language-detection`)
|
|
80
|
+
|
|
81
|
+
#### Issue 作成後の確認
|
|
82
|
+
|
|
83
|
+
- [ ] Issue が正しく作成された
|
|
84
|
+
- [ ] Issue 番号が取得できた
|
|
85
|
+
- [ ] ラベルが適切に付与された
|
|
86
|
+
- [ ] 計画ファイルの内容が Issue 本文に反映された
|
|
87
|
+
|
|
88
|
+
#### Step 4: plan ブランチを作成
|
|
89
|
+
|
|
90
|
+
Issue 番号を使って `plan/{issue_number}` ブランチを作成します。
|
|
91
|
+
|
|
92
|
+
```bash
|
|
93
|
+
# Issue 番号を変数に設定(例: #123)
|
|
94
|
+
ISSUE_NUMBER=123
|
|
95
|
+
|
|
96
|
+
# plan ブランチを作成して切り替え
|
|
97
|
+
git checkout -b plan/${ISSUE_NUMBER}
|
|
98
|
+
|
|
99
|
+
# 確認
|
|
100
|
+
git branch --show-current
|
|
101
|
+
# 出力例: plan/123
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
**ブランチ命名規則**:
|
|
105
|
+
- `plan/{issue_number}`: 単独 Issue の場合
|
|
106
|
+
- `plan/{parent_issue_number}.{sub_issue_number}`: サブ Issue の場合
|
|
107
|
+
|
|
108
|
+
#### Step 5: 計画ファイルをコミット
|
|
109
|
+
|
|
110
|
+
計画ファイルを `plan/{issue_number}` ブランチにコミットします。
|
|
111
|
+
|
|
112
|
+
```bash
|
|
113
|
+
# 計画ファイルをステージング
|
|
114
|
+
git add todo_plans/YYYYMMDD_[機能名].md
|
|
115
|
+
|
|
116
|
+
# コミット
|
|
117
|
+
git commit -m "Add implementation plan for [機能名]
|
|
118
|
+
|
|
119
|
+
- [変更内容1]
|
|
120
|
+
- [変更内容2]
|
|
121
|
+
- [変更内容3]
|
|
122
|
+
- Related to Issue #${ISSUE_NUMBER}"
|
|
123
|
+
|
|
124
|
+
# リモートにプッシュ
|
|
125
|
+
git push -u origin plan/${ISSUE_NUMBER}
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
**コミットメッセージのポイント**:
|
|
129
|
+
- 1行目: 簡潔な要約
|
|
130
|
+
- 空行を挟む
|
|
131
|
+
- 箇条書きで詳細を記載
|
|
132
|
+
- Issue 番号を明記
|
|
133
|
+
|
|
134
|
+
#### Step 6: Pull Request を作成
|
|
135
|
+
|
|
136
|
+
`plan/{issue_number}` から `main` への PR を作成します。
|
|
137
|
+
|
|
138
|
+
**PR 作成のポイント**:
|
|
139
|
+
- Base ブランチ: `main`
|
|
140
|
+
- Head ブランチ: `plan/{issue_number}`
|
|
141
|
+
- Draft モード: 実装完了まで draft 状態を維持
|
|
142
|
+
- Issue リンク: `Closes #XXX` で自動クローズを設定
|
|
143
|
+
|
|
144
|
+
**PR タイトルの例**:
|
|
145
|
+
```
|
|
146
|
+
[mastra-tool-mcp-docs]: CLI機能実装計画
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
**PR の確認**:
|
|
150
|
+
- [ ] PR が draft モードで作成された
|
|
151
|
+
- [ ] base ブランチが `main` である
|
|
152
|
+
- [ ] head ブランチが `plan/{issue_number}` である
|
|
153
|
+
- [ ] Issue とリンクされている
|
|
154
|
+
|
|
155
|
+
#### Step 7: Agent Coding を開始
|
|
156
|
+
|
|
157
|
+
`plan/{issue_number}` をベースブランチとして Agent Coding タスクを起動します。
|
|
158
|
+
|
|
159
|
+
**VS Code での操作**:
|
|
160
|
+
|
|
161
|
+
1. **GitHub Copilot Chat で Agent タスクを開始**
|
|
162
|
+
```
|
|
163
|
+
@workspace /new task
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
2. **ベースブランチを指定**
|
|
167
|
+
- ベースブランチ: `plan/{issue_number}`
|
|
168
|
+
- タスク内容を入力
|
|
169
|
+
|
|
170
|
+
3. **Agent が自動的に作業ブランチを作成**
|
|
171
|
+
- ブランチ名例: `agent/implement-cli-feature`
|
|
172
|
+
|
|
173
|
+
**コマンドラインでの操作**:
|
|
174
|
+
|
|
175
|
+
```bash
|
|
176
|
+
# Agent 用のブランチを作成(手動の場合)
|
|
177
|
+
git checkout -b agent/implement-cli-feature plan/${ISSUE_NUMBER}
|
|
178
|
+
|
|
179
|
+
# Agent タスク起動(GitHub Copilot CLI など)
|
|
180
|
+
# (環境に応じたコマンドを実行)
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
### コマンド一覧(まとめ)
|
|
184
|
+
|
|
185
|
+
以下のコマンドを順に実行することで、plan-fix ワークフローを完了できます。
|
|
186
|
+
|
|
187
|
+
```bash
|
|
188
|
+
#!/bin/bash
|
|
189
|
+
|
|
190
|
+
# Step 1: main ブランチに切り替えて最新化
|
|
191
|
+
git checkout main
|
|
192
|
+
git pull origin main
|
|
193
|
+
|
|
194
|
+
# Step 2: 計画ファイルを確認(手動)
|
|
195
|
+
# todo_plans/YYYYMMDD_[機能名].md を確認
|
|
196
|
+
|
|
197
|
+
# Step 3: GitHub Issue を作成(Web UIまたはCopilot Chat経由)
|
|
198
|
+
|
|
199
|
+
# Issue 番号を設定(例: #123)
|
|
200
|
+
ISSUE_NUMBER=123
|
|
201
|
+
|
|
202
|
+
# Step 4: plan ブランチを作成
|
|
203
|
+
git checkout -b plan/${ISSUE_NUMBER}
|
|
204
|
+
|
|
205
|
+
# Step 5: 計画ファイルをコミット
|
|
206
|
+
git add todo_plans/YYYYMMDD_[機能名].md
|
|
207
|
+
git commit -m "Add implementation plan for [機能名]
|
|
208
|
+
|
|
209
|
+
- [変更内容1]
|
|
210
|
+
- [変更内容2]
|
|
211
|
+
- Related to Issue #${ISSUE_NUMBER}"
|
|
212
|
+
|
|
213
|
+
git push -u origin plan/${ISSUE_NUMBER}
|
|
214
|
+
|
|
215
|
+
# Step 6: Pull Request を作成(Web UIまたはCopilot Chat経由)
|
|
216
|
+
|
|
217
|
+
# Step 7: Agent Coding を開始(VS Code Copilot Chat経由)
|
|
218
|
+
|
|
219
|
+
echo "✅ Workflow completed!"
|
|
220
|
+
echo "Next: Start Agent Coding with base branch plan/${ISSUE_NUMBER}"
|
|
221
|
+
```
|
|
222
|
+
|
|
223
|
+
### ベストプラクティス
|
|
224
|
+
|
|
225
|
+
#### 計画ファイルの準備
|
|
226
|
+
|
|
227
|
+
- **詳細度**: Agent が迷わず実装できるレベルの詳細度を確保
|
|
228
|
+
- **Phase 分け**: 1つの Phase が 2-3時間で完了する規模に分割
|
|
229
|
+
- **受け入れ基準**: 検証可能な形で明記
|
|
230
|
+
|
|
231
|
+
#### Issue 作成時
|
|
232
|
+
|
|
233
|
+
- **タイトル**: `[パッケージ名]: [機能概要]` の形式に統一
|
|
234
|
+
- **ラベル**: 機能種別とカテゴリを適切に設定
|
|
235
|
+
- **親子関係**: 必要に応じて親 Issue との関連を明記
|
|
236
|
+
|
|
237
|
+
#### ブランチ運用
|
|
238
|
+
|
|
239
|
+
- **命名規則の徹底**: `plan/{issue_number}` の形式を厳守
|
|
240
|
+
- **寿命の管理**: plan ブランチは 1-3日以内に main へマージ
|
|
241
|
+
- **クリーンアップ**: マージ後は速やかにブランチを削除
|
|
242
|
+
|
|
243
|
+
#### PR 作成時
|
|
244
|
+
|
|
245
|
+
- **draft モード**: 実装完了まで draft 状態を維持
|
|
246
|
+
- **詳細な説明**: 次のステップを明記
|
|
247
|
+
- **Issue リンク**: `Closes #XXX` で自動クローズを設定
|
|
248
|
+
|
|
249
|
+
### トラブルシューティング
|
|
250
|
+
|
|
251
|
+
#### ブランチの作成に失敗する
|
|
252
|
+
|
|
253
|
+
**原因**: すでに同名のブランチが存在する
|
|
254
|
+
|
|
255
|
+
**解決策**:
|
|
256
|
+
```bash
|
|
257
|
+
# 既存ブランチを確認
|
|
258
|
+
git branch -a | grep plan
|
|
259
|
+
|
|
260
|
+
# 既存ブランチを削除(必要に応じて)
|
|
261
|
+
git branch -D plan/${ISSUE_NUMBER}
|
|
262
|
+
git push origin --delete plan/${ISSUE_NUMBER}
|
|
263
|
+
```
|
|
264
|
+
|
|
265
|
+
#### PR 作成がエラーになる
|
|
266
|
+
|
|
267
|
+
**原因**: リモートブランチが存在しない、または認証エラー
|
|
268
|
+
|
|
269
|
+
**解決策**:
|
|
270
|
+
```bash
|
|
271
|
+
# リモートブランチが push されているか確認
|
|
272
|
+
git branch -r | grep plan/${ISSUE_NUMBER}
|
|
273
|
+
|
|
274
|
+
# 再度 push
|
|
275
|
+
git push -u origin plan/${ISSUE_NUMBER}
|
|
276
|
+
|
|
277
|
+
# PR を再作成(Web UIまたはCopilot Chat経由)
|
|
278
|
+
```
|
|
279
|
+
|
|
280
|
+
### よくある質問
|
|
281
|
+
|
|
282
|
+
#### Q1: VS Code の Plan モードと prompt plan-fix の違いは?
|
|
283
|
+
|
|
284
|
+
**A**:
|
|
285
|
+
- **Plan モード**: 計画の作成に特化
|
|
286
|
+
- **prompt plan-fix**: 計画完成後の Git/GitHub 操作を自動化
|
|
287
|
+
|
|
288
|
+
両者は補完関係にあり、併用することで効率的なワークフローを実現できます。
|
|
289
|
+
|
|
290
|
+
#### Q2: 計画が未完成の状態で plan-fix を実行してもよいか?
|
|
291
|
+
|
|
292
|
+
**A**: 推奨しません。計画が未完成の場合、以下の問題が発生します:
|
|
293
|
+
- Agent が実装方針を理解できない
|
|
294
|
+
- レビューで大幅な修正が必要になる
|
|
295
|
+
- 実装のやり直しが発生する
|
|
296
|
+
|
|
297
|
+
計画を十分に詳細化してから plan-fix を実行してください。
|
|
298
|
+
|
|
299
|
+
#### Q3: Issue 作成後に計画を修正したい場合は?
|
|
300
|
+
|
|
301
|
+
**A**: 以下の手順で修正できます:
|
|
302
|
+
|
|
303
|
+
1. 計画ファイルを修正
|
|
304
|
+
2. `plan/{issue_number}` ブランチで再コミット
|
|
305
|
+
3. PR を更新
|
|
306
|
+
4. Issue にコメントで変更点を記載
|
|
307
|
+
|
|
308
|
+
```bash
|
|
309
|
+
git checkout plan/${ISSUE_NUMBER}
|
|
310
|
+
# 計画ファイルを修正
|
|
311
|
+
git add todo_plans/YYYYMMDD_[機能名].md
|
|
312
|
+
git commit -m "Update implementation plan: [変更内容]"
|
|
313
|
+
git push
|
|
314
|
+
```
|
|
315
|
+
|
|
316
|
+
#### Q4: 複数の Agent タスクを並行して実行したい場合は?
|
|
317
|
+
|
|
318
|
+
**A**: `plan/{issue_number}` から複数の `agent/*` ブランチを作成します:
|
|
319
|
+
|
|
320
|
+
```
|
|
321
|
+
plan/123
|
|
322
|
+
├── agent/implement-core-feature → PR → plan/123
|
|
323
|
+
├── agent/add-tests → PR → plan/123
|
|
324
|
+
└── agent/update-docs → PR → plan/123
|
|
325
|
+
```
|
|
326
|
+
|
|
327
|
+
各 Agent ブランチは独立して作業し、完了後に `plan/123` へマージします。
|
|
328
|
+
|
|
329
|
+
#### Q5: Agent Coding を使わず手動で実装する場合は?
|
|
330
|
+
|
|
331
|
+
**A**: plan-fix で作成したブランチ構造は手動実装でも利用できます:
|
|
332
|
+
|
|
333
|
+
```bash
|
|
334
|
+
# plan ブランチで直接実装
|
|
335
|
+
git checkout plan/${ISSUE_NUMBER}
|
|
336
|
+
|
|
337
|
+
# 実装
|
|
338
|
+
# ...
|
|
339
|
+
|
|
340
|
+
# コミット & プッシュ
|
|
341
|
+
git add .
|
|
342
|
+
git commit -m "Implement [機能名]"
|
|
343
|
+
git push
|
|
344
|
+
|
|
345
|
+
# PR を Ready for review に変更(Web UI経由)
|
|
346
|
+
```
|
|
347
|
+
|
|
348
|
+
### 関連ドキュメント
|
|
349
|
+
|
|
350
|
+
- プランニングワークフロー マニュアル(planning-workflow.md)
|
|
351
|
+
- Git ブランチ命名規則(git-rules.md)
|
|
352
|
+
- todo_plans への記載項目(todo_planning.md)
|
|
353
|
+
|
|
354
|
+
### まとめ
|
|
355
|
+
|
|
356
|
+
prompt plan-fix ワークフローを使用することで:
|
|
357
|
+
|
|
358
|
+
✅ **効率化**: Git/GitHub 操作を一括実行
|
|
359
|
+
✅ **一貫性**: 標準的なブランチ・Issue 構造を維持
|
|
360
|
+
✅ **追跡可能性**: Issue と PR で進捗を可視化
|
|
361
|
+
✅ **スムーズな移行**: Agent Coding へ迅速に移行
|
|
362
|
+
|
|
363
|
+
---
|
|
364
|
+
|
|
365
|
+
**作成日**: 2025年1月15日
|
|
366
|
+
**バージョン**: 1.0.0
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aramassa/ai-rules",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.8.0",
|
|
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",
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
config:
|
|
2
|
+
baseDir: .github/agents
|
|
3
|
+
description: |
|
|
4
|
+
GitHub Copilot custom agent definitions for specialized development tasks.
|
|
5
|
+
These agents provide tailored expertise for agent creation, testing, planning, and documentation.
|
|
6
|
+
|
|
7
|
+
recipe:
|
|
8
|
+
- title: Agent Creation Assistant
|
|
9
|
+
frontmatter:
|
|
10
|
+
"@description": true
|
|
11
|
+
"@tools": true
|
|
12
|
+
"@target": true
|
|
13
|
+
out: agent-creation.agent.md
|
|
14
|
+
filters:
|
|
15
|
+
name: agent-creation
|
|
16
|
+
target: github-copilot
|
|
17
|
+
|
|
18
|
+
- title: E2E Test Executor
|
|
19
|
+
frontmatter:
|
|
20
|
+
"@description": true
|
|
21
|
+
"@tools": true
|
|
22
|
+
"@target": true
|
|
23
|
+
out: e2e-test-executor.agent.md
|
|
24
|
+
filters:
|
|
25
|
+
name: e2e-test-executor
|
|
26
|
+
target: github-copilot
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
description: GitHub Actionsのテストワークフローを実装するための設定です。
|
|
2
|
+
|
|
3
|
+
recipe:
|
|
4
|
+
- import: :basic
|
|
5
|
+
- title: GitHub Actions Test Workflow Rules
|
|
6
|
+
frontmatter:
|
|
7
|
+
"@type": true
|
|
8
|
+
"@category": true
|
|
9
|
+
"@focus": true
|
|
10
|
+
description: |
|
|
11
|
+
Implementation rules for test workflows with GitHub Actions.
|
|
12
|
+
Covers workflow triggers, Node.js version matrix, build and test execution order,
|
|
13
|
+
and comprehensive validation including build artifact verification.
|
|
14
|
+
applyTo: ".github/workflows/*.{yml,yaml}"
|
|
15
|
+
out: ./.github/instructions/github-actions-test.instructions.md
|
|
16
|
+
type: test
|
|
17
|
+
category: github-actions
|
|
18
|
+
focus: test-workflow
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
description: VS Code Plan モードから Agent Coding への移行を自動化するワークフロー。計画完成後の GitHub Issue、ブランチ、PR 操作を簡略化します。
|
|
2
|
+
|
|
3
|
+
config:
|
|
4
|
+
baseDir: .github/prompts
|
|
5
|
+
|
|
6
|
+
recipe:
|
|
7
|
+
- title: "prompt plan-fix ワークフロー"
|
|
8
|
+
out: "plan-fix.prompt.md"
|
|
9
|
+
type: "prompt"
|
|
10
|
+
filters:
|
|
11
|
+
category: "workflow"
|
|
12
|
+
focus: "plan-to-implementation"
|
|
13
|
+
frontmatter:
|
|
14
|
+
description: "VS Code Plan モードから Agent Coding への移行を自動化。計画完成後の Git/GitHub 操作を簡略化し、効率的な開発ワークフローを実現。"
|
|
15
|
+
applyTo: "**/*"
|