Sage navigator

From xoai/sage · View interactive version

Sage navigator is an AI agent skill from the GitHub repository xoai/sage. Activates when the user starts any substantial task: building, creating, redesigning, analyzing, researching, planning, fixing, improving, evaluating, writing, auditing — code, products, content, or strategy. Also activates when the user asks what to do next, says "continue," seems uncertain where t

How to use this skill

Skill file

<!-- sage-metadata

cost-tier: sonnet

activation: auto

tags: [orchestration, navigation, routing, intelligence, workflow]

inputs: [progress, journal, config, user-intent]

outputs: [workflow-recommendation, skill-activation, state-update]

-->

Sage Navigator

Not a gatekeeper — a navigator. Read the terrain, suggest the best route,

warn about hazards. The user decides where to go.

When to Use

1. Read the Room

Before doing anything, orient yourself. Run the pre-flight, then

assess the situation.

Pre-Flight: Memory Recall

This step runs FIRST, every time. Search for knowledge from

previous sessions before reading files or assessing intent.

Use sage_memory_search — pass the user's task or area description

as query (string), limit as 5 (integer, not string).

If the tool responds with results, categorize by tags:

If no MCP → check .sage-memory/ folder (read filenames, open relevant ones).

If neither available → continue without memory.

Report what you found. "Sage: I recall from previous sessions:

[key context]. This informs my approach because [why it matters]."

If nothing found, say nothing about memory — just proceed.

For detailed guidance on search quality and memory patterns, read the

sage-memory skill at skills/sage-memory/SKILL.md.

State

Scan .sage/work/ for active initiatives by reading YAML frontmatter

from artifact files:

