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
9 changes: 9 additions & 0 deletions .github/workflows/runtime-plugin-validate.yml
Original file line numberDiff line numberDiff line change
Expand Up@@ -44,6 +44,15 @@ jobs:
python-version: "3.x"
- run: bash scripts/build-runtime-plugins.sh --check

skill-frontmatter-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.x"
- run: python3 scripts/check-skill-frontmatter.py

runtime-plugin-validate:
runs-on: ubuntu-latest
steps:
Expand Down
53 changes: 53 additions & 0 deletions docs/specifications/ndf-skill-inventory.md
Original file line numberDiff line numberDiff line change
Expand Up@@ -163,6 +163,59 @@ merged, ndf-policies, pr, pr-tests, resolve-pr-comments, review, sync-main
`deploy` へのトリガ語宣言と `qa-security-scan` のトリガ語見直しののち再測定することを、
frontmatter 見直し後の確認項目とする。

## frontmatter 見直しの結果

[棚卸の計画](../../issues/ndf-development-skills/07-tasks.md) の Task 0-7 で全 29 Skill の
frontmatter を [規約](../../plugins/ndf-shared/skills/README.md) へ揃えた。台帳の表は測定日
時点の値であり、以下の変更は表へ反映していない。

### 発動制御

| Skill | 変更 | 理由 |
| --- | --- | --- |
| `merged` / `pr` / `review` / `pr-tests` | `disable-model-invocation` を削除 | 日常的に自然文で依頼されるため。明示指示専用のままではエージェントが Skill を使わず独自手順で実行する |
| `merged` / `pr` | 実行前確認を必須手順として本文へ固定 | 上記 2 つは取り消しの難しい操作(worktree / ブランチ削除、push と PR 作成)を含む。自動発動を許すかわりに、削除・書き込みの直前に対象を一覧提示して同意を得る手順を `SKILL.md` と `description` に固定した。`disable-model-invocation` を解釈しない Codex / Kiro でも同じ安全性が働く |
| `deploy` / `cherry-pick-pr` / `statusline` | 明示指示専用を維持 | 環境ブランチへの書き込みと設定ファイルの書き換えを伴う。`description` に「利用者が明示的に指示したときのみ実行する」と明記し、Codex / Kiro でも意図が伝わるようにした |
| `ndf-policies` | `user-invocable: false` を維持 | `description` に「知識として参照するだけで、手順として実行しない」と明記した |
| `official-skills-autoloader` | 自動発動を維持し、実行前確認を必須手順として本文へ固定 | 本 PR で Claude Code の manifest へ追加したことで暗黙起動が可能になり、外部リポジトリの clone と `~/.claude/skills/` への symlink 作成が同意なしに走りうる状態になった。明示指示専用(`disable-model-invocation`)も検討したが、この Skill は起動 0 / 機会 97 で台帳の判定が「発動改善」であり、明示専用は判定と逆行して機会 97 をそのまま取りこぼす。また `~/.claude/skills/` を読むのは Claude Code だけで Codex / Kiro には配布しないが、`disable-model-invocation` は Claude Code でも発動制御であって実行前確認ではないため、これだけでは同意取得を保証できない。したがって `merged` / `pr` と同じ「自動発動 + 実行前確認」を採り、クローン元 URL・クローン先・symlink を張る先・対象 Skill 名の 4 点を一覧提示して同意を得る手順を `SKILL.md` と `description` に固定した |

### 配布先

| Skill | 台帳の配布 | 変更後 | 理由 |
| --- | --- | --- | --- |
| `qa-security-scan` | — | CXK | 発動改善の判定はどこにも配布されていない状態では効かない。ランタイム非依存の判断基準であり 3 種すべてへ配る |
| `official-skills-autoloader` | — | C | 同上。ただし取得先が `~/.claude/skills/` のため Claude Code 限定 |

### トリガ語

