agentleFS
ROCmROCm/rocprofiler-systems-skills/skills/watch/SKILL.md

watch

Skill5 starsChanged 17 days agoMITView on GitHub

Schedule a recurring poll of an external condition (PR merge, CI green, Jira state, background build) that runs a follow-up action when met and self-stops. Use for async waits across sessions.

  • Deletes or force-pushes
  • Commits and pushes

48 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use decision-map, map and 9 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.
  • Mathews-TomSkill

    decision-map

    Use when mapping unresolved architecture, policy, or scope decisions before planning, or working one decision ticket, including a prototype ticket whose throwaway evidence the prototype package builds. Also applies to "map the decisions", "decision map", and "wayfinder". Not for implementation slices of a known feature, milestone plans, general UI generation, standalone prototypes outside a decision map (use prototype), or adopting experimental code into production.

    Also in 3 projects that use this

  • AWSSkill

    map

    Map verified service capabilities against customer-provided control framework and threat model. Produces mapping-results.json, controls-catalog.md, and framework-mapping.md. Supports pluggable frameworks: CCMv4, NIST 800-53, CIS Benchmarks, ISO 27001, etc. Split into 4 focused sub-skills for better accuracy; this skill orchestrates them.

    Also in 3 projects that use this

  • javatarzSkill

    wiki

    Access and manage the local GitHub Wiki clone. Use this skill when you need to read wiki content (architecture, design docs, guides), update wiki documentation, check wiki status, or push wiki changes. The wiki contains high-level system design and architectural documentation.

    Also in 3 projects that use this

  • renatorozasSkill

    grill

    Adversarial code review. Don't let me ship until the changes pass your scrutiny.

    Also in 3 projects that use this

  • VercelSkill

    setup

    Set up Vercel CLI and project configuration. Use when the user says "set up Vercel", "configure Vercel", "link to Vercel", or "vercel init".

    Also in 7 projects that use this

  • IgorGanapolskySkill

    graphify

    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

The file

We split this skill into the rules it gives an agent

3 rules. 0 are common, 0 are distinctive, and 3 are very specific to this project.

  • 0

    Common

    Most of the 44 edited versions we read keep these.

  • 0

    Distinctive

    This author's own choices. Worth a look.

  • 3

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Use watch when the user wants to react to an async external event without sitting in front of the terminal:

    line 16
  2. Very specific:

    Avoid :00 and :30: every default cron in the world fires there.

    line 76
  3. Very specific:

    Every watch cron's prompt has the same shape:

    line 80

“Common” is measured: kept by at least 6 in 10 of the 44 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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Watch Skill

Schedule a recurring background poll of an external condition (PR merge, CI green, Jira state change, background build job). When the condition is met, run a follow-up action and stop polling automatically.

<IMPORTANT> The recurring prompt MUST call `CronDelete` with its own job ID after running the action. Otherwise the watch fires forever. The skill template below includes this step — do not skip it. </IMPORTANT>

When to Use

Use watch when the user wants to react to an async external event without sitting in front of the terminal:

  • "Watch PR #5334 — rebase decouple-gpu when it gets merged"
  • "Watch the CI run on this branch — ping me on green, summarize failures on red"
  • "Watch Jira AIPROFSYST-411 — when status changes to In Review, notify me"
  • "Watch the background build I just kicked off — when it finishes, run the test suite"

When NOT to Use

SituationUse InsteadWhy
Sleep within the current conversation, then continueScheduleWakeup toolCheaper, in-memory, no cron job
Fire once at a specific time, then stopCronCreate with recurring: falseSimpler, no condition logic needed
Run the same prompt every N minutes indefinitely/loop skillloop doesn't self-stop on a condition
Block the conversation until something completesUse Bash with run_in_background: true and read with TaskOutputStays in-conversation

Workflow

┌────────────────────────────────────────────────────────────┐
│ Phase 1: Clarify the watch                                 │
│   - What's the condition?                                  │
│   - What's the follow-up action?                           │
│   - How urgent is it (drives interval)?                    │
└────────────────────────────────────────────────────────────┘
                             │
                             ▼
┌────────────────────────────────────────────────────────────┐
│ Phase 2: Pick interval (see table below)                   │
└────────────────────────────────────────────────────────────┘
                             │
                             ▼
┌────────────────────────────────────────────────────────────┐
│ Phase 3: Build the recurring prompt                        │
│   1. Run check command                                     │
│   2. If condition met → run action + CronDelete            │
│   3. Else → exit silently                                  │
└────────────────────────────────────────────────────────────┘
                             │
                             ▼
┌────────────────────────────────────────────────────────────┐
│ Phase 4: Call CronCreate (durable: true by default)        │
└────────────────────────────────────────────────────────────┘
                             │
                             ▼
┌────────────────────────────────────────────────────────────┐
│ Phase 5: Report job ID + how to cancel back to user        │
└────────────────────────────────────────────────────────────┘

Phase 2: Picking the Interval

