Feature: Guidance system
Overview
Guidance is how ai-mcp-brain stores how work should be done without baking process into MCP code.
Three vault layers:
| Layer | Authority | Typical content |
|---|---|---|
| Instructions | Binding | Hard process (“must / required / never”) |
| Suggestions | Soft | Standing prefs (“prefer / lean / try to”) |
| Workflows | Playbooks | Multi-step procedures and persona seats |
An action registry (actions/registry.md) maps modes such as coding, pr-review, commit, and git to instruction kinds (and optional workflows). Agents enter a mode once with resolve_action, get a bundle, and follow it.
Extend forever by editing vault markdown. No server change required.
How it works
Paths
- Global:
instructions/global/<kind>.md,suggestions/global/<kind>.md,workflows/global/<id>.md - Project: same under
projects/<slug>/… - Registry:
actions/registry.md(+ optionalprojects/<slug>/actions/registry.md)
Resolution
- Prefer
resolve_actionfor coding / PR / commit / git (and custom registered actions) - Else exact kind /
workflow_idviaresolve_guidance - Else intent synonym or search inside guidance trees
- Miss → say so; do not invent process
Project overlays
- Project notes precede global; when both exist, both may be returned — apply project first
- Project action registry merges with global (project refs first, then global extras)
Suggestions auto-pair
Registry lists instructions: and optional workflows:. Soft suggestion kinds mirror the instruction kinds on that action — there is no separate suggestions: field in v1.
Mode-start policy
Call resolve_action when entering a mode, switching mode, if this thread has no bundle yet, or on explicit reload. Reuse a same-action bundle already in the chat — do not re-call every turn. Skip tiny one-off edits.
Capabilities
- Vault-owned process that grows over time
- Mode bundles in one call
- Soft vs binding semantics enforced in policy and tool messaging
- Surgical upserts: append, replace section, remove section, full replace
- Auto-log soft standing prefs the same turn (no “remember this” required)
- Discovery via
list_actions/list_guidance - Personas as workflows (Orchesto seats), not action ids
How to use
Agent at mode start
resolve_action action=coding project=<git-slug>
Follow the bundle: instructions = must; suggestions = prefer. Empty instruction bodies are normal.
User states a soft preference
Prefer conventional commits from now on.
Agent same-turn: upsert_guidance with type=suggestion, kind=commit (ask scope if unclear).
User states a hard rule
Never skip typecheck before commit — add that as my coding rules.
→ type=instruction, kind=coding (only when they mean binding).
Extend with no code change
- Edit
actions/registry.md(YAML fence,schema: actions/v1) - Add instruction / suggestion / workflow notes
- Optionally add project overlays
- Next
resolve_actionpicks it up
See Extending guidance.
Edge cases
- Empty instructions are intentional — agents must not fill from vibes
- “Override” does not delete global; both expand, project first
- Suggestion-only kinds (e.g.
planning) do not appear inresolve_actionunless an action lists that kind — useresolve_guidance - Personas ≠ actions — no
orchestoaction id - Prefer section edit modes to fix bad appends; full
replacerewrites the whole note - Long notes may truncate in tool output — use
read_noteorpointers_onlywhen needed
Related
- Extending guidance
- Orchesto
- MCP tools
- Vault:
actions/,instructions/,suggestions/,workflows/