routine-init
Skill2 starsChanged 2 months agoMITView on GitHub
Use when the friend wants to declare a pre-declared routine/loop — a scheduled or triggered automation that runs unattended. Documents the v3 routine-spec schema (Task 6.3): every routine must declare its schedule, exit criterion, failure handler, AND a capability/path allowlist bounding WHAT it may touch, not just when it runs. Triggers on the /ren:routine-init slash command.
In this repository19 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- backupSkill
- bootstrap-projectSkill
- code-mapSkill
- distillSkill
- doctorSkill
- ingest-projectSkill
- installSkill
- interviewSkill
- metric-watchSkill
- pinSkill
- recallSkill
- rememberSkill
- retrospectiveSkill
- suggestionsSkill
- updateSkill
- wiki-healthSkill
- wiki-migrationSkill
- wrapSkill
The file
We split this skill into the rules it gives an agent
1 rule. About 0 are common, 0 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 74
Call importlib.import_module("skills.routine-init.lib").validate_routine_spec(spec, migrated=False).
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
routine-init
The declaration side of spec §3.5's routine model: a routine's declaration must bound what it may touch, not just when it runs. This skill's lib doesn't scaffold a repo (see "Scope" below) — it validates the v3 routine-spec schema and provides the runtime allowlist check every routine calls before proposing a write.
The v3 schema (REQUIRED fields)
schema_version: 3
allowlist:
paths: ["projects/myproj/**"] # wiki-relative globs the routine may propose writes to
capabilities: ["recall", "queue-propose"] # named capabilities it may invoke
failure_handler: "notify-journal" # the ONLY valid value in 0.2
exit_criterion: "<non-empty string>" # human-readable, requiredallowlist.pathsmust be non-empty for a NEW spec. A routine that may touch anything is invalid BY SCHEMA — there is no "allow everything" escape hatch. (A migrated v2→v3 spec is the one exception: it may start with emptypathsuntil a human fills it in — seemigrations/routine-spec-2-to-3/README.md.)allowlist.pathsmust never includeglobal/orglobal/**. Routines can never write to the global tier — enforced here at declaration time, and independently again at apply time bylib.governance.tiers.tier_of(Task 6.1): a routinememory_writeto aglobal/page is alwaysdiff_approved, neverauto.failure_handlerhas exactly one valid value:"notify-journal". Spec §3.5: "failure = notify + journal." There is no free-text failure-handler mechanism in 0.2 (donor's pre-0.2 free-text handlers, e.g. "email me@x via Resend MCP", described a mechanism 0.2 doesn't implement — see the 2-to-3 migration's overwrite behavior).exit_criterionis required and must be non-empty. A routine with no declared stopping condition isn't bounded, regardless of what its allowlist says.
When to use this skill
- Friend invokes
/ren:routine-initto declare a new scheduled/triggered automation - Friend or
/ren:doctorneeds to validate an existing routine-spec page against the current schema
When NOT to use this skill
- The routine already exists and just needs its metrics watched →
/ren:metric-watch(sibling skill, reads routine-adjacent signals, doesn't touch routine-spec pages) - Migrating an existing v2 spec to v3 → run
migrations/routine-spec-2-to-3/migrate.shdirectly (or via whatever migration-runner eventually wraps it); this skill validates, it doesn't migrate
Behavior
- Collect the routine's declared fields (schedule, exit criterion, failure handler — fixed to
"notify-journal", allowlist paths/capabilities) from the friend. - Call
importlib.import_module("skills.routine-init.lib").validate_routine_spec(spec, migrated=False). Any error blocks the declaration; warnings (there are none for a NEW spec — those only apply tomigrated=True) are informational. - Once valid, the routine-spec page is written (page-writing itself is outside this module's scope — see below).
- At runtime, whenever the routine is about to
lib.memory.queue.proposea write, it callsimportlib.import_module("skills.routine-init.lib").check_proposal_against_allowlist(routine_spec, proposal)FIRST. AFalseresult means the routine must not propose that write — the allowlist is checked before the queue's own producer/writer validation, not instead of it.
Scope note (what this skill's lib does NOT do)
Donor's skills/routine-init/lib/__init__.py scaffolds an entire lean per-routine repo (CLAUDE.md, ROUTINE_PROMPT.md, state.md, run-log.md) from templates, plus writes the routine-spec wiki page itself. That repo-scaffolding machinery (ADR-034 "cadence-as-glue") is a separate, larger surface this task's brief and test list don't touch — Task 6.3 is specifically about the v3 schema fields and allowlist enforcement. lib/__init__.py here is deliberately narrow: schema validation + the runtime allowlist check, nothing else. Scaffolding a full routine repo (if/when RenOS needs it) is future work layered on top of this validation, not part of it.
Failure-degradation modes
| Failure | Behavior | User-visible |
| No allowlist declared | validate_routine_spec returns an error | "allowlist is required..." |
allowlist.paths includes global/** | Validation error, regardless of other fields | "...touches global/ — routines can never write global" |
failure_handler set to anything but notify-journal | Validation error | "failure_handler must be one of ('notify-journal',)..." |
Empty exit_criterion | Validation error | "exit_criterion is required..." |
| A routine proposes outside its allowlist | check_proposal_against_allowlist returns False; the routine must not call queue.propose | (caller's responsibility to surface this — this function only answers yes/no) |
References
- Task 6.1 (
lib/governance/tiers.py) — the apply-time enforcement this schema's declaration-time checks complement migrations/routine-spec-2-to-3/— the v2→v3 migration, including the failure_handler overwrite rationale- Spec §3.5 — the routine-declaration model this schema implements
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.

