Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add commands/s977043/river-review/preflightgit clone --depth 1 https://github.com/s977043/river-reviewWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/commands/s977043/river-review/preflight)<a href="https://agentmods.dev/commands/s977043/river-review/preflight"><img src="https://agentmods.dev/badge/commands/s977043/river-review/preflight.svg" alt="Measured on agentmods" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00036 | $0.01584 |
| Opus 5 | $0.00018 | $0.00792 |
| Sonnet 5 | $0.00007 | $0.00317 |
| Haiku 4.5 | $0.00004 | $0.00158 |
Grade A, and why
preflight scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 5d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 127 lines — stays where its author put it; the contents beside it link to each section on GitHub.
作業開始前の検証: 「$ARGUMENTS」に関連するタスクが既に完了/不要/並行実施されていないか確認する。
このスキルは書き込み系ツール (Edit / Write / git commit / gh pr create) を実行する 最初の tool call の直前 に呼び出すことを想定している。抽象的な注意喚起ではなく、検証コマンドを具体的に実行して判定まで行う。
前提
以下のような作業シグナルがあれば /preflight を先に実行する:
- 引き継ぎ情報として複数 PR のマージ指示を受けた
- main 修正 / CI 失敗の解消タスクを開始しようとしている
- 新しい PR を作成しようとしている
gh pr listの結果を信頼して作業計画を立てようとしている.github/workflows/*.ymlのnode-version/ action pin /permissionsを変更する PR を作ろうとしている(Node baseline / action version / permissions 系の並行 PR と衝突しやすい)
調査手順
Step 1. 引数からキーワードを抽出
引数から 1-3 個の検索キーワードを抽出する (例: "husky chmod" → husky, "riverbed memory v1" → riverbed, memory)。PR 番号が与えられた場合はそれを直接使う。
Step 2. main の最新状態を取得
git fetch origin main
git log origin/main --oneline -15
直近 15 コミットで関連キーワードが含まれていないか目視確認。
Step 3. 対象 PR の state を REST API で直接検証
PR 番号が指定されている場合は、1 件ずつ:
gh api repos/OWNER/REPO/pulls/{N} --jq '{number, state, merged, merged_at, mergeable, mergeable_state}'
重要: gh pr view や gh pr list は GraphQL 経路でキャッシュ遅延がある。merged: false, state: open と表示されても実際には merged の場合があるため、必ず REST API (gh api) で裏取りする。
Step 4. 並行 in-flight PR の検索
gh pr list --state open --search "<keyword>" --json number,title,headRefName,author
キーワードに該当する open PR を列挙。別の作業者/セッションが同じ問題に取り組んでいないか確認。
Step 5. 直近 close 済 PR の検索
gh pr list --state closed --search "<keyword>" --limit 5 --json number,title,mergedAt,closedAt
直近の close は「並行作業が merge された直後」の可能性が高いシグナル。5 件以内の close がヒットしたら内容を確認。
Step 6. 既存 issue / Epic の state 確認 (関連 issue 番号がある場合)
gh api repos/OWNER/REPO/issues/{N} --jq '{state, closedAt, title}'
判定
検証結果に基づいて以下のいずれかで応答する:
A. SAFE — 作業開始可能
条件:
- 対象 PR が全て OPEN かつ未 merge
- 類似 in-flight PR なし
- 直近 close 済 PR に該当内容なし
- main に関連コミットなし
対応: ユーザーに SAFE 判定を報告し、作業を開始する。
B. OBSOLETE — タスクが不要
条件:
- 対象 PR が既に merged (REST API で確認)
- main に同内容のコミット既に存在
- 関連 Issue/Epic が既に CLOSED
対応:
- obsolete の根拠 (merge commit hash、close 日時) を提示
- 作業を停止し、ユーザーに「このタスクは既に完了しています」と報告
- ユーザーの承認なしに cleanup (close / revert 等) を実行しない
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 5d ago First seen · 127 lines · 36 tokens per session scan A 468c1f32061f
preflight is a command published in the GitHub repository s977043/river-review (3 stars, last pushed today), licensed MIT. It adds 36 tokens to every session and 1,584 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.
Other commands, from other repositories
adversarial-review
Run an adversarial Gemini code review that challenges the implementation approach and design choices.
logic-fix-all
Autonomous audit-and-fix — after consent, scan the target, fix every logic issue found (all severities), verify each fix, and report anything unresolved.
logic-diff
Check two code versions for semantic equivalence — use after a refactor or rewrite.
logic-explain
Trace execution step by step — use when code behavior is surprising or confusing.
logic-health
Sweep a whole codebase or directory for logic correctness — use before a release or to identify risk hotspots.
logic-review
Review code for logic bugs — use when you suspect something is wrong but have no failing test yet.