Skip to content
Back to skills

Skill Policy Router

ASecurity

Intent と Mode を受け取り、必要な Skill・ゲート要件(GatePolicy)を返す。Use when: 依頼の Intent と Mode が確定した後、どの Skill とゲートが必要かを決定したい時。「どのスキルが必要か教えて」「ゲートポリシーを決めて」「Mode に応じた手順を教えて」。

  • 3 stars
  • 0 votes
  • 0 copies
  • 3 views
  • Added September 5, 2026
ai-agentsbash

Works with

  • cli

Security analysis

A100/100

Scanned September 5, 2026

npx -y skills add s977043/PlanGate --skill skill-policy-router --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Skill Policy Router?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Skill Policy Router
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/s977043-skill-policy-router/badge)](https://www.skillsdirectory.com/skills/s977043-skill-policy-router)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: skill-policy-router
description: "Intent と Mode を受け取り、必要な Skill・ゲート要件(GatePolicy)を返す。Use when: 依頼の Intent と Mode が確定した後、どの Skill とゲートが必要かを決定したい時。「どのスキルが必要か教えて」「ゲートポリシーを決めて」「Mode に応じた手順を教えて」。"
---

# Skill Policy Router

> 正本(sync 元): `.agents/skills/skill-policy-router/SKILL.md`。`scripts/sync-plugin-plangate.sh` が
> `.agents/skills/` を読み取り `plugin/plangate/skills/` を機械生成する。`.claude/skills/` と
> `.codex/skills/` は sync 対象外の配布先のため、正本更新時に同一内容を手動で追従させる。

Intent と Mode を入力として受け取り、必要な Skill とゲート要件(GatePolicy)を structured JSON で返す。

## 参照解決順(`.claude/rules/*.md` / 導入先で必ずこの順に探す)

本 Skill は Mode / `lite_eligible` の定義正本として `.claude/rules/mode-classification.md` を
参照する(§Iron Law / §lite_eligible の扱い)。このパスは上流リポジトリ基準のため、導入先では
**次の順で探索する**:

1. 導入先リポジトリの `.claude/rules/mode-classification.md`
2. 無ければ plugin root 配下 `<plugin_root>/rules/mode-classification.md`。
   `<plugin_root>` は **Bash で `ls "${CLAUDE_PLUGIN_ROOT}/rules/"` を実行して展開・確認した
   絶対パス**(Read ツールは絶対パスを要求し環境変数を展開しないため、`${CLAUDE_PLUGIN_ROOT}/...`
   という文字列をそのまま Read しない)。変数が空・未設定ならキャッシュを glob で推測せず 3 へ進む
3. どちらにも無い場合は **「正本 `mode-classification.md` を参照できなかった」と明示**し、
   推測で内容を補わない

## Iron Law

`GATE POLICY IS DETERMINED BY MODE, NOT BY INTENT`

GatePolicy の必須 / 任意判定は Mode によって決まる。
Intent はスキルの優先度や追加推奨にのみ影響する。

> **Mode の定義・判定基準(変更ファイル数・リスク・`lite_eligible`)は `.claude/rules/mode-classification.md` が単一正本**。本スキルは確定済み Mode を入力として受け取り GatePolicy へ写像するのみで、**Mode 自体は判定しない**。下の「Mode 別ポリシー表」は Mode→GatePolicy の*写像*であり Mode の定義ではない(重複定義ではない)。

## Common Rationalizations

| こう思ったら | 現実 |
|---|---|
| 「小さな feature だから approval 不要」 | Mode が high-risk ならば Intent に関わらず approval は必須 |
| 「docs なら worktree は不要では?」 | Mode が high-risk なら docs でも worktree が必要 |
| 「ultra-light なら全部スキップでいい」 | verify は ultra-light でも必須 |

## GatePolicy 型定義

```json
{
  "requiredSkills": ["<skill-name>", "..."],
  "optionalSkills": ["<skill-name>", "..."],
  "requiresUserApproval": "<boolean>",
  "requiresEvidence": "<boolean>",
  "requiresFailingTestFirst": "<boolean>",
  "requiresWorktree": "<boolean>"
}
```

**Skill 識別子**:

| 識別子 | 対応 Skill / 行動 |
|--------|----------------|
| `think` | 設計・計画の立案(plan.md 生成) |
| `hunt` | コードベース調査(Grep / Glob 探索) |
| `check` | セルフレビュー(diff-audit Skill、旧 self-review) |
| `tdd` | テスト駆動開発(failing test first) |
| `verify` | 受け入れ検査(test-cases.md 突合) |
| `worktree` | 独立ブランチでの作業(worktree 分離) |
| `review` | 外部レビュー(human / external AI) |
| `approval` | 人間の明示的承認取得 |

## Mode 別ポリシー表

| フィールド | ultra-light | light | standard | high-risk | critical |
|-----------|------------|-------|----------|-----------|---------|
| requiredSkills | verify | check, verify | think, check, verify | think, approval, worktree, tdd, check, review, verify | think, approval, worktree, tdd, check, review, verify |
| optionalSkills | check | think, hunt | hunt, tdd | — | — |
| requiresUserApproval | false | false | recommended | true | true |
| requiresEvidence | false | false | true | true | true |
| requiresFailingTestFirst | false | false | conditional | true | true |
| requiresWorktree | false | false | false | true | true |

**`standard` の補足**:

- `requiresUserApproval=recommended`: 人間確認を強く推奨するが必須ではない
- `requiresFailingTestFirst=conditional`: TDD が optional として推奨される

**`critical` の追加要件**:

- ロールバック計画の策定が必要
- セキュリティレビューを含む多角的レビューを推奨
- 段階的デプロイ計画の策定を推奨

## 手順

### Step 1: 入力検証

以下のフォーマットで入力を受け取る:

```json
{
  "intent": "<feature|bug|refactor|research|review|docs|ops|exploratory>",
  "mode": "<ultra-light|light|standard|high-risk|critical>"
}
```

`mode` が不明な場合は `standard` をデフォルトとして使用する。
`intent` が不明な場合は `feature` をデフォルトとして使用する(Intent は GatePolicy に影響しない)。

### Step 2: Mode によるベースポリシー決定

「Mode 別ポリシー表」から対応する行を読み取り、ベース GatePolicy を構築する。

### Step 3: Intent による調整(任意)

Intent に応じて optionalSkills を追加・調整する:

| Intent | 推奨 optionalSkills 追加 |
|--------|------------------------|
| `feature` | think(未追加の場合) |
| `bug` | hunt(原因調査のため) |
| `refactor` | check(品質確認のため) |
| `research` | — |
| `review` | check |
| `docs` | — |
| `ops` | verify(デプロイ検証のため、未追加の場合)。**PlanGate CLI 操作**(render/approve/doctor/exec)は skill でなく直接 `plangate <cmd>` を実行する |
| `exploratory` | — (WF-07 opt-in 推奨。通常フローに留まる場合は intent 相当の Skill 構成を使用)|

ただし、requiredSkills に既に含まれている Skill は optionalSkills に重複追加しない。

> **`plangate <cmd>` の表記と CLI 不在時の degrade は `intent-classifier` skill
> 「PlanGate CLI 操作の認識(ops 補足)」節を正本とする**(ここでは再定義しない)。
> 要点のみ: PATH 解決されるコマンド名は **`plangate`**、上流リポジトリの cwd では
> `bin/plangate <cmd>`、CLI が無い環境(**導入先では既定**)は同節の代替手順に置き換える。
> **GatePolicy の内容は CLI の有無で変えない**(強制が機械 block から手動確認に落ちるだけ)。

### Step 4: GatePolicy 出力

構築した GatePolicy を structured JSON で出力する。

## 出力フォーマット

```json
{
  "input": {
    "intent": "<intent>",
    "mode": "<mode>"
  },
  "policy": {
    "requiredSkills": ["<skill-name>"],
    "optionalSkills": ["<skill-name>"],
    "requiresUserApproval": true,
    "requiresEvidence": true,
    "requiresFailingTestFirst": true,
    "requiresWorktree": true
  },
  "notes": "<特記事項(critical の追加要件等)>"
}
```

## 使用例

**入力**: `{ "intent": "docs", "mode": "ultra-light" }`

**出力**:

```json
{
  "input": {
    "intent": "docs",
    "mode": "ultra-light"
  },
  "policy": {
    "requiredSkills": ["verify"],
    "optionalSkills": ["check"],
    "requiresUserApproval": false,
    "requiresEvidence": false,
    "requiresFailingTestFirst": false,
    "requiresWorktree": false
  },
  "notes": ""
}
```

**入力**: `{ "intent": "feature", "mode": "high-risk" }`

**出力**:

```json
{
  "input": {
    "intent": "feature",
    "mode": "high-risk"
  },
  "policy": {
    "requiredSkills": ["think", "approval", "worktree", "tdd", "check", "review", "verify"],
    "optionalSkills": [],
    "requiresUserApproval": true,
    "requiresEvidence": true,
    "requiresFailingTestFirst": true,
    "requiresWorktree": true
  },
  "notes": ""
}
```

## lite_eligible の扱い(責務分界)

`lite_eligible`(Lite ゲート可否)は `.claude/rules/mode-classification.md` の派生属性で、**判定は mode-classification 正本が担う**。本スキルは確定した `lite_eligible` を入力として受け取り、`true` のとき Lite ゲート構成(例: C-2 外部レビューを 1 本に絞る・観点固定)を GatePolicy に反映する。router は `lite_eligible` を**判定せず使用するのみ**。判定不能時は安全側(`lite_eligible=false` 相当の full ゲート)。

## 関連 Skill

- **intent-classifier**: ユーザー依頼文から Intent を判定する。このスキルの前段として使用
- **breakdown-gate**: タスク粒度の intake ゲート。intent-classifier よりさらに前段(PlanGate 起動前)でタスク分割要否を判定する(`.agents/skills/breakdown-gate/`)

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.