watch
Skill4 starsChanged 4 months agoMITView on GitHub
File sentinel that monitors the working directory for changes and marker comments, then auto-triggers appropriate skills. Poll-based via git diff against the last scan commit. Writes intake items for batch processing and routes marker actions through /do. Use for automatic reactions to file changes; do NOT use for one-off inspection or tasks needing human judgment per file.
48 other projects use a version of this.
Adopted by
Most recently taken up by
- athina-ai/goose-skillstheir own version, first seen Nov 9, 2026
- chrisconviviera/conviviera-claude-plugintheir own version, first seen Nov 8, 2026
- Conviviera/conviviera-claude-plugintheir own version, first seen Nov 8, 2026
- blauwtje/exotheir own version, first seen Nov 8, 2026
- leolou0512/claude-skillstheir own version, first seen Nov 8, 2026
- inematds/claude-videotheir own version, first seen Nov 8, 2026
Used with
Projects with it also use ask, graphify and 1 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
dubwoahSkillask
Answer questions about the codebase without generating or modifying any code. Use when the user wants to understand how something works, find where something is defined, or explore the project structure. Invoked with /ask.
Also in 3 projects that use this
IgorGanapolskySkillgraphify
Query the local Graphify-Labs AST knowledge graph for ThumbGate architecture questions (what connects X to Y, explain a symbol, PreToolUse/gates/adapters). Slash: /graphify.
Also in 3 projects that use this
GoogleSkillgrilling
Grill the user relentlessly about a plan, decision, or idea. Use when the user wants to stress-test their thinking, or uses any 'grill' trigger phrases.
Also in 3 projects that use this
Other versions48 projects use a version of this.
Word for word · 1
- SethGammon/Citadel★ 927100% same
Edited · 0
None found.
Wrote their own version · 47
- bradautomates/claude-video★ 18ksame name
- athina-ai/goose-skills★ 1.3ksame name
- gooseworks-ai/goose-skills★ 1.3ksame name
- Mathews-Tom/armory★ 340same name
- diffusionstudio/skills★ 146same name
- hidai25/eval-view★ 140same name
- romarayt/raytsystem-public-os★ 140same name
- mathiaschu/watch★ 127same name
- INo-xious/stockbit-mcp★ 58same name
- bisque-cloud/presenter★ 40same name
37 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository50 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- architectSkill
- archonSkill
- ascii-diagramSkill
- autopilotSkill
- costSkill
- create-appSkill
- create-skillSkill
- daemonSkill
- dashboardSkill
- decision-mapSkill
- deploy-stewardSkill
- designSkill
- doc-genSkill
- doSkill
- evolveSkill
- experimentSkill
- fleetSkill
- grillSkill
- housecleanSkill
- improveSkill
- infra-auditSkill
- learnSkill
- live-previewSkill
- loopSkill
- mapSkill
- marshalSkill
- merge-reviewSkill
- organizeSkill
- postmortemSkill
- prdSkill
- pr-watchSkill
- qaSkill
- refactorSkill
- research-fleetSkill
- researchSkill
- reviewSkill
- scaffoldSkill
- scheduleSkill
- session-handoffSkill
- setupSkill
- systematic-debuggingSkill
- telemetrySkill
- test-genSkill
- triageSkill
- unharnessSkill
- verifySkill
- wikiSkill
- workspaceSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
26 rules. 0 are common, 9 are distinctive, and 17 are very specific to this project.
0
Common
Most of the 43 edited versions we read keep these.
9
Distinctive
This author's own choices. Worth a look.
17
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 29
Use when the user wants automatic reactions to file changes or marker comments (@citadel:).
- Distinctive: line 30
Do NOT use for one-off file inspection or tasks that need human judgment per file.
- Very specific: line 39
/watch startdoes NOT callCronCreateby default: Only pass --remote to use Anthropic's routine system, and only after explicit user … - Distinctive: line 45
Do Steps 1 and 2 below (check existing watch, determine baseline commit).
- Very specific: line 47
Write the state file (Step 4) with status: "watching".
- Very specific: line 61
Only when --remote is explicitly passed:
- Very specific: line 84
Read .planning/watch-state.json if it exists
- Very specific: line 85
If status is "watching":
- Distinctive: line 87
Ask: "A watch is already active.
- Very specific: line 88
If yes: run /watch stop first, then continue
- Distinctive: line 93
Run git rev-parse HEAD to get the current commit hash
- Very specific: line 94
If not a git repo: fall back to timestamp-based detection (store current time as lastScanTime, skip commit-based diffing)
- Very specific: line 143
Read .planning/watch-state.json.
- Very specific: line 145
Update state: "status": "stopped", "cronId": null.
- Very specific: line 159
If .planning/watch-state.json missing: "No watch configured.
- Very specific: line 161
If pendingActions non-empty, list each: [{action}] {file}:{line} -- {description}
- Very specific: line 170
If missing: create default state with lastScanCommit from git rev-parse HEAD and status: "watching".
- Very specific: line 183
If no files changed: update lastScanTime and stats.scansRun, exit early.
- Distinctive: line 187
Search changed files for:
- Very specific: line 248
Before writing, skip the item if the marker hash is already in processedMarkers, or if any existing .planning/intake/*.md carries a …
- Very specific: line 255
Update pendingActions and processedMarkers
- Very specific: line 283
.planning/missing: Create on first scan. - Distinctive: line 285
No files changed: Update stats, exit silently.
- Distinctive: line 286
Unknown action: Treat as intake item, preserve raw action.
- Distinctive: line 308
No duplicate intake items for the same file and classification
- Distinctive: line 309
No re-dispatched already-processed markers
“Common” is measured: kept by at least 6 in 10 of the 43 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
/watch -- File Sentinel
Use when the user wants automatic reactions to file changes or marker comments (@citadel:).
Do NOT use for one-off file inspection or tasks that need human judgment per file.
Orientation
Use when: running a file sentinel that triggers a skill or command automatically when watched paths change. Don't use when: monitoring CI status on a PR (use /pr-watch); running a one-shot verification check (use /verify).
Default execution path (READ FIRST)
/watch start does NOT call CronCreate by default. Only pass --remote
to use Anthropic's routine system, and only after explicit user confirmation.
CronCreate counts against the 15 routine runs / 24h cap — at the default
5-minute interval a watch exhausts the quota in under an hour.
Default flow — /watch start (no --remote flag)
- Do Steps 1 and 2 below (check existing watch, determine baseline commit).
- Skip Step 3 — do NOT call
CronCreate. LeavecronId: nullin state. - Write the state file (Step 4) with
status: "watching". - Output:
Watch state created: .planning/watch-state.json Baseline: {commit hash, first 7 chars} To start real-time watching, run in a separate terminal: npm run watch:local For cloud-persistent polling (machine off, user away): /watch start --remote (uses CronCreate, counts against 15/day cap)
Opt-in routine flow — /watch start --remote
Only when --remote is explicitly passed:
- Confirm: "This will use
CronCreate, which counts against your 15 routine runs / 24h quota. At a 5-minute interval this exhausts the quota in under an hour. Continue? (y/N)" - On confirmation, run the full Step 1–5 protocol including
CronCreate.
Commands
| Command | Behavior |
/watch start | Default: create state, prompt user to run npm run watch:local |
/watch start --remote | Use CronCreate polling (counts against 15/day quota — requires confirmation) |
/watch start --interval {N}m | Set poll interval for --remote mode (default: 5m) |
/watch stop | Stop watching, tear down cron |
/watch status | Show watch state, last scan time, pending actions |
/watch scan | Run a single scan now (manual trigger) |
Protocol
/watch start
Step 1: Check for existing watch
- Read
.planning/watch-state.jsonif it exists - If
statusis"watching":- Show current state: last scan time, interval, pending actions count
- Ask: "A watch is already active. Stop it and start a new one?"
- If yes: run
/watch stopfirst, then continue - If no: abort
Step 2: Determine baseline commit
- Run
git rev-parse HEADto get the current commit hash - If not a git repo: fall back to timestamp-based detection (store current
time as
lastScanTime, skip commit-based diffing) - Store this as
lastScanCommit
Step 3: Create poll schedule (--remote only)
CronCreate:
interval: "{N}m" (default: 5m)
command: "/watch scan"Save the cron ID in the state file.
Step 4: Write state file
Write .planning/watch-state.json:
{
"status": "watching",
"lastScanCommit": "abc1234",
"lastScanTime": null,
"interval": "5m",
"cronId": "{id from step 3 or null}",
"pendingActions": {},
"processedMarkers": {},
"stats": {
"scansRun": 0,
"markersFound": 0,
"intakeItemsCreated": 0,
"skillsDispatched": 0
}
}Step 5: Confirm (--remote only)
Watch started.
Interval: every {N}m
Baseline: {commit hash, first 7 chars}
State: .planning/watch-state.json/watch stop
- Read
.planning/watch-state.json. If missing or not"watching": "No watch is active." CronDelete: {cronId}— if cronId is missing or deletion fails, continue.- Update state:
"status": "stopped", "cronId": null. Preserve all other fields. - Output:
Watch stopped. Scans completed: {stats.scansRun} Markers found: {stats.markersFound} Intake items created: {stats.intakeItemsCreated} Skills dispatched: {stats.skillsDispatched}
/watch status
- If
.planning/watch-state.jsonmissing: "No watch configured. Use/watch startto begin." - Output state fields: status, lastScanTime, lastScanCommit, interval, pendingActions.length, stats.
- If
pendingActionsnon-empty, list each:[{action}] {file}:{line} -- {description}
/watch scan
Step 1: Load state
- Read
.planning/watch-state.json - If missing: create default state with
lastScanCommitfromgit rev-parse HEADandstatus: "watching".
Step 2: Detect changed files
Git mode (primary):
git diff --name-only {lastScanCommit} HEAD(committed changes)git diff --name-only(unstaged) andgit diff --name-only --cached(staged)- Merge and deduplicate all three lists
Fallback mode (no git):
find . -newer {timestamp_file} -type f- Exclude
node_modules/,.git/,.planning/,dist/,build/
If no files changed: update lastScanTime and stats.scansRun, exit early.
Step 3: Scan for marker comments
Search changed files for:
| Pattern | Languages |
// @citadel: {action} {description} | JS, TS, Go, Rust, C, Java |
# @citadel: {action} {description} | Python, Shell, YAML, Ruby |
/* @citadel: {action} {description} */ | CSS, multi-line C-style |
<!-- @citadel: {action} {description} --> | HTML, Markdown |
Action-to-skill mapping:
| Action | Skill |
review | /review |
test | /test-gen |
fix | /systematic-debugging |
document | /doc-gen |
refactor | /refactor |
todo | intake item |
Unknown actions become intake items with the action preserved as metadata.
Deduplication: Every marker gets a stable identity hash: sha256 over {file path}, {action}, and the normalized marker text (trimmed, internal whitespace collapsed), joined with NUL separators and truncated to 16 hex chars. Line numbers are excluded, so the hash survives line shifts. processedMarkers is a map keyed by this hash with {file, action, firstSeen, lastSeen}; pendingActions uses the same hash keys. Both maps are pruned past 500 entries by dropping the oldest lastSeen. Markers whose hash is already in processedMarkers are skipped.
Step 4: Classify unmarked changes
| File pattern | Auto-action |
*.test.*, *.spec.*, __tests__/* | Queue: "run tests" intake item |
*.md in docs/ or project root | Queue: "doc staleness check" intake item |
src/**/*.ts, src/**/*.tsx | Queue: "changed source" intake item |
package.json, tsconfig.json | Queue: "config change" intake item (high priority) |
Step 5: Dispatch markers
For each new marker:
/do {action} in {file} at line {line}: {description}- Log dispatch, add to
processedMarkers, incrementstats.skillsDispatched
Batch limit: Dispatch at most 5 per scan. Queue overflow in pendingActions.
Step 6: Write intake items
Filename: watch-{action}-{file slug}-{epoch ms}.md in .planning/intake/
---
title: "{action} {file}:{line}"
status: pending
priority: normal
target: {file path}
source: watch
marker_hash: {16-char marker hash}
---
Marker comment found at {file}:{line}:
`{raw marker line}`
{description, if any}Before writing, skip the item if the marker hash is already in processedMarkers, or if any existing .planning/intake/*.md carries a matching marker_hash in its frontmatter. Every new intake item records its marker_hash so future scans (and concurrent processes) can detect it.
Step 7: Update state
lastScanCommit:git rev-parse HEADlastScanTime: current ISO timestamp- Increment
stats.scansRun,stats.markersFound - Update
pendingActionsandprocessedMarkers
Step 8: Report
Manual scan:
Scan complete.
Files changed: {N}
Markers found: {new} ({total} total)
Actions dispatched: {N} (batch limit: 5)
Intake items: {N} written to .planning/intake/
Pending actions: {N}Cron poll: silent.
Integration Points
- Intake pipeline: Writes to
.planning/intake/for/autopilot. - Intent router: Routes markers through
/do— never invokes skills directly. - Daemon:
/daemoncan start a watch alongside a campaign.
Fringe Cases
.planning/ missing: Create on first scan.
Not a git repo: Fall back to timestamp detection; warn once.
No files changed: Update stats, exit silently.
Unknown action: Treat as intake item, preserve raw action.
Deleted file: Skip marker scanning; write intake item noting deletion.
Large diff (100+ files): Cap at 50 per scan, queue rest.
Binary files: Skip during marker scanning.
Corrupted state: Reset to defaults, preserve processedMarkers if readable.
CronCreate not available: Warn and suggest manual /watch scan.
Scan overlap: Scans serialize through a lock directory (.planning/watch-state.json.lock, acquired via atomic mkdir with ~10 retries at 100ms). Each scan records scanStartedAt and scanPid in state under the lock, and holds the lock across the state read-modify-write and intake writes. A scan that cannot acquire the lock and finds another scan started under 60 seconds ago logs a skip notice and exits cleanly. A lock older than 30 seconds (by mtime) is treated as stale and removed.
Marker removed: Stale processedMarkers entries age out via the 500-entry oldest-lastSeen prune.
Contextual Gates
Disclosure: "Starting file watch on [paths]. Triggers [skill] on change. Stop with Ctrl+C."
Reversibility: amber — runs sentinel that triggers other skills on file change; triggered skills may modify files; stop with Ctrl+C and run /watch stop
Trust gates:
- Any: start watch and view scan reports
- Familiar (5+ sessions): triggered skills run autonomously on file change; novices should use with caution and review dispatched actions
Quality Gates
- Scan completes in under 10 seconds for repos up to 100K lines
- No duplicate intake items for the same file and classification
- No re-dispatched already-processed markers
- Batch limit of 5 dispatches per scan enforced
- State file updated atomically at end of scan
- Works on Windows, macOS, Linux (Node.js fs + git CLI)
- CronCreate failure does not leave watch in inconsistent state
Exit Protocol
/watch start: Output confirmation block. No HANDOFF./watch stop: Output stop summary with lifetime stats./watch scan(manual): Output scan report with counts./watch scan(cron): Silent./watch status: Output current state.- On error: Clear message with fix. Never leave cron running if state is inconsistent.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

