nx/skills/plan-first/SKILL.md
Use when starting any retrieval task — the gate that tries plan_match first, executes via plan_run if a match clears the threshold, and falls through to /nx:query only on a miss
npx skillsauth add hellblazer/nexus plan-firstInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Gate skill. Every retrieval-shaped task starts here. The plan library exists so agents don't re-derive pipelines that have already been authored; this skill is the discipline that enforces it.
Before decomposing any retrieval task, call plan_match first. If a
match clears min_confidence, execute the returned plan via
plan_run. Only dispatch /nx:query when no plan matches.
plan_match(intent, dimensions={...}, min_confidence=0.40, n=1)
— match the caller's intent against the T1 plans__session
cache. Pin verb when known (via the caller's own verb skill),
leave dimensions={} when unknown.confidence >= 0.40 (or if the output
line shows confidence=fts5 — the FTS5 fallback sentinel that
plan_match renders when the in-session cosine cache is
unavailable; internally this is confidence=None on the Match
object):
description and dimensions to the caller
as a one-line summary.plan_run(plan_id=<match.id>, bindings='{...}').nx_answer(question=<intent>). The tool handles
decomposition internally; new plans are auto-saved via
plan_save so the next identical intent is a cache hit./nx:research): pin dimensions={verb: "research"}. Narrows the cosine pool to research plans; specificity
tiebreaks pick the best strategy variant.dimensions={verb: "review", domain: "security"}.
The curried strategy:security variant wins when available; falls
back to strategy:default otherwise.Every verb scenario template declares required_bindings. Pass them
via plan_run(match, bindings={...}):
research — concept (required), limit (optional)review — changed_paths (required), depth (optional)analyze — area, criterion (required), limit (optional)debug — failing_path, symptom (required)document — area (required), limit (optional)If plan_run raises PlanRunBindingError(missing=[...]), surface
the missing bindings to the user rather than guessing defaults.
/nx:query and save the
resulting plan via plan_save for future reuse.plan_run raised → surface the error verbatim; do not retry
with heuristic bindings.nx_answer enforces the plan-match-first gate at the MCP tool contract
level. Every caller — skill, agent, or script — that calls nx_answer
gets the discipline automatically: plan_match is the first step, and
only on a miss does the tool proceed to decomposition or fallback. This
means the preamble injection that previously lived in 10 agent files is
no longer necessary for correctness — nx_answer is the single
enforcement point. The SubagentStart hook injection (retrieval-agents.txt)
now targets only 2 agents (deep-analyst, deep-research-synthesizer) that
benefit from plan-reuse awareness during exploratory work.
plan_run result is a PlanResult with steps and final; read
final into the user-facing summary, not the raw step list.confidence=fts5. The FTS5 fallback sentinel (rendered
as confidence=fts5 in plan_match output; confidence=None on
the Python Match object) means "no cosine but keyword match
survived" — treat it as a pass, not
a miss. Only confidence < min_confidence (numeric) is a miss.docs/plan-authoring-guide.md — how to write a new plan when
nothing matches.docs/catalog-link-types.md — the link-type set the traverse
operator walks.docs/catalog-purposes.md — purpose aliases for common traversal
shapes.development
Use when critiquing / auditing / reviewing a change set against decision history — tries the review plan library first (catalog lookup → decision-evolution traversal → extract → compare), falls through to /nx:query if nothing matches
documentation
Use when doing design / architecture / planning work that walks from prose (RDRs, docs, knowledge) into the modules implementing a concept
development
Use when surveying the plan library's runtime metrics to propose plans for promotion to a higher scope — advisory-only; dispatches the plan-promote-propose meta-seed (no lifecycle ops — those ship in RDR-079)
business
Use when inspecting plan runtime metrics or enumerating dimension-registry usage — dispatches plan_match with dimensions={verb:plan-inspect}; strategy:default reports per-plan metrics, strategy:dimensions reports registry usage counts