- 広すぎるトリガを具体化した。`investigation-rules` の `調査` → `調査レポートを書く`、
`implementation-plan` の `PR作成` を削除して `pr` へ寄せる、`markdown-writing` の
`仕様書` → `仕様書を書く`、`problem-solving` の `バグ修正` → `バグの根本原因`
- `playwright-evidence` と `playwright-kit-ops` で重複していた `upload_evidence` を解消した。
スクリプトを持つ `playwright-kit-ops` 側に `upload_evidence.py` として残し、
`playwright-evidence` は `エビデンスをDriveへ保管` に置き換えた
- `deploy` と `cherry-pick-pr` はトリガ語を宣言していなかったため新たに宣言した。
次回の `/ndf:skill-stats` で両者の機会を測定できる

### 実測値

| 項目 | 見直し前 | 見直し後 | 上限 |
| --- | ---: | ---: | ---: |
| 検査エラー | 33 | 0 | 0 |
| 検査警告 | 16 | 0 | — |
| `description` 最大 | 401 | 296 | 300 |
| Claude Code 初期一覧 | 3,133 | 6,036 | 8,000 |
| Codex 初期一覧 | 3,933 | 6,473 | 8,000 |
| frontmatter 合計 | 12,724 | 12,211 | 13,000 |

見直し後の値は `python3 scripts/check-skill-frontmatter.py --report` の出力(Skill 29 個、
エラー 0 / 警告 0)である。Claude Code の初期一覧は 1 項目を 250 文字で切り詰めてから積むため、
`description` を 250 文字より長くしても合計は増えない。Codex の初期一覧は Codex の manifest に
載る Skill だけを数えるため、Claude Code 限定の `official-skills-autoloader` は含まれない。

初期一覧の合計が増えているのは、`when_to_use` に置いていたトリガ語を `description` へ移し、
Codex と Kiro でも発動判定に効くようにしたためである。

## 参照

- 棚卸の計画: [issues/ndf-development-skills/02-skill-inventory.md](../../issues/ndf-development-skills/02-skill-inventory.md)
Expand Down
4 changes: 2 additions & 2 deletions plugins/ndf-claude/skills/cherry-pick-pr/SKILL.md
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
---
name: cherry-pick-pr
description: "Create cherry-pick PRs for environment branches and apply the same fix across multiple branches."
argument-hint: "<base-branch> (例: qa/staging, release/v2)"
description: "Cherry-pick a merged fix onto environment branches (qa/staging, release) as a new PR. 破壊的操作のため、利用者が /ndf:cherry-pick-pr を明示的に指示したときのみ実行する。Triggers: 'cherry-pick', 'qaにも同じ修正を適用', 'stagingにも反映', 'release branchへ適用', 'multi-branch fix'"
argument-hint: "ベースブランチ名 (例: qa/staging, release/v2)"
disable-model-invocation: true
allowed-tools:
- Bash
Expand Down
3 changes: 1 addition & 2 deletions plugins/ndf-claude/skills/cross-review/SKILL.md
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
---
name: cross-review
description: "Run iterative Codex and Gemini PR reviews."
when_to_use: "PR を codex + gemini 両方でレビューし、両者 APPROVE まで自動収束させたいときに限定して使う。明示トリガ: 'cross-review', 'クロスレビュー', '両AIレビュー', '収束レビュー', 'codex と gemini でレビュー'。通常の単発 PR レビュー依頼 (第二意見が 1 回欲しい等) は本 skill を選ばず /ndf:review を使う。重い収束ループ (codex+gemini を複数ラウンド起動) のため、単発レビューと責務を明確に分ける。"
description: "Review a PR with both Codex and Gemini, looping fixes until both APPROVE. Use when a converging two-AI review is wanted; for a one-shot second opinion use /ndf:review. Triggers: 'cross-review', 'クロスレビュー', '両AIレビュー', '収束レビュー', 'codex と gemini でレビュー'"
argument-hint: "[PR番号] [--max-rounds N] [--rotate-after K] [--rotate-mode light|squash] [--only codex|gemini] [--focus TEXT] [--extra-instructions-file PATH]"
allowed-tools:
- Bash
Expand Down
4 changes: 2 additions & 2 deletions plugins/ndf-claude/skills/deploy/SKILL.md
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
---
name: deploy
description: "Create a deploy PR from the current feature branch to an environment branch such as qa/staging or release/v2. 破壊的操作のため、利用者が /ndf:deploy を明示的に指示したときのみ実行する環境ブランチへデプロイ / qaに上げる / stagingに反映 / リリースブランチへPR)。deployブランチを作成し origin/main を取り込んでからPRを出す。"
argument-hint: "<env-branch> (例: qa/staging, release/v2)"
description: "Create a deploy PR from the current feature branch to an environment branch such as qa/staging or release/v2. 破壊的操作のため、利用者が /ndf:deploy を明示的に指示したときのみ実行する。Triggers: '環境ブランチへデプロイ', 'qaに上げる', 'stagingへデプロイ', 'リリースブランチへPR'"
argument-hint: "環境ブランチ名 (例: qa/staging, release/v2)"
disable-model-invocation: true
allowed-tools:
- Bash
Expand Down
3 changes: 1 addition & 2 deletions plugins/ndf-claude/skills/docker-container-access/SKILL.md
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
---
name: docker-container-access
description: "Diagnose Docker container access and localhost routing."
when_to_use: "Docker / コンテナへのアクセス・localhost 接続不可・DinD/DooD 環境判定が必要なとき。Triggers: 'docker access', 'container connect', 'localhost not working', 'DinD', 'DooD', 'Docker接続', 'コンテナアクセス', 'curl container'"
description: "Diagnose Docker container access and localhost routing failures. Use when a container is unreachable, localhost does not connect, or DinD/DooD has to be identified. Triggers: 'localhost not working', 'コンテナに接続できない', 'DinD', 'DooD', 'curl container'"
allowed-tools:
- Read
- Bash
Expand Down
3 changes: 1 addition & 2 deletions plugins/ndf-claude/skills/external-ai/SKILL.md
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
---
name: external-ai
description: "Delegate coding, review, or research to an external AI CLI (Codex / Gemini). Use for 'codexで調査', 'geminiレビュー', '第二意見レビュー', 'external AI review', 'codex exec', 'gemini exec'."
when_to_use: "外部 AI へコード生成 / レビュー / 調査を委譲したいとき。追加トリガ: '外部AIに投げて', 'クロスチェックして', 'もう一つのAIに見てもらう', 'CLI で codex を回す'"
description: "Delegate coding, review, or research to an external AI CLI (Codex or Gemini). Use when a second opinion or an offloaded investigation is wanted. Triggers: 'codexで調査', 'geminiレビュー', '第二意見レビュー', 'codex exec', 'gemini exec', '外部AIに投げて'"
---