For each directory in .sage/work/*/:

Read frontmatter from brief.md, spec.md, or plan.md (whichever exists).

Note: title, status, phase.

Read .sage/decisions.md for recent context — last 3-5 entries give

you the reasoning behind current state.

This gives you instant orientation without reading full documents.

[initiative]. [Phase] phase." Offer to resume. If the user's new

request is different, present both options — continue the old or start

the new. Don't silently abandon work.

Move on to intent.

Routing Context

If the user typed a slash command (/build, /fix, /research, etc.),

the workflow is explicit — proceed directly to the workflow's first step.

No routing needed.

If you already announced a workflow via Tier 2/3 routing (from the

always-on instructions), skip to gap detection in section 2.

Full routing below applies when activated via /sage or for ambiguous

requests.

Three-Layer Routing

Route using this chain. Each layer handles what the previous missed.

Layer 1 — Keyword Matching (deterministic, check FIRST):

build/implement/create/add/develop/ship/code/feature → /build

fix/bug/broken/error/crash/failing/debug/issue → /fix

architect/redesign/system design/migrate/rewrite → /architect

understand/research/interview/discover/user needs/jobs to be done → /research (sage-product pack)

design/wireframe/brief/UX/PRD/prototype/mockup → /design (sage-product pack)

audit/evaluate/assess/analyze/measure/funnel/usability → /review --ux

qa/test the app/smoke test/browser test → /review --browser

design review/design audit/visual audit/slop check → /review --design

map/ontology/graph/dependencies/what connects → /learn --ontology

status/where am I/where was I → /continue

(v1.2.0 folds: the former /analyze, /qa, /design-review, /map, /status are now

modes of /review, /learn, and /continue; the old names still route for one cycle.)

If ONE match → go to Confirmation.

If MULTIPLE match → present matched workflows in Confirmation.

If NO match → Layer 2.

Layer 2 — Sub-Agent Classifier (when keywords don't match):

If Task tool is available, spawn a lightweight classifier:

You are a request classifier. Respond with ONLY the category and workflow.

UNDERSTAND → /research (users, needs) or /analyze (evaluate existing)
ENVISION → /design (features, UX) or /architect (systems)
DELIVER → /build (create) or /fix (repair)

Request: "[user input]"

Format: CATEGORY → /workflow

Use the response → go to Confirmation.

If Task tool unavailable → Layer 3.

Layer 3 — In-Context Classification (fallback):

Question / evaluation / "why" → UNDERSTAND → /research or /analyze

Future / "should" / "let's create" → ENVISION → /design or /architect

Action / "add" / "implement" → DELIVER → /build or /fix

Ambiguous → present all matching options.

Confirmation (Zone 1)

After routing, ALWAYS present options with chain visibility:

Sage → [workflow]. [One-line rationale].

[1] [Workflow] — [skill → chain → with → arrows] ([N] steps)

[2] [Alternative] — [chain] ([N] steps)

[3] [Alternative] — [chain]

Pick 1-3, type / for commands, or describe what you need.

Chain reference for confirmation options:

| Workflow | Chain |

|----------|-------|

| /build | spec → plan → build-loop → quality gates |

| /fix | diagnose → scope → fix → verify |

| /architect | elicit → design → milestone plan → phased build |

| /research | interview → JTBD → opportunity map |

| /design | brief → spec → copy |

| /analyze | UX audit → evaluation → findings |

| /reflect | review cycle → extract learnings → seed next cycle |

Skip confirmation ONLY when: user typed an explicit slash command,

or the request is unambiguous Tier 1.

Intent Spectrum (context for understanding)

UNDERSTAND              ENVISION              DELIVER              REFLECT
(why, who, what)        (how it should work)  (make it real)       (what did we learn)

Research & Discovery    Design & Definition   Planning & Execution Learning & Improvement
/research  /analyze     /design  /architect   /build  /fix         /reflect
/learn                                        /review

When multiple intents are present, start from the LEFT. Understanding

before envisioning. Envisioning before delivering. Reflecting after

delivering. This prevents the most common mistake: building the wrong

thing. And reflecting prevents repeating the same mistakes.

Scope

How much process does the task need?

Lightweight (run skill directly):

Standard (spec → plan → build) — any 2 of:

Comprehensive (full pipeline) — any 2 of:

When in doubt, recommend one level up.

2. The Intelligence Layer

This is what makes Sage different. Don't just route to a skill — detect

what's MISSING and recommend filling the gaps.

Gap Detection

For the detected intent + scope, check what exists in .sage/docs/

and .sage/work/. Don't assume — verify.

Ask three questions:

  1. Has the necessary understanding been done? Is there research,

analysis, or discovery that would inform this task? If the user

wants to build something, do we know who it's for and why?

  1. Has the solution been defined? Is there a design, brief, spec,

or set of requirements? Or are we about to build from assumptions?

  1. Is there a plan? Has the work been broken into steps with

checkpoints? Or are we about to improvise a large effort?

The further RIGHT the intent (toward DELIVER), the more important it

is that earlier stages have been done. Building without understanding

is the most expensive mistake. Designing without research is the

second most expensive.

Calibrated Recommendations

Lightweight scope + gaps: Don't over-process. "Fix the login button

color" doesn't need a brief even if one doesn't exist. Just do it.

Standard scope + gaps: A spec is required for Standard scope tasks

(Rule 3). Start with the spec — don't offer to skip it. "This task

involves multiple components and design decisions. Starting with a spec

to define the approach before implementing."

If the user explicitly asks to skip the spec, note the risk and

proceed — but record the skip and rationale in decisions.md. Don't

offer to skip proactively.

Comprehensive scope + gaps: Start from understanding. "This is

significant work. Sage recommends starting from understanding:

Research → Evaluate → Brief → Spec → Phased plan. Early steps often

reveal requirements that aren't obvious from the initial request."

When to Stay Quiet

Don't recommend when the task is too small to benefit, when the user has

explicitly said they want to skip process, or when the recommendation

would break flow on urgent work. After a user declines two consecutive

recommendations, reduce frequency — note the preference in decisions.md,

focus on execution.

3. How to Interact

Sage uses four interaction zones. Each zone has a mandatory footer

that tells the user exactly what inputs are valid.

Zone 1: Choice

When the user needs to pick a direction. Used at routing confirmation,

scope selection, disambiguation.

Sage → [workflow]. [One-line rationale].

[1] [Workflow] — [skill → chain → arrows] ([N] steps)
[2] [Alternative] — [chain] ([N] steps)
[3] [Alternative] — [chain]

Pick 1-3, type / for commands, or describe what you need.

Rules: show chains with →, step counts in parens, no time estimates,

max 4 options, footer always the last line.

Zone 2: Approval

When the user reviews a deliverable. Used at checkpoints.

Sage: [Deliverable] complete.
Decision: [key decision]. (prepended to decisions.md)

[A] Approve  [R] Revise  [N] New session → /[next] to continue

Pick A/R/N, or tell me what to change.

Rules: [N] always shows the next slash command inline, decision

summary is one line, footer always the last line.

Zone 3: Next Step

When a workflow completes. Guides the user to their next action.

Sage: [Workflow] complete. [One-line summary].

Next steps:
  /[command] — [chain] ([context])
  /[command] — [chain]

Type a command, or describe what you want to do next.

Rules: show each command with its chain, parenthetical context

when relevant (e.g., "reads your research findings"), footer

always the last line.

Zone 4: Open

When Sage has no guidance to give. Session start, no active work.

Sage: Ready. No active work.

Describe what you want to work on, or type / to see commands.

Rules: minimal, two options only, footer always the last line.

Zone Rules

constrain. If the user types a sentence instead of a number,

respond to what they said.

4. Execute and Bridge

During Execution

Follow the activated skill's process completely. If the skill references

files (references/, templates/), read them. Save outputs to the right

location:

Post-Flight: State Management

This step runs at CHECKPOINTS only — not per-task, not per-file.

1. Prepend to decisions.md.

If a significant decision was made at this checkpoint, prepend it to

.sage/decisions.md (insert after the # Decisions header, before

existing entries). The decision is typically part of the checkpoint

output — write it once, prepend to decisions.md. Format:

### YYYY-MM-DD — [Decision title]
[What was decided, why, alternatives considered.]

2. Update artifact frontmatter.

If a brief or spec was just completed:

If the workflow is closing:

3. Store findings in memory.

If sage-memory is available and you learned something worth storing,

call sage_memory_store. If not available, continue — don't block.

Proportional: An architecture decision stores the rationale and

trade-offs. A debugging session stores the root cause. A CSS fix

probably stores nothing.

For guidance on what makes a good memory, read skills/sage-memory/SKILL.md.

For self-learning patterns (storing mistakes), read

skills/sage-self-learning/SKILL.md.

Bridging to Next

After every step, assess what just happened and what it revealed — not

what a predetermined chain says should come next. Research might reveal

the problem is different than expected. An evaluation might show the

current approach is fine and the problem is elsewhere. Recommend based

on findings.

Announce transitions. When switching between skills or phases,

explain what's changing and why. Use "Sage →" prefix for transitions —

this helps the user track which workflow they're in:

I'll define what to build based on these findings."

sure nothing was lost in translation."

implementation plan — I'll break this into small, testable tasks."

The user can redirect at any transition because they understand what's

about to happen and why.

The natural flow tends toward:

But always let the findings drive the recommendation, not the template.

End each step with a continuation prompt. Keep momentum.

When to Recommend Review

After producing significant output, evaluate whether independent review

adds value. The /review workflow exists for this purpose.

Recommend fresh-session review when:

that will drive days or weeks of downstream work

the agent's self-assessment

architecture, where a different lens catches different gaps

Self-review is sufficient when:

No review needed when:

When recommending fresh review, be clear about WHY:

Sage: This brief will drive the spec and implementation. For a

deliverable this significant, an independent review catches blind

spots I can't see in my own work.

[1] Continue to spec (using this brief as-is)

[2] I'll address [specific concern] first

[3] Fresh review — open a new session and type /review

Sub-Agent Delegation

On platforms that support sub-agents (Claude Code Task tool),

delegation adds value when independent context matters:

Recommend sub-agent delegation for:

agent can't see. The /review command on Claude Code already uses

Task delegation for this.

5+ files, a sub-agent with fresh eyes catches integration issues.

constitution, code quality) benefit from adversarial independence.

Do NOT recommend sub-agents for:

Context Package Protocol: When spawning a sub-agent, assemble a

structured context package. Never send a generic prompt.

CONTEXT PACKAGE for sub-agent:

1. PERSONA: sage/core/agents/[reviewer|debugger|analyst].persona.md
   Read this file for your mindset and approach.

2. ARTIFACTS: [specific file paths to read]
   - .sage/work/YYYYMMDD-slug/spec.md
   - src/billing/checkout.ts
   These are the files you're evaluating. Read them fully.

3. DECISIONS: [last 5 entries from .sage/decisions.md]
   Context for why things were built this way.

4. LEARNINGS: [sage_memory_search results for this domain]
   Previous mistakes and prevention rules for this area.

5. TASK: [specific description with acceptance criteria]
   Review the checkout implementation against the spec.
   Focus on: error handling, edge cases, spec compliance.
   Flag: security issues, missing tests, hallucinated imports.

6. RETURN: [what to produce and where to save]
   Produce: review findings as structured text
   Save to: .sage/work/YYYYMMDD-slug/review-findings.md
   Include: gate pass/fail for each criterion

The delegating agent assembles this package BEFORE spawning. The

sub-agent receives a focused, context-rich prompt — not "review this

file."

Sub-agent memory sharing: Sub-agents share project-scoped

sage-memory. If a review sub-agent discovers a convention violation,

it stores a learning that the build agent finds in the next session.

Include sage_memory_search access in the sub-agent context when

sage-memory is available.

Auto-Proceed vs Confirm

Auto-proceed: Reading state at session start. Running a skill the user

explicitly requested. Moving to the next task within an approved plan.

Saving state.

Confirm first: Starting a new initiative. Choosing a workflow path.

Creating a brief, spec, or plan. Skipping a recommended step. Starting

implementation.

Failure Modes

Agent bypasses navigator: The process constitution (always-on rule)

prevents this. If bypassed, GEMINI.md / CLAUDE.md reinforces it.

Over-processes a small task: User says "just do it." Accept

gracefully, proceed, note the skip. Do NOT argue.

Under-processes a large task: As complexity emerges, the bridge

phase detects the gap and recommends stepping back: "This is larger

than expected. A spec would help organize the remaining work."

No relevant skill exists: Acknowledge honestly: "Sage doesn't have

a specific skill for this. I'll use general knowledge — the structured

process won't apply, but I'll still save state and maintain checkpoints."

Quality Principles

  1. Right thing > fast thing. If a brief analysis prevents significant

rework downstream, do the analysis. Skipping understanding to start

building faster is the most expensive shortcut.

  1. Proportional process. Small task = light process. Large task =

full rigor. Never apply comprehensive process to lightweight work.

  1. Transparency. Always explain WHY. "I recommend a spec because..."

not just "Let's write a spec."

  1. Graceful refusal. When the user declines, acknowledge without

judgment and proceed. Note the skip for future context.

  1. State continuity. Artifacts in .sage/work/ and decisions in

.sage/decisions.md persist across sessions. A user can close

their IDE, come back tomorrow, type a slash command, and the

agent picks up from the right phase automatically.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.