Skip to content
Agentmart
Submit a tool

watch-sentinel

Use when open PRs need code-sentinel 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-watch-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 open PRs need code-sentinel quality+security review with false-positive filtering

Use cases: 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/watch-sentinel

What's inside

Skill name
watch-sentinel
Description
Use when open PRs need code-sentinel quality+security review with false-positive filtering
License
MIT
Metadata
dev: false · tools: gh, node · author: nishikawa · description: 未チェックの open PR を順番に取得し、code-sentinel(quality+security レンズ + 3票検証)でレビューして結果を PR にコメント、ラベルで状態管理するスキル。各 PR の実レビューは sentinel スキルに委譲する。 · sentinel_root: ~/projects/naoto24kawa/code-sentinel
Instructions
213 lines in SKILL.md · view on GitHub

Files (1)

  • SKILL.md

SKILL.md (first lines)

## 設定

`sentinel_root` に code-sentinel リポジトリ(ビルド済み)のパスを指定する。各 PR のレビューはこのリポジトリの CLI(`dist/cli/main.js`)と `sentinel` スキルを使う。

```yaml
sentinel_root: ~/projects/naoto24kawa/code-sentinel  # ビルド済みリポジトリのパス
```

## 概要

「未チェックの open PR を自動で code-sentinel レビューして進める」スキル。`watch:sentinel:checked` が付いていない open PR を番号昇順で処理し、quality/security の指摘(3票投票で偽陽性を除去済み)を PR にコメントしてラベルを更新する。

各 PR の実レビューは `sentinel` スキルに委譲する(このスキルは PR の Pick・コメント・ラベル管理という薄いラッパーに徹する)。

使わないとき: 特定の PR やコミットを手動でレビューしたい場合は直接 `sentinel` スキルを使う。

**このスキルはレビューのみを行う。コードの修正・Approve・マージはしない。**

## 呼び出し方

```
/watch-sentinel             # 未チェックの open PR を番号昇順で全件レビュー
/watch-sentinel max={N}     # 昇順ソート後、先頭 N 件まで処理
/watch-sentinel {N}         # PR #{N} を直接レビュー(ラベル状態に関わらず1件)
```

`/watch-sentinel max={N}` と `/watch-sentinel {N}` を同時指定した場合はエラーとして終了する。

継続運用したい場合は CC の `/loop` で上から駆動する(例: `/loop 30m /watch-sentinel`)。ループ機構はこのスキルでは定義しない。

## 前提

`sentinel_root` のリポジトリがビルド済みであること(`dist/cli/main.js` が存在する)。`sentinel` スキル(単発レビュー)が利用可能であること。

**このスキルは `gh pr checkout` を行わない。** sentinel は `git show <sha>:<path>` で PR の差分内容を読むため HEAD を切り替えない。したがって他の watch-* スキル等と同一 worktree で同時に実行しても作業を破壊しない。

---

## Workflow

### 前提: 引数解析・環境確認・ラベルの確保

**この前提節は呼び出しモードに関わらず常に最初に実行する**(直接指定モード `/watch-sentinel {N}` でもラベル未作成だと `--add-label` が失敗するため)。

まず引数を解析する。`max=N` と PR 番号 `{N}`(裸の数値)が両方指定された場合はエラーとして終了する。`max=N` は内部バッチループの上限、`{N}` は単一 PR 直接指定で、排他である。

`sentinel_root` を展開し、ビルド済み CLI の存在を確認する。`CODE_SENTINEL_ROOT` をエクスポートして sentinel の ingest に渡す。

```bash
SENTINEL_ROOT=$(eval echo <sentinel_root>)   # チルダ展開
if [ ! -f "$SENTINEL_ROOT/dist/cli/main.js" ]; then
  echo "[error] $SENTINEL_ROOT/dist/cli/main.js が見つかりません。code-sentinel をビルドしてください(cd $SENTINEL_ROOT && npm run build)"
  exit 1
fi
export CODE_SENTINEL_ROOT="$SENTINEL_ROOT"

REPO_PATH=$(git rev-parse --show-toplevel 2>/dev/null) \
  || { echo "[error] git リポジトリ内で実行してください"; exit 1; }
REPO_NAME=$(basename "$REPO_PATH")
```

状態遷移に使うラベルを冪等に確保する(存在しないラベルへの `--add-label` はエラーになるため)。

```bash
gh label create "watch:sentinel:active"  --color "e4e669" --description "watch-sentinel がレビュー中"       2>/dev/null || true
gh label create "watch:sentinel:checked" --color "0e8a16" --description "code-sentinel レビュー完了"        2>/dev/null || true
gh label create "watch:sentinel:warning" --color "e99695" --description "code-sentinel: 指摘あり(要確認)" 2>/dev/null || true
```

### Recovery(毎回 Pick の前に実行)

`watch:sentinel:active` が付いている PR が open のままなら、前セッションでの中断とみなしてリセットする。

```bash
gh pr list --label "watch:sentinel:active" --state open --json number \
  | jq '.[].number' | while read n; do
    gh pr edit "$n" --remove-label "watch:sentinel:active"
  done
```

### Pick(PR 番号を直接指定していない場合)

open PR のうち `watch:sentinel:checked` が付いていないものを番号昇順で取得する。`watch:sentinel:active` 付きはスキップ。`max=N` 指定があれば先頭 N 件に絞り、Workflow 全体をその件数分繰り返す(各ループで Pick → Review → Comment → Update を実行し、未チェック PR が0件になるか N 件に達したら終了する)。`max` 未指定なら全件処理する。

```bash
gh pr list --state open --json number,title,labels \
  --jq '[.[] | select(
    (.labels | map(.name) | contains(["watch:sentinel:checked"]) | not) and
    (.labels | map(.name) | contains(["watch:sentinel:active"])  | not)
  )] | sort_by(.number)'
```

対象 PR が0件なら「未チェックの open PR が見つかりません」と報告して終了する。

対象 PR の先頭1件を選択し、`watch:sentinel:active` を付ける。

```bash
gh pr edit {N} --add-label "watch:sentinel:active"
```

**直接指定モード (`/watch-sentinel {N}`)**: 前提節(環境確認・ラベル確保)と Recovery は通したうえで、Pick をスキップして PR #{N} をそのまま対象にする。ラベル状態に関わらず1件だけ処理する(`active` 付与 → Review → Comment → Update)。

### Review(sentinel スキルへ委譲)

> **sentinel スキルとの関係**: このステップのロール定義の正本は同リポの `sentinel` スキル(インストール先は `~/.agents/skills/sentinel/`)であり、watch-sentinel は sentinel スキルへの委譲を維持する。

PR ごとに専用の workDir を用意し、前回成果物が混ざらないよう作り直す(ledger は workDir 単位で蓄積するため、PR をまたいで再利用すると指摘が混在する)。

```bash
WORK_DIR="${TMPDIR:-/tmp}/code-sentinel-watch-${REPO_NAME}-pr{N}"
rm -rf "$WORK_DIR"

# fork PR でも git show が解決できるよう、PR head を HEAD 非切替で取得する(対象リポで実行)
git -C "$REPO_PATH" fetch origin "pull/{N}/head" --quiet 2>/dev/null || true
```

`sentinel` スキルを **Skill ツール**で起動する。`skill` は `sentinel`、`args` は `<repoPath> <prRef> <workDir>` の順(先頭にスキル名 `sentinel` を含めない)。具体値:

```

From elchika-inc/agent-toolkit, MIT.

More from elchika-inc/agent-toolkit

Signals

Stars
0
Forks
0
Open issues
2
Last commit (this folder)
Jul 16, 2026 (3 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

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