--- name: security:watch description: Continuous security monitoring — runs diff on a recurring interval allowed-tools: Bash, Read, Skill model: sonnet --- # /security watch [path] [--interval 6h] Set up continuous security monitoring. Establishes a baseline, then runs `/security diff` on a recurring interval to detect regressions. ## Step 1: Parse Arguments Extract from `$ARGUMENTS`: - **path** — first non-flag argument (default `.`) - **--interval \** — loop interval like `6h`, `30m`, `1h` (default `6h`) ## Step 2: Establish Baseline Determine plugin root (parent of this `commands/` folder) and resolve the target path. ```bash node /scanners/scan-orchestrator.mjs "" --save-baseline ``` Parse stdout JSON. Display: ``` ## Security Watch: **Baseline established** at **Findings:** XC XH XM XL XI | **Risk Score:** X/100 | **Verdict:** ALLOW/WARNING/BLOCK Starting watch with interval: ``` If the verdict is BLOCK, add a warning: "Initial scan shows BLOCK verdict — you will be alerted to any new findings above this baseline." ## Step 3: Start Loop Use the **Skill** tool to invoke the built-in `/loop` skill: - skill: `loop` - args: ` /security diff ` This runs `/security diff ` every ``. Each diff compares against the latest baseline and saves a new one — a rolling window of changes. ## Step 4: Advisory After starting the loop, display: ``` **Watch active.** `/security diff ` runs every . To run as a system cron job instead: node /scanners/watch-cron.mjs To stop watching: Escape or Ctrl+C ```