# 外部 AI 委譲スキル (Codex / Gemini)
Expand Down
3 changes: 1 addition & 2 deletions plugins/ndf-claude/skills/fix/SKILL.md
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
---
name: fix
description: "Classify PR review comments, fix the actionable ones, then reply and resolve each thread. Use when responding to PR review feedback from codex, gemini, bots, or humans."
when_to_use: "PR レビューコメントへの対応全般。分類だけしたいときは --classify-only。Triggers: 'PRコメント対応', 'PRレビュー修正', 'PRコメントを確認', 'PRコメントを分類', 'コメント対応の優先度', 'PR fix', 'classify PR comments', 'コメントに対応して修正', 'Resolveして'"
description: "Classify PR review comments, fix the actionable ones, then reply and resolve each thread. Use when responding to review feedback from codex, gemini, bots, or humans on a PR. Triggers: 'PRコメント対応', 'PRレビュー修正', 'PRコメントを分類', 'コメントに対応して修正', 'Resolveして'"
argument-hint: "[PR番号] [--classify-only] [--defer-nit] [--severity-min critical|major|minor]"
allowed-tools:
- Bash
Expand Down
3 changes: 1 addition & 2 deletions plugins/ndf-claude/skills/implementation-plan/SKILL.md
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
---
name: implementation-plan
description: "Create or update implementation plan files."
when_to_use: "実装開始時 / PR作成時に実装プランの作成・更新が必要なとき。複数ファイル変更・新機能追加・DBマイグレーションを含む変更で自動参照。Triggers: '実装プラン', '実装を開始', 'PR作成', 'implementation plan', 'plan first', '設計書を作成', 'issues/に追加'"
description: "Create or update an implementation plan file under issues/ before coding starts. Use when a change spans multiple files, adds a feature, or includes a DB migration. Triggers: '実装プラン', '実装を開始', 'implementation plan', '設計書を作成', 'issues/に追加'"
---

