/yka-code:loop-patternsfrom yka-code
[yka-code] Recipes for `/loop`, `CronCreate`, and `ScheduleWakeup`. Activate when the user asks Claude to "keep checking", "poll", "run every N minutes", "wait until X", "babysit", "watch for", or describes a task that repeats on a cadence or needs to resume after a delay. Not a route for one-shot work — only for recurring/scheduled tasks.
Ships in yka-code. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Three Claude Code primitives for time-based work:
| Primitive | Shape | Use when |
|---|---|---|
/loop <interval> <prompt> | Fixed-interval recurrence (e.g. /loop 5m /check-prs). Same prompt re-fires until you stop it. | Cadence is known, prompt doesn't change. |
CronCreate tool | In-session recurring or one-shot schedule. CronList/CronDelete manage. Survives --resume / --continue. | "Remind me in 2h to check X"; session-scoped scheduled work. |
ScheduleWakeup tool | Self-paced wakeup. Claude picks delaySeconds ∈ [60, 3600] based on what it's waiting for. Only available during dynamic /loop (no interval given). | Model should judge the right cadence — e.g. waiting on a long build, poll-until-ready. |
Use-case: "watch PR #142 and merge it once CI passes and a reviewer approves."
/loop 3m Check PR #142 via `gh pr view 142 --json mergeable,statusCheckRollup,reviewDecision`. If mergeable=MERGEABLE AND all checks=SUCCESS AND reviewDecision=APPROVED, run `gh pr merge 142 --squash --delete-branch` and stop the loop. If any check=FAILURE, stop and report. Otherwise keep watching.
Stop conditions: merge succeeds, check fails, or user cancels. Cadence: 3m matches CI feedback cycle; slower wastes human time, faster burns tokens.
Use-case: kicked off a deploy, want Claude to confirm rollout before moving on.
/loop 60s Check `kubectl rollout status deployment/api -n prod --timeout=10s`. If status is "successfully rolled out", stop and report deployed commit SHA. If condition=Progressing and age>10m, alert and stop. If condition=Failed, roll back via `kubectl rollout undo deployment/api -n prod` and stop.
Cadence: 60s matches typical k8s reconcile loop — tighter than needed doesn't see new state.
Use-case: "every Monday morning run the simplify skill across src/ and open a PR if anything changed."
CronCreate({ schedule: "0 9 * * 1", prompt: "Run the simplify skill on src/. If any diffs result, create a branch chore/weekly-simplify-{date}, commit, push, open PR titled 'weekly refactor sweep'. If diff is empty, skip silently." })
Use CronCreate not /loop — this is a calendar schedule, not an interval. Session-scoped; re-add on next session.
Use-case: bun test takes 8 minutes; don't spam re-checks.
(Dynamic /loop — no interval given)
/loop Check `tail -n 20 .test-output.log`. If the log contains "Tests passed" or "FAIL", summarize the result and stop. Otherwise sleep and check again.
Dynamic mode enables ScheduleWakeup — Claude picks ~270s (stay in cache) or ~1200s+ (single-miss amortization) based on expected remaining run time.
(Dynamic /loop)
/loop Poll `gh pr view 87 --json mergeable,statusCheckRollup` on the upstream repo. When mergeable=MERGEABLE, open our downstream sync PR via `gh pr create --title "sync with upstream #87" ...` and stop.
Skill("test-driven-development"), not /loop./loop when CronCreate fits. Calendar schedules (0 9 * * 1) go in Cron; intervals (5m) go in /loop.delaySeconds for dynamic mode.CronCreate, remind the user that schedules are session-scoped — they must re-create on a new session or ask for a host-level cron.ci-hygiene — when the loop polls CI state.claude-mem:version-bump — when a loop waits for a release branch to settle.fix-bug — when a loop babysits a flaky test until it reproduces.What SKILL.md sets; muted values are Claude Code's defaults
20 skills in this plugin
/audit-rigor[yka-code] Discipline for audit, review, and technology-comparison tasks. Use when the request is "audit X", "review our stack", "is this the best option", "compare alternatives", "what should we swap / add / drop", or any task that produces prioritized recommendations rather than new code. Enforces a ≥70% confidence threshold, delegate-retrieval-to-subagent pattern, inline citations with ISO dates, MCP-first sourcing, and a fixed output format (SWAP / ADD / DROP / KEEP-BUT-UPGRADE / SURPRISE). Pair with research-first (retrieval discipline) and karpathy-guidelines (surgical scope). Chained from security-audit, onboard-codebase, and any /do route that smells like "is this the best we have"./ci-hygiene[yka-code] CI/CD and DevOps hygiene enforcer. Activates when editing GitHub Actions workflows, Dockerfiles, docker-compose, justfile, deploy scripts, or any CI configuration. Enforces pinned versions, proper Claude Code invocation in CI (--bare, API key not Max sub), secret management, and reproducibility. Fills the DevOps gap — no plugin covers this in the wild./coding-style[yka-code] Enforce minimalist, self-documenting, defensively-sane coding style. Use ALWAYS when writing, editing, or reviewing ANY code in ANY language — every function, every edit, every diff, no exceptions. Covers five rules: (1) no comments unless critical (WHY only, never WHAT, never history), (2) clean + optimized (no dead code, no speculative abstractions, no stale imports, delete over deprecate), (3) self-documenting names (full words, verbs for functions, nouns for data), (4) smallest surface (one function one concern, extract only on 3rd reuse, validate only at boundaries), (5) no dead defense (no try/catch for impossible cases, no fallbacks for inputs you control, let errors bubble to the right handler). Pair with karpathy-guidelines for behavioral principles (Think Before Coding, Simplicity First, Surgical Changes, Goal-Driven Execution)./do[yka-code] Front-door entry skill for ANY coding task. Use whenever the user asks to build, fix, refactor, review, audit, understand, or otherwise work on code. Classifies the request, applies karpathy-guidelines, routes to the right sub-workflow (ship-feature, fix-bug, refactor-safely, security-audit, onboard-codebase), and keeps the full toolkit (Anthropic-official plugins, MCPs, auto-installed LSPs, 17 custom skills, hooks) in-context. This is the skill to activate first on almost every coding turn./doc-hygiene[yka-code] Documentation discipline for README, CLAUDE.md, docs/, changelogs, design docs. Use when editing or generating any markdown/rst/asciidoc intended for humans or future AI sessions. Enforces brevity (<50 lines unless structurally required), no filler phrases, dated verification, and deletes rules that the code already demonstrates. Complements karpathy-guidelines (general principles) and claude-md-management:claude-md-improver (CLAUDE.md-specific audits)./evals-first[yka-code] Enforce eval-first discipline for LLM-touching code. Use when the task ships prompt text, skill logic, hook behavior, agent instructions, or any string a Claude Code session will read and act on. Writes a failing eval BEFORE the implementation. Red → Green loop using `claude -p` subprocess harness (Claude Max subscription, no Anthropic API key). Complements `test-driven-development` (which covers unit logic) with LLM-behavioral regression coverage.Other plugins' skills for the same job
Generated from the plugin's indexed repository (youssefkadaouiabbassi/yka-code) — no native marketplace selected
npx claudepluginhub p/youssefkadaouiabbassi-code-tools-setup