[追加] Sprint 1-4 アクションプラン + miyabi gate CLI スキル
autorun/: sprint-1-today/TASKS.md + GATE.md: verify_merge + escape hatch + E2E テスト sprint-2-this-week/TASKS.md: OpenClaw ドッキング (hooks/sync/サブエージェント) sprint-3-next-week/TASKS.md: 運用基盤 (Heartbeat/Telegram/VOICEBOX/Maestro) sprint-4-this-month/TASKS.md: 品質ゲート多層化 (rust-ai-pipeline/proptest/mutants) skills/miyabi-gate-cli/SKILL.md: 全11サブコマンドの使い方 Claude Code / Codex / OpenClaw からの呼び出し方法 exit code (0/1/2) とエージェントの対処方法 GATE フロー図 ~/.claude/skills/miyabi-gate-cli → シンボリックリンク設定 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
15b7c98ac2
commit
cc2c6a90f4
9 changed files with 359 additions and 2 deletions
|
|
@ -29,7 +29,7 @@
|
|||
<!-- gitnexus:start -->
|
||||
# GitNexus — Code Intelligence
|
||||
|
||||
This project is indexed by GitNexus as **miyabi-cli-standalone** (5232 symbols, 11415 relationships, 300 execution flows). Use the GitNexus MCP tools to understand code, assess impact, and navigate safely.
|
||||
This project is indexed by GitNexus as **miyabi-cli-standalone** (5414 symbols, 11907 relationships, 300 execution flows). Use the GitNexus MCP tools to understand code, assess impact, and navigate safely.
|
||||
|
||||
> If any GitNexus tool warns the index is stale, run `npx gitnexus analyze` in terminal first.
|
||||
|
||||
|
|
|
|||
|
|
@ -121,7 +121,7 @@ miyabi agent run coordinator --issue <番号>
|
|||
<!-- gitnexus:start -->
|
||||
# GitNexus — Code Intelligence
|
||||
|
||||
This project is indexed by GitNexus as **miyabi-cli-standalone** (5232 symbols, 11415 relationships, 300 execution flows). Use the GitNexus MCP tools to understand code, assess impact, and navigate safely.
|
||||
This project is indexed by GitNexus as **miyabi-cli-standalone** (5414 symbols, 11907 relationships, 300 execution flows). Use the GitNexus MCP tools to understand code, assess impact, and navigate safely.
|
||||
|
||||
> If any GitNexus tool warns the index is stale, run `npx gitnexus analyze` in terminal first.
|
||||
|
||||
|
|
|
|||
20
autorun/sprint-1-today/GATE.md
Normal file
20
autorun/sprint-1-today/GATE.md
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
# Sprint 1 承認ゲート
|
||||
|
||||
## 通過条件(全て GREEN で Sprint 2 へ進む)
|
||||
|
||||
- [ ] `cargo test --all` → 全 GREEN(900+ テスト)
|
||||
- [ ] `cargo clippy --all-targets --all-features -- -D warnings` → ゼロエラー
|
||||
- [ ] `cargo build --release` → 成功
|
||||
- [ ] verify_merge が mock で動作する
|
||||
- [ ] force_unlock が event log に記録する
|
||||
- [ ] manual_complete が done に遷移する
|
||||
- [ ] E2E テスト: register → done の全シーケンスが通る
|
||||
- [ ] GATE 拒否テスト: 6件以上が正しく拒否する
|
||||
- [ ] GNI 再インデックス完了
|
||||
- [ ] `v1.0-dtp-complete` タグが打たれている
|
||||
|
||||
## 失敗時
|
||||
|
||||
- テスト失敗 → 原因特定 → 修正 → 再テスト(最大3回)
|
||||
- clippy エラー → 該当行修正 → 再チェック
|
||||
- 3回連続失敗 → エスカレーション(人間判断)
|
||||
70
autorun/sprint-1-today/TASKS.md
Normal file
70
autorun/sprint-1-today/TASKS.md
Normal file
|
|
@ -0,0 +1,70 @@
|
|||
# Sprint 1: 品質確定(今日)
|
||||
|
||||
> Phase C + clippy 完了 → v1.0 タグ
|
||||
|
||||
## 1.1 verify_merge ラッパー (~50行)
|
||||
|
||||
- [ ] `crates/miyabi-core/src/protocol.rs` に `verify_merge()` を追加
|
||||
- 既存の `get_pull_request()` (github.rs) を呼ぶ
|
||||
- `PullRequest.merge_commit_sha` を取得
|
||||
- `pr.state == "merged"` を検証
|
||||
- SHA が 40hex であることを検証
|
||||
- tasks.json 更新: merge_commit + state → done
|
||||
- ロック解放
|
||||
- 後続タスク blocked → pending
|
||||
- [ ] CLI に `miyabi gate verify-merge <task-id>` サブコマンド追加
|
||||
- [ ] テスト: mock PullRequest で merged → done 遷移
|
||||
|
||||
## 1.2 escape hatch (~50行)
|
||||
|
||||
- [ ] `protocol.rs` に `force_unlock()` 追加
|
||||
```
|
||||
fn force_unlock(&self, task_id: &str, reason: &str, operator: &str) -> Result<()>
|
||||
```
|
||||
- ロック即解放
|
||||
- event log に reason + operator を記録
|
||||
- state は変更しない(implementing のまま)
|
||||
- [ ] `protocol.rs` に `manual_complete()` 追加
|
||||
```
|
||||
fn manual_complete(&self, task_id: &str, reason: &str, operator: &str) -> Result<()>
|
||||
```
|
||||
- PR/merge なしで done に遷移
|
||||
- event log に reason + operator + "manual" を記録
|
||||
- CompletionMode::Manual として区別
|
||||
- [ ] CLI に `miyabi gate force-unlock <task-id> --reason R --operator O` 追加
|
||||
- [ ] CLI に `miyabi gate manual-complete <task-id> --reason R --operator O` 追加
|
||||
- [ ] テスト: force_unlock → ロック解放確認
|
||||
- [ ] テスト: manual_complete → done 遷移 + event 記録
|
||||
|
||||
## 1.3 E2E テスト (~100行)
|
||||
|
||||
- [ ] `crates/miyabi-core/src/protocol.rs` の tests モジュールに E2E 追加
|
||||
```
|
||||
#[test]
|
||||
fn full_lifecycle_register_to_done() {
|
||||
// 1. register(issue=1, title="test")
|
||||
// 2. check_dependencies → ready
|
||||
// 3. record_impact(risk=LOW)
|
||||
// 4. assign_and_lock(agent="test", files=["src/test.rs"])
|
||||
// 5. record_branch("feature/issue-1-test")
|
||||
// 6. record_pr(42)
|
||||
// 7. record_merge("a1b2c3d4...40hex")
|
||||
// 8. assert: state == Done, lock == None
|
||||
}
|
||||
```
|
||||
- [ ] GATE 拒否テスト: issue=0 → GateError
|
||||
- [ ] GATE 拒否テスト: impact なしで assign → GateError
|
||||
- [ ] GATE 拒否テスト: HIGH risk + 承認なし → GateError
|
||||
- [ ] GATE 拒否テスト: ロック競合 → LockError
|
||||
- [ ] GATE 拒否テスト: 不正 SHA → GateError
|
||||
- [ ] escape hatch テスト: force_unlock + manual_complete
|
||||
|
||||
## 1.4 最終確認
|
||||
|
||||
- [ ] `cargo test --all` → 全 GREEN
|
||||
- [ ] `cargo clippy --all-targets --all-features -- -D warnings` → ゼロエラー
|
||||
- [ ] `cargo build --release` → リリースビルド成功
|
||||
- [ ] `npx gitnexus analyze --force` → 再インデックス
|
||||
- [ ] `git tag v1.0-dtp-complete`
|
||||
- [ ] `git push origin v1.0-dtp-complete`
|
||||
- [ ] `~/bin/announce "Polaris v1.0 完成。全 GATE 実装済み。テスト GREEN。"`
|
||||
39
autorun/sprint-2-this-week/TASKS.md
Normal file
39
autorun/sprint-2-this-week/TASKS.md
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
# Sprint 2: OpenClaw ドッキング(今週)
|
||||
|
||||
> Sprint 1 の v1.0 タグ完了後に開始
|
||||
|
||||
## 2.1 JSON 出力の標準化 (~30行)
|
||||
|
||||
- [ ] 全コマンドの JSON 出力スキーマを統一
|
||||
```json
|
||||
{ "status": "ok"|"gate_rejected"|"error", "exit_code": 0|1|2, "task_id": "...", "data": {} }
|
||||
```
|
||||
- [ ] テスト: 各コマンドの JSON が上記スキーマに準拠
|
||||
|
||||
## 2.2 OpenClaw hooks 連携 (~100行)
|
||||
|
||||
- [ ] `miyabi gate register` 完了時に stdout に JSON イベント出力
|
||||
- [ ] `miyabi gate merge` 完了時に stdout に JSON イベント出力
|
||||
- [ ] OpenClaw hooks 設定に DTP イベントテンプレート追加
|
||||
- [ ] テスト: イベント出力が正しい形式
|
||||
|
||||
## 2.3 OpenClaw main 呼び出しテスト
|
||||
|
||||
- [ ] OpenClaw main セッションで register → status → assign を実行
|
||||
- [ ] exit code で分岐する SOUL.md 追記
|
||||
- [ ] サブエージェント(カエデ)に作業を配布するテスト
|
||||
|
||||
## 2.4 tasks.json の memory sync (~30行)
|
||||
|
||||
- [ ] OpenClaw memory sync 対象に `project_memory/` を追加
|
||||
- [ ] sync 頻度設定(タスク変更時 + 定期5分)
|
||||
|
||||
## 2.5 E2E: OpenClaw → miyabi gate → エージェント → merge
|
||||
|
||||
- [ ] register → dispatchable → spawn kade → assign → pr → merge → done
|
||||
- [ ] 全ステップのログ確認
|
||||
|
||||
## 承認ゲート
|
||||
|
||||
- [ ] OpenClaw main が register → merge を完走
|
||||
- [ ] `git tag v1.1-openclaw-dock`
|
||||
38
autorun/sprint-3-next-week/TASKS.md
Normal file
38
autorun/sprint-3-next-week/TASKS.md
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
# Sprint 3: 運用基盤(来週)
|
||||
|
||||
> Sprint 2 の v1.1 タグ完了後に開始
|
||||
|
||||
## 3.1 Heartbeat デーモン (~50行)
|
||||
|
||||
- [ ] `miyabi gate heartbeat --all` で全アクティブタスクの lease 更新
|
||||
- [ ] launchd plist 作成(60秒間隔)
|
||||
- [ ] `launchctl load` で自動起動
|
||||
- [ ] stale 検出テスト
|
||||
|
||||
## 3.2 tasks.json git 自動同期 (~30行)
|
||||
|
||||
- [ ] merge 完了時に自動 git add + commit + push
|
||||
- [ ] hooks.rs に DtpTaskCompleted イベント追加
|
||||
- [ ] hooks.yaml に自動コミットフック登録
|
||||
|
||||
## 3.3 Telegram 通知 (~50行)
|
||||
|
||||
- [ ] GATE 通過/拒否を Telegram に通知
|
||||
- [ ] HIGH/CRITICAL 承認要求を Telegram ボタンで
|
||||
- [ ] Phase 完了報告
|
||||
|
||||
## 3.4 VOICEBOX アナウンス自動化 (~20行)
|
||||
|
||||
- [ ] hooks.yaml で DTP イベント → announce 連携
|
||||
- [ ] テンプレート: "Polaris: {task_id} のゲート {gate_name} を通過しました"
|
||||
|
||||
## 3.5 Maestro Playbook 登録
|
||||
|
||||
- [ ] Auto Run 形式に変換
|
||||
- [ ] Maestro GUI で実行確認
|
||||
- [ ] Session Isolation + Worktree Support
|
||||
|
||||
## 承認ゲート
|
||||
|
||||
- [ ] Heartbeat + Telegram + VOICEBOX が全て動作
|
||||
- [ ] `git tag v1.2-ops-ready`
|
||||
27
autorun/sprint-4-this-month/TASKS.md
Normal file
27
autorun/sprint-4-this-month/TASKS.md
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
# Sprint 4: 品質ゲート多層化(今月)
|
||||
|
||||
> Sprint 3 の v1.2 タグ完了後に開始
|
||||
|
||||
## 4.1 rust-ai-pipeline Phase 1 統合 (~50行)
|
||||
|
||||
- [ ] `miyabi gate assign` 後に `ai-pipeline phase1 --format json` 自動実行
|
||||
- [ ] `all_passed == false` → implementing に留まる
|
||||
- [ ] `failure_kind` を tasks.json に記録
|
||||
- [ ] CLI に `miyabi gate quality-check <task-id>` 追加
|
||||
|
||||
## 4.2 proptest 拡張 (~100行)
|
||||
|
||||
- [ ] gate.rs: ランダムタスク状態で GATE 一貫性検証
|
||||
- [ ] lock.rs: ランダムファイルセットで acquire/release 不変条件
|
||||
- [ ] store.rs: ランダムイベント列で snapshot rebuild 冪等性
|
||||
|
||||
## 4.3 cargo-mutants (~50行設定)
|
||||
|
||||
- [ ] `cargo mutants` 実行
|
||||
- [ ] ミューテーションスコア 80% 以上
|
||||
- [ ] 殺せないミュータントにテスト追加
|
||||
|
||||
## 承認ゲート
|
||||
|
||||
- [ ] mutation score 80%+
|
||||
- [ ] `git tag v1.3-quality-gates`
|
||||
160
skills/miyabi-gate-cli/SKILL.md
Normal file
160
skills/miyabi-gate-cli/SKILL.md
Normal file
|
|
@ -0,0 +1,160 @@
|
|||
# miyabi gate CLI — 確定的タスク実行スキル
|
||||
|
||||
## 概要
|
||||
|
||||
Polaris (DTP) の CLI インターフェース。エージェントがタスクの登録・ロック・検証・完了を確定的に実行する。
|
||||
|
||||
## トリガー
|
||||
|
||||
miyabi gate, polaris, dtp, タスク登録, ロック, GATE, 確定的, deterministic
|
||||
|
||||
## 前提
|
||||
|
||||
- バイナリ: `cargo build --release` で `target/release/miyabi` を生成
|
||||
- ワークスペース: `/Users/shunsukehayashi/dev/platform/miyabi-cli-standalone`
|
||||
- tasks.json: `project_memory/tasks.json`(デフォルト)
|
||||
|
||||
## コマンド一覧
|
||||
|
||||
### タスク登録
|
||||
|
||||
```bash
|
||||
miyabi gate register --issue 45 --title "認証移行"
|
||||
miyabi gate register --issue 45 --title "認証移行" --format json
|
||||
miyabi gate register --issue 45 --title "認証移行" --store-path /path/to/tasks.json
|
||||
```
|
||||
|
||||
### タスク状態確認
|
||||
|
||||
```bash
|
||||
miyabi gate status # 全タスク一覧
|
||||
miyabi gate status task-001 # 特定タスク
|
||||
miyabi gate status --format json # JSON出力
|
||||
```
|
||||
|
||||
### 実行可能タスク
|
||||
|
||||
```bash
|
||||
miyabi gate dispatchable # DAG依存解決済みのタスク
|
||||
miyabi gate dispatchable --format json
|
||||
```
|
||||
|
||||
### DAG 可視化
|
||||
|
||||
```bash
|
||||
miyabi gate dag # DAGレベル表示
|
||||
```
|
||||
|
||||
### impact 記録
|
||||
|
||||
```bash
|
||||
miyabi gate impact task-001 --risk LOW --symbols 3
|
||||
miyabi gate impact task-001 --risk HIGH --symbols 12 # → 人間承認が必要
|
||||
miyabi gate impact task-001 --risk HIGH --symbols 12 --approve # 承認付き
|
||||
```
|
||||
|
||||
### ロック獲得 + 実装開始
|
||||
|
||||
```bash
|
||||
miyabi gate assign task-001 --agent codex --node macbook --files "src/auth.rs,src/middleware.rs"
|
||||
```
|
||||
|
||||
### ブランチ記録
|
||||
|
||||
```bash
|
||||
miyabi gate branch task-001 feature/issue-45-auth
|
||||
```
|
||||
|
||||
### PR 記録
|
||||
|
||||
```bash
|
||||
miyabi gate pr task-001 78
|
||||
```
|
||||
|
||||
### merge 検証 + 完了
|
||||
|
||||
```bash
|
||||
miyabi gate merge task-001 a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1b2
|
||||
```
|
||||
|
||||
### ロック一覧
|
||||
|
||||
```bash
|
||||
miyabi gate locks # 現在のロック一覧
|
||||
miyabi gate locks --format json
|
||||
```
|
||||
|
||||
### escape hatch
|
||||
|
||||
```bash
|
||||
miyabi gate force-unlock task-001 --reason "agent crashed" --operator hayashi
|
||||
miyabi gate manual-complete task-001 --reason "doc task, no PR" --operator hayashi
|
||||
```
|
||||
|
||||
## exit code
|
||||
|
||||
| コード | 意味 | エージェントの対処 |
|
||||
|--------|------|------------------|
|
||||
| 0 | 成功 | 次のステップへ進む |
|
||||
| 1 | GATE 拒否 | 理由を確認して条件を満たしてからリトライ |
|
||||
| 2 | 入力エラー | コマンドを修正して再実行 |
|
||||
|
||||
## エージェントの使い方
|
||||
|
||||
### Claude Code から
|
||||
|
||||
```bash
|
||||
# タスク登録
|
||||
miyabi gate register --issue 45 --title "認証移行" --format json
|
||||
|
||||
# 状態確認
|
||||
miyabi gate status task-001 --format json
|
||||
|
||||
# ロック獲得
|
||||
miyabi gate assign task-001 --agent claude --node macbook --files "src/auth.rs"
|
||||
```
|
||||
|
||||
### Codex から
|
||||
|
||||
```bash
|
||||
# Codex は --format json で結果をパースする
|
||||
result=$(miyabi gate register --issue 45 --title "test" --format json)
|
||||
exit_code=$?
|
||||
if [ $exit_code -eq 0 ]; then
|
||||
task_id=$(echo "$result" | jq -r '.task_id')
|
||||
miyabi gate assign "$task_id" --agent codex --node macbook --files "src/test.rs"
|
||||
fi
|
||||
```
|
||||
|
||||
### OpenClaw から
|
||||
|
||||
```bash
|
||||
# OpenClaw main がディスパッチ
|
||||
miyabi gate dispatchable --format json | jq -r '.[0].id'
|
||||
# → サブエージェントに渡す
|
||||
```
|
||||
|
||||
## GATE フロー
|
||||
|
||||
```
|
||||
register (GATE 0: Issue必須)
|
||||
→ status: pending
|
||||
→ check_dependencies (GATE 2: 依存解決)
|
||||
→ status: ready
|
||||
→ impact (GATE 3: 分析記録 + HIGH承認)
|
||||
→ status: analyzing
|
||||
→ assign (GATE 4: ロック獲得)
|
||||
→ status: implementing
|
||||
→ branch (GATE 5: ブランチ名検証)
|
||||
→ pr (GATE 6: PR番号記録)
|
||||
→ status: reviewing
|
||||
→ merge (GATE 7: SHA検証)
|
||||
→ status: done ✅
|
||||
```
|
||||
|
||||
## 関連スキル
|
||||
|
||||
- `polaris-ops` — 開発オペレーション全般
|
||||
- `rust-llm-pitfalls` — Rust 開発時の注意点
|
||||
- `context-and-impact` — コンテキスト収集パイプライン
|
||||
- `gitnexus-impact-analysis` — GNI 影響分析
|
||||
3
skills/self-improving-skills/skill-runs.jsonl
Normal file
3
skills/self-improving-skills/skill-runs.jsonl
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
{"ts":"2026-04-09T16:35:38.725Z","agent":"codex","skill":"context-and-impact","task":"DTP Phase A: miyabi-core に gate/lock/store/protocol を追加し cargo test とコミットまで完了","result":"success","score":0.95,"notes":""}
|
||||
{"ts":"2026-04-09T21:17:09.658Z","agent":"codex","skill":"context-and-impact","task":"DTP Phase B: miyabi gate CLI サブコマンド追加、protocol API 拡張、cargo test とコミット完了","result":"success","score":0.96,"notes":""}
|
||||
{"ts":"2026-04-09T21:27:55.420Z","agent":"codex","skill":"context-and-impact","task":"miyabi-core の clippy 7件を解消し clippy/test を通過確認。ただし HEAD 差分ゼロのため指定コミットは未作成","result":"partial","score":0.78,"notes":""}
|
||||
Loading…
Add table
Add a link
Reference in a new issue