architecture
Use when the user asks to improve architecture, find refactoring opportunities, surface deepening opportunities, consolidate tightly-coupled modules, or make a…
Use this skill when performing deterministic mode selection for session-start. Reads Phase A STATE.md recommendations + (future) learnings, sessions, backlog, bootstrap signals and returns {mode, rationale, confidence, alternatives}. Pure-function contract — no side effects, no
$ npx -y skills add Kanevry/session-orchestrator --skill mode-selector --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/mode-selectorContext preview
The summary Claude sees to decide when to auto-load this skill.
Use this skill when performing deterministic mode selection for session-start. Reads Phase A STATE.md recommendations + (future) learnings, sessions, backlog, bootstrap signals and returns {mode, rationale, confidence, alternatives}. Pure-function contract — no side effects, no
name: mode-selector
description: >
Use this skill when performing deterministic mode selection for session-start. Reads Phase A STATE.md
recommendations + (future) learnings, sessions, backlog, bootstrap signals
and returns {mode, rationale, confidence, alternatives}. Pure-function
contract — no side effects, no STATE.md writes. Phase B scaffold (issue #276);
full heuristic is follow-up sub-issues.
model: haiku
user-invocable: false
tags: [phase-b, autopilot, mode-selection, scaffold]Heuristic v1 active (issue #291, shipped 2026-04-25). Wired into session-start Phase 7.5 (issue #292, shipped 2026-04-25). Backlog signal source live (issue #293, shipped 2026-04-25): `signals.backlog` is populated by `scripts/lib/backlog-scan.mjs::scanBacklog`. Accuracy feedback loop live (issue #294, shipped 2026-04-25): `scripts/lib/mode-selector-accuracy.mjs::recordAccuracy` writes a `mode-selector-accuracy` learning after the user confirms/overrides the Phase 7.5 banner. Phase B contract is **closed**. Phase C (#277) `/autopilot` Loop Command is the next epic and owns its own PRD.
Mode-Selector centralizes the session-mode decision across all consumers: session-start Phase 1.5 banner, `/autopilot` (Phase C), and any future caller that needs a structured recommendation rather than ad-hoc heuristics inline at the call site. Before this skill existed, mode-picking logic was either implicit (user-typed free text) or embedded directly in session-start with no reuse path.
Phase A (`state-md.mjs::parseRecommendations`, issue #272) established the `recommended-mode` frontmatter field written by session-end Phase 3.7a. Phase B is the skill that reads that field (plus future signals) and returns a structured recommendation. The key output is a four-field tuple: `{mode, rationale, confidence, alternatives}`. `mode` is the recommended session type. `rationale` is a ≤120-char human-readable explanation. `confidence` is a float (0.0–1.0) indicating how strongly the selector commits to the recommendation. `alternatives` is an ordered list of `{mode, confidence}` objects representing the next-best choices, enabling callers to offer override options without re-running the selector.
The selector is a pure function: given the same `signals` object it always returns the same output. No file I/O, no network calls, no global state. This makes it trivially testable and safe to call from any skill without side-effect risk.
| Field | Type | Range / Values | Purpose | |---|---|---|---| | `mode` | string enum | `housekeeping` \| `feature` \| `deep` \| `discovery` \| `evolve` \| `plan-retro` | Recommended session type | | `rationale` | string | ≤120 chars | Human-readable explanation for the recommendation | | `confidence` | float | 0.0–1.0 | Selector commitment; see Fallback Behavior for threshold semantics | | `alternatives` | `{mode, confidence}[]` | 0–3 entries; may be empty, never null | Next-best modes with partial confidence scores |
`📊 Mode-Selector suggests:` when `confidence < 0.5` (informational, no pre-selection) or `📊 Mode-Selector recommends:` when `confidence >= 0.5` (pre-selects AUQ option 1). Eight graceful no-op conditions documented inline. Note: Phase 1.5 `📋` banner is NOT a Mode-Selector invocation — it reads Phase A STATE.md frontmatter directly via `parseRecommendations`; the Mode-Selector lives at Phase 7.5.
CARRYOVER, high-confidence path, conflicting-signals, stale-signals, alternatives generation, and defensive parsing. `mode-selector.mjs` coverage 100%/100%/100%/100%. Issue #291.
SPIRAL/FAILED/carryover-50% kill-switches pass. No user prompt in that path.
Module-level cache, glab/gh auto-detection, returns `null` on graceful-degradation paths.
Subject pattern `<recommended>-selected-vs-<chosen>`; agreement and override land at distinct subjects so the existing learning lifecycle can confirm/contradict them independently.
The v0 scaffold implements a minimal three-branch passthrough. It is intentionally thin so the contract is exercisable by tests before the full Phase B-1 rule-set lands.
selectMode(signals):
if signals is null/undefined:
→ {mode: 'feature', rationale: 'scaffold: null signals → default', confidence: 0.0, aGive your agents a working rhythm. You type three commands: /session reads your repository, your open issues and the last session, proposes what to work on, and waits for your correction.
Repo: Kanevry/session-orchestrator
Use when the user asks to improve architecture, find refactoring opportunities, surface deepening opportunities, consolidate tightly-coupled modules, or make a…
Use this skill when running an autonomous session-orchestration loop. Chains session-start → session-plan → wave-executor → session-end for N iterations with…
Use this skill when scaffolding the minimum repository structure required by session-orchestrator. Invoked automatically by the Bootstrap Gate when CLAUDE.md,…
Use when you have a feature idea but the scope or UX is still ambiguous — runs a lightweight Socratic design dialogue (3-5 AUQ rounds) and writes a spec…
Use when detecting drift between CLAUDE.md (or AGENTS.md, the Codex CLI alias) / _meta narrative and live repository state. Ten checks: absolute-path…
Monitor iterative improvement loops for convergence. Three signals — shrinking diff, pass-rate plateau, velocity — drive a Stop/Continue/Investigate decision…