with one click
cadence-using-cadence
// Routing skill for Cadence — read at session start to detect or create a session and spawn the agent that owns the next unchecked section of session.md
// Routing skill for Cadence — read at session start to detect or create a session and spawn the agent that owns the next unchecked section of session.md
[HINT] Download the complete skill directory including SKILL.md and all related files
| name | cadence:using-cadence |
| description | Cadence workflow router — invoke when starting any feature, bugfix, or analysis task. |
Cadence drives every task through one per-session checklist file:
<project>/.claude/sessions/YYYY-MM-DD-<slug>/session.md## CheckList section groups every workflow item under ### <Sub-section> headings; each sub-section is owned by exactly one agent (or the main thread) and contains - [ ] items the owner ticks to - [x] as work completes. Body sections (## Clarification, ## Analysis, ## Plan, ## Review, ## Delivery, ## Answer) hold the structured content the agents fill in.session.md; only session.md is consulted by routing.Routing reduces to: read session.md, walk ## CheckList top-to-bottom, find the first ### <Sub-section> with any unchecked item, spawn that sub-section's owner.
Single source of truth for routing. The mapped sub-section lives under ## CheckList.
## CheckList sub-section | Owner |
|---|---|
### Clarification | clarify agent |
### Analysis | analyze-problem agent |
### Plan | plan agent |
### Implementation | implement agent |
### Review | review agent |
### Delivery | deliver agent |
### Answer | main thread |
Run on every user prompt — including natural-language requests, explicit /skill-name slash commands, and meta-questions about Cadence ("is Cadence active?"). Meta-questions always start the clarify agent (step 3) rather than answering inline. Skip only when the user explicitly opts out ("skip the workflow", "just answer"). When in doubt, run routing.
## CheckList in session.md top-to-bottom. Find the first ### <Sub-section> whose item list contains any - [ ]. Spawn its owner (see "How to Spawn"). If ### Answer, the main thread answers and ticks items. If every sub-section is ticked, ask the user via AskUserQuestion whether to start a new session; if yes, fall through to step 3.clarify when no session.md exists. It creates the session folder, writes a minimal session.md with a ticked ### Clarification under ## CheckList plus a filled ## Clarification body, and returns a session-type hint.After clarify returns for a brand-new session:
Before calling AskUserQuestion for session-type confirmation:
Check if the clarify handoff line contains delegate_to_skill: <skill-name>.
If it does:
AskUserQuestion — session type is trivial.<skill-name> from the handoff.bash "${CLAUDE_PLUGIN_ROOT:-$CURSOR_PLUGIN_ROOT}/templates/build-templates.sh" trivial "<session-folder>/session.md".### Clarification ticks and ## Clarification body (same as normal trivial path).### Answer checklist item in session.md, append a note: invoke \``.If the handoff does not contain delegate_to_skill, proceed with the normal session-type confirmation below.
AskUserQuestion (pre-select the agent's hint):
trivial — small change or factual question; ends after ### Answer is fully tickedfeature-dev — new behavior or doc work; full plan/implement/review/deliverbugfix — broken behavior; analysis runs before plananalysis — diagnostic; ends after ### Delivery is fully ticked## Clarification body that clarify just wrote. (The ### Clarification ticks are deterministic — clarify always ticks every item before returning — so they do not need to be captured.)build-templates.sh: bash "${CLAUDE_PLUGIN_ROOT:-$CURSOR_PLUGIN_ROOT}/templates/build-templates.sh" <type> "<session-folder>/session.md". This assembles the template from fragments and writes it directly to the session file. Use the script, not Write (Write guard rails reject filenames containing "analysis").Edit pass: tick every - [ ] item under ## CheckList → ### Clarification to - [x], and replace the template's ## Clarification body blanks with the captured filled body.Cadence is active. then spawn or answer. No other preamble.Agent tool. Always pass the session folder absolute path in the prompt.
When spawning the clarify agent for a brand-new session, also extract the installed skill list from the current session system-reminder block (the block that lists "Available skills" with descriptions). Include each skill's name and description in the spawn prompt under the key available_skills, formatted as:
Available skills (name → description):
- <skill-name>: <description>
...
NEEDS_CLARIFICATION:, run "Plan Rejection Recovery" below. Otherwise re-run routing.The plan agent emits 3 lines when the user rejects the plan for inadequate clarification:
NEEDS_CLARIFICATION: <gap>
User feedback: <verbatim>
Reuse session folder: <abs-path>
On detection:
Reuse session folder: from line 3 to get the absolute path.Cadence is active. then re-spawn.clarify via Agent with reuse_folder: <path> plus the gap and user feedback. Clarify overwrites ## Clarification in place.Honor "skip the workflow" or equivalent opt-outs.