Condition typeIntervalCron expression
GitHub PR merge / mergeability5 min7 */1 * * * (no — every 5 min: */5 * * * * is fine, but pick an off minute like 3,8,13,18,23,28,33,38,43,48,53,58 * * * * if the user wants quiet polling)
GitHub CI conclusion (long matrix)5 min7-59/5 * * * *
Jira state change5 min7-59/5 * * * *
Local background build60–120 s*/2 * * * * (cron min granularity is 1 min — use shorter via ScheduleWakeup if it's still in the same session)
Idle "any change yet"15+ min13,28,43,58 * * * *

Avoid :00 and :30: every default cron in the world fires there. Pick an off minute (the CronCreate tool itself recommends this — it adds jitter, but the source minute matters more for upstream API quotas).

Phase 3: The Recurring Prompt — Self-Cleanup Pattern

Every watch cron's prompt has the same shape:

Check if <CONDITION>. Use <CHECK COMMAND>.

If the condition is MET:
  1. Run <ACTION>.
  2. Call CronDelete with id "<JOB_ID>" so this watch stops firing.
  3. Tell the user the watch fired and what happened.

If NOT met: do nothing visible, just exit.

The <JOB_ID> is filled in after CronCreate returns it. So either:

a. Call CronCreate first, get the ID, then immediately call CronCreate again with the ID-templated prompt — wasteful, two cron jobs. Don't.

b. Use CronList inside the recurring prompt to discover the job ID at fire time. The fired prompt itself doesn't know its own job ID, but it can find itself by matching the prompt text or schedule. Reliable.

c. Simplest: have the prompt itself include a unique tag in its text, then CronList | grep <tag> at fire time to find the matching job, then CronDelete it. Recommended pattern below.

Tag: watch-<short-uuid>

[check command]
[if met: action + find this cron via CronList tag and CronDelete it]
[if not met: exit]

Phase 4: CronCreate Call

Defaults:

  • durable: true — user expects a watch to survive Claude restarts.
  • recurring: true — keep firing until the condition is met (then the prompt deletes itself).

Override only when the user is clearly opting for short-lived (e.g., "just for this session").

Common Recipes

Watch a PR for merge → run a command

Tag: watch-pr-merge-5334

Check `gh pr view 5334 --repo ROCm/rocm-systems --json state,mergedAt -q '.state'`.

If output is "MERGED":
  1. Run: cd <worktree> && git fetch origin develop && git rebase origin/develop && git push --force-with-lease
  2. CronList → find job with tag "watch-pr-merge-5334" → CronDelete it
  3. Report: "PR #5334 merged at <mergedAt>; rebased and pushed."

If "OPEN" or anything else: exit silently.

Schedule: 7-59/5 * * * *, recurring: true, durable: true.

Watch CI for conclusion → summarize failures

Tag: watch-ci-5334

Check `gh pr checks 5334 --repo ROCm/rocm-systems --watch=false --json conclusion,name`.

If every check has a non-empty conclusion (no "" or null):
  1. If all SUCCESS: tell the user CI is green.
  2. If any FAILURE: invoke `git-pull-request-status` skill to summarize the failures in plain English.
  3. CronList → find job with tag "watch-ci-5334" → CronDelete it.

If any check is still pending: exit silently.

Schedule: 2-59/5 * * * *.

Watch a Jira issue for status change

Tag: watch-jira-AIPROFSYST-411-status

Check via mcp__mcp-atlassian__jira_get_issue with key "AIPROFSYST-411", fields "status".

If fields.status.name != "Open" (or != recorded baseline):
  1. Tell the user: "AIPROFSYST-411 moved to <new-status>".
  2. CronList → find job with tag "watch-jira-AIPROFSYST-411-status" → CronDelete it.

Else: exit silently.

Schedule: 4-59/5 * * * *.

Watch a background bash task → run follow-up

Tag: watch-build-bdexslltb

Use TaskOutput with task_id "bdexslltb", block: false.

If status == "completed" with exit_code 0:
  1. Run the test suite (or whatever the user asked for).
  2. CronList → find job with tag "watch-build-bdexslltb" → CronDelete it.

If status == "completed" with non-zero exit: report the failure and CronDelete.
If status == "running": exit silently.

Schedule: */2 * * * * (local build, 2-min granularity).

Phase 5: Report Back to User

After CronCreate returns:

Watching <CONDITION> every <INTERVAL>.
Job ID: <returned-id>
Tag: <unique-tag>
Will auto-stop when met. Cancel anytime with CronDelete or `/loop` controls.

Common Mistakes

MistakeFix
Forgetting CronDelete in the recurring promptThe watch fires forever. Always include the self-cleanup step.
Picking 0 */1 * * * for "every hour"Floods upstream APIs at the same instant as everyone else. Pick an off minute (e.g., 7 */1 * * *).
Setting durable: false for a multi-hour waitIf Claude restarts, the watch is lost. Default to durable for any cross-session wait.
Using watch for a one-shot reminderUse CronCreate with recurring: false instead.
Using watch to sleep within the current turnUse ScheduleWakeup instead — cheaper and stays in-conversation.
Reinventing PR-status logic in the check commandIf the watch is "PR is green / failing", invoke the git-pull-request-status skill from inside the action step.

Integration with Other Skills

After watch firesUse
CI failure detectedgit-pull-request-status to explain failures
PR merged, need to rebasegit (commit/rebase) skills
Jira moved to In ReviewOpen the appropriate planning or review skill
Background build doneverify-pmc-metrics or whatever the build was for

No Planning Required

watch itself is a one-step setup. Don't open planning-feature to plan a watch — just configure it and report the job ID.

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.