/rootnode-governance:mode-routerfrom root.node Governance
Selects the active profile from triggering context by evaluating a rule set against inputs (time, calendar, geofence, manual commands, custom signals). Configuration-driven with deterministic precedence. Use when an orchestrator needs automatic profile selection.
Ships in root.node Governance. 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.
Read when SKILL.md points to them.
Calibration: Tier 1 (Model-compatible) — runs cleanly on the current dual-primary tier (Opus 5.5, Sonnet 5.5), on Fable 5.2, and on Haiku 5.5. Structured retrieval, rule evaluation, or template lookup — output shape does not depend on the model. Fallback-graceful on Opus 5 / Sonnet 5; legacy-graceful on Sonnet 4.6. See repository README for model compatibility.
Selects the active profile from triggering context. The piece that ties everything together: gates apply profiles, gates need to know which profile is active, the router decides.
The premise: profile selection is a routing problem with deterministic precedence, not a reasoning problem. Operational modes (e.g., active-supervision, mobile-only HITL, unattended) have well-defined boundaries — calendar entries, time windows, geofences, manual override commands — that a rule engine can evaluate without an LLM. The router applies those rules and returns a profile name. No interpretation, no judgment calls.
This Skill is the rootnode runtime layer's analog to a "context dispatcher" — the orchestrator's first call when work arrives, before the gates fire. Without it, every gate invocation requires the caller to specify which profile applies. With it, the orchestrator picks a profile based on what the world looks like at that moment.
Configuration-driven, not hardcoded. The Skill itself contains no user-specific rules. The rule set lives in a router config file (validated against the included schema). An example router config (configs/example-router.json) ships as a working reference; users author their own.
Deterministic precedence. Manual override always wins over time-based rules. Time-based rules apply in a documented priority order. Default profile is the fallback when no rule matches. The Skill never picks "the most plausible profile" — it follows the rules in order.
Required default profile. Every router config must specify a default. This guarantees the router always returns a valid profile name. Halt-with-error on no-match is forbidden — autonomous orchestrators cannot recover from a routing failure.
The router doesn't validate that the returned profile exists. Profile existence is the consuming Skill's concern (the gate checks its own profile directory). The router returns a name; the consumer either has it or surfaces "profile not found." Single Responsibility Principle.
Time-zone awareness is the caller's responsibility. The router accepts a current-time input as ISO-8601 with timezone offset. The caller (UCIS, OpenClaw, etc.) is responsible for passing the right timezone. The router doesn't infer location.
The router supports five trigger source types. A router config can use any combination. Per-type configuration semantics, supported predicates, evaluation behavior, edge cases, and worked examples are in references/trigger-types-detailed.md.
A user-provided profile name that wins over all other rules. Source: Telegram command, Apple Shortcut, CLI flag. Has a TTL; after expiry, rules-based routing resumes. Always evaluated first.
The router evaluates the user's calendar at decision time. Supports three predicates: event_in_progress(category), event_starts_within(category, minutes), no_events_for(minutes). The router doesn't fetch calendar data — the caller provides active_calendar_events in context.
Day-of-week + time-of-day windows. Configurable time zone per rule. Supports wrapping windows (start_time > end_time, e.g., 22:00-06:00). Inclusive of start, exclusive of end.
Caller-supplied geofence state as a label (e.g., at_office, at_home, in_transit). The router doesn't compute geofences — it accepts a label. Match is exact string equality.
User-defined named signals passed by the caller (battery level, network state, "do not disturb" toggle, etc.). Match types include equals, not_equals, truthy, falsy. The escape hatch for triggers the schema doesn't anticipate.
Multiple trigger conditions combined with AND, OR, or NOT logic. The most common trigger structure in well-designed router configs — express real intent ("weekdays during work hours AND at the office") rather than single-axis conditions. Full semantics including evaluation order, short-circuiting behavior, nesting, common patterns, and anti-patterns are in references/compound-trigger-semantics.md.
When invoked:
Step 1 — Receive inputs. The Skill expects:
router_config: A router config object conforming to the schema. Specifies rules, default profile, manual override state.context: Current state — current time, calendar state, geofence label, custom signals. Caller is responsible for providing accurate context.Optional:
verbose: When true, return the full rule evaluation trace in the output. Default false (just the verdict).Step 2 — Check manual override. If router_config.manual_override is set AND the override's TTL has not expired, return the override's profile name immediately. Skip rule evaluation.
Step 3 — Evaluate rules in order. Walk the rule list in declared priority order (lowest priority number first). For each rule:
contextprofile nameStep 4 — Fall back to default. If no rule matched, return router_config.default_profile.
Step 5 — Generate verdict. Produce structured JSON output (see Output Format below). Include the selected profile, the trigger that matched (or default_fallback), and optionally the full evaluation trace.
Step 6 — Return. Output the JSON. The consuming Skill (handoff-trigger-check, critic-gate, etc.) reads selected_profile and proceeds.
{
"selected_profile": "balanced",
"matched_trigger": {
"type": "time_window",
"rule_id": "weekday-work-hours",
"description": "Weekdays 9-5 → day-job profile"
},
"context_snapshot": {
"current_time": "2026-05-01T14:30:00-07:00",
"geofence": "at_office",
"active_calendar_events": [],
"manual_override": null
},
"router_config_version": "1.0.0",
"evaluated_at": "2026-05-01T14:30:00-07:00",
"evaluation_trace": []
}
When manual override is active:
{
"selected_profile": "lenient",
"matched_trigger": {
"type": "manual_override",
"set_at": "2026-05-01T14:00:00-07:00",
"expires_at": "2026-05-01T15:00:00-07:00",
"set_by": "telegram_command"
},
"context_snapshot": { "...": "..." }
}
When fallback to default:
{
"selected_profile": "lenient",
"matched_trigger": {
"type": "default_fallback",
"reason": "no rules matched"
},
"context_snapshot": { "...": "..." }
}
When verbose: true, evaluation_trace contains an entry for each rule evaluated:
"evaluation_trace": [
{
"rule_id": "sleeping-window",
"evaluated": true,
"matched": false,
"reason": "current_time 14:30 is outside sleeping window (22:00-06:00)"
},
{
"rule_id": "weekday-work-hours",
"evaluated": true,
"matched": true,
"reason": "current_time 14:30 falls in weekday window (Mon-Fri 09:00-17:00) AND geofence is at_office"
}
]
Three worked examples — standard weekday afternoon at office (compound trigger match), Saturday morning with manual override (override pre-empts rules), and late evening with no rule match (default fallback) — are in references/trigger-types-detailed.md (in the "Worked Examples" section). A pre-existing routing walkthrough is also in examples/routing-walkthrough.md.
The router config conforms to schema/router-config.schema.json. Minimum structure:
{
"schema_version": "1.0.0",
"name": "example-router",
"description": "Example routing rules for three operational modes (lenient/balanced/strict)",
"default_profile": "lenient",
"rules": [
{
"rule_id": "sleeping-window",
"priority": 1,
"trigger": {
"type": "time_window",
"time_zone": "America/Phoenix",
"days_of_week": ["all"],
"start_time": "22:00",
"end_time": "06:00"
},
"profile": "strict"
},
{
"rule_id": "weekday-work-hours",
"priority": 2,
"trigger": {
"type": "compound",
"logic": "AND",
"conditions": [
{ "type": "time_window", "days_of_week": ["mon","tue","wed","thu","fri"], "start_time": "09:00", "end_time": "17:00" },
{ "type": "geofence", "location": "at_office" }
]
},
"profile": "balanced"
}
],
"manual_override": null
}
A starter router config (configs/example-router.json) ships as a working example. Authoring custom router configs uses profile-builder (if available), which supports the router-config schema in addition to gate-profile schemas — or hand-edit JSON against schema/router-config.schema.json.
Use this Skill when:
Do NOT use this Skill when:
Common failure modes and resolution guidance — covering match failure issues (default returned when rule should match, multiple-rule-match priority, profile-doesn't-exist), manual override issues (doesn't expire, doesn't take effect, stacking), time zone and calendar issues (timezone offset, DST transitions, calendar predicate evaluation), schema validation issues (config validation failures, custom signal naming), and rule-set design issues (decision feels wrong, rule set growing unmanageable) — are in references/troubleshooting.md. Consult that file when routing decisions don't match expectations.
configs/example-router.json (opens in a new tab)examples/routing-walkthrough.md (opens in a new tab)references/compound-trigger-semantics.md (opens in a new tab)references/trigger-types-detailed.md (opens in a new tab)references/troubleshooting.md (opens in a new tab)schema/router-config.schema.json (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub drayline/rootnode-skills --plugin rootnode-governance5 skills in this plugin
/critic-gateIndependent re-derivation gate for proposed changes during autonomous execution. Evaluates a change (code diff, config edit, engine evolution, schema change) against the work's authority matrix and a 4-check protocol: invariant compliance, scope authorization, detection narrowness, and regression risk. Returns structured JSON with pass/fail per check, an overall verdict (APPROVE / REQUEST_CHANGES / REJECT), and blockers. Profile-driven thresholds (strict for unattended runs, lenient for desk supervision). Use when an autonomous agent proposes an engine change, when reviewing a Claude Code-authored modification before merge, or when an unattended profile requires independent re-derivation. Trigger on: "review/approve this proposed change," "critic-gate this," "is this change safe," "is this safe to merge," "should I let this land," "run the critic." Do NOT use for handoff-readiness checks (use handoff-trigger-check), general code review, or design-time correctness. Authority matrix required./handoff-trigger-checkEvaluates whether work-in-design is ready to hand off from a chat design conversation to autonomous execution (Claude Code, n8n, agent runtime). Runs a 7-condition gate: spec stability, verification surface, invariants, pump-primer, work decomposition, rollback cost, token budget headroom. Three invocation modes — deliberate (caller provides work_context, returns JSON verdict), proactive sensing (Claude detects handoff signals in design conversation and offers the check), conversational walkthrough (Claude walks the 7 conditions as discussion topics). Returns structured JSON in all modes. Use when designing a Claude Code deployment, scoping an autonomous run, or deciding next move. Trigger on: "ready to hand off," "ready for execution," "is this CC-ready," "handoff check," "walk me through readiness," "are we ready to ship this," "should I just hand this off," or proactive detection. Do NOT use for evaluating completed work, runtime selection, or prompt quality. Profile-agnostic./profile-builderConversational profile builder. Produces validated JSON config files for any rootnode Skill that consumes profile-shaped configuration (handoff trigger check, mode router, critic gate, future Skills). Reads a target JSON Schema (draft-07), conducts a progressive-depth interview using plain-language questions, validates answers, and writes the resulting JSON to a destination path. Schema-agnostic — works with any profile schema conforming to draft-07. Use when a user needs to create, clone, or revise a profile and you do not want them hand-editing JSON. Trigger on: "build me a profile," "create a profile," "I need a profile for X," "set up my profile," "edit my profile," "clone the X profile," "walk me through making a profile." Do NOT use when the user already has a working profile and only wants to invoke the consuming Skill, when the schema cannot be located, or for non-profile JSON config work. Always validate before writing./session-handoffProduces structured markdown session continuation documents for multi-session workflows. Captures active work streams, decisions with rationale, knowledge-file deltas learned during the session, the exact files to load next conversation, ingested content, artifacts, and open items into an ingestion-optimized handoff. Carries pending KF updates and unresolved items forward across handoff chains so context never drops. Generates a closeout checklist and echoes the starter prompt to chat. Use when approaching context limits, wrapping up a session, or managing work across conversations. Trigger on: "create a handoff," "session closeout," "wrap up this session," "build session handoff," "BSH," "continue next session," "we're running out of context," "context is getting long." Do NOT use for Memory optimization, context budget analysis, project audits, deciding whether work is ready for autonomous/Claude Code execution (use handoff-trigger-check), or summaries with no continuation intent.Other plugins' skills for the same job