Skip to content
Agentmart
Submit a tool

sentinel

Use when code changes need structured quality + security review with false-positive filtering.

Skill by nishikawa

IndexedMIT
Write a review

Install

Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.

npx agentmarket install skill/elchika-inc-sentinel

Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.

Get the weekly diff

The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.

We use your email only for this newsletter. Privacy

About

Use when code changes need structured quality + security review with false-positive filtering. Takes a repo path and optional ref (GitHub PR number, git range, HEAD~N, or nothing for latest commit), reviews the diff with quality/security lenses, filters findings via 3-vote verification, and produces a findings report.

Use cases: documents, security

No reviews yet. Installed it? Reviews come from verified installers only. How reviews work

Permissions

What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.

Tools
No tools found
Secrets
None asked for
Install scripts
None found

Network hosts it talks to 1

  • codeload.github.com · found in install command

Files it touches

  • ~/.claude/skills/sentinel

What's inside

Skill name
sentinel
Description
Use when code changes need structured quality + security review with false-positive filtering. Takes a repo path and optional ref (GitHub PR number, git range, HEAD~N, or nothing for latest commit), reviews the diff with quality/security lenses, filters findings via 3-vote verification, and produces a findings report.
License
MIT
Metadata
tools: gh, git, node · author: nishikawa · description: ワンショットコードレビュー。PR・main ブランチのコミット・任意の git レンジを quality + security レンズで審査し、3票投票で偽陽性をフィルタリングする。PatrolState を使わず継続巡回の状態に影響しない。
Instructions
455 lines in SKILL.md · view on GitHub

Files (1)

  • SKILL.md

SKILL.md (first lines)

コードのワンショットレビューを実行する。PR だけでなく main ブランチのコミットや任意の git レンジにも使える。
PatrolState を使わず、指定した差分のみを審査する(継続巡回は `/patrol` を使うこと)。

## 実行モデル

レビューは推論の深さが結果を支配するため、**Opus** で実行する。この節がモデル指定の正本であり、
frontmatter の `model` / `effort` はこの節を Claude Code 上で自動適用するためのショートカットである。

- **オーケストレータ**: frontmatter の `model: opus` / `effort: high` で指定済み。
- **サブエージェント**: ステップ 5(quality)・ステップ 6(security)・ステップ 7(verify × 3)の
  すべてで `model: "opus"` を**明示指定**する。親からの継承に任せない——frontmatter の override は
  そのターンの残りしか効かず、ユーザーが途中で入力するとセッションのモデルへ戻り、
  発見と3票判定の質が実行ごとに変わる。
- ユーザーが明示的にモデルを指定した場合はそれに従う。
- サブエージェントのモデル指定を持たない環境(Codex 等。frontmatter の `model` も無視される)では
  既定モデルで実行してよい。

## 引数

`$ARGUMENTS` から取得する:

```
sentinel <repoPath> [prRef] [workDir]
```

- `repoPath`: レビュー対象リポジトリのパス(例: `~/projects/myapp`)
- `prRef`: 以下のいずれか。**省略時は `HEAD~1`(最新コミット1件)**
  - GitHub PR 番号(整数): `123`
  - git レンジ(SHA): `abc123..def456`
  - 相対参照: `HEAD~3`(HEAD~3..HEAD に展開)、`HEAD~3..HEAD~1` 等
- `workDir`: 省略時は自動生成(実行ごとに新規推奨。patrol の workDir とは別に保つこと)

---

## 実行フロー

### ステップ 1: 引数解析・workDir 準備

`$ARGUMENTS` を解析して `repoPath` / `prRef` / `workDir` を取得する。

**パス正規化(必須)**: `repoPath`・`workDir` はチルダ展開+絶対パス化した値に正規化する。
以降の全ステップ・全サブエージェントプロンプトの `<repoPath>` / `<workDir>` プレースホルダーには**正規化後の絶対パスのみ**を使用する。

