Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions .claude/agents/issue-reviewer.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,11 @@ skills:
- **read-only**: Issue の mutation を行わない
- **loop worker**: `issue-refinement-loop` orchestrator から呼ばれ、結果を返して終了する
- **script-first executor**: C1〜C12 の決定論的チェック・scope mismatch / VC anti-pattern / C1 skeleton 系 non-blocking warning・diff_proposal の生成は `.claude/skills/review-issue/scripts/check_issue_contract.py` で実行する。
- **contract readiness consumer**: `ISSUE_CONTRACT_READINESS_RESULT_V1` を `.claude/skills/issue-contract-review/scripts/contract_readiness_check.py --mode preflight-static` で取得し、`errors[]` が空でない場合は以下の 2 系統に分離する:(1) 各 `fix_hint` 文字列を `blocking_issues` に転写する(人間向け要約)、(2) `errors[]` 構造体をそのまま `structured_blockers` に転写する(機械処理用・issue-author への修復 payload)。`verdict: needs-fix` とする(判定ロジックは helper に委譲し、本 SubAgent では再実装しない)。
- **contract readiness consumer**: `ISSUE_CONTRACT_READINESS_RESULT_V1` を `.claude/skills/issue-contract-review/scripts/contract_readiness_check.py --mode execute` で取得し、`errors[]` が空でない場合は以下の 2 系統に分離する:(1) 各 `fix_hint` 文字列を `blocking_issues` に転写する(人間向け要約)、(2) `errors[]` 構造体をそのまま `structured_blockers` に転写する(機械処理用・issue-author への修復 payload)。`verdict: needs-fix` とする(判定ロジックは helper に委譲し、本 SubAgent では再実装しない)。
- `source_check` / `source_payload.decision` / `source_payload.classification` / `exit_code` / `command_hash` を損失なく保持すること(lossless pass-through)
- `status: human_judgment` を返すエラー(`human_judgment` decision / timeout / env_missing_dep)は `needs-fix` に畳み込まない;`failure_class: contract_readiness_human_judgment` を出力に含む

Note: `--mode preflight-static` は静的に `compound_command_disallowed` を検出する。`unexpected_pass` は VC を実際に実行しないと検出不可であり、`issue-contract-review` の `--mode execute` で検出される設計。
Note: `--mode execute` は `compound_command_disallowed`(静的検出)と `unexpected_pass`(VC 実行結果)の両方を検出する。`shell=True` は導入しない(既存の `shell=False` 前提を維持)。入力は `--body-file` のみを使い、`--issue` / gh / network / external auth に依存しない。

## Result & Consume Contract (SubAgent-owned)

Expand Down
14 changes: 9 additions & 5 deletions .claude/skills/review-issue/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,16 @@ Issue 本文の構造品質を `.claude/skills/review-issue/scripts/check_issue_
1. `gh issue view <番号> --json title,body,labels` で本文を取得する。
2. 本文を一時ファイルに保存し、以下の 2 スクリプトを順に実行する:
- `python3 .claude/skills/review-issue/scripts/check_issue_contract.py --file <tmp> --json`
- `python3 .claude/skills/issue-contract-review/scripts/contract_readiness_check.py --body-file <tmp> --mode preflight-static`
- `uv run python3 .claude/skills/issue-contract-review/scripts/contract_readiness_check.py --body-file <tmp> --mode execute`

`ISSUE_CONTRACT_READINESS_RESULT_V1` の `errors[]` が空でない場合、以下の 2 系統に分離する:
- `blocking_issues` には各 error の `fix_hint` 文字列を転写する(人間向け要約)
- `structured_blockers` には `errors[]` の構造体をそのまま転写する(機械処理用・issue-author への修復 payload)
`verdict: needs-fix` とする。判定ロジックは `contract_readiness_check.py` に集約し、本 skill では再実装しない。
`ISSUE_CONTRACT_READINESS_RESULT_V1` の `errors[]` が空でない場合、以下のルールで `REVIEW_ISSUE_RESULT_V1` へ合成する:
- `blocking_issues` には各 error の `fix_hint` 文字列を転写する(人間向け要約)。`check_issue_contract.py` の `blocking_issues` も同配列にマージする。
- `structured_blockers` には `errors[]` の構造体をそのまま転写する(機械処理用・issue-author への修復 payload)。`source_check` / `source_payload.decision` / `source_payload.classification` / `exit_code` / `command_hash` を損失なく保持すること(lossless pass-through)。
- `status: needs_fix` の errors → `verdict: needs-fix` に反映する。
- `status: human_judgment` の errors(`env_missing_dep` / `timeout` / unknown 分類など)は `verdict: needs-fix` に畳み込まない。`structured_blockers` に `failure_class: contract_readiness_human_judgment` を付与して別扱いとする。overall verdict は `needs-fix` ではなく `human_judgment` として区別する。
- 判定ロジックは `contract_readiness_check.py` に集約し、本 skill では再実装しない。

Note: `--mode execute` は `compound_command_disallowed`(静的検出)と `unexpected_pass`(VC 実行結果)の両方を検出する。`shell=True` は導入しない(既存の `shell=False` 前提を維持)。
3. checker の JSON をそのまま `REVIEW_ISSUE_RESULT_V1` に整形する(`verdict` / `deterministic_checks` / `blocking_issues` / `non_blocking_improvements` / `diff_proposal` を保持)。
4. `verdict: needs-fix` の場合のみ `diff_proposal` を呼び出し元に提示する。本文書き戻しは Step 5 の条件分岐に従う。
5. 本文書き戻し条件:
Expand Down
Loading
Loading