Spec
Background
Agent からの CLI 利用で、ツール仕様の内省不足と副作用制御不足が原因で再試行や失敗率が増える。
User Scenarios
- P0: Agent が
tool schema で入力仕様を取得し、正しい JSON を生成できる
- P0: 変更系コマンドを
--dry-run で安全に事前確認できる
- P1: 不正な入力が実行前に明確なエラーで拒否される
Functional Requirements
- FR-001:
unity-cli tool schema [tool_name] を提供する
- FR-002:
tool schema は全ツール分の最小機械可読スキーマを返す
- FR-003: グローバル
--dry-run は mutating ツールのみ実行抑止する
- FR-004: バッチ実行で
--dry-run 指定時、mutating ツールを item 単位で skip する
- FR-005: 明示スキーマ対象は strict validation(required/type/additionalProperties)を適用する
Non-Functional Requirements
- NFR-001:
tool list の既存出力互換を維持する
- NFR-002: validation エラーは tool 名とフィールド位置を含む
Success Criteria
- SC-001:
tool schema --output json で全ツール定義が返る
- SC-002:
--dry-run で変更系実行が抑止される
- SC-003: 不正パラメータが実行前にエラー化される
Plan
- CLIに
tool schema と --dry-run を追加
- ツールカタログに
ToolSpec/schema/metadata を追加
- 実行経路に共通 validation + dry-run 判定を追加
- batch は通常経路互換を維持しつつ dry-run item skip を追加
- README/docs を更新
Tasks
TDD
- RED: schemaコマンド、validation失敗、dry-runスキップのテストを先に追加
- GREEN: 最小実装でテストを通過
- REFACTOR: 共通関数化、既存互換維持を確認
Research
- 既存構成:
src/cli.rs, src/main.rs, src/tool_catalog.rs
- 既存 batch 挙動は通常経路で維持すべき(回帰防止)
Data Model
ToolSpec
name, description, mutating, executor, params_schema, response_schema
Quickstart
cargo run -- tool schema ping --output json
cargo run -- --dry-run tool call create_scene --json {sceneName:Main} --output json
cargo run -- tool call ping --json {unknown:true} --output json
Contracts
Artifact files are managed in issue comments with contract:<name> entries.
Checklists
Artifact files are managed in issue comments with checklist:<name> entries.
Acceptance Checklist
Spec
Background
Agent からの CLI 利用で、ツール仕様の内省不足と副作用制御不足が原因で再試行や失敗率が増える。
User Scenarios
tool schemaで入力仕様を取得し、正しい JSON を生成できる--dry-runで安全に事前確認できるFunctional Requirements
unity-cli tool schema [tool_name]を提供するtool schemaは全ツール分の最小機械可読スキーマを返す--dry-runは mutating ツールのみ実行抑止する--dry-run指定時、mutating ツールを item 単位で skip するNon-Functional Requirements
tool listの既存出力互換を維持するSuccess Criteria
tool schema --output jsonで全ツール定義が返る--dry-runで変更系実行が抑止されるPlan
tool schemaと--dry-runを追加ToolSpec/schema/metadata を追加Tasks
--dry-run/tool schema追加tool_catalogにToolSpecと最小スキーマ群を追加TDD
Research
src/cli.rs,src/main.rs,src/tool_catalog.rsData Model
ToolSpecname,description,mutating,executor,params_schema,response_schemaQuickstart
cargo run -- tool schema ping --output json cargo run -- --dry-run tool call create_scene --json {sceneName:Main} --output json cargo run -- tool call ping --json {unknown:true} --output jsonContracts
Artifact files are managed in issue comments with
contract:<name>entries.Checklists
Artifact files are managed in issue comments with
checklist:<name>entries.Acceptance Checklist
tool schema実装--dry-run実装cargo test --all-targets)cargo clippy --all-targets -- -D warnings)