`workDir` 省略時のデフォルト(patrol の workDir と衝突させないよう `-sentinel-` を含む):

```bash
REPO_NAME=$(basename "$(cd <repoPath> && pwd)")
WORK_DIR="${TMPDIR:-/tmp}/code-sentinel-sentinel-${REPO_NAME}-$(date +%Y%m%d)"
```

**workDir の指定有無に関わらず**、以下の準備を必ず実行する:

```bash
WORK_DIR=<workDir>
mkdir -p "$WORK_DIR"
chmod 700 "$WORK_DIR" || { echo "[error] chmod 700 失敗 — 他ユーザー所有の可能性"; exit 1; }
[ -O "$WORK_DIR" ] || { echo "[error] $WORK_DIR が他ユーザー所有"; exit 1; }
```

stale な前回成果物を削除(同一 workDir を再利用した場合の混入防止):

```bash
WORK_DIR=<workDir>
rm -f "$WORK_DIR/findings-quality.json" "$WORK_DIR/findings-security.json" \
      "$WORK_DIR/findings.json" "$WORK_DIR/votes.json" "$WORK_DIR/review-request.json"
```

### ステップ 2: base/head SHA を解決する

以下の優先順で `prRef` の形式を判定し、`BASE_SHA` と `HEAD_SHA` を確定する。

**① prRef が省略された場合(デフォルト: 最新コミット1件)**:

```bash
cd <repoPath>
BASE_SHA=$(git rev-parse HEAD~1)
HEAD_SHA=$(git rev-parse HEAD)
```

**② prRef が整数(GitHub PR 番号)の場合**:

```bash
cd <repoPath>
BASE_SHA=$(gh pr view <prRef> --json baseRefOid --jq '.baseRefOid')
HEAD_SHA=$(gh pr view <prRef> --json headRefOid --jq '.headRefOid')
```

**③ prRef が `..` を含まない参照(`HEAD~3` / `main` / SHA 等)の場合**:
head を指定参照、base をその1つ前(`<ref>^`)として展開する:

```bash
cd <repoPath>
BASE_SHA=$(git rev-parse <prRef>^)
HEAD_SHA=$(git rev-parse <prRef>)
# 例: HEAD~3 → BASE=HEAD~4、HEAD=HEAD~3
```

**④ prRef が `<base>..<head>` 形式の場合**:
`..` で分割して両辺を `git rev-parse` で解決する(SHA・相対参照どちらも可):

```bash
cd <repoPath>
BASE_SHA=$(git rev-parse <.. より前の部分>)
HEAD_SHA=$(git rev-parse <.. より後の部分>)
# 例: HEAD~3..HEAD~1、abc123..def456
```

**SHA 検証**(40桁の16進数でなければエラー終了):

```bash
echo "$BASE_SHA" | grep -qE '^[0-9a-f]{40}$' || { echo "[error] BASE_SHA が不正: $BASE_SHA"; exit 1; }
echo "$HEAD_SHA" | grep -qE '^[0-9a-f]{40}$' || { echo "[error] HEAD_SHA が不正: $HEAD_SHA"; exit 1; }
```

### ステップ 3: review-request.json を構築

git diff から変更ファイル一覧を取得し、各ファイルの内容(HEAD_SHA 時点)を読んで `review-request.json` を生成する。
**scope CLI は使用しない**(PatrolState 不要のため)。

From elchika-inc/agent-toolkit, MIT.

More from elchika-inc/agent-toolkit

Signals

Stars
0
Forks
0
Open issues
2
Last commit (this folder)
Aug 8, 2026 (2 months ago)

From GitHub (fetched Oct 24, 2026).

Details

License
MIT
First seen
Oct 24, 2026
Last checked
Oct 24, 2026

More from nishikawa

Cite this page

sentinel skill. Agent Mart. https://agentmart.dev/skills/elchika-inc-sentinel (last updated 2026-10-24)