# 実装プランガイド
Expand Down
3 changes: 1 addition & 2 deletions plugins/ndf-claude/skills/investigation-rules/SKILL.md
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
---
name: investigation-rules
description: "Write evidence-backed investigation and debug reports."
when_to_use: "調査・デバッグ・不具合レポートを作成するとき。「ない」「該当なし」等の否定的結論を出すときは必ず参照。Triggers: '調査', 'デバッグ', '不具合レポート', '原因調査', 'investigation', 'root cause', 'カラムがない', '該当コードがない', 'データがない'"
description: "Write evidence-backed investigation and debug reports, and never state a negative finding without showing the search behind it. Use when writing an investigation or bug report. Triggers: '調査レポートを書く', '不具合レポート', '原因調査', 'カラムがない', '該当コードがない'"
---

# 調査レポート作成ルール
Expand Down
3 changes: 1 addition & 2 deletions plugins/ndf-claude/skills/issue-plan-strategy/SKILL.md
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
---
name: issue-plan-strategy
description: "Turn issues into plans and implementation workflows."
when_to_use: "issue → plan 作成 / 既存 plan の実装 (実行) を依頼されたとき。複数 PR に分割される設計や、release branch + 個別 PR + worktree 運用が必要なときに参照する。Triggers: 'issueのplanを作って', 'PLANxxの設計', '設計書を起こして', 'このplanを実装して', 'PLANxxを実装', 'planを実行', 'release branch 作って実装開始', 'multi-PR で進めて'"
description: "Turn an issue into a plan, then drive the plan through a release branch, per-PR worktrees, and multi-PR execution. Use when asked to design a plan from an issue or to execute an existing plan. Triggers: 'issueのplanを作って', 'このplanを実装して', 'planを実行', 'release branch 作って実装開始', 'multi-PR で進めて'"
argument-hint: "[issue-path-or-url] (例: issues/i16.md, https://github.com/org/repo/issues/123)"
allowed-tools:
- Bash
Expand Down
2 changes: 1 addition & 1 deletion plugins/ndf-claude/skills/logging-guidelines/SKILL.md
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
---
name: logging-guidelines
description: "Choose log levels and write safe, useful application logswhen addingor reworking logging in code(ログ追加 / logger / ログレベル / デバッグログ / エラーログ / print文をログに). Use when editing source code that emits logs, to pick the level and keep secrets and personal data out of the output."
description: "Choose log levels and keep secrets and personal data out of application logs. Use when adding, reworking, or reviewing logging in source code. Triggers: 'ログ追加', 'ログレベルを決める', 'ログ設計', 'print文をログに', 'ログに個人情報'"
paths:
- "**/*.py"
- "**/*.ts"
Expand Down
3 changes: 1 addition & 2 deletions plugins/ndf-claude/skills/markdown-writing/SKILL.md
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
---
name: markdown-writing
description: "Write Markdown docs, PR bodies, and reports that read well to a third party."
when_to_use: "Markdown 文書 / 仕様書 / 設計書 / PR 本文 / 調査レポート / 図表を作成・編集するとき。Triggers: 'Markdown作成', 'ドキュメント作成', '文書作成', '仕様書', '設計書', 'PR本文', 'PR説明', '調査レポート', '図を描く', 'mermaid', 'create document', 'write docs', 'write PR description'"
description: "Write Markdown docs, specs, PR bodies, and reports that read well to a third party, including tables and mermaid diagrams. Use when authoring or editing a Markdown document. Triggers: 'ドキュメント作成', 'PR本文', 'PR説明', '仕様書を書く', 'mermaid', 'write docs'"
allowed-tools:
- Read
- Write
Expand Down
31 changes: 25 additions & 6 deletions plugins/ndf-claude/skills/merged/SKILL.md
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
---
name: merged
description: "Clean up after a PR is merged: update main, remove the worktree, and delete merged branches."
description: "Clean up after a merged PR: update main, remove the worktree, and delete merged branches. 削除の前に対象を一覧提示して同意を取る。Use when a PR was merged or branches and worktrees need clearing. Triggers: 'マージ後の後片付け', 'ブランチを整理', 'worktreeを削除', 'merged cleanup'"
argument-hint: "[PR番号]"
disable-model-invocation: true
allowed-tools:
- Bash
- Read
Expand All@@ -24,13 +23,32 @@ PR マージ後の後始末をまとめて実行する。対象 PR のブラン
手順 1(PR のマージ確認)を前提条件にしてはならない。「マージ済みブランチの整理」と
「main の取り込み」はいずれも **単独で実行可能** で、PR のマージ状態に依存しない。

## 削除前の同意取得(必須)

worktree 削除・ローカルブランチ削除・リモートブランチ削除はいずれも取り消しが難しい。
**この 3 種類の操作は、実行の直前に削除対象を一覧で提示して利用者の同意を得る。
同意が得られていない対象は削除しない。** この Skill は自然文の依頼でも起動するため、
安全性はこの手順で担保する(frontmatter の発動制御には依存しない)。

| 操作 | 提示するもの |
|---|---|
| worktree 削除 | worktree のパスと、未コミット変更の有無(`git -C <path> status --short`) |
| ローカルブランチ削除 | ブランチ名と、main へ未マージのコミットがあるか |
| リモートブランチ削除 | リモート名とブランチ名。共有ブランチに影響するため、他の削除と分けて同意を取る |

- 「削除してよいか」だけを尋ねるのは確認にならない。**対象そのものを一覧で示す**
- 同意が得られなかった対象はスキップし、作業完了報告にスキップした対象と理由を記載する
- 利用者が対象を明示して削除を依頼した場合(`/ndf:merged 123` で PR 番号を指定した等)は、
その依頼が対象への同意にあたる。それでも一覧の提示は行い、依頼に含まれない対象
(マージ済みブランチの一括整理、リモート削除)については改めて同意を取る

## クリーンアップの手順

1. **マージ確認**: 引数の(引数がなければ自身が作成した最新の)PR が main に merge されていることを github mcp で確認。merge されていなければクリーンアップは実施せず終了
2. **作業ツリー退避**: `git branch --show-current` で**退避元のブランチ名を記録**し、`git status` を確認して変更があれば `git stash`
3. **main 更新**: `git checkout main` → `git pull`
4. **worktree クリーンアップ**: `git worktree list` で当該 PR 番号に対応する worktree (`pr<PR番号>`) を探し、あれば `git worktree remove <path>` で削除(worktree 内の `.cross_review/` も一緒に消える)
5. **ブランチ削除**: `git branch -d <feature-branch>`
4. **worktree クリーンアップ**: `git worktree list` で当該 PR 番号に対応する worktree (`pr<PR番号>`) を探し、**「削除前の同意取得」に従ってパスと未コミット変更の有無を提示し、同意を得てから** `git worktree remove <path>` で削除(worktree 内の `.cross_review/` も一緒に消える)
5. **ブランチ削除**: 削除するブランチ名を提示して同意を得てから `git branch -d <feature-branch>`
6. **マージ済みブランチの整理**: 下記の手順で残存ブランチをまとめて削除
7. **復元**: 手順 2 で stash していれば、**退避元のブランチへ戻してから**復元する
- 退避元のブランチが残っている場合: `git checkout <退避元のブランチ>` → `git stash pop`
Expand All@@ -51,8 +69,9 @@ git push origin --delete <branch> # 3. リモートにも残っていれば削
```

- main と現在のブランチは必ず除外する
- 削除対象を提示し、確認を取ってから削除する
- リモート削除は共有ブランチに影響するため、対象を明示してから実行する
- **手順 2 の前に削除対象のローカルブランチを一覧で提示し、同意を得てから削除する**
- **手順 3 のリモート削除は共有ブランチに影響するため、ローカル削除とは分けて対象を提示し、
改めて同意を得てから実行する**(「削除前の同意取得」を参照)

## main の取り込み

Expand Down
Loading
Loading