diff --git a/.gitignore b/.gitignore
index 5a627d84..761ad209 100644
--- a/.gitignore
+++ b/.gitignore
@@ -2,7 +2,8 @@ close-bureau
.worktrees/
*.pyc
.serena/
-.vscode/
+.vscode/*
+!.vscode/settings.json
.npm-cache/
bureau.egg-info/
.coverage
diff --git a/.vscode/settings.json b/.vscode/settings.json
new file mode 100644
index 00000000..3d8cd419
--- /dev/null
+++ b/.vscode/settings.json
@@ -0,0 +1,5 @@
+{
+ // ensure VSCode extension picks up Mypy when the uv-installed Python interpreter
+ // (in bureau/.venv/) is selected in VSCode
+ "mypy-type-checker.importStrategy": "fromEnvironment"
+}
\ No newline at end of file
diff --git a/README.md b/README.md
index 166b85db..0b05bc45 100644
--- a/README.md
+++ b/README.md
@@ -19,9 +19,11 @@
- spawnable as **cross-CLI subagents** with *minimal* task delegation overhead
- usable in *every* supported CLI as both:
- - **isolated subagents**
+ - **isolated subagents**
- **interactive main agents**
+- **Built-in workflow skills** — structured, multi-step protocols (like [two-phase code assessment](protocols/context/static/skills/assess-mode/SKILL.md)) that agents activate automatically when they recognise a matching task
+
- A ***near-zero* learning curve** via:
1. **context injection** that ensures:
@@ -110,15 +112,16 @@ All agents automatically read these files at startup:
- Serves as an entrypoint to documentation progressively disclosing each MCP servers' tool capabilities
-- Guidance on automatically activating [skills](https://github.com/obra/superpowers/tree/main/skills) highly relevant and useful for key dev workflows/tasks *(provided by the [Superpowers plugin](https://github.com/obra/superpowers), currently **only for Claude Code or Codex**)*
+- **Custom Bureau skills**: structured workflow protocols (e.g. `bureau-assess-mode`) installed for all supported CLIs and activated automatically by matching prompts
+- **[Superpowers](https://github.com/obra/superpowers) skills** — community-maintained skill library *(currently Claude Code and Codex only)*
-Injected via these files (created in setup steps)
+Injected via these files
- `~/.claude/CLAUDE.md` (Claude Code)
- `~/.gemini/GEMINI.md` (Gemini CLI)
- `~/.codex/AGENTS.md` (Codex)
-with each of the 3 files above generated from templates (for portability regardless of repo clone location).
+with each of the 3 files above generated from [templates](protocols/context/templates/) and symlinked (for portability).
### Spec-driven development *(maintainer favourite)*
@@ -132,9 +135,44 @@ with each of the 3 files above generated from templates (for portability regardl
- can seamlessly handle on-the-fly updates, accordingly synchronize/adjust specs, plans, tasks, etc. in a cascading fashion
> [!TIP]
->
+>
> To get started fast, **read [Bureau's 5-minute guide to `spec-kit`](docs/USAGE.md#using-github-speckit-cli)**.
+### Workflow skills that actually help
+
+> *Structured, multi-step protocols that agents activate automatically when they recognise a matching task.*
+
+> [!NOTE]
+>
+> All skill names below appear in agent interfaces prefixed with `bureau-` (e.g. `assess-mode` → `bureau-assess-mode`).
+
+#### Skills installed by default
+
+| Skill | What it does |
+| :--- | :--- |
+| **[Assess mode](protocols/context/static/skills/assess-mode/SKILL.md)** | **Two-phase guided review**: first builds a mental model of changes (with 4 comprehension styles to choose from), then audits every file against [configurable quality standards](docs/CONFIGURATION.md#assess_mode). Interactive tour when used as a main agent; structured report when delegated to a subagent. |
+| **[Micro mode](protocols/context/static/skills/micro-mode/SKILL.md)** | **Step-gated editing with DAG-based planning:** offers maximum control over each atomic edit, with pause points after every change. |
+
+#### Additional skills available in the catalog
+
+The [`protocols/context/static/skills/`](protocols/context/static/skills/) directory ships several more skills that can be enabled on demand:
+
+| Skill | What it does |
+| :--- | :--- |
+| [Scrimmage mode](protocols/context/static/skills/scrimmage-mode/SKILL.md) | Systematic self-attack testing after every code change: generates attack vectors across 5 categories (input validation, state, failure modes, concurrency, security) and blocks progression until vulnerabilities are fixed. |
+| [Blast radius mode](protocols/context/static/skills/blast-radius-mode/SKILL.md) | Runs impact analysis before edits by enumerating callers, dependents, tests, and contracts affected, then classifying changes as *safe/needs review/breaking/blocked*. |
+| [Clearance mode](protocols/context/static/skills/clearance-mode/SKILL.md) | Rigorous completion verification that defines measurable "done" criteria upfront and blocks clearance until they're satisfied, with evidence. |
+| [Safeguard mode](protocols/context/static/skills/safeguard-mode/SKILL.md) | Defines system invariants (value constraints, state machines, relationships, ordering) that must never break and verifies them after all changes. |
+| [Prompt engineering](protocols/context/static/skills/prompt-engineering/SKILL.md) | Guided prompt creation and refinement for system prompts, agent instructions, skill definitions, or any LLM-facing text. |
+| [Shadow mode](protocols/context/static/skills/shadow-mode/SKILL.md) | Propose-only editing: the agent shows diffs without touching files, with the user applying changes manually. Ideal for learning, maximum transparency, or untrusted environments. |
+
+To enable any of these, add them to the `skills.enabled` [config setting](docs/CONFIGURATION.md#skills):
+
+```yaml
+skills:
+ enabled: [micro-mode, assess-mode, shadow-mode, scrimmage-mode]
+```
+
## Agent role usage patterns
### Spawning subagents
@@ -190,12 +228,12 @@ Use the built-in [primary agents mechanism](https://opencode.ai/docs/agents/#pri
| File | Purpose | Tracked? |
| :--- | :--- | :--- |
-| `charter.yml` | Fixed, rarely-changed system defaults | Yes |
-| `directives.yml` | Streamlined collection of user-oriented, often-tweaked settings | Yes |
+| `defaults.yml` | All git-tracked package defaults (ships with Bureau) | Yes |
+| `.bureau.yml` | Optional project-level config (discovered by CWD walk-up) | Yes (in *your* project) |
| **`local.yml`** | **Personal customizations/overrides** (gitignored) | **No** (gitignored) |
Configuration loads based on the following hierarchy *(later config sources override earlier ones)*: \
-**`charter.yml` → `directives.yml` → `local.yml` → environment variables**
+**`defaults.yml` → `.bureau.yml` → `local.yml` → environment variables**
See [`docs/CONFIGURATION.md`](docs/CONFIGURATION.md) for full reference.
@@ -203,7 +241,7 @@ See [`docs/CONFIGURATION.md`](docs/CONFIGURATION.md) for full reference.
```
bureau/
-├── bin/ # CLI entry points (open-bureau, close-bureau, check-prereqs)
+├── bin/ # CLI entry points (open-bureau, close-bureau, ensure-prereqs)
├── agents/ # Agent definitions and setup
├── protocols/ # Context/guidance files for agents
├── tools/ # MCP servers and their documentation
diff --git a/agents/README.md b/agents/README.md
deleted file mode 100644
index a33bc360..00000000
--- a/agents/README.md
+++ /dev/null
@@ -1,302 +0,0 @@
-# Agent-ready context/config files
-
-## Role prompts
-
-- **`role-prompts/`**: contains role prompts to be used for clink and OpenCode subagents
-
- - Body-only "delta" role prompts (no YAML)
- - 600–2,000 chars
-
-- **`claude-subagents`**: contains Claude Code subagent files
-
- - Generated (using script) to contain:
-
- - YAML frontmatter
- - Body is the agent template in `role-prompts/` for the same role
-
- - 1,200-5,000 chars
-
-### General role prompt pattern
-
-- **Role and scope**: 2-3 bullets about what this agent does + boundaries
-- **When to invoke checklist**: 3-6 triggers that should activate this role
-- **Approach/workflow**: 3-6 bullets
-- **Must-read files**: 4-5 max, see below
-- **Output format**: deliverable structure
-- **Constraints**: 3-6 bullets containing guardrails + handoff conditions
-
-## Linked files (in `reference/`)
-
-### Must-read (all roles)
-
-#### MCP quick decision tree (`tools-guide.md`)
-
-- 1,000-1,500 chars (~330 tokens)
-- Fast decision tree for MCPs available by use case (code search, web research, memory, etc.)
-- Tool selection hierarchy by category (code search, web research, memory, etc.)
-
- - Provides first-choice tool per category, with limits
-
-- "Tier 1" document
-
- - Links to per-category MCP decision guides ("tier 2") and per-MCP reference docs ("tier 3")
-
-#### Handoff guidelines (`handoff-guide.md`):
-
-**Guide for agents: when to delegate vs. when to ask the user for guidance**
-
- - When to use clink to spawn another CLI (cross-model orchestration)
-
- - This section will include a quick guide to model selection for each `clink` role prompt
-
- - When to use Task tool to spawn Claude Code subagents
- - When to stop and ask user (AskUserQuestion scenarios)
- - When to hand off between agents (e.g., research → planning → implementation)
- - What requires explicit approval (commits, deployments, deletions)
- - Decision matrix: `"If X, then delegate to Y agent with Z role"`
-
-> ### Integrating must-read files within role prompts
->
-> Reference must‑read files in role prompts *without* including their content.
->
-> #### Claude Code subagent frontmatter example:
->
-> ```markdown
-> ---
-> name: code-reviewer
-> description: Reviews code for quality, security, maintainability
-> tools: Read, Grep, Glob, Bash, mcp__semgrep
-> model: sonnet
-> ---
->
-> You are a senior code reviewer. Before starting, read these files:
-> - `protocols/context/static/tools-guide.md` – Tier 1 tool quick ref
-> - `protocols/context/static/style-guide.md` – Project coding standards
-> - `protocols/context/static/handoff-guide.md` – When to delegate
->
-> If you need detailed Semgrep usage, read:
-> - `protocols/context/static/tools/semgrep.md` – Tier 3 deep dive
->
-> [Rest of role prompt body...]
-> ```
->
-> #### `clink` role prompt example:
->
-> ```markdown
-> You are a research synthesis specialist.
->
-> At startup, read:
-> - protocols/context/static/tools-guide.md (tier 1: tool selection)
-> - protocols/context/static/handoff-guide.md (delegation rules)
->
-> When comparing web research tools, read:
-> - protocols/context/static/category/web-research.md (tier 2: Tavily vs Brave vs Fetch)
->
-> [Rest of role prompt body...]
-> ```
-
-### Must-read (for certain roles only)
-
-- **Style guides** (in `style-guides/`):
-
- - Code-specific: `code-style-guide.md` *(unused for now, rely instead on guides provided by repos themselves)*
- - Docs-specific: `docs-style-guide.md`
-
-### Read as needed (progressive disclosure)
-
-#### Per-category decision guides (read when exploring options)
-
-- **Location**: `reference/category/*.md`
-
-- **Size**: 3,500-5,000 characters each
-
-- **Categories**:
-
- - `web-research.md` - Tavily, Brave, Fetch (simple/medium tools)
- - `code-search.md` - Serena, Grep patterns (simple tools)
- - `memory.md` - Qdrant, Memory MCP, claude-mem (simple/medium tools)
- - `documentation.md` - Context7 (simple tool)
-
-- **Content (for each category)**:
-
- - Side-by-side comparison table (tool vs strengths vs use cases)
- - 2-3 examples per tool
- - Common parameters and patterns
- - When to escalate to tier 3 complex tools
-
-- **Read when**:
-
- - Need to compare alternatives within a category
- - Learning basic usage
- - "Tier 2"
-
-### Per-MCP deep dives (read on-demand for complex tools)
-
-- **Location**: `reference/deep-dives/*.md` (planned)
-- **Size**: 4,000-6,000 characters each
-- **Content per MCP**:
-
- - Detailed tool-by-tool breakdown
- - Advanced usage patterns and examples
- - Parameter reference tables
- - Common pitfalls and gotchas
-
-- **Read when**: deep understanding of an MCP being used is required ("tier 3")
-
-> ### Benefits of progressive disclosure for tool docs
->
-> | Benefit | Description |
-> | :------ | :---------- |
-> | Low startup cost | Tier 1 only costs ~330 tokens (every agent) |
-> | Progressive disclosure | Agents drill down only when needed |
-> | Comparison enabled | Tier 2 shows trade-offs between related tools in the same category |
-> | Depth available | Tier 3 provides comprehensive guidance for complex tools |
-> | Maintenance decoupled | Update complex tool docs without touching simple ones |
-> | Token efficient | Most tasks complete with tier 1 + tier 2 (~1,200-1,500 tokens total) |
-
-## Using with PAL's `clink`
-
-This repo's role bodies in `agents/role-prompts/` can be used as clink roles across any project. clink loads CLI client configs and role prompt files at startup.
-
-- Prereqs
- - Run PAL MCP with clink enabled (for example via this repo's setup script). Uses stdio transport.
- - Create user‑level CLI client configs under `~/.pal/cli_clients/*.json` (or point `CLI_CLIENTS_CONFIG_PATH` to your configs).
-
-- Config search precedence
- - Repo built‑ins: `conf/cli_clients`
- - `CLI_CLIENTS_CONFIG_PATH` (directory or single JSON)
- - User overrides: `~/.pal/cli_clients`
-
-- Map roles to these prompt files
- - Option A (absolute paths): point `prompt_path` at files in `agents/role-prompts/`.
- - Option B (symlink + relative): symlink this folder under `~/.pal/cli_clients/systemprompts/` and use a relative `prompt_path`.
-
-Example (`~/.pal/cli_clients/gemini.json`):
-
-```json
-{
- "name": "gemini",
- "command": "gemini",
- "additional_args": ["--yolo", "-o", "json"],
- "env": {},
- "roles": {
- "frontend": {
- "prompt_path": "/path/to/bureau/agents/role-prompts/frontend.md"
- },
- "testing": {
- "prompt_path": "/path/to/bureau/agents/role-prompts/testing.md"
- }
- }
-}
-```
-
-Or using a symlinked layout:
-
-```bash
-mkdir -p ~/.pal/cli_clients/systemprompts/clink
-ln -s "$PWD/bureau/agents/role-prompts" \
- ~/.pal/cli_clients/systemprompts/clink/for-use-prompts
-```
-
-```json
-{
- "name": "codex",
- "command": "codex",
- "additional_args": ["--json", "--dangerously-bypass-approvals-and-sandbox"],
- "roles": {
- "architecture_audit": {
- "prompt_path": "systemprompts/clink/for-use-prompts/architecture-audit.md"
- }
- }
-}
-```
-
-- Prompt resolution rules
- - Relative `prompt_path` resolves relative to the JSON's directory, then falls back to the PAL project root.
- - Absolute paths are used as‑is.
- - Role names are per‑CLI. If duplicate CLI `name` definitions exist across search paths, later ones override earlier.
-
-- Verify and use
- - Restart the PAL server to reload configs.
- - Invoke from your agent: `clink with gemini role=frontend to assess UI components in src/ui/`.
- - You can pass file paths as context, for example: `clink with codex role=architecture_audit on src/, services/auth/`.
- - If only one CLI is configured, clink can default to it and allow omitting `cli_name`.
- - Troubleshoot: bad paths raise "Prompt file not found: …". Check PAL server logs for details.
- - The clink tool schema enumerates available `cli_name` and `role` values: use it to confirm your roles are loaded.
- - The example JSONs include permissive flags (for example, Codex `--dangerously-bypass-approvals-and-sandbox`). Remove or adjust them for stricter guardrails.
-
-Tip: Keep role bodies short and reference Tier‑1/2/3 docs from `protocols/context/static/` in the prompt text (don’t inline).
-
-## Using with Claude Code subagents
-
-This repo’s subagent files in `agents/claude-subagents/` are ready to install.
-
-- Where they live (precedence)
- - Project: `.claude/agents/` (overrides user for same `name`)
- - User: `~/.claude/agents/` (available everywhere)
-
-- Install (copy or symlink)
-
-```bash
-mkdir -p ~/.claude/agents
-ln -s "$PWD/bureau/agents/claude-subagents/frontend.md" ~/.claude/agents/frontend.md
-ln -s "$PWD/bureau/agents/claude-subagents/testing.md" ~/.claude/agents/testing.md
-```
-
-- Minimal, correct frontmatter (already included):
-
-```markdown
----
-name: frontend
-description: Use for frontend implementation reviews and UI architecture decisions; prefer concrete, file:line guidance and least‑invasive fixes.
-tools: Read, Grep, Glob, Bash
-model: inherit
----
-```
-
-- Make delegation proactive
- - Write specific triggers in `description` (for example, “Use after UI code changes; review only the diff.”).
- - Grant only the tools the role needs (omit `tools` to inherit all; include to restrict).
- - Prefer `model: inherit`; set default via `CLAUDE_CODE_SUBAGENT_MODEL` if desired.
- - Name must be unique, lowercase, hyphenated (for example, `architecture-agent`).
-
-- Verify and use
- - Run `/agents` in Claude to confirm the subagents appear.
- - Use natural prompts and let Claude auto‑delegate, or explicitly invoke a subagent by name.
- - You can define session‑only subagents via CLI:
-
-```bash
-claude --agents '{
- "code-reviewer": {
- "description": "Expert code reviewer. Use proactively after code changes.",
- "prompt": "You are a senior code reviewer. Focus on code quality, security, and best practices.",
- "tools": ["Read", "Grep", "Glob", "Bash"],
- "model": "sonnet"
- }
-}'
-```
-
-Note: Role bodies should reference `protocols/context/static/tools-guide.md` (Tier 1) and any relevant Tier‑2/3 guides. We'll add `agents/handoff-guide.md` next and reference it as a must‑read for delegation rules.
-
-## Using with OpenCode subagents
-
-This repo's role prompts in `agents/role-prompts/` are automatically configured as OpenCode subagents by the setup script.
-
-- Where they live
- - Role prompts are symlinked to `~/.config/opencode/agent/bureau-agents/`
- - Agents are registered in `~/.config/opencode/opencode.json` under the `agent` key with `mode: "subagent"`
-
-- Install (via setup script)
-
-```bash
-agents/scripts/set-up-agents.sh
-```
-
-The setup script:
-1. Creates symlinks from `agents/role-prompts/*.md` to `~/.config/opencode/agent/bureau-agents/`
-2. Registers each agent in `opencode.json` with `mode: "all"`
-
-- Verify and use
- - Press **Tab** in OpenCode to cycle through available agents: Bureau agents should appear
- - Use natural prompts and let OpenCode auto-delegate, or explicitly mention a subagent by name
- - Example: `Have the debugger agent investigate this stack trace`
diff --git a/agents/claude-subagents/accessibility-auditor.md b/agents/claude-subagents/accessibility-auditor.md
index fd99fdb2..d67a3f8c 100644
--- a/agents/claude-subagents/accessibility-auditor.md
+++ b/agents/claude-subagents/accessibility-auditor.md
@@ -27,8 +27,8 @@ Approach:
- Motion: respect prefers-reduced-motion; provide pause controls for animations.
Must‑read at startup:
-- the [compact MCP list](../reference/tools-guide.md) (Tier 1: tool selection)
-- the [handoff guidelines](../reference/handoff-guide.md)
+- the [compact MCP list](../../protocols/context/static/tools-guide.md) (Tier 1: tool selection)
+- the [handoff guidelines](../../protocols/context/static/handoff-guide.md)
Output format:
- Audit report: issues by WCAG criterion, severity, affected elements.
diff --git a/agents/claude-subagents/ai-ml-eng.md b/agents/claude-subagents/ai-ml-eng.md
index 84cb9728..597b5faa 100644
--- a/agents/claude-subagents/ai-ml-eng.md
+++ b/agents/claude-subagents/ai-ml-eng.md
@@ -24,10 +24,8 @@ Approach:
- Prepare safe diffs and a staged rollout; validate on representative data.
Must-read at startup:
-- the [compact MCP list](../reference/tools-guide.md) (Tier 1)
-- the [code search guide](../reference/by-category/code-search.md) (Tier 2)
-- the [Sourcegraph deep dive](../reference/deep-dives/sourcegraph.md) (Tier 3)
-- the [handoff guidelines](../reference/handoff-guide.md)
+- the [compact MCP list](../../protocols/context/static/tools-guide.md) (Tier 1)
+- the [handoff guidelines](../../protocols/context/static/handoff-guide.md)
Output format:
- Findings: risks, hotspots, and evidence (paths:lines) with short rationale.
diff --git a/agents/claude-subagents/api-client-designer.md b/agents/claude-subagents/api-client-designer.md
index 53b14a83..7b5578cc 100644
--- a/agents/claude-subagents/api-client-designer.md
+++ b/agents/claude-subagents/api-client-designer.md
@@ -29,10 +29,8 @@ Approach:
- Request coalescing: batch APIs, deduplication windows, streaming for high volume.
Must‑read at startup:
-- the [compact MCP list](../reference/tools-guide.md) (Tier 1: tool selection)
-- the [documentation category guide](../reference/by-category/documentation.md) (Tier 2)
-- the [Context7 deep dive](../reference/deep-dives/context7.md) (Tier 3 as needed)
-- the [handoff guidelines](../reference/handoff-guide.md)
+- the [compact MCP list](../../protocols/context/static/tools-guide.md) (Tier 1: tool selection)
+- the [handoff guidelines](../../protocols/context/static/handoff-guide.md)
Output format:
- SDK design: initialization, auth, client lifecycle, resource cleanup.
diff --git a/agents/claude-subagents/api-integration.md b/agents/claude-subagents/api-integration.md
index 270e8b8d..dd01c7d8 100644
--- a/agents/claude-subagents/api-integration.md
+++ b/agents/claude-subagents/api-integration.md
@@ -26,12 +26,9 @@ Approach:
- Set per-endpoint SLOs and error taxonomy; add schema-change alerts and observability hooks.
Must-read at startup:
-- the [compact MCP list](../reference/tools-guide.md) (Tier 1: quick tool selection)
-- the [documentation guide](../reference/by-category/documentation.md) (Tier 2: Context7 vs alternatives; versioned docs)
-- the [Context7 deep dive](../reference/deep-dives/context7.md) (Tier 3: official framework/library docs)
-- the [Semgrep deep dive](../reference/deep-dives/semgrep.md) (security/hygiene checks for APIs)
-- the [docs style guide](../reference/style-guides/docs-style-guide.md) (structure and formatting for deliverables)
-- the [handoff guidelines](../reference/handoff-guide.md)
+- the [compact MCP list](../../protocols/context/static/tools-guide.md) (Tier 1: quick tool selection)
+- the [docs style guide](../../protocols/context/static/style-guides/docs-style-guide.md) (structure and formatting for deliverables)
+- the [handoff guidelines](../../protocols/context/static/handoff-guide.md)
Output format:
- Charter: goals, boundaries, protocol decision and trade-offs.
diff --git a/agents/claude-subagents/api-mocking-specialist.md b/agents/claude-subagents/api-mocking-specialist.md
index 9c2addcd..de3c0171 100644
--- a/agents/claude-subagents/api-mocking-specialist.md
+++ b/agents/claude-subagents/api-mocking-specialist.md
@@ -27,8 +27,8 @@ Approach:
- Record/replay: capture real responses for realistic mocking.
Must‑read at startup:
-- the [compact MCP list](../reference/tools-guide.md) (Tier 1: tool selection)
-- the [handoff guidelines](../reference/handoff-guide.md)
+- the [compact MCP list](../../protocols/context/static/tools-guide.md) (Tier 1: tool selection)
+- the [handoff guidelines](../../protocols/context/static/handoff-guide.md)
Output format:
- Mock implementation: MSW handlers, WireMock mappings, Pact contracts.
diff --git a/agents/claude-subagents/architect.md b/agents/claude-subagents/architect.md
index 82aa2298..13e602dc 100644
--- a/agents/claude-subagents/architect.md
+++ b/agents/claude-subagents/architect.md
@@ -25,9 +25,8 @@ Approach:
- Specify artifacts (ADRs/diagrams/SLO sketches) and enable a walking skeleton.
Must‑read at startup:
-- the [compact MCP list](../reference/tools-guide.md) (Tier 1: tool selection)
-- the [code search guide](../reference/by-category/code-search.md) (Tier 2)
-- the [handoff guidelines](../reference/handoff-guide.md)
+- the [compact MCP list](../../protocols/context/static/tools-guide.md) (Tier 1: tool selection)
+- the [handoff guidelines](../../protocols/context/static/handoff-guide.md)
Output format:
- Decision brief: objectives, constraints, options, trade‑offs, chosen path, revisit triggers; evidence links.
diff --git a/agents/claude-subagents/architecture-audit.md b/agents/claude-subagents/architecture-audit.md
index 475750dd..50cc9436 100644
--- a/agents/claude-subagents/architecture-audit.md
+++ b/agents/claude-subagents/architecture-audit.md
@@ -19,9 +19,8 @@ When to invoke:
- Onboarding to inherited/acquired codebases
At startup, read:
-- the [compact MCP list](../reference/tools-guide.md) (tier 1: tool selection)
-- the [code search guide](../reference/category/code-search.md) (tier 2: finding patterns)
-- the [handoff guidelines](../reference/handoff-guide.md) (delegation rules)
+- the [compact MCP list](../../protocols/context/static/tools-guide.md) (tier 1: tool selection)
+- the [handoff guidelines](../../protocols/context/static/handoff-guide.md) (delegation rules)
Approach:
1. Map high-level structure: layers, modules, boundaries, data flows
@@ -42,5 +41,4 @@ Constraints and handoffs:
- Distinguish must-fix (security, correctness, blockers) from should-improve
- Use clink to delegate specialized deep dives (Semgrep for patterns, performance analysis)
- AskUserQuestion for business constraints, roadmap priorities, team capacity
-- Read tier 3 deep dives when specialized analysis needed
diff --git a/agents/claude-subagents/auth-specialist.md b/agents/claude-subagents/auth-specialist.md
index 0324dd6b..755a9457 100644
--- a/agents/claude-subagents/auth-specialist.md
+++ b/agents/claude-subagents/auth-specialist.md
@@ -29,10 +29,8 @@ Approach:
- Zero‑trust: mTLS, service mesh identities, short‑lived certs, least privilege.
Must‑read at startup:
-- the [compact MCP list](../reference/tools-guide.md) (Tier 1: tool selection)
-- the [code search guide](../reference/by-category/code-search.md) (Tier 2)
-- the [Semgrep deep dive](../reference/deep-dives/semgrep.md) (Tier 3 as needed)
-- the [handoff guidelines](../reference/handoff-guide.md)
+- the [compact MCP list](../../protocols/context/static/tools-guide.md) (Tier 1: tool selection)
+- the [handoff guidelines](../../protocols/context/static/handoff-guide.md)
Output format:
- Flow diagrams: auth/authz sequences with security boundaries and token exchanges.
diff --git a/agents/claude-subagents/background-job-architect.md b/agents/claude-subagents/background-job-architect.md
index b2c4fe3e..9b570654 100644
--- a/agents/claude-subagents/background-job-architect.md
+++ b/agents/claude-subagents/background-job-architect.md
@@ -28,8 +28,8 @@ Approach:
- Graceful shutdown: finish current job or checkpoint before worker dies.
Must‑read at startup:
-- the [compact MCP list](../reference/tools-guide.md) (Tier 1: tool selection)
-- the [handoff guidelines](../reference/handoff-guide.md)
+- the [compact MCP list](../../protocols/context/static/tools-guide.md) (Tier 1: tool selection)
+- the [handoff guidelines](../../protocols/context/static/handoff-guide.md)
Output format:
- Job definition: class/function, arguments, queue, retry policy, timeout.
diff --git a/agents/claude-subagents/build-optimizer.md b/agents/claude-subagents/build-optimizer.md
index 70f9092b..e2a88fc4 100644
--- a/agents/claude-subagents/build-optimizer.md
+++ b/agents/claude-subagents/build-optimizer.md
@@ -27,8 +27,8 @@ Approach:
- Minimize transforms: avoid unnecessary Babel plugins, use native ESM.
Must‑read at startup:
-- the [compact MCP list](../reference/tools-guide.md) (Tier 1: tool selection)
-- the [handoff guidelines](../reference/handoff-guide.md)
+- the [compact MCP list](../../protocols/context/static/tools-guide.md) (Tier 1: tool selection)
+- the [handoff guidelines](../../protocols/context/static/handoff-guide.md)
Output format:
- Config changes: webpack.config.js, vite.config.ts, etc. with comments.
diff --git a/agents/claude-subagents/caching-specialist.md b/agents/claude-subagents/caching-specialist.md
index 2c6c1f9e..0ae08ac8 100644
--- a/agents/claude-subagents/caching-specialist.md
+++ b/agents/claude-subagents/caching-specialist.md
@@ -29,10 +29,8 @@ Approach:
- Monitoring: track hit rate, miss rate, latency, evictions, memory usage.
Must‑read at startup:
-- the [compact MCP list](../reference/tools-guide.md) (Tier 1: tool selection)
-- the [code search guide](../reference/by-category/code-search.md) (Tier 2)
-- the [Sourcegraph deep dive](../reference/deep-dives/sourcegraph.md) (Tier 3 as needed)
-- the [handoff guidelines](../reference/handoff-guide.md)
+- the [compact MCP list](../../protocols/context/static/tools-guide.md) (Tier 1: tool selection)
+- the [handoff guidelines](../../protocols/context/static/handoff-guide.md)
Output format:
- Cache topology: layers (browser/CDN/app/DB), responsibilities, TTLs.
diff --git a/agents/claude-subagents/chaos-engineer.md b/agents/claude-subagents/chaos-engineer.md
index 8f96c0fd..61315709 100644
--- a/agents/claude-subagents/chaos-engineer.md
+++ b/agents/claude-subagents/chaos-engineer.md
@@ -28,10 +28,8 @@ Approach:
- Automate: codify experiments in CI/staging; run continuously or on schedule.
Must‑read at startup:
-- the [compact MCP list](../reference/tools-guide.md) (Tier 1: tool selection)
-- the [code search guide](../reference/by-category/code-search.md) (Tier 2)
-- the [Sourcegraph deep dive](../reference/deep-dives/sourcegraph.md) (Tier 3 as needed)
-- the [handoff guidelines](../reference/handoff-guide.md)
+- the [compact MCP list](../../protocols/context/static/tools-guide.md) (Tier 1: tool selection)
+- the [handoff guidelines](../../protocols/context/static/handoff-guide.md)
Output format:
- Experiment plan: hypothesis, failure scenario, blast radius, abort criteria.
diff --git a/agents/claude-subagents/ci-pipeline-builder.md b/agents/claude-subagents/ci-pipeline-builder.md
index 791a03c7..b9361b11 100644
--- a/agents/claude-subagents/ci-pipeline-builder.md
+++ b/agents/claude-subagents/ci-pipeline-builder.md
@@ -27,8 +27,8 @@ Approach:
- Reusability: composite actions, reusable workflows, shared templates.
Must‑read at startup:
-- the [compact MCP list](../reference/tools-guide.md) (Tier 1: tool selection)
-- the [handoff guidelines](../reference/handoff-guide.md)
+- the [compact MCP list](../../protocols/context/static/tools-guide.md) (Tier 1: tool selection)
+- the [handoff guidelines](../../protocols/context/static/handoff-guide.md)
Output format:
- Pipeline config: .github/workflows/*.yml, .gitlab-ci.yml, Jenkinsfile, etc.
diff --git a/agents/claude-subagents/code-reviewer.md b/agents/claude-subagents/code-reviewer.md
index 57dd6bb9..85f5299b 100644
--- a/agents/claude-subagents/code-reviewer.md
+++ b/agents/claude-subagents/code-reviewer.md
@@ -29,10 +29,8 @@ Approach:
- Provide specific feedback: file:line, suggested fix, rationale, severity (blocker/optional).
Must‑read at startup:
-- the [compact MCP list](../reference/tools-guide.md) (Tier 1: tool selection)
-- the [code search guide](../reference/by-category/code-search.md) (Tier 2)
-- the [Semgrep deep dive](../reference/deep-dives/semgrep.md) (Tier 3 as needed)
-- the [handoff guidelines](../reference/handoff-guide.md)
+- the [compact MCP list](../../protocols/context/static/tools-guide.md) (Tier 1: tool selection)
+- the [handoff guidelines](../../protocols/context/static/handoff-guide.md)
Output format:
- Summary: PR scope, risk level, overall assessment (approve/request changes/block).
diff --git a/agents/claude-subagents/concurrency-specialist.md b/agents/claude-subagents/concurrency-specialist.md
index d377b809..ee1bfdd9 100644
--- a/agents/claude-subagents/concurrency-specialist.md
+++ b/agents/claude-subagents/concurrency-specialist.md
@@ -28,8 +28,8 @@ Approach:
- Reason about happens-before: understand memory models and ordering.
Must‑read at startup:
-- the [compact MCP list](../reference/tools-guide.md) (Tier 1: tool selection)
-- the [handoff guidelines](../reference/handoff-guide.md)
+- the [compact MCP list](../../protocols/context/static/tools-guide.md) (Tier 1: tool selection)
+- the [handoff guidelines](../../protocols/context/static/handoff-guide.md)
Output format:
- Analysis: shared state identification, potential race conditions.
diff --git a/agents/claude-subagents/cost-optimization-finops.md b/agents/claude-subagents/cost-optimization-finops.md
index 36673910..8f3f0eeb 100644
--- a/agents/claude-subagents/cost-optimization-finops.md
+++ b/agents/claude-subagents/cost-optimization-finops.md
@@ -23,10 +23,8 @@ Approach:
- Governance/anomalies: enforce tags, budgets/alerts, PR checks; correlate spikes; rollback/guardrail; document.
Must‑read at startup:
-- the [compact MCP list](../reference/tools-guide.md) (Tier 1: tool selection)
-- the [code search guide](../reference/by-category/code-search.md) (Tier 2)
-- the [Sourcegraph deep dive](../reference/deep-dives/sourcegraph.md) (Tier 3 as needed)
-- the [handoff guidelines](../reference/handoff-guide.md)
+- the [compact MCP list](../../protocols/context/static/tools-guide.md) (Tier 1: tool selection)
+- the [handoff guidelines](../../protocols/context/static/handoff-guide.md)
Output format:
- Summary: baseline spend, top drivers, savings targets, constraints.
diff --git a/agents/claude-subagents/cpp-pro.md b/agents/claude-subagents/cpp-pro.md
index ecb8c235..cc901e73 100644
--- a/agents/claude-subagents/cpp-pro.md
+++ b/agents/claude-subagents/cpp-pro.md
@@ -26,10 +26,8 @@ Approach:
- Validate: benchmark deltas, perf counters, compile‑time checks; document diffs/risks.
Must‑read at startup:
-- the [compact MCP list](../reference/tools-guide.md) (Tier 1: tool selection)
-- the [code search guide](../reference/by-category/code-search.md) (Tier 2)
-- the [Semgrep deep dive](../reference/deep-dives/semgrep.md) (Tier 3 as needed)
-- the [handoff guidelines](../reference/handoff-guide.md)
+- the [compact MCP list](../../protocols/context/static/tools-guide.md) (Tier 1: tool selection)
+- the [handoff guidelines](../../protocols/context/static/handoff-guide.md)
Output format:
- Summary: context, target standard, constraints, assumptions.
diff --git a/agents/claude-subagents/data-eng.md b/agents/claude-subagents/data-eng.md
index de7eb268..16843217 100644
--- a/agents/claude-subagents/data-eng.md
+++ b/agents/claude-subagents/data-eng.md
@@ -28,10 +28,8 @@ Approach:
- Backfills: incremental with checkpointing; validate output; minimal recompute.
Must‑read at startup:
-- the [compact MCP list](../reference/tools-guide.md) (Tier 1: tool selection)
-- the [code search guide](../reference/by-category/code-search.md) (Tier 2)
-- the [Sourcegraph deep dive](../reference/deep-dives/sourcegraph.md) (Tier 3 as needed)
-- the [handoff guidelines](../reference/handoff-guide.md)
+- the [compact MCP list](../../protocols/context/static/tools-guide.md) (Tier 1: tool selection)
+- the [handoff guidelines](../../protocols/context/static/handoff-guide.md)
Output format:
- Data flow: DAG with sources/transforms/sinks, dependencies, SLAs.
diff --git a/agents/claude-subagents/datetime-specialist.md b/agents/claude-subagents/datetime-specialist.md
index f400c673..77f8b8e1 100644
--- a/agents/claude-subagents/datetime-specialist.md
+++ b/agents/claude-subagents/datetime-specialist.md
@@ -28,8 +28,8 @@ Approach:
- Document assumptions: what timezone is input, what timezone is output.
Must‑read at startup:
-- the [compact MCP list](../reference/tools-guide.md) (Tier 1: tool selection)
-- the [handoff guidelines](../reference/handoff-guide.md)
+- the [compact MCP list](../../protocols/context/static/tools-guide.md) (Tier 1: tool selection)
+- the [handoff guidelines](../../protocols/context/static/handoff-guide.md)
Output format:
- Data model: how datetime is stored, what timezone context is preserved.
diff --git a/agents/claude-subagents/db-internals.md b/agents/claude-subagents/db-internals.md
index 98592954..dec3cd1a 100644
--- a/agents/claude-subagents/db-internals.md
+++ b/agents/claude-subagents/db-internals.md
@@ -26,10 +26,8 @@ Approach:
- Prepare staged, reversible migrations/backfills; validate in staging.
Must-read at startup:
-- the [compact MCP list](../reference/tools-guide.md) (Tier 1)
-- the [code search guide](../reference/by-category/code-search.md) (Tier 2)
-- the [Sourcegraph deep dive](../reference/deep-dives/sourcegraph.md) (Tier 3)
-- the [handoff guidelines](../reference/handoff-guide.md)
+- the [compact MCP list](../../protocols/context/static/tools-guide.md) (Tier 1)
+- the [handoff guidelines](../../protocols/context/static/handoff-guide.md)
Output format:
- Findings: affected queries/tables with evidence (paths:lines, plan snippets).
diff --git a/agents/claude-subagents/debugger.md b/agents/claude-subagents/debugger.md
index aeff6757..7faa32b6 100644
--- a/agents/claude-subagents/debugger.md
+++ b/agents/claude-subagents/debugger.md
@@ -27,10 +27,8 @@ Approach:
- Document findings: timeline, evidence (logs/traces/dumps), root cause, fix validation.
Must‑read at startup:
-- the [compact MCP list](../reference/tools-guide.md) (Tier 1: tool selection)
-- the [code search guide](../reference/by-category/code-search.md) (Tier 2)
-- the [Sourcegraph deep dive](../reference/deep-dives/sourcegraph.md) (Tier 3 as needed)
-- the [handoff guidelines](../reference/handoff-guide.md)
+- the [compact MCP list](../../protocols/context/static/tools-guide.md) (Tier 1: tool selection)
+- the [handoff guidelines](../../protocols/context/static/handoff-guide.md)
Output format:
- Repro: minimal steps and environment to trigger the issue.
diff --git a/agents/claude-subagents/dependency-auditor.md b/agents/claude-subagents/dependency-auditor.md
index 3965cbb8..11b7c58c 100644
--- a/agents/claude-subagents/dependency-auditor.md
+++ b/agents/claude-subagents/dependency-auditor.md
@@ -27,8 +27,8 @@ Approach:
- Minimize attack surface: remove unused deps, prefer well-maintained packages.
Must‑read at startup:
-- the [compact MCP list](../reference/tools-guide.md) (Tier 1: tool selection)
-- the [handoff guidelines](../reference/handoff-guide.md)
+- the [compact MCP list](../../protocols/context/static/tools-guide.md) (Tier 1: tool selection)
+- the [handoff guidelines](../../protocols/context/static/handoff-guide.md)
Output format:
- Vulnerability report: CVE ID, severity, affected versions, fix version, exploitability.
diff --git a/agents/claude-subagents/devops-infra-as-code.md b/agents/claude-subagents/devops-infra-as-code.md
index 30d34363..13969546 100644
--- a/agents/claude-subagents/devops-infra-as-code.md
+++ b/agents/claude-subagents/devops-infra-as-code.md
@@ -25,11 +25,9 @@ Approach:
- Document runbooks and patterns; standardize as reusable modules/templates.
Must-read at startup:
-- the [compact MCP list](../reference/tools-guide.md) (Tier 1: quick MCP decision guide)
-- the [code search guide](../reference/by-category/code-search.md) (Tier 2: Serena vs grep vs Sourcegraph for infra/code searches)
-- the [Semgrep deep dive](../reference/deep-dives/semgrep.md) (Tier 3: scanning IaC/K8s/CI for security/hygiene)
-- the [docs style guide](../reference/style-guides/docs-style-guide.md) (structure and formatting for deliverables)
-- the [handoff guidelines](../reference/handoff-guide.md)
+- the [compact MCP list](../../protocols/context/static/tools-guide.md) (Tier 1: quick MCP decision guide)
+- the [docs style guide](../../protocols/context/static/style-guides/docs-style-guide.md) (structure and formatting for deliverables)
+- the [handoff guidelines](../../protocols/context/static/handoff-guide.md)
Output format:
- Current vs target state: risks, constraints, goals.
diff --git a/agents/claude-subagents/distributed-systems-architect.md b/agents/claude-subagents/distributed-systems-architect.md
index 7610d18d..f799601c 100644
--- a/agents/claude-subagents/distributed-systems-architect.md
+++ b/agents/claude-subagents/distributed-systems-architect.md
@@ -25,10 +25,8 @@ Approach:
Must‑read at startup:
- the [compact MCP list](../../protocols/context/static/tools-guide.md) (Tier 1: tool selection)
-- the [web research guide](../../protocols/context/static/by-category/web-research.md) (Tier 2)
-- the [Sourcegraph deep dive](../../protocols/context/static/deep-dives/sourcegraph.md) (Tier 3 as needed)
- the [docs style guide](../../protocols/context/static/tools-guide.md) (for concise outputs)
-- the [handoff guidelines](../reference/handoff-guide.md)
+- the [handoff guidelines](../../protocols/context/static/handoff-guide.md)
Output format:
- Architecture brief: goals, CAP stance, consistency model, failure assumptions.
diff --git a/agents/claude-subagents/distributed-systems.md b/agents/claude-subagents/distributed-systems.md
index 61bbbd5f..16e098a1 100644
--- a/agents/claude-subagents/distributed-systems.md
+++ b/agents/claude-subagents/distributed-systems.md
@@ -25,10 +25,8 @@ Approach:
- Validate: tracing/correlation IDs; chaos tests for partitions/clocks.
Must‑read at startup:
-- the [compact MCP list](../reference/tools-guide.md) (Tier 1: tool selection)
-- the [web research guide](../reference/by-category/web-research.md) (Tier 2)
-- the [Sourcegraph deep dive](../reference/deep-dives/sourcegraph.md) (Tier 3 as needed)
-- the [handoff guidelines](../reference/handoff-guide.md)
+- the [compact MCP list](../../protocols/context/static/tools-guide.md) (Tier 1: tool selection)
+- the [handoff guidelines](../../protocols/context/static/handoff-guide.md)
Output format:
- Architecture brief: goals, CAP stance, consistency model, failure assumptions.
diff --git a/agents/claude-subagents/environment-debugger.md b/agents/claude-subagents/environment-debugger.md
index 305ae91c..ba777571 100644
--- a/agents/claude-subagents/environment-debugger.md
+++ b/agents/claude-subagents/environment-debugger.md
@@ -29,8 +29,8 @@ Approach:
- Automate checks: version validation in CI, environment linting.
Must‑read at startup:
-- the [compact MCP list](../reference/tools-guide.md) (Tier 1: tool selection)
-- the [handoff guidelines](../reference/handoff-guide.md)
+- the [compact MCP list](../../protocols/context/static/tools-guide.md) (Tier 1: tool selection)
+- the [handoff guidelines](../../protocols/context/static/handoff-guide.md)
Output format:
- Diagnosis: what's different between environments.
diff --git a/agents/claude-subagents/event-driven.md b/agents/claude-subagents/event-driven.md
index 38ce2c2a..f0543869 100644
--- a/agents/claude-subagents/event-driven.md
+++ b/agents/claude-subagents/event-driven.md
@@ -29,10 +29,8 @@ Approach:
- Error handling: dead‑letter queues, retries with backoff, poison message detection.
Must‑read at startup:
-- the [compact MCP list](../reference/tools-guide.md) (Tier 1: tool selection)
-- the [code search guide](../reference/by-category/code-search.md) (Tier 2)
-- the [Sourcegraph deep dive](../reference/deep-dives/sourcegraph.md) (Tier 3 as needed)
-- the [handoff guidelines](../reference/handoff-guide.md)
+- the [compact MCP list](../../protocols/context/static/tools-guide.md) (Tier 1: tool selection)
+- the [handoff guidelines](../../protocols/context/static/handoff-guide.md)
Output format:
- Event flow: diagram with producers/consumers/topics, partitioning, ordering guarantees.
diff --git a/agents/claude-subagents/explainer.md b/agents/claude-subagents/explainer.md
index f690438c..1fab0a6d 100644
--- a/agents/claude-subagents/explainer.md
+++ b/agents/claude-subagents/explainer.md
@@ -18,7 +18,7 @@ When to invoke:
- Clarifying why architectural decisions were made
At startup, read:
-- the [compact MCP list](../reference/tools-guide.md) to make yourself fully aware of the MCP tools available to you, as well as the extra resources about them in this repo (for when you need them)
+- the [compact MCP list](../../protocols/context/static/tools-guide.md) to make yourself fully aware of the MCP tools available to you, as well as the extra resources about them in this repo (for when you need them)
Approach:
1. Start with the README, package.json/requirements.txt, or entry points to map high-level structure
@@ -26,7 +26,6 @@ Approach:
3. Trace a single, simple execution path end-to-end before generalizing
4. Use analogies and diagrams when helpful (offer to create mermaid visualizations)
5. Pause after each concept to check understanding before proceeding
-6. For complex tools, read references in [per-category MCP guides](../reference/by-category/) and [per-MCP deep dives](../reference/deep-dives/) as needed
Output format:
- Layered explanations: overview → key components → detailed walkthrough
diff --git a/agents/claude-subagents/feature-flag-engineer.md b/agents/claude-subagents/feature-flag-engineer.md
index 0a5a77d4..ac3bd2b0 100644
--- a/agents/claude-subagents/feature-flag-engineer.md
+++ b/agents/claude-subagents/feature-flag-engineer.md
@@ -28,8 +28,8 @@ Approach:
- Cleanup automation: lint rules for stale flags, alerts for expired flags, removal PRs.
Must‑read at startup:
-- the [compact MCP list](../reference/tools-guide.md) (Tier 1: tool selection)
-- the [handoff guidelines](../reference/handoff-guide.md)
+- the [compact MCP list](../../protocols/context/static/tools-guide.md) (Tier 1: tool selection)
+- the [handoff guidelines](../../protocols/context/static/handoff-guide.md)
Output format:
- Flag specification: name, description, type, default, targeting rules, expiration.
diff --git a/agents/claude-subagents/finops-optimizer.md b/agents/claude-subagents/finops-optimizer.md
index c702cfee..59a74979 100644
--- a/agents/claude-subagents/finops-optimizer.md
+++ b/agents/claude-subagents/finops-optimizer.md
@@ -27,10 +27,8 @@ Approach:
Must‑read at startup:
- the [compact MCP list](../../protocols/context/static/tools-guide.md) (Tier 1: tool selection)
-- the [code search guide](../../protocols/context/static/by-category/code-search.md) (Tier 2)
-- the [Sourcegraph deep dive](../../protocols/context/static/deep-dives/sourcegraph.md) (Tier 3 as needed)
- the [docs style guide](../../protocols/context/static/tools-guide.md) (for concise outputs)
-- the [handoff guidelines](../reference/handoff-guide.md)
+- the [handoff guidelines](../../protocols/context/static/handoff-guide.md)
Output format:
- Summary: baseline, top cost drivers, savings targets, constraints.
diff --git a/agents/claude-subagents/frontend.md b/agents/claude-subagents/frontend.md
index edbe8b89..8c0559de 100644
--- a/agents/claude-subagents/frontend.md
+++ b/agents/claude-subagents/frontend.md
@@ -26,11 +26,9 @@ Approach:
- Measure every change (Lighthouse/RUM); block regressions.
Must-read at startup:
-- the [compact MCP list](../reference/tools-guide.md) (Tier 1: quick tool selection)
-- the [code search guide](../reference/by-category/code-search.md) (Tier 2: code navigation/search choices)
-- the [Semgrep deep dive](../reference/deep-dives/semgrep.md) (Tier 3: scanning UI/a11y/security anti-patterns)
-- the [docs style guide](../reference/style-guides/docs-style-guide.md) (structure and formatting for deliverables)
-- the [handoff guidelines](../reference/handoff-guide.md)
+- the [compact MCP list](../../protocols/context/static/tools-guide.md) (Tier 1: quick tool selection)
+- the [docs style guide](../../protocols/context/static/style-guides/docs-style-guide.md) (structure and formatting for deliverables)
+- the [handoff guidelines](../../protocols/context/static/handoff-guide.md)
Output format:
- Audit: baseline Web Vitals, a11y gaps, bundle analysis, and prioritized issues.
diff --git a/agents/claude-subagents/git-surgeon.md b/agents/claude-subagents/git-surgeon.md
index 87b5af1b..cacf6a26 100644
--- a/agents/claude-subagents/git-surgeon.md
+++ b/agents/claude-subagents/git-surgeon.md
@@ -28,8 +28,8 @@ Approach:
- Clean history: atomic commits, meaningful messages, no merge commits in features.
Must‑read at startup:
-- the [compact MCP list](../reference/tools-guide.md) (Tier 1: tool selection)
-- the [handoff guidelines](../reference/handoff-guide.md)
+- the [compact MCP list](../../protocols/context/static/tools-guide.md) (Tier 1: tool selection)
+- the [handoff guidelines](../../protocols/context/static/handoff-guide.md)
Output format:
- Commands: exact git commands to run, in order, with explanations.
diff --git a/agents/claude-subagents/golang-pro.md b/agents/claude-subagents/golang-pro.md
index 96b36e32..3f854974 100644
--- a/agents/claude-subagents/golang-pro.md
+++ b/agents/claude-subagents/golang-pro.md
@@ -26,9 +26,8 @@ Approach:
- Stage small commits with clear rationale and rollback paths.
Must‑read at startup:
-- the [compact MCP list](../reference/tools-guide.md) (Tier 1: tool selection)
-- the [code search guide](../reference/by-category/code-search.md) (Tier 2)
-- the [handoff guidelines](../reference/handoff-guide.md)
+- the [compact MCP list](../../protocols/context/static/tools-guide.md) (Tier 1: tool selection)
+- the [handoff guidelines](../../protocols/context/static/handoff-guide.md)
Output format:
- Diff summary with rationale and Go idioms.
diff --git a/agents/claude-subagents/graphql-specialist.md b/agents/claude-subagents/graphql-specialist.md
index 861621e9..d4e64667 100644
--- a/agents/claude-subagents/graphql-specialist.md
+++ b/agents/claude-subagents/graphql-specialist.md
@@ -27,8 +27,8 @@ Approach:
- Monitor: field-level tracing, query complexity scoring, slow query logging.
Must‑read at startup:
-- the [compact MCP list](../reference/tools-guide.md) (Tier 1: tool selection)
-- the [handoff guidelines](../reference/handoff-guide.md)
+- the [compact MCP list](../../protocols/context/static/tools-guide.md) (Tier 1: tool selection)
+- the [handoff guidelines](../../protocols/context/static/handoff-guide.md)
Output format:
- Schema SDL: types, queries, mutations with descriptions and deprecation notices.
diff --git a/agents/claude-subagents/historian.md b/agents/claude-subagents/historian.md
index a49937f2..1aa5f868 100644
--- a/agents/claude-subagents/historian.md
+++ b/agents/claude-subagents/historian.md
@@ -29,10 +29,8 @@ Approach:
- Extract rationale: commit messages, PR descriptions, code comments, design docs.
Must‑read at startup:
-- the [compact MCP list](../reference/tools-guide.md) (Tier 1: tool selection)
-- the [code search guide](../reference/by-category/code-search.md) (Tier 2)
-- the [Sourcegraph deep dive](../reference/deep-dives/sourcegraph.md) (Tier 3 as needed)
-- the [handoff guidelines](../reference/handoff-guide.md)
+- the [compact MCP list](../../protocols/context/static/tools-guide.md) (Tier 1: tool selection)
+- the [handoff guidelines](../../protocols/context/static/handoff-guide.md)
Output format:
- Timeline: chronological narrative with commits, PRs, issues, and decision points.
diff --git a/agents/claude-subagents/http-client-specialist.md b/agents/claude-subagents/http-client-specialist.md
index a504eb34..4cd0e3fb 100644
--- a/agents/claude-subagents/http-client-specialist.md
+++ b/agents/claude-subagents/http-client-specialist.md
@@ -28,8 +28,8 @@ Approach:
- Test failure modes: simulate timeouts, 5xx errors, connection refused.
Must‑read at startup:
-- the [compact MCP list](../reference/tools-guide.md) (Tier 1: tool selection)
-- the [handoff guidelines](../reference/handoff-guide.md)
+- the [compact MCP list](../../protocols/context/static/tools-guide.md) (Tier 1: tool selection)
+- the [handoff guidelines](../../protocols/context/static/handoff-guide.md)
Output format:
- Client configuration: timeouts, pool sizes, retry policy, circuit breaker settings.
diff --git a/agents/claude-subagents/implementation-helper.md b/agents/claude-subagents/implementation-helper.md
index d90c895c..2aec5a6c 100644
--- a/agents/claude-subagents/implementation-helper.md
+++ b/agents/claude-subagents/implementation-helper.md
@@ -20,8 +20,8 @@ When to invoke:
- Making principled engineering decisions under constraints
At startup, read:
-- the [compact MCP list](../reference/tools-guide.md) to make yourself fully aware of the MCP tools available to you, as well as the extra resources about them in this repo (for when you need them)
-- the [handoff guidelines](../reference/handoff-guide.md) (delegation rules)
+- the [compact MCP list](../../protocols/context/static/tools-guide.md) to make yourself fully aware of the MCP tools available to you, as well as the extra resources about them in this repo (for when you need them)
+- the [handoff guidelines](../../protocols/context/static/handoff-guide.md) (delegation rules)
Approach:
1. Clarify scope and success criteria; identify ambiguities upfront
diff --git a/agents/claude-subagents/incident-commander.md b/agents/claude-subagents/incident-commander.md
index 60bdef55..15f89335 100644
--- a/agents/claude-subagents/incident-commander.md
+++ b/agents/claude-subagents/incident-commander.md
@@ -28,10 +28,8 @@ Approach:
- Patterns: track recurring issues, MTTR, alert noise; propose systemic fixes.
Must‑read at startup:
-- the [compact MCP list](../reference/tools-guide.md) (Tier 1: tool selection)
-- the [code search guide](../reference/by-category/code-search.md) (Tier 2)
-- the [Sourcegraph deep dive](../reference/deep-dives/sourcegraph.md) (Tier 3 as needed)
-- the [handoff guidelines](../reference/handoff-guide.md)
+- the [compact MCP list](../../protocols/context/static/tools-guide.md) (Tier 1: tool selection)
+- the [handoff guidelines](../../protocols/context/static/handoff-guide.md)
Output format:
- Incident brief: severity, impact, start time, status, war room link.
diff --git a/agents/claude-subagents/interviewer.md b/agents/claude-subagents/interviewer.md
index d0f4378d..5dc1b2ab 100644
--- a/agents/claude-subagents/interviewer.md
+++ b/agents/claude-subagents/interviewer.md
@@ -29,10 +29,8 @@ Approach:
- Provide feedback: acknowledge correct reasoning, gently correct misconceptions.
Must‑read at startup:
-- the [compact MCP list](../reference/tools-guide.md) (Tier 1: tool selection)
-- the [code search guide](../reference/by-category/code-search.md) (Tier 2)
-- the [Sourcegraph deep dive](../reference/deep-dives/sourcegraph.md) (Tier 3 as needed)
-- the [handoff guidelines](../reference/handoff-guide.md)
+- the [compact MCP list](../../protocols/context/static/tools-guide.md) (Tier 1: tool selection)
+- the [handoff guidelines](../../protocols/context/static/handoff-guide.md)
Output format:
- Question sequence: progressive difficulty, building on previous answers.
diff --git a/agents/claude-subagents/kubernetes-operator.md b/agents/claude-subagents/kubernetes-operator.md
index 85d6a5d8..ae2b26bc 100644
--- a/agents/claude-subagents/kubernetes-operator.md
+++ b/agents/claude-subagents/kubernetes-operator.md
@@ -27,8 +27,8 @@ Approach:
- Observability: prometheus annotations, structured logging, tracing headers.
Must‑read at startup:
-- the [compact MCP list](../reference/tools-guide.md) (Tier 1: tool selection)
-- the [handoff guidelines](../reference/handoff-guide.md)
+- the [compact MCP list](../../protocols/context/static/tools-guide.md) (Tier 1: tool selection)
+- the [handoff guidelines](../../protocols/context/static/handoff-guide.md)
Output format:
- Manifests: Deployment, Service, ConfigMap, etc. with inline comments.
diff --git a/agents/claude-subagents/localization-engineer.md b/agents/claude-subagents/localization-engineer.md
index e99ba122..a35f3f7f 100644
--- a/agents/claude-subagents/localization-engineer.md
+++ b/agents/claude-subagents/localization-engineer.md
@@ -28,8 +28,8 @@ Approach:
- Plan for text expansion: translations can be 30-50% longer.
Must‑read at startup:
-- the [compact MCP list](../reference/tools-guide.md) (Tier 1: tool selection)
-- the [handoff guidelines](../reference/handoff-guide.md)
+- the [compact MCP list](../../protocols/context/static/tools-guide.md) (Tier 1: tool selection)
+- the [handoff guidelines](../../protocols/context/static/handoff-guide.md)
Output format:
- Message catalog: extracted strings in ICU format or framework-specific.
diff --git a/agents/claude-subagents/log-analyst.md b/agents/claude-subagents/log-analyst.md
index 3bba9cfe..3b9b7664 100644
--- a/agents/claude-subagents/log-analyst.md
+++ b/agents/claude-subagents/log-analyst.md
@@ -27,8 +27,8 @@ Approach:
- Context gathering: what happened before the error, related logs.
Must‑read at startup:
-- the [compact MCP list](../reference/tools-guide.md) (Tier 1: tool selection)
-- the [handoff guidelines](../reference/handoff-guide.md)
+- the [compact MCP list](../../protocols/context/static/tools-guide.md) (Tier 1: tool selection)
+- the [handoff guidelines](../../protocols/context/static/handoff-guide.md)
Output format:
- Timeline: sequence of events with timestamps and service names.
diff --git a/agents/claude-subagents/message-queue-architect.md b/agents/claude-subagents/message-queue-architect.md
index ad37e4b4..89ea4913 100644
--- a/agents/claude-subagents/message-queue-architect.md
+++ b/agents/claude-subagents/message-queue-architect.md
@@ -28,8 +28,8 @@ Approach:
- Dead letter strategy: capture failures, enable investigation, support replay.
Must‑read at startup:
-- the [compact MCP list](../reference/tools-guide.md) (Tier 1: tool selection)
-- the [handoff guidelines](../reference/handoff-guide.md)
+- the [compact MCP list](../../protocols/context/static/tools-guide.md) (Tier 1: tool selection)
+- the [handoff guidelines](../../protocols/context/static/handoff-guide.md)
Output format:
- Architecture diagram: producers, topics/queues, consumers, DLQ flow.
diff --git a/agents/claude-subagents/migration-refactoring.md b/agents/claude-subagents/migration-refactoring.md
index 6171c7b0..6e2f339f 100644
--- a/agents/claude-subagents/migration-refactoring.md
+++ b/agents/claude-subagents/migration-refactoring.md
@@ -26,11 +26,9 @@ Approach:
- Plan data migration (expand–migrate–contract), backfills, reconciliation; clean up flags/shims.
Must‑read at startup:
-- the [compact MCP list](../reference/tools-guide.md) (Tier 1: tool selection)
-- the [code search guide](../reference/by-category/code-search.md) (Tier 2)
-- the [Sourcegraph deep dive](../reference/deep-dives/sourcegraph.md) (Tier 3 as needed)
-- the [docs style guide](../reference/style-guides/docs-style-guide.md) (concise specs/ADRs)
-- the [handoff guidelines](../reference/handoff-guide.md)
+- the [compact MCP list](../../protocols/context/static/tools-guide.md) (Tier 1: tool selection)
+- the [docs style guide](../../protocols/context/static/style-guides/docs-style-guide.md) (concise specs/ADRs)
+- the [handoff guidelines](../../protocols/context/static/handoff-guide.md)
Output format:
- Migration spec: target, scope, assumptions, risks, success criteria.
diff --git a/agents/claude-subagents/mobile-architect.md b/agents/claude-subagents/mobile-architect.md
index c4176898..1e2bfc58 100644
--- a/agents/claude-subagents/mobile-architect.md
+++ b/agents/claude-subagents/mobile-architect.md
@@ -26,10 +26,8 @@ Approach:
Must‑read at startup:
- the [compact MCP list](../../protocols/context/static/tools-guide.md) (Tier 1: tool selection)
-- the [code search guide](../../protocols/context/static/by-category/code-search.md) (Tier 2)
-- the [Sourcegraph deep dive](../../protocols/context/static/deep-dives/sourcegraph.md) (Tier 3 as needed)
- the [docs style guide](../../protocols/context/static/tools-guide.md) (for concise outputs)
-- the [handoff guidelines](../reference/handoff-guide.md)
+- the [handoff guidelines](../../protocols/context/static/handoff-guide.md)
Output format:
- Architecture brief: platform targets, framework decision, modules, state/nav pattern, risks.
diff --git a/agents/claude-subagents/monorepo-architect.md b/agents/claude-subagents/monorepo-architect.md
index 09fb198a..932b4b8d 100644
--- a/agents/claude-subagents/monorepo-architect.md
+++ b/agents/claude-subagents/monorepo-architect.md
@@ -27,8 +27,8 @@ Approach:
- Code sharing: internal packages with proper exports, avoid barrel files at scale.
Must‑read at startup:
-- the [compact MCP list](../reference/tools-guide.md) (Tier 1: tool selection)
-- the [handoff guidelines](../reference/handoff-guide.md)
+- the [compact MCP list](../../protocols/context/static/tools-guide.md) (Tier 1: tool selection)
+- the [handoff guidelines](../../protocols/context/static/handoff-guide.md)
Output format:
- Structure diagram: folder hierarchy with package boundaries and dependencies.
diff --git a/agents/claude-subagents/networking-edge-infra.md b/agents/claude-subagents/networking-edge-infra.md
index 10e98ed6..012830fb 100644
--- a/agents/claude-subagents/networking-edge-infra.md
+++ b/agents/claude-subagents/networking-edge-infra.md
@@ -27,11 +27,9 @@ Approach:
- Plan rollout: canary by path/region, staged shifts; monitoring + rollback.
Must‑read at startup:
-- the [compact MCP list](../reference/tools-guide.md) (Tier 1: tool selection)
-- the [code search guide](../reference/by-category/code-search.md) (Tier 2)
-- the [Sourcegraph deep dive](../reference/deep-dives/sourcegraph.md) (Tier 3 as needed)
-- the [docs style guide](../reference/style-guides/docs-style-guide.md) (decision docs)
-- the [handoff guidelines](../reference/handoff-guide.md)
+- the [compact MCP list](../../protocols/context/static/tools-guide.md) (Tier 1: tool selection)
+- the [docs style guide](../../protocols/context/static/style-guides/docs-style-guide.md) (decision docs)
+- the [handoff guidelines](../../protocols/context/static/handoff-guide.md)
Output format:
- Summary: objectives, constraints, SLOs, assumptions.
diff --git a/agents/claude-subagents/observability.md b/agents/claude-subagents/observability.md
index a56b56b5..64cffcf0 100644
--- a/agents/claude-subagents/observability.md
+++ b/agents/claude-subagents/observability.md
@@ -25,10 +25,8 @@ Approach:
- For incidents: declare, stabilize, correlate traces/metrics/logs, document timeline and follow‑ups.
Must‑read at startup:
-- the [compact MCP list](../reference/tools-guide.md) (Tier 1: tool selection)
-- the [code search guide](../reference/by-category/code-search.md) (Tier 2)
-- the [Sourcegraph deep dive](../reference/deep-dives/sourcegraph.md) (Tier 3 as needed)
-- the [handoff guidelines](../reference/handoff-guide.md)
+- the [compact MCP list](../../protocols/context/static/tools-guide.md) (Tier 1: tool selection)
+- the [handoff guidelines](../../protocols/context/static/handoff-guide.md)
Output format:
- Telemetry plan: coverage deltas, propagation, key metrics/log fields.
diff --git a/agents/claude-subagents/optimization.md b/agents/claude-subagents/optimization.md
index 1cc28e99..383bc573 100644
--- a/agents/claude-subagents/optimization.md
+++ b/agents/claude-subagents/optimization.md
@@ -24,10 +24,8 @@ Approach:
- Re-measure after each change; keep diffs small and reversible.
Must‑read at startup:
-- the [compact MCP list](../reference/tools-guide.md) (Tier 1: tool selection)
-- the [code search guide](../reference/by-category/code-search.md) (Tier 2)
-- the [Semgrep deep dive](../reference/deep-dives/semgrep.md) (Tier 3 as needed)
-- the [handoff guidelines](../reference/handoff-guide.md)
+- the [compact MCP list](../../protocols/context/static/tools-guide.md) (Tier 1: tool selection)
+- the [handoff guidelines](../../protocols/context/static/handoff-guide.md)
Output format:
- Summary: baseline vs targets; constraints and risks.
diff --git a/agents/claude-subagents/orm-optimization-specialist.md b/agents/claude-subagents/orm-optimization-specialist.md
index 36e47563..93aa5a7b 100644
--- a/agents/claude-subagents/orm-optimization-specialist.md
+++ b/agents/claude-subagents/orm-optimization-specialist.md
@@ -28,8 +28,8 @@ Approach:
- Test with realistic data: N+1 is invisible with 2 records, catastrophic with 1000.
Must‑read at startup:
-- the [compact MCP list](../reference/tools-guide.md) (Tier 1: tool selection)
-- the [handoff guidelines](../reference/handoff-guide.md)
+- the [compact MCP list](../../protocols/context/static/tools-guide.md) (Tier 1: tool selection)
+- the [handoff guidelines](../../protocols/context/static/handoff-guide.md)
Output format:
- Query analysis: current queries, N+1 identification, query count per operation.
diff --git a/agents/claude-subagents/platform-eng.md b/agents/claude-subagents/platform-eng.md
index 563865bf..6536525e 100644
--- a/agents/claude-subagents/platform-eng.md
+++ b/agents/claude-subagents/platform-eng.md
@@ -24,11 +24,9 @@ Approach:
- Document in the portal; version templates/actions; provide upgrade paths and escape hatches.
Must-read at startup:
-- the [compact MCP list](../reference/tools-guide.md) (Tier 1)
-- the [code search guide](../reference/by-category/code-search.md) (Tier 2)
-- the [Sourcegraph deep dive](../reference/deep-dives/sourcegraph.md) (Tier 3)
-- the [docs style guide](../reference/style-guides/docs-style-guide.md)
-- the [handoff guidelines](../reference/handoff-guide.md)
+- the [compact MCP list](../../protocols/context/static/tools-guide.md) (Tier 1)
+- the [docs style guide](../../protocols/context/static/style-guides/docs-style-guide.md)
+- the [handoff guidelines](../../protocols/context/static/handoff-guide.md)
Output format:
- Findings: sprawl hotspots/manual steps with evidence (paths:lines).
diff --git a/agents/claude-subagents/realtime.md b/agents/claude-subagents/realtime.md
index 8c844954..7bdfaf85 100644
--- a/agents/claude-subagents/realtime.md
+++ b/agents/claude-subagents/realtime.md
@@ -25,11 +25,9 @@ Approach:
- Validate via load/soak/replay/chaos; stage behind flags/canaries; re-measure.
Must-read at startup:
-- the [compact MCP list](../reference/tools-guide.md) (Tier 1: quick tool selection)
-- the [code search guide](../reference/by-category/code-search.md) (Tier 2: code navigation/search choices)
-- the [Context7 deep dive](../reference/deep-dives/context7.md) (Tier 3: official framework/RTOS/protocol docs)
-- the [docs style guide](../reference/style-guides/docs-style-guide.md) (structure and formatting for deliverables)
-- the [handoff guidelines](../reference/handoff-guide.md)
+- the [compact MCP list](../../protocols/context/static/tools-guide.md) (Tier 1: quick tool selection)
+- the [docs style guide](../../protocols/context/static/style-guides/docs-style-guide.md) (structure and formatting for deliverables)
+- the [handoff guidelines](../../protocols/context/static/handoff-guide.md)
Output format:
- Budget: topology, per-hop targets, assumptions, constraints.
diff --git a/agents/claude-subagents/regex-wizard.md b/agents/claude-subagents/regex-wizard.md
index b49f0e33..8892aaf8 100644
--- a/agents/claude-subagents/regex-wizard.md
+++ b/agents/claude-subagents/regex-wizard.md
@@ -27,8 +27,8 @@ Approach:
- Document: explain each part of the pattern inline.
Must‑read at startup:
-- the [compact MCP list](../reference/tools-guide.md) (Tier 1: tool selection)
-- the [handoff guidelines](../reference/handoff-guide.md)
+- the [compact MCP list](../../protocols/context/static/tools-guide.md) (Tier 1: tool selection)
+- the [handoff guidelines](../../protocols/context/static/handoff-guide.md)
Output format:
- Pattern: the regex with inline comments (x-flag style when supported).
diff --git a/agents/claude-subagents/rust-pro.md b/agents/claude-subagents/rust-pro.md
index ad33455b..12499927 100644
--- a/agents/claude-subagents/rust-pro.md
+++ b/agents/claude-subagents/rust-pro.md
@@ -26,9 +26,8 @@ Approach:
- Stage small commits with rationale and rollback paths.
Must‑read at startup:
-- the [compact MCP list](../reference/tools-guide.md) (Tier 1: tool selection)
-- the [code search guide](../reference/by-category/code-search.md) (Tier 2)
-- the [handoff guidelines](../reference/handoff-guide.md)
+- the [compact MCP list](../../protocols/context/static/tools-guide.md) (Tier 1: tool selection)
+- the [handoff guidelines](../../protocols/context/static/handoff-guide.md)
Output format:
- Diff summary with rationale, referenced Rust idioms.
diff --git a/agents/claude-subagents/scalability-reliability.md b/agents/claude-subagents/scalability-reliability.md
index 08783d11..ea77bbc0 100644
--- a/agents/claude-subagents/scalability-reliability.md
+++ b/agents/claude-subagents/scalability-reliability.md
@@ -25,11 +25,9 @@ Approach:
- Codify runbooks, dashboards‑as‑code, and post‑incident action tracking; reduce alert noise.
Must-read at startup:
-- the [compact MCP list](../reference/tools-guide.md) (Tier 1: quick tool selection)
-- the [code search guide](../reference/by-category/code-search.md) (Tier 2: navigating code/config for reliability patterns)
-- the [Semgrep deep dive](../reference/deep-dives/semgrep.md) (Tier 3: scanning for reliability/security anti‑patterns)
-- the [docs style guide](../reference/style-guides/docs-style-guide.md) (structure and formatting for deliverables)
-- the [handoff guidelines](../reference/handoff-guide.md)
+- the [compact MCP list](../../protocols/context/static/tools-guide.md) (Tier 1: quick tool selection)
+- the [docs style guide](../../protocols/context/static/style-guides/docs-style-guide.md) (structure and formatting for deliverables)
+- the [handoff guidelines](../../protocols/context/static/handoff-guide.md)
Output format:
- SLO spec: SLIs, targets, windows; error‑budget policy and alerts.
diff --git a/agents/claude-subagents/schema-evolution.md b/agents/claude-subagents/schema-evolution.md
index 5a950bdb..38ab30f0 100644
--- a/agents/claude-subagents/schema-evolution.md
+++ b/agents/claude-subagents/schema-evolution.md
@@ -29,10 +29,8 @@ Approach:
- API versioning: URL/header versioning, deprecation notices, sunset timelines.
Must‑read at startup:
-- the [compact MCP list](../reference/tools-guide.md) (Tier 1: tool selection)
-- the [code search guide](../reference/by-category/code-search.md) (Tier 2)
-- the [Sourcegraph deep dive](../reference/deep-dives/sourcegraph.md) (Tier 3 as needed)
-- the [handoff guidelines](../reference/handoff-guide.md)
+- the [compact MCP list](../../protocols/context/static/tools-guide.md) (Tier 1: tool selection)
+- the [handoff guidelines](../../protocols/context/static/handoff-guide.md)
Output format:
- Migration plan: phases (expand/migrate/contract), DDL statements, rollback steps.
diff --git a/agents/claude-subagents/search-implementation-specialist.md b/agents/claude-subagents/search-implementation-specialist.md
index f8150a6c..994d3a10 100644
--- a/agents/claude-subagents/search-implementation-specialist.md
+++ b/agents/claude-subagents/search-implementation-specialist.md
@@ -28,8 +28,8 @@ Approach:
- Iterate: relevance is never "done"; instrument, measure, improve continuously.
Must‑read at startup:
-- the [compact MCP list](../reference/tools-guide.md) (Tier 1: tool selection)
-- the [handoff guidelines](../reference/handoff-guide.md)
+- the [compact MCP list](../../protocols/context/static/tools-guide.md) (Tier 1: tool selection)
+- the [handoff guidelines](../../protocols/context/static/handoff-guide.md)
Output format:
- Index mapping: field types, analyzers, multi-fields for different query patterns.
diff --git a/agents/claude-subagents/searcher.md b/agents/claude-subagents/searcher.md
index 21d0ce8b..6c7b0e36 100644
--- a/agents/claude-subagents/searcher.md
+++ b/agents/claude-subagents/searcher.md
@@ -26,10 +26,8 @@ Approach:
- Present the user with a list of relevant code snippets.
Must-read at startup:
-- the [compact MCP list](../reference/tools-guide.md) (Tier 1)
-- the [code search guide](../reference/by-category/code-search.md) (Tier 2)
-- the [Sourcegraph deep dive](../reference/deep-dives/sourcegraph.md) (Tier 3)
-- the [handoff guidelines](../reference/handoff-guide.md)
+- the [compact MCP list](../../protocols/context/static/tools-guide.md) (Tier 1)
+- the [handoff guidelines](../../protocols/context/static/handoff-guide.md)
Output format:
- A list of code snippets, each with the file path and line number.
diff --git a/agents/claude-subagents/security-compliance.md b/agents/claude-subagents/security-compliance.md
index 15ab206a..add9cf56 100644
--- a/agents/claude-subagents/security-compliance.md
+++ b/agents/claude-subagents/security-compliance.md
@@ -24,10 +24,8 @@ Approach:
- Verify/capture: targeted tests; adherence dashboards; store decisions/evidence.
Must‑read at startup:
-- the [compact MCP list](../reference/tools-guide.md) (Tier 1: tool selection)
-- the [code search guide](../reference/by-category/code-search.md) (Tier 2)
-- the [Semgrep deep dive](../reference/deep-dives/semgrep.md) (Tier 3 as needed)
-- a [handoff guidelines](../reference/handoff-guide.md)
+- the [compact MCP list](../../protocols/context/static/tools-guide.md) (Tier 1: tool selection)
+- the [handoff guidelines](../../protocols/context/static/handoff-guide.md)
Output format:
- Risk summary: top findings, severity, assets, impact.
diff --git a/agents/claude-subagents/serverless-specialist.md b/agents/claude-subagents/serverless-specialist.md
index 5a6084a5..e832a9ff 100644
--- a/agents/claude-subagents/serverless-specialist.md
+++ b/agents/claude-subagents/serverless-specialist.md
@@ -28,8 +28,8 @@ Approach:
- Idempotency: event sources may duplicate; design handlers to be replayable.
Must‑read at startup:
-- the [compact MCP list](../reference/tools-guide.md) (Tier 1: tool selection)
-- the [handoff guidelines](../reference/handoff-guide.md)
+- the [compact MCP list](../../protocols/context/static/tools-guide.md) (Tier 1: tool selection)
+- the [handoff guidelines](../../protocols/context/static/handoff-guide.md)
Output format:
- Function design: handler structure, initialization, event parsing, response format.
diff --git a/agents/claude-subagents/shell-scripter.md b/agents/claude-subagents/shell-scripter.md
index 5d5bbba5..6226c886 100644
--- a/agents/claude-subagents/shell-scripter.md
+++ b/agents/claude-subagents/shell-scripter.md
@@ -27,8 +27,8 @@ Approach:
- Clean up: trap EXIT for cleanup, use mktemp for temp files.
Must‑read at startup:
-- the [compact MCP list](../reference/tools-guide.md) (Tier 1: tool selection)
-- the [handoff guidelines](../reference/handoff-guide.md)
+- the [compact MCP list](../../protocols/context/static/tools-guide.md) (Tier 1: tool selection)
+- the [handoff guidelines](../../protocols/context/static/handoff-guide.md)
Output format:
- Script: complete, commented, with shebang and set flags.
diff --git a/agents/claude-subagents/state-machine-designer.md b/agents/claude-subagents/state-machine-designer.md
index 89c06ffa..46963f83 100644
--- a/agents/claude-subagents/state-machine-designer.md
+++ b/agents/claude-subagents/state-machine-designer.md
@@ -28,8 +28,8 @@ Approach:
- Visualize always: state diagrams are documentation and debugging tools.
Must‑read at startup:
-- the [compact MCP list](../reference/tools-guide.md) (Tier 1: tool selection)
-- the [handoff guidelines](../reference/handoff-guide.md)
+- the [compact MCP list](../../protocols/context/static/tools-guide.md) (Tier 1: tool selection)
+- the [handoff guidelines](../../protocols/context/static/handoff-guide.md)
Output format:
- State diagram: visual representation (Mermaid, XState Viz, or ASCII).
diff --git a/agents/claude-subagents/task-decomposer.md b/agents/claude-subagents/task-decomposer.md
index a2c5d899..96940983 100644
--- a/agents/claude-subagents/task-decomposer.md
+++ b/agents/claude-subagents/task-decomposer.md
@@ -29,8 +29,8 @@ Approach:
- Agent routing: map subtasks to roles (architect, debugger, testing, etc.).
Must‑read at startup:
-- the [compact MCP list](../reference/tools-guide.md) (Tier 1: tool selection)
-- the [handoff guidelines](../reference/handoff-guide.md) (when to delegate to which agent)
+- the [compact MCP list](../../protocols/context/static/tools-guide.md) (Tier 1: tool selection)
+- the [handoff guidelines](../../protocols/context/static/handoff-guide.md) (when to delegate to which agent)
Output format:
- Summary: problem statement, success criteria, constraints, assumptions.
diff --git a/agents/claude-subagents/tech-debt.md b/agents/claude-subagents/tech-debt.md
index c66ff89f..ca278648 100644
--- a/agents/claude-subagents/tech-debt.md
+++ b/agents/claude-subagents/tech-debt.md
@@ -26,11 +26,9 @@ Approach:
- Sequence work into safe iterations; measure deltas after each step.
Must‑read at startup:
-- the [compact MCP list](../reference/tools-guide.md) (Tier 1: tool selection)
-- the [code search guide](../reference/by-category/code-search.md) (Tier 2)
-- the [Sourcegraph deep dive](../reference/deep-dives/sourcegraph.md) (Tier 3 as needed)
-- the [docs style guide](../reference/style-guides/docs-style-guide.md) (for concise decision docs)
-- the [handoff guidelines](../reference/handoff-guide.md)
+- the [compact MCP list](../../protocols/context/static/tools-guide.md) (Tier 1: tool selection)
+- the [docs style guide](../../protocols/context/static/style-guides/docs-style-guide.md) (for concise decision docs)
+- the [handoff guidelines](../../protocols/context/static/handoff-guide.md)
Output format:
- Summary: context, objectives, constraints; current risk level.
diff --git a/agents/claude-subagents/terraform-specialist.md b/agents/claude-subagents/terraform-specialist.md
index ed73a325..cda89874 100644
--- a/agents/claude-subagents/terraform-specialist.md
+++ b/agents/claude-subagents/terraform-specialist.md
@@ -27,8 +27,8 @@ Approach:
- Prefer data sources over hardcoded IDs; use `moved` blocks for refactors.
Must‑read at startup:
-- the [compact MCP list](../reference/tools-guide.md) (Tier 1: tool selection)
-- the [handoff guidelines](../reference/handoff-guide.md)
+- the [compact MCP list](../../protocols/context/static/tools-guide.md) (Tier 1: tool selection)
+- the [handoff guidelines](../../protocols/context/static/handoff-guide.md)
Output format:
- Plan summary: resources to add/change/destroy with risk assessment (low/medium/high).
diff --git a/agents/claude-subagents/testing.md b/agents/claude-subagents/testing.md
index 6db366f7..f6815ef7 100644
--- a/agents/claude-subagents/testing.md
+++ b/agents/claude-subagents/testing.md
@@ -25,10 +25,8 @@ Approach:
- Prepare minimal, safe diffs and rollout notes; validate trends in CI.
Must‑read at startup:
-- the [compact MCP list](../reference/tools-guide.md) (Tier 1)
-- the [code search guide](../reference/by-category/code-search.md) (Tier 2)
-- the [Semgrep deep dive](../reference/deep-dives/semgrep.md) (Tier 3)
-- the [handoff guidelines](../reference/handoff-guide.md)
+- the [compact MCP list](../../protocols/context/static/tools-guide.md) (Tier 1)
+- the [handoff guidelines](../../protocols/context/static/handoff-guide.md)
Output format:
- Findings: flake hotspots and gaps with evidence (paths:lines).
diff --git a/agents/claude-subagents/type-system-expert.md b/agents/claude-subagents/type-system-expert.md
index 0982e6d3..7bfb1401 100644
--- a/agents/claude-subagents/type-system-expert.md
+++ b/agents/claude-subagents/type-system-expert.md
@@ -28,8 +28,8 @@ Approach:
- Document complex types: JSDoc, comments, examples.
Must‑read at startup:
-- the [compact MCP list](../reference/tools-guide.md) (Tier 1: tool selection)
-- the [handoff guidelines](../reference/handoff-guide.md)
+- the [compact MCP list](../../protocols/context/static/tools-guide.md) (Tier 1: tool selection)
+- the [handoff guidelines](../../protocols/context/static/handoff-guide.md)
Output format:
- Type definitions: with inline comments explaining each part.
diff --git a/agents/claude-subagents/webhook-integration-specialist.md b/agents/claude-subagents/webhook-integration-specialist.md
index ae9bd3f1..b35f29bd 100644
--- a/agents/claude-subagents/webhook-integration-specialist.md
+++ b/agents/claude-subagents/webhook-integration-specialist.md
@@ -27,8 +27,8 @@ Approach:
- **Sending:** provide event logs, retry buttons, and delivery status in dashboard.
Must‑read at startup:
-- the [compact MCP list](../reference/tools-guide.md) (Tier 1: tool selection)
-- the [handoff guidelines](../reference/handoff-guide.md)
+- the [compact MCP list](../../protocols/context/static/tools-guide.md) (Tier 1: tool selection)
+- the [handoff guidelines](../../protocols/context/static/handoff-guide.md)
Output format:
- Endpoint implementation: signature verification, quick response, async processing.
diff --git a/agents/role-prompts/accessibility-auditor.md b/agents/role-prompts/accessibility-auditor.md
index ee06db81..59b72332 100644
--- a/agents/role-prompts/accessibility-auditor.md
+++ b/agents/role-prompts/accessibility-auditor.md
@@ -21,8 +21,8 @@ Approach:
- Motion: respect prefers-reduced-motion; provide pause controls for animations.
Must‑read at startup:
-- the [compact MCP list](../reference/tools-guide.md) (Tier 1: tool selection)
-- the [handoff guidelines](../reference/handoff-guide.md)
+- the [compact MCP list](../../protocols/context/static/tools-guide.md) (Tier 1: tool selection)
+- the [handoff guidelines](../../protocols/context/static/handoff-guide.md)
Output format:
- Audit report: issues by WCAG criterion, severity, affected elements.
diff --git a/agents/role-prompts/ai-ml-eng.md b/agents/role-prompts/ai-ml-eng.md
index 71a44b08..35e5e503 100644
--- a/agents/role-prompts/ai-ml-eng.md
+++ b/agents/role-prompts/ai-ml-eng.md
@@ -20,10 +20,8 @@ Approach:
- Document decisions and a staged plan; prepare safe diffs.
Must-read at startup:
-- the [compact MCP list](../reference/tools-guide.md)
-- the [code search guide](../reference/by-category/code-search.md)
-- the [Sourcegraph deep dive](../reference/deep-dives/sourcegraph.md)
-- the [handoff guidelines](../reference/handoff-guide.md)
+- the [compact MCP list](../../protocols/context/static/tools-guide.md)
+- the [handoff guidelines](../../protocols/context/static/handoff-guide.md)
Output format:
- Findings: risks, hotspots, and evidence (paths:lines) with short rationale.
diff --git a/agents/role-prompts/api-client-designer.md b/agents/role-prompts/api-client-designer.md
index 79974e3e..c0b5bdab 100644
--- a/agents/role-prompts/api-client-designer.md
+++ b/agents/role-prompts/api-client-designer.md
@@ -23,10 +23,8 @@ Approach:
- Request coalescing: batch APIs, deduplication windows, streaming for high volume.
Must‑read at startup:
-- the [compact MCP list](../reference/tools-guide.md) (Tier 1: tool selection)
-- the [documentation category guide](../reference/by-category/documentation.md) (Tier 2)
-- the [Context7 deep dive](../reference/deep-dives/context7.md) (Tier 3 as needed)
-- the [handoff guidelines](../reference/handoff-guide.md)
+- the [compact MCP list](../../protocols/context/static/tools-guide.md) (Tier 1: tool selection)
+- the [handoff guidelines](../../protocols/context/static/handoff-guide.md)
Output format:
- SDK design: initialization, auth, client lifecycle, resource cleanup.
diff --git a/agents/role-prompts/api-integration.md b/agents/role-prompts/api-integration.md
index d00e81b8..fb2a4fe6 100644
--- a/agents/role-prompts/api-integration.md
+++ b/agents/role-prompts/api-integration.md
@@ -20,11 +20,9 @@ Approach:
- Wire contract/conformance tests to CI; add per‑endpoint SLOs; plan rollout/rollback.
Must‑read at startup:
-- the [compact MCP list](../reference/tools-guide.md) (Tier 1: tool selection)
-- the [documentation category guide](../reference/by-category/documentation.md) (Tier 2)
-- the [Context7 deep dive](../reference/deep-dives/context7.md) (Tier 3 as needed)
-- the [docs style guide](../reference/style-guides/docs-style-guide.md) (clear ADRs/decision docs)
-- the [handoff guidelines](../reference/handoff-guide.md)
+- the [compact MCP list](../../protocols/context/static/tools-guide.md) (Tier 1: tool selection)
+- the [docs style guide](../../protocols/context/static/style-guides/docs-style-guide.md) (clear ADRs/decision docs)
+- the [handoff guidelines](../../protocols/context/static/handoff-guide.md)
Output format:
- Summary: goals, scope, trust boundaries, SLOs, assumptions.
diff --git a/agents/role-prompts/api-mocking-specialist.md b/agents/role-prompts/api-mocking-specialist.md
index ae912934..2add22b8 100644
--- a/agents/role-prompts/api-mocking-specialist.md
+++ b/agents/role-prompts/api-mocking-specialist.md
@@ -21,8 +21,8 @@ Approach:
- Record/replay: capture real responses for realistic mocking.
Must‑read at startup:
-- the [compact MCP list](../reference/tools-guide.md) (Tier 1: tool selection)
-- the [handoff guidelines](../reference/handoff-guide.md)
+- the [compact MCP list](../../protocols/context/static/tools-guide.md) (Tier 1: tool selection)
+- the [handoff guidelines](../../protocols/context/static/handoff-guide.md)
Output format:
- Mock implementation: MSW handlers, WireMock mappings, Pact contracts.
diff --git a/agents/role-prompts/architect.md b/agents/role-prompts/architect.md
index 3e7ff457..b250fccb 100644
--- a/agents/role-prompts/architect.md
+++ b/agents/role-prompts/architect.md
@@ -19,9 +19,8 @@ Approach:
- Specify artifacts (ADRs/diagrams/SLO sketches) and enable a walking skeleton.
Must‑read at startup:
-- the [compact MCP list](../reference/tools-guide.md) (Tier 1: tool selection)
-- the [code search guide](../reference/by-category/code-search.md) (Tier 2)
-- the [handoff guidelines](../reference/handoff-guide.md)
+- the [compact MCP list](../../protocols/context/static/tools-guide.md) (Tier 1: tool selection)
+- the [handoff guidelines](../../protocols/context/static/handoff-guide.md)
Output format:
- Decision brief: objectives, constraints, options, trade‑offs, chosen path, revisit triggers; evidence links.
diff --git a/agents/role-prompts/architecture-audit.md b/agents/role-prompts/architecture-audit.md
index 5ca63b0d..ae8b226f 100644
--- a/agents/role-prompts/architecture-audit.md
+++ b/agents/role-prompts/architecture-audit.md
@@ -13,9 +13,8 @@ When to invoke:
- Onboarding to inherited/acquired codebases
At startup, read:
-- the [compact MCP list](../reference/tools-guide.md) (tier 1: tool selection)
-- the [code search guide](../reference/category/code-search.md) (tier 2: finding patterns)
-- the [handoff guidelines](../reference/handoff-guide.md) (delegation rules)
+- the [compact MCP list](../../protocols/context/static/tools-guide.md) (tier 1: tool selection)
+- the [handoff guidelines](../../protocols/context/static/handoff-guide.md) (delegation rules)
Approach:
1. Map high-level structure: layers, modules, boundaries, data flows
@@ -36,4 +35,3 @@ Constraints and handoffs:
- Distinguish must-fix (security, correctness, blockers) from should-improve
- Use clink to delegate specialized deep dives (Semgrep for patterns, performance analysis)
- AskUserQuestion for business constraints, roadmap priorities, team capacity
-- Read tier 3 deep dives when specialized analysis needed
diff --git a/agents/role-prompts/auth-specialist.md b/agents/role-prompts/auth-specialist.md
index b30442fe..b61edab8 100644
--- a/agents/role-prompts/auth-specialist.md
+++ b/agents/role-prompts/auth-specialist.md
@@ -23,10 +23,8 @@ Approach:
- Zero‑trust: mTLS, service mesh identities, short‑lived certs, least privilege.
Must‑read at startup:
-- the [compact MCP list](../reference/tools-guide.md) (Tier 1: tool selection)
-- the [code search guide](../reference/by-category/code-search.md) (Tier 2)
-- the [Semgrep deep dive](../reference/deep-dives/semgrep.md) (Tier 3 as needed)
-- the [handoff guidelines](../reference/handoff-guide.md)
+- the [compact MCP list](../../protocols/context/static/tools-guide.md) (Tier 1: tool selection)
+- the [handoff guidelines](../../protocols/context/static/handoff-guide.md)
Output format:
- Flow diagrams: auth/authz sequences with security boundaries and token exchanges.
diff --git a/agents/role-prompts/background-job-architect.md b/agents/role-prompts/background-job-architect.md
index 2d09e111..c0f5dcfa 100644
--- a/agents/role-prompts/background-job-architect.md
+++ b/agents/role-prompts/background-job-architect.md
@@ -22,8 +22,8 @@ Approach:
- Graceful shutdown: finish current job or checkpoint before worker dies.
Must‑read at startup:
-- the [compact MCP list](../reference/tools-guide.md) (Tier 1: tool selection)
-- the [handoff guidelines](../reference/handoff-guide.md)
+- the [compact MCP list](../../protocols/context/static/tools-guide.md) (Tier 1: tool selection)
+- the [handoff guidelines](../../protocols/context/static/handoff-guide.md)
Output format:
- Job definition: class/function, arguments, queue, retry policy, timeout.
diff --git a/agents/role-prompts/build-optimizer.md b/agents/role-prompts/build-optimizer.md
index 17f208e0..027ef243 100644
--- a/agents/role-prompts/build-optimizer.md
+++ b/agents/role-prompts/build-optimizer.md
@@ -21,8 +21,8 @@ Approach:
- Minimize transforms: avoid unnecessary Babel plugins, use native ESM.
Must‑read at startup:
-- the [compact MCP list](../reference/tools-guide.md) (Tier 1: tool selection)
-- the [handoff guidelines](../reference/handoff-guide.md)
+- the [compact MCP list](../../protocols/context/static/tools-guide.md) (Tier 1: tool selection)
+- the [handoff guidelines](../../protocols/context/static/handoff-guide.md)
Output format:
- Config changes: webpack.config.js, vite.config.ts, etc. with comments.
diff --git a/agents/role-prompts/caching-specialist.md b/agents/role-prompts/caching-specialist.md
index 68f4d7d6..d5de113b 100644
--- a/agents/role-prompts/caching-specialist.md
+++ b/agents/role-prompts/caching-specialist.md
@@ -23,10 +23,8 @@ Approach:
- Monitoring: track hit rate, miss rate, latency, evictions, memory usage.
Must‑read at startup:
-- the [compact MCP list](../reference/tools-guide.md) (Tier 1: tool selection)
-- the [code search guide](../reference/by-category/code-search.md) (Tier 2)
-- the [Sourcegraph deep dive](../reference/deep-dives/sourcegraph.md) (Tier 3 as needed)
-- the [handoff guidelines](../reference/handoff-guide.md)
+- the [compact MCP list](../../protocols/context/static/tools-guide.md) (Tier 1: tool selection)
+- the [handoff guidelines](../../protocols/context/static/handoff-guide.md)
Output format:
- Cache topology: layers (browser/CDN/app/DB), responsibilities, TTLs.
diff --git a/agents/role-prompts/chaos-engineer.md b/agents/role-prompts/chaos-engineer.md
index 999ce6fc..1359dccd 100644
--- a/agents/role-prompts/chaos-engineer.md
+++ b/agents/role-prompts/chaos-engineer.md
@@ -22,10 +22,8 @@ Approach:
- Automate: codify experiments in CI/staging; run continuously or on schedule.
Must‑read at startup:
-- the [compact MCP list](../reference/tools-guide.md) (Tier 1: tool selection)
-- the [code search guide](../reference/by-category/code-search.md) (Tier 2)
-- the [Sourcegraph deep dive](../reference/deep-dives/sourcegraph.md) (Tier 3 as needed)
-- the [handoff guidelines](../reference/handoff-guide.md)
+- the [compact MCP list](../../protocols/context/static/tools-guide.md) (Tier 1: tool selection)
+- the [handoff guidelines](../../protocols/context/static/handoff-guide.md)
Output format:
- Experiment plan: hypothesis, failure scenario, blast radius, abort criteria.
diff --git a/agents/role-prompts/ci-pipeline-builder.md b/agents/role-prompts/ci-pipeline-builder.md
index 59226eab..cc5571fd 100644
--- a/agents/role-prompts/ci-pipeline-builder.md
+++ b/agents/role-prompts/ci-pipeline-builder.md
@@ -21,8 +21,8 @@ Approach:
- Reusability: composite actions, reusable workflows, shared templates.
Must‑read at startup:
-- the [compact MCP list](../reference/tools-guide.md) (Tier 1: tool selection)
-- the [handoff guidelines](../reference/handoff-guide.md)
+- the [compact MCP list](../../protocols/context/static/tools-guide.md) (Tier 1: tool selection)
+- the [handoff guidelines](../../protocols/context/static/handoff-guide.md)
Output format:
- Pipeline config: .github/workflows/*.yml, .gitlab-ci.yml, Jenkinsfile, etc.
diff --git a/agents/role-prompts/code-reviewer.md b/agents/role-prompts/code-reviewer.md
index 54ebf284..6f4e900e 100644
--- a/agents/role-prompts/code-reviewer.md
+++ b/agents/role-prompts/code-reviewer.md
@@ -23,10 +23,8 @@ Approach:
- Provide specific feedback: file:line, suggested fix, rationale, severity (blocker/optional).
Must‑read at startup:
-- the [compact MCP list](../reference/tools-guide.md) (Tier 1: tool selection)
-- the [code search guide](../reference/by-category/code-search.md) (Tier 2)
-- the [Semgrep deep dive](../reference/deep-dives/semgrep.md) (Tier 3 as needed)
-- the [handoff guidelines](../reference/handoff-guide.md)
+- the [compact MCP list](../../protocols/context/static/tools-guide.md) (Tier 1: tool selection)
+- the [handoff guidelines](../../protocols/context/static/handoff-guide.md)
Output format:
- Summary: PR scope, risk level, overall assessment (approve/request changes/block).
diff --git a/agents/role-prompts/concurrency-specialist.md b/agents/role-prompts/concurrency-specialist.md
index 0097f2dc..d56eb1f3 100644
--- a/agents/role-prompts/concurrency-specialist.md
+++ b/agents/role-prompts/concurrency-specialist.md
@@ -22,8 +22,8 @@ Approach:
- Reason about happens-before: understand memory models and ordering.
Must‑read at startup:
-- the [compact MCP list](../reference/tools-guide.md) (Tier 1: tool selection)
-- the [handoff guidelines](../reference/handoff-guide.md)
+- the [compact MCP list](../../protocols/context/static/tools-guide.md) (Tier 1: tool selection)
+- the [handoff guidelines](../../protocols/context/static/handoff-guide.md)
Output format:
- Analysis: shared state identification, potential race conditions.
diff --git a/agents/role-prompts/cost-optimization-finops.md b/agents/role-prompts/cost-optimization-finops.md
index d9813e1b..90abe4a0 100644
--- a/agents/role-prompts/cost-optimization-finops.md
+++ b/agents/role-prompts/cost-optimization-finops.md
@@ -17,10 +17,8 @@ Approach:
- Governance/anomalies: enforce tags, budgets/alerts, PR checks; correlate spikes; rollback/guardrail; document.
Must‑read at startup:
-- the [compact MCP list](../reference/tools-guide.md) (Tier 1: tool selection)
-- the [code search guide](../reference/by-category/code-search.md) (Tier 2)
-- the [Sourcegraph deep dive](../reference/deep-dives/sourcegraph.md) (Tier 3 as needed)
-- the [handoff guidelines](../reference/handoff-guide.md)
+- the [compact MCP list](../../protocols/context/static/tools-guide.md) (Tier 1: tool selection)
+- the [handoff guidelines](../../protocols/context/static/handoff-guide.md)
Output format:
- Summary: baseline spend, top drivers, savings targets, constraints.
diff --git a/agents/role-prompts/cpp-pro.md b/agents/role-prompts/cpp-pro.md
index 7e3c3bab..1f63f301 100644
--- a/agents/role-prompts/cpp-pro.md
+++ b/agents/role-prompts/cpp-pro.md
@@ -20,10 +20,8 @@ Approach:
- Validate: benchmark deltas, perf counters, compile‑time checks; document diffs/risks.
Must‑read at startup:
-- the [compact MCP list](../reference/tools-guide.md) (Tier 1: tool selection)
-- the [code search guide](../reference/by-category/code-search.md) (Tier 2)
-- the [Semgrep deep dive](../reference/deep-dives/semgrep.md) (Tier 3 as needed)
-- the [handoff guidelines](../reference/handoff-guide.md)
+- the [compact MCP list](../../protocols/context/static/tools-guide.md) (Tier 1: tool selection)
+- the [handoff guidelines](../../protocols/context/static/handoff-guide.md)
Output format:
- Summary: context, target standard, constraints, assumptions.
diff --git a/agents/role-prompts/data-eng.md b/agents/role-prompts/data-eng.md
index d789da2b..cadcee28 100644
--- a/agents/role-prompts/data-eng.md
+++ b/agents/role-prompts/data-eng.md
@@ -22,10 +22,8 @@ Approach:
- Backfills: incremental with checkpointing; validate output; minimal recompute.
Must‑read at startup:
-- the [compact MCP list](../reference/tools-guide.md) (Tier 1: tool selection)
-- the [code search guide](../reference/by-category/code-search.md) (Tier 2)
-- the [Sourcegraph deep dive](../reference/deep-dives/sourcegraph.md) (Tier 3 as needed)
-- the [handoff guidelines](../reference/handoff-guide.md)
+- the [compact MCP list](../../protocols/context/static/tools-guide.md) (Tier 1: tool selection)
+- the [handoff guidelines](../../protocols/context/static/handoff-guide.md)
Output format:
- Data flow: DAG with sources/transforms/sinks, dependencies, SLAs.
diff --git a/agents/role-prompts/datetime-specialist.md b/agents/role-prompts/datetime-specialist.md
index 4372a3ae..295b9811 100644
--- a/agents/role-prompts/datetime-specialist.md
+++ b/agents/role-prompts/datetime-specialist.md
@@ -22,8 +22,8 @@ Approach:
- Document assumptions: what timezone is input, what timezone is output.
Must‑read at startup:
-- the [compact MCP list](../reference/tools-guide.md) (Tier 1: tool selection)
-- the [handoff guidelines](../reference/handoff-guide.md)
+- the [compact MCP list](../../protocols/context/static/tools-guide.md) (Tier 1: tool selection)
+- the [handoff guidelines](../../protocols/context/static/handoff-guide.md)
Output format:
- Data model: how datetime is stored, what timezone context is preserved.
diff --git a/agents/role-prompts/db-internals.md b/agents/role-prompts/db-internals.md
index 1f056f51..f9bc6a98 100644
--- a/agents/role-prompts/db-internals.md
+++ b/agents/role-prompts/db-internals.md
@@ -21,10 +21,8 @@ Approach:
- Prepare staged, reversible migrations/backfills; validate in staging.
Must-read at startup:
-- the [compact MCP list](../reference/tools-guide.md)
-- the [code search guide](../reference/by-category/code-search.md)
-- the [Sourcegraph deep dive](../reference/deep-dives/sourcegraph.md)
-- the [handoff guidelines](../reference/handoff-guide.md)
+- the [compact MCP list](../../protocols/context/static/tools-guide.md)
+- the [handoff guidelines](../../protocols/context/static/handoff-guide.md)
Output format:
- Findings: affected queries/tables with evidence (paths:lines, plans).
diff --git a/agents/role-prompts/debugger.md b/agents/role-prompts/debugger.md
index be97397d..c5d6fbd4 100644
--- a/agents/role-prompts/debugger.md
+++ b/agents/role-prompts/debugger.md
@@ -21,10 +21,8 @@ Approach:
- Document findings: timeline, evidence (logs/traces/dumps), root cause, fix validation.
Must‑read at startup:
-- the [compact MCP list](../reference/tools-guide.md) (Tier 1: tool selection)
-- the [code search guide](../reference/by-category/code-search.md) (Tier 2)
-- the [Sourcegraph deep dive](../reference/deep-dives/sourcegraph.md) (Tier 3 as needed)
-- the [handoff guidelines](../reference/handoff-guide.md)
+- the [compact MCP list](../../protocols/context/static/tools-guide.md) (Tier 1: tool selection)
+- the [handoff guidelines](../../protocols/context/static/handoff-guide.md)
Output format:
- Repro: minimal steps and environment to trigger the issue.
diff --git a/agents/role-prompts/dependency-auditor.md b/agents/role-prompts/dependency-auditor.md
index edc375ba..151701a5 100644
--- a/agents/role-prompts/dependency-auditor.md
+++ b/agents/role-prompts/dependency-auditor.md
@@ -21,8 +21,8 @@ Approach:
- Minimize attack surface: remove unused deps, prefer well-maintained packages.
Must‑read at startup:
-- the [compact MCP list](../reference/tools-guide.md) (Tier 1: tool selection)
-- the [handoff guidelines](../reference/handoff-guide.md)
+- the [compact MCP list](../../protocols/context/static/tools-guide.md) (Tier 1: tool selection)
+- the [handoff guidelines](../../protocols/context/static/handoff-guide.md)
Output format:
- Vulnerability report: CVE ID, severity, affected versions, fix version, exploitability.
diff --git a/agents/role-prompts/devops-infra-as-code.md b/agents/role-prompts/devops-infra-as-code.md
index 3daa07ed..cb8b3e8c 100644
--- a/agents/role-prompts/devops-infra-as-code.md
+++ b/agents/role-prompts/devops-infra-as-code.md
@@ -19,10 +19,8 @@ Approach:
- Document runbooks and patterns; standardize as reusable modules/templates.
Must‑read at startup:
-- the [compact MCP list](../reference/tools-guide.md) (Tier 1: tool selection)
-- the [code search guide](../reference/by-category/code-search.md) (Tier 2)
-- the [Semgrep deep dive](../reference/deep-dives/semgrep.md) (Tier 3 as needed)
-- the [handoff guidelines](../reference/handoff-guide.md)
+- the [compact MCP list](../../protocols/context/static/tools-guide.md) (Tier 1: tool selection)
+- the [handoff guidelines](../../protocols/context/static/handoff-guide.md)
Output format:
- Current vs target state: risks, constraints, and goals.
diff --git a/agents/role-prompts/distributed-systems.md b/agents/role-prompts/distributed-systems.md
index bcc267e0..0594034c 100644
--- a/agents/role-prompts/distributed-systems.md
+++ b/agents/role-prompts/distributed-systems.md
@@ -19,10 +19,8 @@ Approach:
- Validate: tracing/correlation IDs; chaos tests for partitions/clocks.
Must‑read at startup:
-- the [compact MCP list](../reference/tools-guide.md) (Tier 1: tool selection)
-- the [web research guide](../reference/by-category/web-research.md) (Tier 2)
-- the [Sourcegraph deep dive](../reference/deep-dives/sourcegraph.md) (Tier 3 as needed)
-- the [handoff guidelines](../reference/handoff-guide.md)
+- the [compact MCP list](../../protocols/context/static/tools-guide.md) (Tier 1: tool selection)
+- the [handoff guidelines](../../protocols/context/static/handoff-guide.md)
Output format:
- Architecture brief: goals, CAP stance, consistency model, failure assumptions.
diff --git a/agents/role-prompts/environment-debugger.md b/agents/role-prompts/environment-debugger.md
index 5a024591..a3e6d360 100644
--- a/agents/role-prompts/environment-debugger.md
+++ b/agents/role-prompts/environment-debugger.md
@@ -23,8 +23,8 @@ Approach:
- Automate checks: version validation in CI, environment linting.
Must‑read at startup:
-- the [compact MCP list](../reference/tools-guide.md) (Tier 1: tool selection)
-- the [handoff guidelines](../reference/handoff-guide.md)
+- the [compact MCP list](../../protocols/context/static/tools-guide.md) (Tier 1: tool selection)
+- the [handoff guidelines](../../protocols/context/static/handoff-guide.md)
Output format:
- Diagnosis: what's different between environments.
diff --git a/agents/role-prompts/event-driven.md b/agents/role-prompts/event-driven.md
index 0e7f365b..dc070a3f 100644
--- a/agents/role-prompts/event-driven.md
+++ b/agents/role-prompts/event-driven.md
@@ -23,10 +23,8 @@ Approach:
- Error handling: dead‑letter queues, retries with backoff, poison message detection.
Must‑read at startup:
-- the [compact MCP list](../reference/tools-guide.md) (Tier 1: tool selection)
-- the [code search guide](../reference/by-category/code-search.md) (Tier 2)
-- the [Sourcegraph deep dive](../reference/deep-dives/sourcegraph.md) (Tier 3 as needed)
-- the [handoff guidelines](../reference/handoff-guide.md)
+- the [compact MCP list](../../protocols/context/static/tools-guide.md) (Tier 1: tool selection)
+- the [handoff guidelines](../../protocols/context/static/handoff-guide.md)
Output format:
- Event flow: diagram with producers/consumers/topics, partitioning, ordering guarantees.
diff --git a/agents/role-prompts/explainer.md b/agents/role-prompts/explainer.md
index 29ea1b37..fc158c9e 100644
--- a/agents/role-prompts/explainer.md
+++ b/agents/role-prompts/explainer.md
@@ -12,7 +12,7 @@ When to invoke:
- Clarifying why architectural decisions were made
At startup, read:
-- the [compact MCP list](../reference/tools-guide.md) to make yourself fully aware of the MCP tools available to you, as well as the extra resources about them in this repo (for when you need them)
+- the [compact MCP list](../../protocols/context/static/tools-guide.md) to make yourself fully aware of the MCP tools available to you, as well as the extra resources about them in this repo (for when you need them)
Approach:
1. Start with the README, package.json/requirements.txt, or entry points to map high-level structure
@@ -20,7 +20,6 @@ Approach:
3. Trace a single, simple execution path end-to-end before generalizing
4. Use analogies and diagrams when helpful (offer to create mermaid visualizations)
5. Pause after each concept to check understanding before proceeding
-6. For complex tools, read references in [per-category MCP guides](../reference/by-category/) and [per-MCP deep dives](../reference/deep-dives/) as needed
Output format:
- Layered explanations: overview → key components → detailed walkthrough
diff --git a/agents/role-prompts/feature-flag-engineer.md b/agents/role-prompts/feature-flag-engineer.md
index 03379be3..52118662 100644
--- a/agents/role-prompts/feature-flag-engineer.md
+++ b/agents/role-prompts/feature-flag-engineer.md
@@ -22,8 +22,8 @@ Approach:
- Cleanup automation: lint rules for stale flags, alerts for expired flags, removal PRs.
Must‑read at startup:
-- the [compact MCP list](../reference/tools-guide.md) (Tier 1: tool selection)
-- the [handoff guidelines](../reference/handoff-guide.md)
+- the [compact MCP list](../../protocols/context/static/tools-guide.md) (Tier 1: tool selection)
+- the [handoff guidelines](../../protocols/context/static/handoff-guide.md)
Output format:
- Flag specification: name, description, type, default, targeting rules, expiration.
diff --git a/agents/role-prompts/frontend.md b/agents/role-prompts/frontend.md
index 3ba9708c..3aa8bd15 100644
--- a/agents/role-prompts/frontend.md
+++ b/agents/role-prompts/frontend.md
@@ -20,10 +20,8 @@ Approach:
- Measure every change (Lighthouse/RUM); block regressions.
Must‑read at startup:
-- the [compact MCP list](../reference/tools-guide.md) (Tier 1: tool selection)
-- the [code search guide](../reference/by-category/code-search.md) (Tier 2)
-- the [Semgrep deep dive](../reference/deep-dives/semgrep.md) (Tier 3 as needed)
-- the [handoff guidelines](../reference/handoff-guide.md)
+- the [compact MCP list](../../protocols/context/static/tools-guide.md) (Tier 1: tool selection)
+- the [handoff guidelines](../../protocols/context/static/handoff-guide.md)
Output format:
- Audit report: baseline Web Vitals, a11y gaps, bundle analysis.
diff --git a/agents/role-prompts/git-surgeon.md b/agents/role-prompts/git-surgeon.md
index 7cfbf49b..63473116 100644
--- a/agents/role-prompts/git-surgeon.md
+++ b/agents/role-prompts/git-surgeon.md
@@ -22,8 +22,8 @@ Approach:
- Clean history: atomic commits, meaningful messages, no merge commits in features.
Must‑read at startup:
-- the [compact MCP list](../reference/tools-guide.md) (Tier 1: tool selection)
-- the [handoff guidelines](../reference/handoff-guide.md)
+- the [compact MCP list](../../protocols/context/static/tools-guide.md) (Tier 1: tool selection)
+- the [handoff guidelines](../../protocols/context/static/handoff-guide.md)
Output format:
- Commands: exact git commands to run, in order, with explanations.
diff --git a/agents/role-prompts/golang-pro.md b/agents/role-prompts/golang-pro.md
index 18da6df4..7ee0e7f6 100644
--- a/agents/role-prompts/golang-pro.md
+++ b/agents/role-prompts/golang-pro.md
@@ -20,9 +20,8 @@ Approach:
- Stage small commits with clear rationale and rollback paths.
Must‑read at startup:
-- the [compact MCP list](../reference/tools-guide.md) (Tier 1: tool selection)
-- the [code search guide](../reference/by-category/code-search.md) (Tier 2)
-- the [handoff guidelines](../reference/handoff-guide.md)
+- the [compact MCP list](../../protocols/context/static/tools-guide.md) (Tier 1: tool selection)
+- the [handoff guidelines](../../protocols/context/static/handoff-guide.md)
Output format:
- Diff summary with rationale and Go idioms.
diff --git a/agents/role-prompts/graphql-specialist.md b/agents/role-prompts/graphql-specialist.md
index 039dcb6a..9477aa22 100644
--- a/agents/role-prompts/graphql-specialist.md
+++ b/agents/role-prompts/graphql-specialist.md
@@ -21,8 +21,8 @@ Approach:
- Monitor: field-level tracing, query complexity scoring, slow query logging.
Must‑read at startup:
-- the [compact MCP list](../reference/tools-guide.md) (Tier 1: tool selection)
-- the [handoff guidelines](../reference/handoff-guide.md)
+- the [compact MCP list](../../protocols/context/static/tools-guide.md) (Tier 1: tool selection)
+- the [handoff guidelines](../../protocols/context/static/handoff-guide.md)
Output format:
- Schema SDL: types, queries, mutations with descriptions and deprecation notices.
diff --git a/agents/role-prompts/historian.md b/agents/role-prompts/historian.md
index 1db6ec0a..677fd4ba 100644
--- a/agents/role-prompts/historian.md
+++ b/agents/role-prompts/historian.md
@@ -23,10 +23,8 @@ Approach:
- Extract rationale: commit messages, PR descriptions, code comments, design docs.
Must‑read at startup:
-- the [compact MCP list](../reference/tools-guide.md) (Tier 1: tool selection)
-- the [code search guide](../reference/by-category/code-search.md) (Tier 2)
-- the [Sourcegraph deep dive](../reference/deep-dives/sourcegraph.md) (Tier 3 as needed)
-- the [handoff guidelines](../reference/handoff-guide.md)
+- the [compact MCP list](../../protocols/context/static/tools-guide.md) (Tier 1: tool selection)
+- the [handoff guidelines](../../protocols/context/static/handoff-guide.md)
Output format:
- Timeline: chronological narrative with commits, PRs, issues, and decision points.
diff --git a/agents/role-prompts/http-client-specialist.md b/agents/role-prompts/http-client-specialist.md
index 646e2138..f2fbe559 100644
--- a/agents/role-prompts/http-client-specialist.md
+++ b/agents/role-prompts/http-client-specialist.md
@@ -22,8 +22,8 @@ Approach:
- Test failure modes: simulate timeouts, 5xx errors, connection refused.
Must‑read at startup:
-- the [compact MCP list](../reference/tools-guide.md) (Tier 1: tool selection)
-- the [handoff guidelines](../reference/handoff-guide.md)
+- the [compact MCP list](../../protocols/context/static/tools-guide.md) (Tier 1: tool selection)
+- the [handoff guidelines](../../protocols/context/static/handoff-guide.md)
Output format:
- Client configuration: timeouts, pool sizes, retry policy, circuit breaker settings.
diff --git a/agents/role-prompts/implementation-helper.md b/agents/role-prompts/implementation-helper.md
index 1205bf13..90150806 100644
--- a/agents/role-prompts/implementation-helper.md
+++ b/agents/role-prompts/implementation-helper.md
@@ -14,8 +14,8 @@ When to invoke:
- Making principled engineering decisions under constraints
At startup, read:
-- the [compact MCP list](../reference/tools-guide.md) to make yourself fully aware of the MCP tools available to you, as well as the extra resources about them in this repo (for when you need them)
-- the [handoff guidelines](../reference/handoff-guide.md) (delegation rules)
+- the [compact MCP list](../../protocols/context/static/tools-guide.md) to make yourself fully aware of the MCP tools available to you, as well as the extra resources about them in this repo (for when you need them)
+- the [handoff guidelines](../../protocols/context/static/handoff-guide.md) (delegation rules)
Approach:
1. Clarify scope and success criteria; identify ambiguities upfront
diff --git a/agents/role-prompts/incident-commander.md b/agents/role-prompts/incident-commander.md
index 856852b3..50380a74 100644
--- a/agents/role-prompts/incident-commander.md
+++ b/agents/role-prompts/incident-commander.md
@@ -22,10 +22,8 @@ Approach:
- Patterns: track recurring issues, MTTR, alert noise; propose systemic fixes.
Must‑read at startup:
-- the [compact MCP list](../reference/tools-guide.md) (Tier 1: tool selection)
-- the [code search guide](../reference/by-category/code-search.md) (Tier 2)
-- the [Sourcegraph deep dive](../reference/deep-dives/sourcegraph.md) (Tier 3 as needed)
-- the [handoff guidelines](../reference/handoff-guide.md)
+- the [compact MCP list](../../protocols/context/static/tools-guide.md) (Tier 1: tool selection)
+- the [handoff guidelines](../../protocols/context/static/handoff-guide.md)
Output format:
- Incident brief: severity, impact, start time, status, war room link.
diff --git a/agents/role-prompts/interviewer.md b/agents/role-prompts/interviewer.md
index 0f7a99f1..40a941f3 100644
--- a/agents/role-prompts/interviewer.md
+++ b/agents/role-prompts/interviewer.md
@@ -23,10 +23,8 @@ Approach:
- Provide feedback: acknowledge correct reasoning, gently correct misconceptions.
Must‑read at startup:
-- the [compact MCP list](../reference/tools-guide.md) (Tier 1: tool selection)
-- the [code search guide](../reference/by-category/code-search.md) (Tier 2)
-- the [Sourcegraph deep dive](../reference/deep-dives/sourcegraph.md) (Tier 3 as needed)
-- the [handoff guidelines](../reference/handoff-guide.md)
+- the [compact MCP list](../../protocols/context/static/tools-guide.md) (Tier 1: tool selection)
+- the [handoff guidelines](../../protocols/context/static/handoff-guide.md)
Output format:
- Question sequence: progressive difficulty, building on previous answers.
diff --git a/agents/role-prompts/kubernetes-operator.md b/agents/role-prompts/kubernetes-operator.md
index d77a5465..e8a2f93d 100644
--- a/agents/role-prompts/kubernetes-operator.md
+++ b/agents/role-prompts/kubernetes-operator.md
@@ -21,8 +21,8 @@ Approach:
- Observability: prometheus annotations, structured logging, tracing headers.
Must‑read at startup:
-- the [compact MCP list](../reference/tools-guide.md) (Tier 1: tool selection)
-- the [handoff guidelines](../reference/handoff-guide.md)
+- the [compact MCP list](../../protocols/context/static/tools-guide.md) (Tier 1: tool selection)
+- the [handoff guidelines](../../protocols/context/static/handoff-guide.md)
Output format:
- Manifests: Deployment, Service, ConfigMap, etc. with inline comments.
diff --git a/agents/role-prompts/localization-engineer.md b/agents/role-prompts/localization-engineer.md
index 9d574712..57897105 100644
--- a/agents/role-prompts/localization-engineer.md
+++ b/agents/role-prompts/localization-engineer.md
@@ -22,8 +22,8 @@ Approach:
- Plan for text expansion: translations can be 30-50% longer.
Must‑read at startup:
-- the [compact MCP list](../reference/tools-guide.md) (Tier 1: tool selection)
-- the [handoff guidelines](../reference/handoff-guide.md)
+- the [compact MCP list](../../protocols/context/static/tools-guide.md) (Tier 1: tool selection)
+- the [handoff guidelines](../../protocols/context/static/handoff-guide.md)
Output format:
- Message catalog: extracted strings in ICU format or framework-specific.
diff --git a/agents/role-prompts/log-analyst.md b/agents/role-prompts/log-analyst.md
index be634e59..d021e17e 100644
--- a/agents/role-prompts/log-analyst.md
+++ b/agents/role-prompts/log-analyst.md
@@ -21,8 +21,8 @@ Approach:
- Context gathering: what happened before the error, related logs.
Must‑read at startup:
-- the [compact MCP list](../reference/tools-guide.md) (Tier 1: tool selection)
-- the [handoff guidelines](../reference/handoff-guide.md)
+- the [compact MCP list](../../protocols/context/static/tools-guide.md) (Tier 1: tool selection)
+- the [handoff guidelines](../../protocols/context/static/handoff-guide.md)
Output format:
- Timeline: sequence of events with timestamps and service names.
diff --git a/agents/role-prompts/message-queue-architect.md b/agents/role-prompts/message-queue-architect.md
index f42592f3..671ca47d 100644
--- a/agents/role-prompts/message-queue-architect.md
+++ b/agents/role-prompts/message-queue-architect.md
@@ -22,8 +22,8 @@ Approach:
- Dead letter strategy: capture failures, enable investigation, support replay.
Must‑read at startup:
-- the [compact MCP list](../reference/tools-guide.md) (Tier 1: tool selection)
-- the [handoff guidelines](../reference/handoff-guide.md)
+- the [compact MCP list](../../protocols/context/static/tools-guide.md) (Tier 1: tool selection)
+- the [handoff guidelines](../../protocols/context/static/handoff-guide.md)
Output format:
- Architecture diagram: producers, topics/queues, consumers, DLQ flow.
diff --git a/agents/role-prompts/migration-refactoring.md b/agents/role-prompts/migration-refactoring.md
index bd0fca7b..f9415c72 100644
--- a/agents/role-prompts/migration-refactoring.md
+++ b/agents/role-prompts/migration-refactoring.md
@@ -20,11 +20,9 @@ Approach:
- Plan data migration (expand–migrate–contract), backfills, reconciliation; clean up flags/shims.
Must‑read at startup:
-- the [compact MCP list](../reference/tools-guide.md) (Tier 1: tool selection)
-- the [code search guide](../reference/by-category/code-search.md) (Tier 2)
-- the [Sourcegraph deep dive](../reference/deep-dives/sourcegraph.md) (Tier 3 as needed)
-- the [docs style guide](../reference/style-guides/docs-style-guide.md) (concise specs/ADRs)
-- the [handoff guidelines](../reference/handoff-guide.md)
+- the [compact MCP list](../../protocols/context/static/tools-guide.md) (Tier 1: tool selection)
+- the [docs style guide](../../protocols/context/static/style-guides/docs-style-guide.md) (concise specs/ADRs)
+- the [handoff guidelines](../../protocols/context/static/handoff-guide.md)
Output format:
- Migration spec: target, scope, assumptions, risks, success criteria.
diff --git a/agents/role-prompts/mobile-eng-architect.md b/agents/role-prompts/mobile-eng-architect.md
index 2fd6c25b..f01922cb 100644
--- a/agents/role-prompts/mobile-eng-architect.md
+++ b/agents/role-prompts/mobile-eng-architect.md
@@ -18,10 +18,8 @@ Approach:
- Release/CI: Fastlane/Gradle, signing, test gates, phased rollout, store checks.
Must‑read at startup:
-- the [compact MCP list](../reference/tools-guide.md) (Tier 1: tool selection)
-- the [code search guide](../reference/by-category/code-search.md) (Tier 2)
-- the [Sourcegraph deep dive](../reference/deep-dives/sourcegraph.md) (Tier 3 as needed)
-- the [handoff guidelines](../reference/handoff-guide.md)
+- the [compact MCP list](../../protocols/context/static/tools-guide.md) (Tier 1: tool selection)
+- the [handoff guidelines](../../protocols/context/static/handoff-guide.md)
Output format:
- Architecture brief: platforms, framework choice, modules, state/nav.
diff --git a/agents/role-prompts/monorepo-architect.md b/agents/role-prompts/monorepo-architect.md
index fe526d14..37c434d1 100644
--- a/agents/role-prompts/monorepo-architect.md
+++ b/agents/role-prompts/monorepo-architect.md
@@ -21,8 +21,8 @@ Approach:
- Code sharing: internal packages with proper exports, avoid barrel files at scale.
Must‑read at startup:
-- the [compact MCP list](../reference/tools-guide.md) (Tier 1: tool selection)
-- the [handoff guidelines](../reference/handoff-guide.md)
+- the [compact MCP list](../../protocols/context/static/tools-guide.md) (Tier 1: tool selection)
+- the [handoff guidelines](../../protocols/context/static/handoff-guide.md)
Output format:
- Structure diagram: folder hierarchy with package boundaries and dependencies.
diff --git a/agents/role-prompts/networking-edge-infra.md b/agents/role-prompts/networking-edge-infra.md
index d19ad876..11d1d044 100644
--- a/agents/role-prompts/networking-edge-infra.md
+++ b/agents/role-prompts/networking-edge-infra.md
@@ -21,11 +21,9 @@ Approach:
- Plan rollout: canary by path/region, staged shifts; monitoring + rollback.
Must‑read at startup:
-- the [compact MCP list](../reference/tools-guide.md) (Tier 1: tool selection)
-- the [code search guide](../reference/by-category/code-search.md) (Tier 2)
-- the [Sourcegraph deep dive](../reference/deep-dives/sourcegraph.md) (Tier 3 as needed)
-- the [docs style guide](../reference/style-guides/docs-style-guide.md) (decision docs)
-- the [handoff guidelines](../reference/handoff-guide.md)
+- the [compact MCP list](../../protocols/context/static/tools-guide.md) (Tier 1: tool selection)
+- the [docs style guide](../../protocols/context/static/style-guides/docs-style-guide.md) (decision docs)
+- the [handoff guidelines](../../protocols/context/static/handoff-guide.md)
Output format:
- Summary: objectives, constraints, SLOs, assumptions.
diff --git a/agents/role-prompts/observability.md b/agents/role-prompts/observability.md
index 83cf8c1b..2eacd13d 100644
--- a/agents/role-prompts/observability.md
+++ b/agents/role-prompts/observability.md
@@ -19,10 +19,8 @@ Approach:
- For incidents: declare, stabilize, correlate traces/metrics/logs, document timeline and follow‑ups.
Must‑read at startup:
-- the [compact MCP list](../reference/tools-guide.md) (Tier 1: tool selection)
-- the [code search guide](../reference/by-category/code-search.md) (Tier 2)
-- the [Sourcegraph deep dive](../reference/deep-dives/sourcegraph.md) (Tier 3 as needed)
-- the [handoff guidelines](../reference/handoff-guide.md)
+- the [compact MCP list](../../protocols/context/static/tools-guide.md) (Tier 1: tool selection)
+- the [handoff guidelines](../../protocols/context/static/handoff-guide.md)
Output format:
- Telemetry plan: coverage deltas, propagation, key metrics/log fields.
diff --git a/agents/role-prompts/optimization.md b/agents/role-prompts/optimization.md
index 81b6ffee..2da74cef 100644
--- a/agents/role-prompts/optimization.md
+++ b/agents/role-prompts/optimization.md
@@ -18,10 +18,8 @@ Approach:
- Re-measure after each change; keep diffs small and reversible.
Must‑read at startup:
-- the [compact MCP list](../reference/tools-guide.md) (Tier 1: tool selection)
-- the [code search guide](../reference/by-category/code-search.md) (Tier 2)
-- the [Semgrep deep dive](../reference/deep-dives/semgrep.md) (Tier 3 as needed)
-- the [handoff guidelines](../reference/handoff-guide.md)
+- the [compact MCP list](../../protocols/context/static/tools-guide.md) (Tier 1: tool selection)
+- the [handoff guidelines](../../protocols/context/static/handoff-guide.md)
Output format:
- Summary: baseline vs targets; constraints and risks.
diff --git a/agents/role-prompts/orm-optimization-specialist.md b/agents/role-prompts/orm-optimization-specialist.md
index ac1126f8..d43d0aee 100644
--- a/agents/role-prompts/orm-optimization-specialist.md
+++ b/agents/role-prompts/orm-optimization-specialist.md
@@ -22,8 +22,8 @@ Approach:
- Test with realistic data: N+1 is invisible with 2 records, catastrophic with 1000.
Must‑read at startup:
-- the [compact MCP list](../reference/tools-guide.md) (Tier 1: tool selection)
-- the [handoff guidelines](../reference/handoff-guide.md)
+- the [compact MCP list](../../protocols/context/static/tools-guide.md) (Tier 1: tool selection)
+- the [handoff guidelines](../../protocols/context/static/handoff-guide.md)
Output format:
- Query analysis: current queries, N+1 identification, query count per operation.
diff --git a/agents/role-prompts/platform-eng.md b/agents/role-prompts/platform-eng.md
index 57097ed2..185b752b 100644
--- a/agents/role-prompts/platform-eng.md
+++ b/agents/role-prompts/platform-eng.md
@@ -19,10 +19,8 @@ Approach:
- Document in portal; provide upgrade paths/escape hatches; track feedback.
Must-read at startup:
-- the [compact MCP list](../reference/tools-guide.md)
-- the [code search guide](../reference/by-category/code-search.md)
-- the [Sourcegraph deep dive](../reference/deep-dives/sourcegraph.md)
-- the [handoff guidelines](../reference/handoff-guide.md)
+- the [compact MCP list](../../protocols/context/static/tools-guide.md)
+- the [handoff guidelines](../../protocols/context/static/handoff-guide.md)
Output format:
- Findings: sprawl hotspots/manual steps with evidence (paths:lines).
diff --git a/agents/role-prompts/realtime.md b/agents/role-prompts/realtime.md
index 2e3dfb34..cfff4551 100644
--- a/agents/role-prompts/realtime.md
+++ b/agents/role-prompts/realtime.md
@@ -19,10 +19,8 @@ Approach:
- Validate with load/soak/replay/chaos; stage behind flags/canaries; re‑measure.
Must‑read at startup:
-- the [compact MCP list](../reference/tools-guide.md) (Tier 1: tool selection)
-- the [code search guide](../reference/by-category/code-search.md) (Tier 2)
-- the [Context7 deep dive](../reference/deep-dives/context7.md) (Tier 3 as needed)
-- the [handoff guidelines](../reference/handoff-guide.md)
+- the [compact MCP list](../../protocols/context/static/tools-guide.md) (Tier 1: tool selection)
+- the [handoff guidelines](../../protocols/context/static/handoff-guide.md)
Output format:
- Budget: topology, per‑hop targets, assumptions, and constraints.
diff --git a/agents/role-prompts/regex-wizard.md b/agents/role-prompts/regex-wizard.md
index ec71946c..eeb9891a 100644
--- a/agents/role-prompts/regex-wizard.md
+++ b/agents/role-prompts/regex-wizard.md
@@ -21,8 +21,8 @@ Approach:
- Document: explain each part of the pattern inline.
Must‑read at startup:
-- the [compact MCP list](../reference/tools-guide.md) (Tier 1: tool selection)
-- the [handoff guidelines](../reference/handoff-guide.md)
+- the [compact MCP list](../../protocols/context/static/tools-guide.md) (Tier 1: tool selection)
+- the [handoff guidelines](../../protocols/context/static/handoff-guide.md)
Output format:
- Pattern: the regex with inline comments (x-flag style when supported).
diff --git a/agents/role-prompts/rust-pro.md b/agents/role-prompts/rust-pro.md
index ac2c9782..c283f45f 100644
--- a/agents/role-prompts/rust-pro.md
+++ b/agents/role-prompts/rust-pro.md
@@ -20,9 +20,8 @@ Approach:
- Stage small commits with rationale and rollback paths.
Must‑read at startup:
-- the [compact MCP list](../reference/tools-guide.md) (Tier 1: tool selection)
-- the [code search guide](../reference/by-category/code-search.md) (Tier 2)
-- the [handoff guidelines](../reference/handoff-guide.md)
+- the [compact MCP list](../../protocols/context/static/tools-guide.md) (Tier 1: tool selection)
+- the [handoff guidelines](../../protocols/context/static/handoff-guide.md)
Output format:
- Diff summary with rationale, referenced Rust idioms.
diff --git a/agents/role-prompts/scalability-reliability.md b/agents/role-prompts/scalability-reliability.md
index 1e767acb..202cb1f0 100644
--- a/agents/role-prompts/scalability-reliability.md
+++ b/agents/role-prompts/scalability-reliability.md
@@ -19,10 +19,8 @@ Approach:
- Capture runbooks, dashboards‑as‑code, and post‑incident actions.
Must‑read at startup:
-- the [compact MCP list](../reference/tools-guide.md) (Tier 1: tool selection)
-- the [code search guide](../reference/by-category/code-search.md) (Tier 2)
-- the [Semgrep deep dive](../reference/deep-dives/semgrep.md) (Tier 3 as needed)
-- the [handoff guidelines](../reference/handoff-guide.md)
+- the [compact MCP list](../../protocols/context/static/tools-guide.md) (Tier 1: tool selection)
+- the [handoff guidelines](../../protocols/context/static/handoff-guide.md)
Output format:
- SLO spec: SLIs, targets, windows; error‑budget policy and alerts.
diff --git a/agents/role-prompts/schema-evolution.md b/agents/role-prompts/schema-evolution.md
index 74f6fe82..2d34b30d 100644
--- a/agents/role-prompts/schema-evolution.md
+++ b/agents/role-prompts/schema-evolution.md
@@ -23,10 +23,8 @@ Approach:
- API versioning: URL/header versioning, deprecation notices, sunset timelines.
Must‑read at startup:
-- the [compact MCP list](../reference/tools-guide.md) (Tier 1: tool selection)
-- the [code search guide](../reference/by-category/code-search.md) (Tier 2)
-- the [Sourcegraph deep dive](../reference/deep-dives/sourcegraph.md) (Tier 3 as needed)
-- the [handoff guidelines](../reference/handoff-guide.md)
+- the [compact MCP list](../../protocols/context/static/tools-guide.md) (Tier 1: tool selection)
+- the [handoff guidelines](../../protocols/context/static/handoff-guide.md)
Output format:
- Migration plan: phases (expand/migrate/contract), DDL statements, rollback steps.
diff --git a/agents/role-prompts/search-implementation-specialist.md b/agents/role-prompts/search-implementation-specialist.md
index b906c00d..8b531322 100644
--- a/agents/role-prompts/search-implementation-specialist.md
+++ b/agents/role-prompts/search-implementation-specialist.md
@@ -22,8 +22,8 @@ Approach:
- Iterate: relevance is never "done"; instrument, measure, improve continuously.
Must‑read at startup:
-- the [compact MCP list](../reference/tools-guide.md) (Tier 1: tool selection)
-- the [handoff guidelines](../reference/handoff-guide.md)
+- the [compact MCP list](../../protocols/context/static/tools-guide.md) (Tier 1: tool selection)
+- the [handoff guidelines](../../protocols/context/static/handoff-guide.md)
Output format:
- Index mapping: field types, analyzers, multi-fields for different query patterns.
diff --git a/agents/role-prompts/searcher.md b/agents/role-prompts/searcher.md
index cc6fb82a..cc096efc 100644
--- a/agents/role-prompts/searcher.md
+++ b/agents/role-prompts/searcher.md
@@ -16,10 +16,8 @@ Approach:
- Present the user with a list of relevant code snippets.
Must-read at startup:
-- the [compact MCP list](../reference/tools-guide.md) (Tier 1)
-- the [code search guide](../reference/by-category/code-search.md) (Tier 2)
-- the [Sourcegraph deep dive](../reference/deep-dives/sourcegraph.md) (Tier 3)
-- the [handoff guidelines](../reference/handoff-guide.md)
+- the [compact MCP list](../../protocols/context/static/tools-guide.md) (Tier 1)
+- the [handoff guidelines](../../protocols/context/static/handoff-guide.md)
Output format:
- A list of code snippets, each with the file path and line number.
diff --git a/agents/role-prompts/security-compliance.md b/agents/role-prompts/security-compliance.md
index e3661338..ca586c96 100644
--- a/agents/role-prompts/security-compliance.md
+++ b/agents/role-prompts/security-compliance.md
@@ -18,10 +18,8 @@ Approach:
- Verify/capture: targeted tests; adherence dashboards; store decisions/evidence.
Must‑read at startup:
-- the [compact MCP list](../reference/tools-guide.md) (Tier 1: tool selection)
-- the [code search guide](../reference/by-category/code-search.md) (Tier 2)
-- the [Semgrep deep dive](../reference/deep-dives/semgrep.md) (Tier 3 as needed)
-- the [handoff guidelines](../reference/handoff-guide.md)
+- the [compact MCP list](../../protocols/context/static/tools-guide.md) (Tier 1: tool selection)
+- the [handoff guidelines](../../protocols/context/static/handoff-guide.md)
Output format:
- Risk summary: top findings, severity, assets, impact.
diff --git a/agents/role-prompts/serverless-specialist.md b/agents/role-prompts/serverless-specialist.md
index 190789b0..fb13717a 100644
--- a/agents/role-prompts/serverless-specialist.md
+++ b/agents/role-prompts/serverless-specialist.md
@@ -22,8 +22,8 @@ Approach:
- Idempotency: event sources may duplicate; design handlers to be replayable.
Must‑read at startup:
-- the [compact MCP list](../reference/tools-guide.md) (Tier 1: tool selection)
-- the [handoff guidelines](../reference/handoff-guide.md)
+- the [compact MCP list](../../protocols/context/static/tools-guide.md) (Tier 1: tool selection)
+- the [handoff guidelines](../../protocols/context/static/handoff-guide.md)
Output format:
- Function design: handler structure, initialization, event parsing, response format.
diff --git a/agents/role-prompts/shell-scripter.md b/agents/role-prompts/shell-scripter.md
index a7621b7e..999be34a 100644
--- a/agents/role-prompts/shell-scripter.md
+++ b/agents/role-prompts/shell-scripter.md
@@ -21,8 +21,8 @@ Approach:
- Clean up: trap EXIT for cleanup, use mktemp for temp files.
Must‑read at startup:
-- the [compact MCP list](../reference/tools-guide.md) (Tier 1: tool selection)
-- the [handoff guidelines](../reference/handoff-guide.md)
+- the [compact MCP list](../../protocols/context/static/tools-guide.md) (Tier 1: tool selection)
+- the [handoff guidelines](../../protocols/context/static/handoff-guide.md)
Output format:
- Script: complete, commented, with shebang and set flags.
diff --git a/agents/role-prompts/state-machine-designer.md b/agents/role-prompts/state-machine-designer.md
index 1b02e9dd..b8b0ab1e 100644
--- a/agents/role-prompts/state-machine-designer.md
+++ b/agents/role-prompts/state-machine-designer.md
@@ -22,8 +22,8 @@ Approach:
- Visualize always: state diagrams are documentation and debugging tools.
Must‑read at startup:
-- the [compact MCP list](../reference/tools-guide.md) (Tier 1: tool selection)
-- the [handoff guidelines](../reference/handoff-guide.md)
+- the [compact MCP list](../../protocols/context/static/tools-guide.md) (Tier 1: tool selection)
+- the [handoff guidelines](../../protocols/context/static/handoff-guide.md)
Output format:
- State diagram: visual representation (Mermaid, XState Viz, or ASCII).
diff --git a/agents/role-prompts/task-decomposer.md b/agents/role-prompts/task-decomposer.md
index 8edca017..cbba94ae 100644
--- a/agents/role-prompts/task-decomposer.md
+++ b/agents/role-prompts/task-decomposer.md
@@ -23,8 +23,8 @@ Approach:
- Agent routing: map subtasks to roles (architect, debugger, testing, etc.).
Must‑read at startup:
-- the [compact MCP list](../reference/tools-guide.md) (Tier 1: tool selection)
-- the [handoff guidelines](../reference/handoff-guide.md) (when to delegate to which agent)
+- the [compact MCP list](../../protocols/context/static/tools-guide.md) (Tier 1: tool selection)
+- the [handoff guidelines](../../protocols/context/static/handoff-guide.md) (when to delegate to which agent)
Output format:
- Summary: problem statement, success criteria, constraints, assumptions.
diff --git a/agents/role-prompts/tech-debt.md b/agents/role-prompts/tech-debt.md
index 69a56a40..4a17d5ab 100644
--- a/agents/role-prompts/tech-debt.md
+++ b/agents/role-prompts/tech-debt.md
@@ -20,11 +20,9 @@ Approach:
- Sequence work into safe iterations; measure deltas after each step.
Must‑read at startup:
-- the [compact MCP list](../reference/tools-guide.md) (Tier 1: tool selection)
-- the [code search guide](../reference/by-category/code-search.md) (Tier 2)
-- the [Sourcegraph deep dive](../reference/deep-dives/sourcegraph.md) (Tier 3 as needed)
-- the [docs style guide](../reference/style-guides/docs-style-guide.md) (for concise decision docs)
-- the [handoff guidelines](../reference/handoff-guide.md)
+- the [compact MCP list](../../protocols/context/static/tools-guide.md) (Tier 1: tool selection)
+- the [docs style guide](../../protocols/context/static/style-guides/docs-style-guide.md) (for concise decision docs)
+- the [handoff guidelines](../../protocols/context/static/handoff-guide.md)
Output format:
- Summary: context, objectives, constraints; current risk level.
diff --git a/agents/role-prompts/terraform-specialist.md b/agents/role-prompts/terraform-specialist.md
index 70f52903..96acfecc 100644
--- a/agents/role-prompts/terraform-specialist.md
+++ b/agents/role-prompts/terraform-specialist.md
@@ -21,8 +21,8 @@ Approach:
- Prefer data sources over hardcoded IDs; use `moved` blocks for refactors.
Must‑read at startup:
-- the [compact MCP list](../reference/tools-guide.md) (Tier 1: tool selection)
-- the [handoff guidelines](../reference/handoff-guide.md)
+- the [compact MCP list](../../protocols/context/static/tools-guide.md) (Tier 1: tool selection)
+- the [handoff guidelines](../../protocols/context/static/handoff-guide.md)
Output format:
- Plan summary: resources to add/change/destroy with risk assessment (low/medium/high).
diff --git a/agents/role-prompts/testing.md b/agents/role-prompts/testing.md
index 251a09f7..f4762e47 100644
--- a/agents/role-prompts/testing.md
+++ b/agents/role-prompts/testing.md
@@ -21,10 +21,8 @@ Approach:
- Document patterns; prepare minimal, safe diffs and rollout notes.
Must‑read at startup:
-- the [compact MCP list](../reference/tools-guide.md)
-- the [code search guide](../reference/by-category/code-search.md)
-- the [Semgrep deep dive](../reference/deep-dives/semgrep.md)
-- the [handoff guidelines](../reference/handoff-guide.md)
+- the [compact MCP list](../../protocols/context/static/tools-guide.md)
+- the [handoff guidelines](../../protocols/context/static/handoff-guide.md)
Output format:
- Findings: flake hotspots and gaps with evidence (paths:lines).
diff --git a/agents/role-prompts/type-system-expert.md b/agents/role-prompts/type-system-expert.md
index 6b32b9b5..2245a36f 100644
--- a/agents/role-prompts/type-system-expert.md
+++ b/agents/role-prompts/type-system-expert.md
@@ -22,8 +22,8 @@ Approach:
- Document complex types: JSDoc, comments, examples.
Must‑read at startup:
-- the [compact MCP list](../reference/tools-guide.md) (Tier 1: tool selection)
-- the [handoff guidelines](../reference/handoff-guide.md)
+- the [compact MCP list](../../protocols/context/static/tools-guide.md) (Tier 1: tool selection)
+- the [handoff guidelines](../../protocols/context/static/handoff-guide.md)
Output format:
- Type definitions: with inline comments explaining each part.
diff --git a/agents/role-prompts/webhook-integration-specialist.md b/agents/role-prompts/webhook-integration-specialist.md
index 316cc99b..0ce99202 100644
--- a/agents/role-prompts/webhook-integration-specialist.md
+++ b/agents/role-prompts/webhook-integration-specialist.md
@@ -21,8 +21,8 @@ Approach:
- **Sending:** provide event logs, retry buttons, and delivery status in dashboard.
Must‑read at startup:
-- the [compact MCP list](../reference/tools-guide.md) (Tier 1: tool selection)
-- the [handoff guidelines](../reference/handoff-guide.md)
+- the [compact MCP list](../../protocols/context/static/tools-guide.md) (Tier 1: tool selection)
+- the [handoff guidelines](../../protocols/context/static/handoff-guide.md)
Output format:
- Endpoint implementation: signature verification, quick response, async processing.
diff --git a/agents/scripts/README.md b/agents/scripts/README.md
new file mode 100644
index 00000000..3bcc0953
--- /dev/null
+++ b/agents/scripts/README.md
@@ -0,0 +1,23 @@
+# Agent setup scripts
+
+This directory contains scripts that set up Bureau's agent role prompts for use within the supported coding agent CLIs, both as background subagents and direct, main agents.
+
+## Why role prompt bodies are *embedded* in the launcher scripts generated for Codex & Gemini
+
+> [!NOTE]
+> This section concerns *only* the launcher generator scripts [for Codex](set-up-codex-role-launchers.sh) and [for Gemini](set-up-gemini-role-launchers.sh).
+
+### Background
+
+- The launcher generators *embed* the role prompt content into each generated launcher script.
+- These, in turn, only write their role prompt to a temp file when they're run (the temp file gets automatically cleaned via `trap`, and backups are used to avoid clobbering).
+
+### Rationale
+
+- **Maintains a snapshot of behavior:** launchers are stable even if role prompts are changed later (the role prompts only update upon the next run of the corresponding launcher generator script and/or `open-bureau`)
+- **Launchers keep working without the repo** even if it's moved or deleted, avoiding runtime dependency on repo availability.
+- **Keeping security/perms consistent** by not requiring launchers to read repo files at runtime.
+
+> [!TIP]
+>
+> After updating any role prompts, you **must** run [`open-bureau`](../../bin/open-bureau) to regenerate the launcher scripts to contain the updated prompts.
diff --git a/agents/scripts/set-up-agents.sh b/agents/scripts/set-up-agents.sh
index 2cc0555d..69f6fc5d 100755
--- a/agents/scripts/set-up-agents.sh
+++ b/agents/scripts/set-up-agents.sh
@@ -5,12 +5,6 @@
set -euo pipefail
-# Color codes for output
-RED='\033[0;31m'
-GREEN='\033[0;32m'
-YELLOW='\033[1;33m'
-NC='\033[0m' # No Color
-
# Find the repo root (where this script's ancestor directory is)
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
AGENTS_DIR="$(cd "$SCRIPT_DIR/.." && pwd)"
@@ -18,8 +12,9 @@ CLAUDE_AGENTS_DIRNAME="claude-subagents"
CLINK_AGENTS_DIRNAME="role-prompts"
REPO_ROOT="$(cd "$AGENTS_DIR/.." && pwd)"
-# Source agent selection library
+# Source internal Bureau libraries
source "$REPO_ROOT/bin/lib/agent-selection.sh"
+source "$REPO_ROOT/bin/lib/logging.sh"
# Detect installed CLIs based on directory existence (exits if none found, logs detected CLIs)
discover_agents
@@ -27,30 +22,15 @@ discover_agents
# Subdirectory name for symlinked agents
AGENTS_SUBDIR="bureau-agents"
-echo -e "${GREEN}Setting up Bureau agents${NC}"
-echo -e "Repo root: $REPO_ROOT"
-echo -e "Selected agents: ${AGENTS[*]}"
-echo ""
-
-# Function to print step headers
-print_step() {
- echo -e "${YELLOW}==>${NC} $1"
-}
-
-# Function to print success
-print_success() {
- echo -e "${GREEN}✓${NC} $1"
-}
-
-# Function to print error and exit
-print_error() {
- echo -e "${RED}✗${NC} $1" >&2
- exit 1
-}
+log_banner "Setting up Bureau agents"
+echo "Repo root: $REPO_ROOT"
+echo "Selected agents: ${AGENTS[*]}"
+log_empty_line
# Check if we're in the right place
if [[ ! -d "$AGENTS_DIR/$CLAUDE_AGENTS_DIRNAME" ]] || [[ ! -d "$AGENTS_DIR/$CLINK_AGENTS_DIRNAME" ]]; then
- print_error "Cannot find agent directories! ($CLAUDE_AGENTS_DIRNAME/ and $CLINK_AGENTS_DIRNAME within $AGENTS_DIR)"
+ log_error "Cannot find agent directories! ($CLAUDE_AGENTS_DIRNAME/ and $CLINK_AGENTS_DIRNAME within $AGENTS_DIR)"
+ exit 1
fi
# ============================================================================
@@ -58,19 +38,19 @@ fi
# ============================================================================
# Only set up PAL if any agent is selected (PAL is cross-CLI, used by all)
if [[ ${#AGENTS[@]} -gt 0 ]]; then
- print_step "Setting up clink subagents for PAL MCP"
+ log_action "Setting up clink subagents for PAL MCP"
# Create directory structure
mkdir -p ~/.pal/cli_clients/systemprompts
- print_success "Ensured/created ~/.pal/cli_clients/systemprompts"
+ log_success "Ensured/created ~/.pal/cli_clients/systemprompts"
# Symlink role prompts folder
if [[ -L ~/.pal/cli_clients/systemprompts/$AGENTS_SUBDIR ]]; then
rm ~/.pal/cli_clients/systemprompts/$AGENTS_SUBDIR
- print_success "Removed existing Bureau symlink at ~/.pal/cli_clients/systemprompts/$AGENTS_SUBDIR (to ensure consistency after any reconfiguration)"
+ log_success "Removed existing Bureau symlink at ~/.pal/cli_clients/systemprompts/$AGENTS_SUBDIR (to ensure consistency after any reconfiguration)"
fi
ln -s "$AGENTS_DIR/$CLINK_AGENTS_DIRNAME" ~/.pal/cli_clients/systemprompts/$AGENTS_SUBDIR
- print_success "Symlinked role prompts (for use with clink) to ~/.pal/cli_clients/systemprompts/$AGENTS_SUBDIR"
+ log_success "Symlinked role prompts (for use with clink) to ~/.pal/cli_clients/systemprompts/$AGENTS_SUBDIR"
echo ""
fi
@@ -79,23 +59,23 @@ fi
# Step 2: Set up Claude Code subagents
# ============================================================================
if agent_enabled "Claude Code"; then
- print_step "Setting up Claude Code subagents"
+ log_action "Setting up Claude Code subagents"
# Symlink Claude subagents folder
if [[ -L ~/.claude/agents/$AGENTS_SUBDIR ]]; then
rm ~/.claude/agents/$AGENTS_SUBDIR
- print_success "Removed existing Bureau symlink at ~/.claude/agents/$AGENTS_SUBDIR (to ensure consistency after any reconfiguration)"
+ log_success "Removed existing Bureau symlink at ~/.claude/agents/$AGENTS_SUBDIR (to ensure consistency after any reconfiguration)"
fi
mkdir -p ~/.claude/agents
- print_success "Ensured/created ~/.claude/agents directory"
+ log_success "Ensured/created ~/.claude/agents directory"
# Symlink all Claude subagent files
ln -s "$AGENTS_DIR/$CLAUDE_AGENTS_DIRNAME" ~/.claude/agents/$AGENTS_SUBDIR
- print_success "Symlinked Claude subagent templates/role prompts to ~/.claude/agents/$AGENTS_SUBDIR"
+ log_success "Symlinked Claude subagent templates/role prompts to ~/.claude/agents/$AGENTS_SUBDIR"
echo ""
else
- print_step "Skipping Claude Code subagents (CLI directory not found)"
+ log_action "Skipping Claude Code subagents (CLI directory not found)"
echo ""
fi
@@ -105,49 +85,67 @@ fi
# Claude Code slash commands
if agent_enabled "Claude Code"; then
- print_step "Setting up Claude Code slash commands"
+ log_action "Setting up Claude Code slash commands"
"$AGENTS_DIR/scripts/set-up-claude-slash-commands.sh"
echo ""
fi
# Codex role launchers
if agent_enabled "Codex"; then
- print_step "Setting up Codex role launchers"
+ log_action "Setting up Codex role launchers"
"$AGENTS_DIR/scripts/set-up-codex-role-launchers.sh"
echo ""
fi
# Gemini CLI role launchers
if agent_enabled "Gemini CLI"; then
- print_step "Setting up Gemini CLI role launchers"
+ log_action "Setting up Gemini CLI role launchers"
"$AGENTS_DIR/scripts/set-up-gemini-role-launchers.sh"
echo ""
fi
-# OpenCode agents (symlink for auto-discovery)
+# OpenCode agents (filtered symlinks for auto-discovery)
if agent_enabled "OpenCode"; then
- print_step "Setting up Bureau agents for OpenCode"
+ log_action "Setting up Bureau agents for OpenCode"
+ OPENCODE_AGENTS_DIR="$HOME/.config/opencode/agent/$AGENTS_SUBDIR"
+
+ # Get filtered role list
+ AGENTS_ENABLED_FOR_OPENCODE=$(uv run python -m operations.roles_catalog opencode)
- # Symlink role prompts - OpenCode auto-discovers agents from this directory
- OPEN_AGENT_DIR="$HOME/.config/opencode/agent/$AGENTS_SUBDIR"
- mkdir -p "$HOME/.config/opencode/agent"
+ # Remove old directory (may be symlink or real directory) so config always wins
+ if [[ -e "$OPENCODE_AGENTS_DIR" ]]; then
+ rm -rf "$OPENCODE_AGENTS_DIR"
+ log_success "Removed old agent directory at $OPENCODE_AGENTS_DIR"
+ fi
- if [[ -L "$OPEN_AGENT_DIR" ]]; then
- rm "$OPEN_AGENT_DIR"
- print_success "Removed old symlink at $OPEN_AGENT_DIR"
+ if [[ -z "$AGENTS_ENABLED_FOR_OPENCODE" ]]; then
+ log_warning "No agents enabled for OpenCode. Skipping setup and clearing any previously generated OpenCode Bureau agents."
+ log_info "To enable agents, update the roles.enabled list in your local.yml"
+ else
+ # Create directory and populate with symlinks corresponding to the agents
+ # enabled for OpenCode
+ mkdir -p "$OPENCODE_AGENTS_DIR"
+
+ count=0
+ for agent_name in $AGENTS_ENABLED_FOR_OPENCODE; do
+ source_file="$AGENTS_DIR/$CLINK_AGENTS_DIRNAME/${agent_name}.md"
+ if [[ -f "$source_file" ]]; then
+ ln -s "$source_file" "$OPENCODE_AGENTS_DIR/${agent_name}.md"
+ count=$((count + 1))
+ else
+ log_warning "Agent file not found: $source_file (skipping)"
+ fi
+ done
+
+ log_success "Created $count filtered agent symlinks in $OPENCODE_AGENTS_DIR"
fi
- ln -s "$AGENTS_DIR/$CLINK_AGENTS_DIRNAME" "$OPEN_AGENT_DIR"
- print_success "Symlinked Bureau role prompts to $OPEN_AGENT_DIR (OpenCode auto-discovers these)"
echo ""
fi
-# ============================================================================
-# Done!
-# ============================================================================
-echo -e "${GREEN}✓ Agent setup complete!${NC}"
+log_success "Agent setup complete!"
echo ""
echo "Next steps:"
-echo " 1. Run the configs setup script: protocols/scripts/set-up-configs.sh"
+echo " 1. Run the configs setup script: protocols/scripts/set-up-protocols.sh"
echo " 2. Restart PAL MCP server to reload clink configs"
echo " 3. Verify Claude Code agents with: claude (then run /agents)"
echo " 4. Install claude-mem plugin:"
diff --git a/agents/scripts/set-up-claude-slash-commands.sh b/agents/scripts/set-up-claude-slash-commands.sh
index f5338b82..0c5d0ab9 100755
--- a/agents/scripts/set-up-claude-slash-commands.sh
+++ b/agents/scripts/set-up-claude-slash-commands.sh
@@ -1,95 +1,55 @@
#!/usr/bin/env bash
+
+# Exits on any:
+# - error (-e)
+# - undefined variable (-u)
+# - failed pipe (-o pipefail)
set -euo pipefail
# Setup script for Claude Code slash commands that inject agent role prompts
-# This allows launching agents in the current conversation via /architect, /frontend, etc.
-
-# Color codes for output
-RED='\033[0;31m'
-GREEN='\033[0;32m'
-YELLOW='\033[1;33m'
-BLUE='\033[0;34m'
-NC='\033[0m' # No Color
+# This allows launching agents in the current conversation via /architect-bureau, /frontend-bureau, etc.
-# Find the repo root
+# Locate repo root
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
AGENTS_DIR="$(cd "$SCRIPT_DIR/.." && pwd)"
REPO_ROOT="$(cd "$AGENTS_DIR/.." && pwd)"
CLAUDE_SUBAGENTS_DIR="$AGENTS_DIR/claude-subagents"
-# Source agent selection library
-source "$REPO_ROOT/bin/lib/agent-selection.sh"
+# Source internal Bureau libraries
+source "$REPO_ROOT/bin/lib/agent-selection.sh" # reads configs to determine enabled agents
+source "$REPO_ROOT/bin/lib/logging.sh"
+source "$REPO_ROOT/bin/lib/roles-setup.sh" # handles cross-CLI role prompt setup
# Detect installed CLIs (exits if none found, logs detected CLIs)
discover_agents
-
-# Skip entirely if Claude not enabled
-if ! agent_enabled "Claude Code"; then
- echo -e "${YELLOW}Claude Code not enabled. Skipping slash commands setup.${NC}"
- echo "To enable Claude Code:"
- echo " mkdir -p ~/.claude"
- echo " Then re-run this script or agents/scripts/set-up-agents.sh"
- exit 0
-fi
-
-# Target directory for slash commands
-COMMANDS_DIR="$HOME/.claude/commands"
-
-echo -e "${GREEN}Agent slash command setup for Claude Code${NC}"
-echo -e "Source: $CLAUDE_SUBAGENTS_DIR"
-echo -e "Target: $COMMANDS_DIR"
-echo ""
-
-# Function to print step headers
-print_step() {
- echo -e "${YELLOW}==>${NC} $1"
-}
-
-# Function to print success
-print_success() {
- echo -e "${GREEN}✓${NC} $1"
-}
-
-# Function to print info
-print_info() {
- echo -e "${BLUE}ℹ${NC} $1"
-}
-
-# Function to print error and exit
-print_error() {
- echo -e "${RED}✗${NC} $1" >&2
- exit 1
-}
+echo "Source: $CLAUDE_SUBAGENTS_DIR"
+echo "Target: $HOME/.claude/commands"
+log_empty_line
# Check if source directory exists
if [[ ! -d "$CLAUDE_SUBAGENTS_DIR" ]]; then
- print_error "Cannot find claude-subagents directory at: $CLAUDE_SUBAGENTS_DIR"
+ log_error "Cannot find claude-subagents/ at the expected path: $CLAUDE_SUBAGENTS_DIR"
+ exit 1
fi
-# Create commands directory if it doesn't exist
-mkdir -p "$COMMANDS_DIR"
-print_success "Ensured $COMMANDS_DIR exists"
-
-# Counter for generated commands
-count=0
-
-# Process each agent file
-print_step "Generating slash commands from agent files"
-echo ""
-
-for agent_file in "$CLAUDE_SUBAGENTS_DIR"/*.md; do
- # Get the base name without extension (e.g., "architect" from "architect.md")
- agent_name=$(basename "$agent_file" .md)
+# Claude-specific processing function
+process_claude_command() {
+ local role_name="$1"
+ local target_dir="$2"
+ local role_file="$CLAUDE_SUBAGENTS_DIR/${role_name}.md"
- # Target command file
- command_file="$COMMANDS_DIR/${agent_name}.md"
+ # Skip if file doesn't exist (configuration error)
+ if [[ ! -f "$role_file" ]]; then
+ log_warning "Role file not found: $role_file (skipping)"
+ return 1
+ fi
- # Extract the content after the frontmatter (everything after the second ---)
- # The frontmatter is between the first --- and second ---
- # We want everything after the second ---
+ # Target command file (suffixed to avoid collisions with user-created commands)
+ local command_file="$target_dir/${role_name}-bureau.md"
- # Using awk to skip frontmatter and get the actual content
- agent_content=$(awk '
+ # Extract content after frontmatter (everything after the second ---)
+ local role_content
+ role_content=$(awk '
BEGIN { in_frontmatter=0; past_frontmatter=0 }
/^---$/ {
if (!past_frontmatter) {
@@ -99,7 +59,7 @@ for agent_file in "$CLAUDE_SUBAGENTS_DIR"/*.md; do
}
}
past_frontmatter { print }
- ' "$agent_file")
+ ' "$role_file")
# Create the slash command file with a preamble
cat > "$command_file" << EOF
@@ -119,18 +79,18 @@ print_success "Generated $count slash commands"
# Print usage instructions
echo ""
-echo -e "${GREEN}Setup complete!${NC}"
+log_success "Setup complete!"
echo ""
echo "Usage:"
echo -e " 1. Launch Claude Code: ${BLUE}claude${NC}"
echo " 2. Use any agent role via slash command:"
echo ""
-echo -e " ${BLUE}/architect${NC} - Principal software architect"
-echo -e " ${BLUE}/frontend${NC} - Frontend architecture & UX"
-echo -e " ${BLUE}/observability${NC} - Monitoring & incident response"
-echo -e " ${BLUE}/security-compliance${NC} - Security & privacy architect"
-echo -e " ${BLUE}/testing${NC} - Test quality & reliability"
-echo " ... and $((count - 5)) more"
+echo -e " ${BLUE}/architect${NC} - Principal software architect"
+echo -e " ${BLUE}/frontend${NC} - Frontend architecture & UX"
+echo -e " ${BLUE}/observability${NC} - Monitoring & incident response"
+echo -e " ${BLUE}/security-compliance${NC} - Security & privacy architect"
+echo -e " ${BLUE}/testing${NC} - Test quality & reliability"
+echo " ... and more"
echo ""
echo -e " 3. List all available commands: ${BLUE}/help${NC}"
echo ""
diff --git a/agents/scripts/set-up-codex-role-launchers.sh b/agents/scripts/set-up-codex-role-launchers.sh
index 5924a01a..36ad9120 100755
--- a/agents/scripts/set-up-codex-role-launchers.sh
+++ b/agents/scripts/set-up-codex-role-launchers.sh
@@ -1,15 +1,12 @@
#!/usr/bin/env bash
set -euo pipefail
-# Setup script for Codex role launcher wrappers
-# Creates executable scripts in ~/.local/bin/ for launching Codex with specific agent roles
-
-# Color codes for output
-RED='\033[0;31m'
-GREEN='\033[0;32m'
-YELLOW='\033[1;33m'
-BLUE='\033[0;34m'
-NC='\033[0m' # No Color
+# Setup script for Codex role launcher wrappers: creates executable scripts
+# in ~/.local/bin/ for launching Codex with specific agent roles
+#
+# Note: to see the rationale for *embedding* role prompts in the launcher scripts
+# (e.g. rather than providing a Bureau-internal path to the role prompt file):
+# see agents/scripts/README.md
# Find the repo root
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
@@ -17,88 +14,52 @@ AGENTS_DIR="$(cd "$SCRIPT_DIR/.." && pwd)"
REPO_ROOT="$(cd "$AGENTS_DIR/.." && pwd)"
CLINK_ROLES_DIR="$AGENTS_DIR/role-prompts"
-# Source agent selection library
+# Source internal Bureau libraries
source "$REPO_ROOT/bin/lib/agent-selection.sh"
+source "$REPO_ROOT/bin/lib/logging.sh"
+source "$REPO_ROOT/bin/lib/roles-setup.sh"
# Detect installed CLIs (exits if none found, logs detected CLIs)
discover_agents
-# Skip entirely if Codex not enabled
-if ! agent_enabled "Codex"; then
- echo -e "${YELLOW}Codex not enabled. Skipping role launchers setup.${NC}"
- echo "To enable Codex:"
- echo " mkdir -p ~/.codex"
- echo " Then re-run this script or agents/scripts/set-up-agents.sh"
- exit 0
-fi
-
-# Target directory for launcher scripts
-LAUNCHERS_DIR="$HOME/.local/bin"
-
-echo -e "${GREEN}Role launcher setup for Codex${NC}"
+log_success "Role launcher setup for Codex"
echo -e "Source: $CLINK_ROLES_DIR"
-echo -e "Target: $LAUNCHERS_DIR"
+echo -e "Target: $HOME/.local/bin"
echo ""
-# Function to print step headers
-print_step() {
- echo -e "${YELLOW}==>${NC} $1"
-}
-
-# Function to print success
-print_success() {
- echo -e "${GREEN}✓${NC} $1"
-}
-
-# Function to print info
-print_info() {
- echo -e "${BLUE}ℹ${NC} $1"
-}
-
-# Function to print error and exit
-print_error() {
- echo -e "${RED}✗${NC} $1" >&2
- exit 1
-}
-
# Check if source directory exists
if [[ ! -d "$CLINK_ROLES_DIR" ]]; then
- print_error "Cannot find role-prompts directory at: $CLINK_ROLES_DIR"
+ log_error "Cannot find role-prompts directory at: $CLINK_ROLES_DIR"
+ exit 1
fi
-# Create launchers directory if it doesn't exist
-mkdir -p "$LAUNCHERS_DIR"
-print_success "Ensured $LAUNCHERS_DIR exists"
-
# Check if ~/.local/bin is in PATH
if [[ ":$PATH:" != *":$HOME/.local/bin:"* ]]; then
- print_info "Note: $HOME/.local/bin is not in your PATH"
- print_info "Add this to your ~/.zshrc or ~/.bashrc:"
+ log_info "Note: $HOME/.local/bin is not in your PATH"
+ log_info "Add this to your ~/.zshrc or ~/.bashrc:"
echo ""
echo " export PATH=\"\$HOME/.local/bin:\$PATH\""
echo ""
fi
-# Counter for generated launchers
-count=0
-
-# Process each role file
-print_step "Generating role launchers from clink role prompts"
-echo ""
-
-for role_file in "$CLINK_ROLES_DIR"/*.md; do
- # Get the base name without extension (e.g., "architect" from "architect.md")
- role_name=$(basename "$role_file" .md)
+# Codex-specific processing function
+process_codex_launcher() {
+ local role_name="$1"
+ local target_dir="$2"
+ local role_file="$CLINK_ROLES_DIR/${role_name}.md"
- # Create a launcher script name with "codex-" prefix
- launcher_name="codex-${role_name}"
- launcher_file="$LAUNCHERS_DIR/$launcher_name"
+ # Skip if file doesn't exist
+ if [[ ! -f "$role_file" ]]; then
+ log_warning "Role file not found: $role_file (skipping)"
+ return 1
+ fi
- # Read the role prompt content
- role_content=$(cat "$role_file")
+ # Create launcher script with "codex-" prefix
+ local launcher_name="codex-${role_name}"
+ local launcher_file="$target_dir/$launcher_name"
# Create the launcher script that:
- # 1. Creates a temporary AGENTS.md with the role prompt in the current directory
+ # 1. Creates a temporary AGENTS.md with the role prompt
# 2. Launches codex (which auto-loads ./AGENTS.md)
# 3. Cleans up on exit
cat > "$launcher_file" << 'EOF_OUTER'
@@ -139,16 +100,22 @@ EOF_OUTER
# Make it executable
chmod +x "$launcher_file"
- print_info "Created $launcher_name"
- count=$((count + 1))
-done
+ log_info "Created $launcher_name"
+ return 0
+}
+
+# Cleanup: remove all existing Codex launchers before re-creating enabled ones
+cleanup_codex_launchers() {
+ remove_roles_by_pattern "$1" "codex-*"
+}
+
+# Run setup using common workflow
+setup_roles_for_cli "Codex" "codex" "$HOME/.local/bin" process_codex_launcher cleanup_codex_launchers
-echo ""
-print_success "Generated $count role launchers"
# Print usage instructions
echo ""
-echo -e "${GREEN}Setup complete!${NC}"
+log_success "Setup complete!"
echo ""
echo "Usage examples:"
echo ""
@@ -170,6 +137,6 @@ echo ""
# Verify PATH setup
if [[ ":$PATH:" != *":$HOME/.local/bin:"* ]]; then
- echo -e "${YELLOW}⚠${NC} Remember to add ~/.local/bin to your PATH!"
+ log_warning "Remember to add ~/.local/bin to your PATH!"
echo ""
fi
diff --git a/agents/scripts/set-up-codex-superpowers.sh b/agents/scripts/set-up-codex-superpowers.sh
index b9aa4488..518221b7 100755
--- a/agents/scripts/set-up-codex-superpowers.sh
+++ b/agents/scripts/set-up-codex-superpowers.sh
@@ -4,17 +4,12 @@
set -euo pipefail
-GREEN='\033[0;32m'
-YELLOW='\033[1;33m'
-RED='\033[0;31m'
-NC='\033[0m'
-
# Find repo root
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
-AGENTS_DIR="$(cd "$SCRIPT_DIR/.." && pwd)"
-REPO_ROOT="$(cd "$AGENTS_DIR/.." && pwd)"
+REPO_ROOT="$(cd "$SCRIPT_DIR/../.." && pwd)"
-# Source agent selection library
+# Source logging + agent selection libraries
+source "$REPO_ROOT/bin/lib/logging.sh"
source "$REPO_ROOT/bin/lib/agent-selection.sh"
# Load agent selection from profile
@@ -22,7 +17,7 @@ discover_agents
# Skip entirely if Codex not selected
if ! agent_enabled "Codex"; then
- echo -e "${YELLOW}Codex not in CLI profile. Skipping Superpowers setup.${NC}"
+ log_warning "Codex not in CLI profile. Skipping Superpowers setup."
echo "To enable Codex, run:"
echo " tools/scripts/set-up-tools.sh -a x # Codex only"
echo " tools/scripts/set-up-tools.sh -a cx # Codex + Claude"
@@ -31,59 +26,50 @@ if ! agent_enabled "Codex"; then
fi
REPO_URL="https://github.com/obra/superpowers.git"
-TARGET_DIR="${HOME}/.codex/superpowers"
-SKILLS_DIR="${HOME}/.codex/skills"
-BOOTSTRAP_CMD="${TARGET_DIR}/.codex/superpowers-codex"
-
-print_step() {
- echo -e "${YELLOW}==>${NC} $1"
-}
-
-print_success() {
- echo -e "${GREEN}✓${NC} $1"
-}
-
-print_warning() {
- echo -e "${YELLOW}⚠${NC} $1"
-}
+SUPERPOWERS_DIR="${HOME}/.codex/superpowers"
+CODEX_SKILLS_DIR="${HOME}/.agents/skills"
+SUPERPOWERS_SKILLS_SOURCE="${SUPERPOWERS_DIR}/skills"
+SUPERPOWERS_SKILLS_LINK="${CODEX_SKILLS_DIR}/superpowers"
-print_error() {
- echo -e "${RED}✗${NC} $1" >&2
- exit 1
-}
-
-print_step "Ensuring Codex directories exist"
+log_action "==>" "Ensuring Codex directories exist"
mkdir -p "${HOME}/.codex"
-mkdir -p "${SKILLS_DIR}"
-print_success "Codex directories ready"
+mkdir -p "${CODEX_SKILLS_DIR}"
+log_success "Codex directories ready"
-if [ -d "${TARGET_DIR}/.git" ]; then
- print_step "Updating existing Superpowers checkout"
- git -C "${TARGET_DIR}" remote set-url origin "${REPO_URL}"
- if ! git -C "${TARGET_DIR}" fetch --tags --prune; then
- print_warning "Unable to fetch updates for Superpowers. Continuing with existing checkout."
+if [ -d "${SUPERPOWERS_DIR}/.git" ]; then
+ log_action "==>" "Updating existing Superpowers checkout"
+ git -C "${SUPERPOWERS_DIR}" remote set-url origin "${REPO_URL}"
+ if ! git -C "${SUPERPOWERS_DIR}" fetch --tags --prune; then
+ log_warning "Unable to fetch updates for Superpowers. Continuing with existing checkout."
else
- if ! git -C "${TARGET_DIR}" merge --ff-only origin/main >/dev/null 2>&1; then
- print_warning "Could not fast-forward Superpowers repository (local changes?). Leaving as-is."
+ if ! git -C "${SUPERPOWERS_DIR}" merge --ff-only origin/main >/dev/null 2>&1; then
+ log_warning "Could not fast-forward Superpowers repository (local changes?). Leaving as-is."
else
- print_success "Superpowers repository updated"
+ log_success "Superpowers repository updated"
fi
fi
else
- print_step "Cloning Superpowers repository"
- git clone "${REPO_URL}" "${TARGET_DIR}"
- print_success "Superpowers repository cloned"
+ log_action "==>" "Cloning Superpowers repository"
+ git clone "${REPO_URL}" "${SUPERPOWERS_DIR}"
+ log_success "Superpowers repository cloned"
+fi
+
+if [ ! -d "${SUPERPOWERS_SKILLS_SOURCE}" ]; then
+ log_error "Superpowers skills directory not found at ${SUPERPOWERS_SKILLS_SOURCE}"
+ exit 1
+fi
+
+if [ -L "${SUPERPOWERS_SKILLS_LINK}" ]; then
+ rm -f "${SUPERPOWERS_SKILLS_LINK}"
fi
-if [ ! -x "${BOOTSTRAP_CMD}" ]; then
- print_warning "Bootstrap command ${BOOTSTRAP_CMD} not found or not executable"
+if [ -e "${SUPERPOWERS_SKILLS_LINK}" ]; then
+ log_error "Path exists and is not a symlink: ${SUPERPOWERS_SKILLS_LINK}"
+ log_error "Move or remove it, then rerun this setup script."
+ exit 1
else
- print_step "Running Superpowers bootstrap (verification)"
- if "${BOOTSTRAP_CMD}" bootstrap >/dev/null 2>&1; then
- print_success "Superpowers bootstrap completed"
- else
- print_warning "Bootstrap command exited with a non-zero status. Review output above if any."
- fi
+ ln -s "${SUPERPOWERS_SKILLS_SOURCE}" "${SUPERPOWERS_SKILLS_LINK}"
+ log_success "Linked ${SUPERPOWERS_SKILLS_LINK} -> ${SUPERPOWERS_SKILLS_SOURCE}"
fi
-print_success "Superpowers setup for Codex complete!"
+log_success "Superpowers setup for Codex complete!"
diff --git a/agents/scripts/set-up-gemini-role-launchers.sh b/agents/scripts/set-up-gemini-role-launchers.sh
index eab32c3c..2090f65a 100755
--- a/agents/scripts/set-up-gemini-role-launchers.sh
+++ b/agents/scripts/set-up-gemini-role-launchers.sh
@@ -1,15 +1,12 @@
#!/usr/bin/env bash
set -euo pipefail
-# Setup script for Gemini CLI role launcher wrappers
-# Creates executable scripts in ~/.local/bin/ for launching Gemini with specific agent roles
-
-# Color codes for output
-RED='\033[0;31m'
-GREEN='\033[0;32m'
-YELLOW='\033[1;33m'
-BLUE='\033[0;34m'
-NC='\033[0m' # No Color
+# Setup script for Gemini CLI role launcher wrappers: creates executable scripts
+# in ~/.local/bin/ for launching Gemini with specific agent roles
+#
+# Note: to see the rationale for *embedding* role prompts in the launcher scripts
+# (e.g. rather than providing a Bureau-internal path to the role prompt file):
+# see agents/scripts/README.md
# Find the repo root
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
@@ -17,89 +14,53 @@ AGENTS_DIR="$(cd "$SCRIPT_DIR/.." && pwd)"
REPO_ROOT="$(cd "$AGENTS_DIR/.." && pwd)"
CLINK_ROLES_DIR="$AGENTS_DIR/role-prompts"
-# Source agent selection library
+# Source internal Bureau libraries
source "$REPO_ROOT/bin/lib/agent-selection.sh"
+source "$REPO_ROOT/bin/lib/logging.sh"
+source "$REPO_ROOT/bin/lib/roles-setup.sh"
# Detect installed CLIs (exits if none found, logs detected CLIs)
discover_agents
-# Skip entirely if Gemini not enabled
-if ! agent_enabled "Gemini CLI"; then
- echo -e "${YELLOW}Gemini CLI not enabled. Skipping role launchers setup.${NC}"
- echo "To enable Gemini CLI:"
- echo " mkdir -p ~/.gemini"
- echo " Then re-run this script or agents/scripts/set-up-agents.sh"
- exit 0
-fi
-
-# Target directory for launcher scripts
-LAUNCHERS_DIR="$HOME/.local/bin"
-
-echo -e "${GREEN}Role launcher setup for Gemini${NC}"
+log_success "Role launcher setup for Gemini"
echo -e "Source: $CLINK_ROLES_DIR"
-echo -e "Target: $LAUNCHERS_DIR"
+echo -e "Target: $HOME/.local/bin"
echo ""
-# Function to print step headers
-print_step() {
- echo -e "${YELLOW}==>${NC} $1"
-}
-
-# Function to print success
-print_success() {
- echo -e "${GREEN}✓${NC} $1"
-}
-
-# Function to print info
-print_info() {
- echo -e "${BLUE}ℹ${NC} $1"
-}
-
-# Function to print error and exit
-print_error() {
- echo -e "${RED}✗${NC} $1" >&2
- exit 1
-}
-
# Check if source directory exists
if [[ ! -d "$CLINK_ROLES_DIR" ]]; then
- print_error "Cannot find role-prompts directory at: $CLINK_ROLES_DIR"
+ log_error "Cannot find role-prompts directory at: $CLINK_ROLES_DIR"
+ exit 1
fi
-# Create launchers directory if it doesn't exist
-mkdir -p "$LAUNCHERS_DIR"
-print_success "Ensured $LAUNCHERS_DIR exists"
-
# Check if ~/.local/bin is in PATH
if [[ ":$PATH:" != *":$HOME/.local/bin:"* ]]; then
- print_info "Note: $HOME/.local/bin is not in your PATH"
- print_info "Add this to your ~/.zshrc or ~/.bashrc:"
+ log_info "Note: $HOME/.local/bin is not in your PATH"
+ log_info "Add this to your ~/.zshrc or ~/.bashrc:"
echo ""
echo " export PATH=\"\$HOME/.local/bin:\$PATH\""
echo ""
fi
-# Counter for generated launchers
-count=0
-
-# Process each role file
-print_step "Generating role launchers from clink role prompts"
-echo ""
-
-for role_file in "$CLINK_ROLES_DIR"/*.md; do
- # Get the base name without extension (e.g., "architect" from "architect.md")
- role_name=$(basename "$role_file" .md)
+# Gemini-specific processing function
+process_gemini_launcher() {
+ local role_name="$1"
+ local target_dir="$2"
+ local role_file="$CLINK_ROLES_DIR/${role_name}.md"
- # Create a launcher script name with "gemini-" prefix
- launcher_name="gemini-${role_name}"
- launcher_file="$LAUNCHERS_DIR/$launcher_name"
+ # Skip if file doesn't exist
+ if [[ ! -f "$role_file" ]]; then
+ log_warning "Role file not found: $role_file (skipping)"
+ return 1
+ fi
- # Read the role prompt content
- role_content=$(cat "$role_file")
+ # Create launcher script with "gemini-" prefix
+ local launcher_file="gemini-${role_name}"
+ launcher_file="$target_dir/$launcher_file"
# Create the launcher script that:
- # 1. Creates a temporary GEMINI.md with the role prompt
- # 2. Launches gemini with that config
+ # 1. Creates a temporary file with the role prompt
+ # 2. Launches gemini with --prompt-interactive
# 3. Cleans up on exit
cat > "$launcher_file" << 'EOF_OUTER'
#!/usr/bin/env bash
@@ -113,7 +74,7 @@ trap "rm -f $ROLE_FILE" EXIT
cat > "$ROLE_FILE" << 'EOF_INNER'
EOF_OUTER
- # Append the actual role content
+ # Append the actual role content between the EOF_INNER delineators in the launcher
cat "$role_file" >> "$launcher_file"
# Close the heredoc and add the launch command
@@ -121,23 +82,28 @@ EOF_OUTER
EOF_INNER
# Launch Gemini with the role as a system prompt via --prompt-interactive
-# The role content is injected as the first message
gemini --prompt-interactive "$(cat "$ROLE_FILE")" "$@"
EOF_OUTER
# Make it executable
chmod +x "$launcher_file"
- print_info "Created $launcher_name"
- count=$((count + 1))
-done
+ log_info "Created $launcher_file"
+ return 0
+}
+
+# Cleanup: remove all existing Gemini launchers before re-creating enabled ones
+cleanup_gemini_launchers() {
+ remove_roles_by_pattern "$1" "gemini-*"
+}
+
+# Run setup using common workflow
+setup_roles_for_cli "Gemini CLI" "gemini" "$HOME/.local/bin" process_gemini_launcher cleanup_gemini_launchers
-echo ""
-print_success "Generated $count role launchers"
# Print usage instructions
echo ""
-echo -e "${GREEN}Setup complete!${NC}"
+log_success "Setup complete!"
echo ""
echo "Usage examples:"
echo ""
@@ -155,6 +121,6 @@ echo ""
# Verify PATH setup
if [[ ":$PATH:" != *":$HOME/.local/bin:"* ]]; then
- echo -e "${YELLOW}⚠${NC} Remember to add ~/.local/bin to your PATH!"
+ log_warning "Remember to add ~/.local/bin to your PATH!"
echo ""
fi
diff --git a/bin/check-prereqs b/bin/ensure-prereqs
similarity index 58%
rename from bin/check-prereqs
rename to bin/ensure-prereqs
index 269cd0b4..5b526dae 100755
--- a/bin/check-prereqs
+++ b/bin/ensure-prereqs
@@ -6,8 +6,8 @@
# - Syncs project deps from pyproject.toml
#
# Usage:
-# ./bin/check-prereqs # Check prerequisites and set up Python
-# ./bin/check-prereqs --quiet # Exit 0 if all present, 1 if any missing (no output)
+# ./bin/ensure-prereqs # Check prerequisites and set up Python
+# ./bin/ensure-prereqs --quiet # Exit 0 if all present, 1 if any missing (no output)
#
# Exit codes:
# 0 - All prerequisites installed
@@ -15,11 +15,8 @@
set -e
-# Colors
-GREEN='\033[0;32m'
-RED='\033[0;31m'
-YELLOW='\033[1;33m'
-NC='\033[0m'
+REPO_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
+source "$REPO_ROOT/bin/lib/logging.sh"
QUIET=false
MISSING=0
@@ -48,36 +45,37 @@ check_cmd() {
if command -v "$cmd" &>/dev/null; then
if [[ "$QUIET" == false ]]; then
- echo -e "${GREEN}✓${NC} $cmd"
+ log_success "$cmd"
fi
return 0
else
if [[ "$QUIET" == false ]]; then
- echo -e "${RED}✗${NC} $cmd"
- echo -e " └─ ${YELLOW}$install_msg${NC}"
+ log_error "$cmd"
+ log_warning " └─ $install_msg"
fi
MISSING=1
return 1
fi
}
-[[ "$QUIET" == false ]] && echo -e "Checking Bureau prerequisites...\n"
+if [[ "$QUIET" == false ]]; then
+ log_action "Checking" "Bureau prerequisites..."
+ log_empty_line
+fi
# check required prerequisites
check_cmd "npx" "Install Node.js: https://nodejs.org or use nvm"
check_cmd "uvx" "Install uv: curl -LsSf https://astral.sh/uv/install.sh | sh"
check_cmd "docker" "Install Docker: https://docs.docker.com/get-docker/"
-[[ "$QUIET" == false ]] && echo ""
+[[ "$QUIET" == false ]] && log_empty_line
if [[ $MISSING -ne 0 ]]; then
- [[ "$QUIET" == false ]] && echo -e "${RED}Install missing prerequisites and try again.${NC}"
+ [[ "$QUIET" == false ]] && log_error "Install missing prerequisites and try again."
exit 1
fi
-[[ "$QUIET" == false ]] && echo -e "${GREEN}All prerequisites are present.${NC}"
-
-REPO_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
+[[ "$QUIET" == false ]] && log_success "All prerequisites are present."
# Reuse Python version in .python-version
PYTHON_VERSION=$(cat "$REPO_ROOT/.python-version" | tr -d '[:space:]')
@@ -85,21 +83,29 @@ PYTHON_VERSION=$(cat "$REPO_ROOT/.python-version" | tr -d '[:space:]')
# Verify .python-version and pyproject.toml's `requires-python` match
PYPROJECT_PYTHON=$(grep 'requires-python' "$REPO_ROOT/pyproject.toml" | grep -oE '[0-9]+\.[0-9]+')
if [[ "$PYTHON_VERSION" != "$PYPROJECT_PYTHON" ]]; then
- echo -e "${YELLOW}⚠${NC} Version mismatch: .python-version ($PYTHON_VERSION) vs pyproject.toml ($PYPROJECT_PYTHON)"
- echo -e " └─ ${YELLOW}Update both files to match${NC}"
+ log_warning "Version mismatch: .python-version ($PYTHON_VERSION) vs pyproject.toml ($PYPROJECT_PYTHON)"
+ log_warning " └─ Update both files to match"
fi
# Ensure correct Python version and sync dependencies
-[[ "$QUIET" == false ]] && echo -e "\nSetting up Python environment...\n"
+if [[ "$QUIET" == false ]]; then
+ log_empty_line
+ log_action "Setting up" "Python environment..."
+ log_empty_line
+fi
uv python install "$PYTHON_VERSION" --quiet 2>/dev/null || true
-[[ "$QUIET" == false ]] && echo -e "${GREEN}✓${NC} Python $PYTHON_VERSION ready"
+[[ "$QUIET" == false ]] && log_success "Python $PYTHON_VERSION ready"
if ! (cd "$REPO_ROOT" && uv sync); then
- echo -e "${RED}✗${NC} Failed to sync Python dependencies"
+ log_error "Failed to sync Python dependencies"
exit 1
fi
-[[ "$QUIET" == false ]] && echo -e "${GREEN}✓${NC} Python dependencies installed"
+[[ "$QUIET" == false ]] && log_success "Python dependencies installed"
-[[ "$QUIET" == false ]] && echo -e "\n${GREEN}Python environment is ready.${NC}\n"
-exit 0
\ No newline at end of file
+if [[ "$QUIET" == false ]]; then
+ log_empty_line
+ log_success "Python environment is ready."
+ log_empty_line
+fi
+exit 0
diff --git a/bin/lib/agent-selection.sh b/bin/lib/agent-selection.sh
index 705595f1..256490c3 100644
--- a/bin/lib/agent-selection.sh
+++ b/bin/lib/agent-selection.sh
@@ -51,7 +51,7 @@ _get_repo_root() {
}
# Internal: call get-config Python module
-# (caller must ensure env is setup, i.e. by running check-prereqs)
+# (caller must ensure env is setup, i.e. by running ensure-prereqs)
# Usage: _get_config
_get_config() {
local repo_root
diff --git a/bin/lib/logging.sh b/bin/lib/logging.sh
new file mode 100644
index 00000000..9f605291
--- /dev/null
+++ b/bin/lib/logging.sh
@@ -0,0 +1,224 @@
+#!/usr/bin/env bash
+#
+# Logging library: consistent, colorized logger functions for all Bureau scripts.
+#
+# Usage:
+# source "$REPO_ROOT/bin/lib/logging.sh"
+#
+# Available functions:
+# log_info "message" - Blue [INFO] prefix
+# log_success "message" - Green ✓ prefix
+# log_warning "message" - Yellow ⚠ prefix
+# log_error "message" - Red ✗ prefix
+# log_debug "message" - Gray [DEBUG] prefix (only if LOG_DEBUG=true)
+# log_action "verb" "obj" - Blue verb, white object
+# log_header "title" "path" ["note1" "note2" ...] - Section headers
+# log_empty_line - Blank line
+# log_divider - Horizontal rule
+# log_separator - Empty + divider + empty
+# log_banner "title" - Banner with dividers
+#
+# Environment variables:
+# LOG_COLORS=false - Disable all colors (for CI/logs)
+# LOG_DEBUG=true - Enable debug messages
+# LOG_QUIET=true - Suppress info messages (warnings/errors only)
+
+# Color codes (ANSI escape sequences)
+if [[ "${LOG_COLORS:-true}" == "true" && -t 1 ]]; then
+ # Terminal supports colors and user hasn't disabled them
+ export LOG_GREEN='\033[0;32m'
+ export LOG_BLUE='\033[0;34m'
+ export LOG_YELLOW='\033[1;33m'
+ export LOG_RED='\033[0;31m'
+ export LOG_GRAY='\033[0;90m'
+ export LOG_BOLD='\033[1m'
+ export LOG_NC='\033[0m' # ANSI "no colour" = reset
+else
+ # No color support or disabled
+ export LOG_GREEN=''
+ export LOG_BLUE=''
+ export LOG_YELLOW=''
+ export LOG_RED=''
+ export LOG_GRAY=''
+ export LOG_BOLD=''
+ export LOG_NC=''
+fi
+
+# For backward compatibility, also export unprefixed versions
+export GREEN="$LOG_GREEN"
+export BLUE="$LOG_BLUE"
+export YELLOW="$LOG_YELLOW"
+export RED="$LOG_RED"
+export NC="$LOG_NC"
+
+# Core logging functions
+log_info() {
+ if [[ "${LOG_QUIET:-false}" == "true" ]]; then
+ return 0
+ fi
+ echo -e "${LOG_BLUE}[INFO]${LOG_NC} $*"
+}
+
+log_success() {
+ echo -e "${LOG_GREEN}✓${LOG_NC} $*"
+}
+
+log_warning() {
+ echo -e "${LOG_YELLOW}⚠${LOG_NC} $*" >&2
+}
+
+log_error() {
+ echo -e "${LOG_RED}✗${LOG_NC} $*" >&2
+}
+
+log_debug() {
+ if [[ "${LOG_DEBUG:-false}" == "true" ]]; then
+ echo -e "${LOG_GRAY}[DEBUG]${LOG_NC} $*"
+ fi
+}
+
+# Action logging (verb + object pattern)
+log_action() {
+ local action=$1
+ local detail=${2:-} # Optional second argument
+ echo -e "${LOG_BLUE}${action}${LOG_NC} ${detail}"
+}
+
+# Section headers (with optional notes in yellow)
+log_header() {
+ local label=$1
+ local path=$2
+ shift 2
+
+ echo -e "${LOG_BLUE}${label}${LOG_NC} (${path})"
+ for line in "$@"; do
+ echo -e " ${LOG_YELLOW}${line}${LOG_NC}"
+ done
+}
+
+# Formatting helpers
+log_empty_line() {
+ echo ""
+}
+
+log_divider() {
+ echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
+}
+
+log_separator() {
+ log_empty_line
+ log_divider
+ log_empty_line
+}
+
+# Print a styled banner (for script headers)
+log_banner() {
+ local title=$1
+ local padding=" "
+ local divider_char="━"
+ local line_len=$(( ${#title} + 16 ))
+
+ local divider
+ divider=$(printf '%*s' "$line_len" "" | tr ' ' "$divider_char")
+
+ echo "$divider"
+ echo "${padding}${title}${padding}"
+ echo "$divider"
+}
+
+# Progress indicator (for long-running operations)
+log_progress() {
+ local current=$1
+ local total=$2
+ local message=${3:-""}
+
+ local percent=$((current * 100 / total))
+ local bar_width=30
+ local filled=$((bar_width * current / total))
+ local empty=$((bar_width - filled))
+
+ # Build progress bar
+ local bar=""
+ for ((i=0; i=0.8.0
+ - mcp-server-qdrant
+ - --transport
+ - streamable-http
+ env:
+ QDRANT_URL: "http://127.0.0.1:${mcp.runtime_services.qdrant_db.host_port}"
+ COLLECTION_NAME: "${mcp.runtime_services.qdrant_mcp.settings.collection}"
+ EMBEDDING_PROVIDER: "${mcp.runtime_services.qdrant_mcp.settings.embedding_provider}"
+ FASTMCP_SERVER_PORT: "${mcp.runtime_services.qdrant_mcp.port}"
+ FASTMCP_SERVER_STATELESS_HTTP: "true"
+ healthcheck:
+ tcp: ${mcp.runtime_services.qdrant_mcp.port}
+
+ sourcegraph_mcp:
+ enabled: true
+ kind: http_process
+ port: 8783
+ depends_on:
+ dependencies: [sourcegraph_repo]
+ command:
+ - uv
+ - --directory
+ - ${mcp.dependencies.sourcegraph_repo.path}
+ - run
+ - sourcegraph-mcp
+ env:
+ SRC_ENDPOINT: https://sourcegraph.com
+ MCP_STREAMABLE_HTTP_PORT: "${mcp.runtime_services.sourcegraph_mcp.port}"
+ healthcheck:
+ tcp: ${mcp.runtime_services.sourcegraph_mcp.port}
+
+ semgrep_mcp:
+ enabled: false
+ kind: http_process
+ port: 8784
+ command:
+ - semgrep
+ - mcp
+ - -t
+ - streamable-http
+ - --port
+ - ${mcp.runtime_services.semgrep_mcp.port}
+ healthcheck:
+ tcp: ${mcp.runtime_services.semgrep_mcp.port}
+
+ serena_mcp:
+ enabled: true
+ kind: http_process
+ port: 8785
+ command:
+ - uvx
+ - --from
+ - git+https://github.com/oraios/serena
+ - serena
+ - start-mcp-server
+ - --transport
+ - streamable-http
+ - --port
+ - ${mcp.runtime_services.serena_mcp.port}
+ healthcheck:
+ tcp: ${mcp.runtime_services.serena_mcp.port}
+
+ client_configs:
+ qdrant:
+ enabled: true
+ clients:
+ default:
+ transport: http
+ url: "http://localhost:${mcp.runtime_services.qdrant_mcp.port}/mcp/"
+
+ sourcegraph:
+ enabled: true
+ clients:
+ default:
+ transport: http
+ url: "http://localhost:${mcp.runtime_services.sourcegraph_mcp.port}/sourcegraph/mcp/"
+
+ semgrep:
+ enabled: false
+ clients:
+ default:
+ transport: http
+ url: "http://localhost:${mcp.runtime_services.semgrep_mcp.port}/mcp/"
+
+ serena:
+ enabled: true
+ clients:
+ default:
+ transport: http
+ url: "http://localhost:${mcp.runtime_services.serena_mcp.port}/mcp/"
+
+ context7:
+ enabled: true
+ requires_env: [CONTEXT7_API_KEY]
+ clients:
+ default:
+ transport: http
+ url: "https://mcp.context7.com/mcp"
+ headers:
+ CONTEXT7_API_KEY: "${CONTEXT7_API_KEY}"
+ Accept: "application/json, text/event-stream"
+ codex:
+ transport: stdio
+ command:
+ - npx
+ - -y
+ - "@upstash/context7-mcp"
+ - --api-key
+ - ${CONTEXT7_API_KEY}
+
+ tavily:
+ enabled: true
+ requires_env: [TAVILY_API_KEY]
+ clients:
+ default:
+ transport: http
+ url: "https://mcp.tavily.com/mcp/?tavilyApiKey=${TAVILY_API_KEY}"
+
+ brave:
+ enabled: true
+ requires_env: [BRAVE_API_KEY]
+ clients:
+ default:
+ transport: stdio
+ command:
+ - npx
+ - -y
+ - "@brave/brave-search-mcp-server"
+ - --transport
+ - stdio
+ env:
+ BRAVE_API_KEY: "${BRAVE_API_KEY}"
+
+ pal:
+ enabled: true
+ settings:
+ disabled_tools: "analyze,apilookup,challenge,chat,codereview,consensus,debug,docgen,planner,precommit,refactor,secaudit,testgen,thinkdeep,tracer"
+ clients:
+ default:
+ transport: stdio
+ command: &pal_command
+ - sh
+ - -c
+ - "for p in $(which uvx 2>/dev/null) $HOME/.local/bin/uvx /opt/homebrew/bin/uvx /usr/local/bin/uvx uvx; do [ -x \"$p\" ] && exec \"$p\" --from git+https://github.com/BeehiveInnovations/pal-mcp-server.git pal-mcp-server; done; echo \"uvx not found\" >&2; exit 1"
+ env:
+ PATH: "/usr/local/bin:/usr/bin:/bin:/opt/homebrew/bin:$HOME/.local/bin:${CLI_BIN_PATHS}"
+ DISABLED_TOOLS: "${mcp.client_configs.pal.settings.disabled_tools}"
+ CUSTOM_API_URL: "http://localhost:11434"
+ claude:
+ transport: stdio
+ command: *pal_command
+ env:
+ PATH: "/usr/local/bin:/usr/bin:/bin:/opt/homebrew/bin:$HOME/.local/bin:${CLI_BIN_PATHS}"
+ DISABLED_TOOLS: "${mcp.client_configs.pal.settings.disabled_tools}"
+ CUSTOM_API_URL: "http://localhost:11434"
+ post_config:
+ claude_settings_env:
+ MCP_TIMEOUT: "300000"
+ MCP_TOOL_TIMEOUT: "1200000"
+ gemini:
+ transport: stdio
+ command: *pal_command
+ env:
+ PATH: "/usr/local/bin:/usr/bin:/bin:/opt/homebrew/bin:$HOME/.local/bin:${CLI_BIN_PATHS}"
+ DISABLED_TOOLS: "${mcp.client_configs.pal.settings.disabled_tools}"
+ CUSTOM_API_URL: "http://localhost:11434"
+ timeout_ms: 1200000
+ codex:
+ transport: stdio
+ command: *pal_command
+ env:
+ PATH: "/usr/local/bin:/usr/bin:/bin:/opt/homebrew/bin:$HOME/.local/bin:${CLI_BIN_PATHS}"
+ DISABLED_TOOLS: "${mcp.client_configs.pal.settings.disabled_tools}"
+ CUSTOM_API_URL: "http://localhost:11434"
+ startup_timeout_sec: 300
+ tool_timeout_sec: 1200
+
+ filesystem:
+ enabled: true
+ settings:
+ whitelist: "${path_to.workspace}"
+ allowed_methods:
+ - read_multiple_files
+ clients:
+ default:
+ transport: stdio
+ command:
+ - npx
+ - -y
+ - mcp-filter
+ - -s
+ - "npx -y @modelcontextprotocol/server-filesystem ${mcp.client_configs.filesystem.settings.whitelist}"
+ - -a
+ - read_multiple_files
+
+ fetch:
+ enabled: true
+ clients:
+ default:
+ transport: stdio
+ command:
+ - uvx
+ - mcp-server-fetch
+
+ memory:
+ enabled: true
+ storage_path: ~/.memory-mcp/memory.jsonl
+ clients:
+ default:
+ transport: stdio
+ command:
+ - npx
+ - -y
+ - "@modelcontextprotocol/server-memory"
+ env:
+ MEMORY_FILE_PATH: "${mcp.client_configs.memory.storage_path}"
+
+ playwright:
+ enabled: true
+ clients:
+ default:
+ transport: stdio
+ command:
+ - npx
+ - -y
+ - "@playwright/mcp@latest"
+
+
+# ─────────────────────────────────────────────────────────────────────────────
+# Agent configuration
+# ─────────────────────────────────────────────────────────────────────────────
+# Coding agent CLIs that Bureau should configure
+# Available: claude, gemini, codex, opencode
+
+agents:
+ - claude
+ - gemini
+ - codex
+ - opencode
+
+
+# ─────────────────────────────────────────────────────────────────────────────
+# Roles and skills
+# ─────────────────────────────────────────────────────────────────────────────
+
+# Role prompt availability: choose which agents are available when launching
+# CLIs directly (separate from PAL's clink cross-CLI delegation, configured
+# via pal.base-roles)
+# Options: "all", explicit list, or empty list []
+roles:
+ enabled:
+ - architect
+ - debugger
+ - code-reviewer
+ - optimization
+ - testing
+ - migration-refactoring
+
+ # roles to explicitly exclude (takes precedence over enabled)
+ disabled: []
+
+ # source directories for role discovery
+ sources:
+ - path: agents/role-prompts # For Codex, Gemini, OpenCode
+ cli: [codex, gemini, opencode]
+ - path: agents/claude-subagents # For Claude Code (has frontmatter)
+ cli: [claude]
+
+# Skills configuration (installed via protocols/scripts/set-up-skills.sh)
+skills:
+ enabled: [micro-mode, assess-mode]
+ disabled: []
+ sources:
+ - path: protocols/context/static/skills
+ prefix: bureau-
+
+# PAL clink configuration: controls which models and system prompts are
+# available when using PAL MCP's clink tool to spawn subagents across CLIs
+pal:
+ # Baseline roles made available to ALL coding CLIs
+ #
+ # - Roles are auto-discovered based on the set in agents/role-prompts
+ # - Options (also for per-CLI `extra-roles` settings below):
+ # - "all" => include all role prompts (note that when this is set,
+ # the per-CLI `extra-roles` settings below will have no effect)
+ # - "none" => include no roles
+ # - an explicitly-specified list of role prompts, referenced by their
+ # file's basename, e.g. `architect` for `agents/role-prompts/architect.md`
+ base-roles: all
+
+ # PAL CLI-specific setting options
+ # IMPORTANT: After changing any of the settings below:
+ # 1. Re-run protocols/scripts/set-up-protocols.sh (or bin/open-bureau wrapper)
+ # 2. Restart coding CLIs (or if possible, use their MCP-related commands
+ # without restarting) to reconnect to PAL
+ claude:
+ # Takes any valid option for Claude's `model` config setting
+ # (see https://code.claude.com/docs/en/model-config)
+ model: sonnet
+
+ # Extra role prompts (beyond `base-roles` above) to make available to
+ # only Claude when called via clink
+ extra-roles: none
+
+ codex:
+ # Takes any valid option for Codex's `model` config setting
+ # (see https://developers.openai.com/codex/local-config#configuration-options)
+ model: gpt-5.2-codex
+
+ # Takes any valid option for Codex's `model_reasoning_effort` config setting
+ # (see https://developers.openai.com/codex/local-config#configuration-options)
+ effort: medium
+
+ # Extra role prompts (beyond `base-roles` above) to make available to
+ # only Codex when called via clink
+ extra-roles: none
+
+ gemini:
+ # Extra role prompts (beyond `base-roles` above) to make available to
+ # only Gemini when called via clink
+ extra-roles: none
+
+
+# ─────────────────────────────────────────────────────────────────────────────
+# Paths
+# ─────────────────────────────────────────────────────────────────────────────
+
+# File paths for config files, connection settings, etc.
+# Note: environment variables take precedence over these values
+path_to:
+ # Base workspace for user projects (override using: $BUREAU_WORKSPACE)
+ # When set, the following paths are automatically derived from it
+ # (unless explicitly overridden):
+ # - serena_memories_root (root for recursive scanning of Serena memory
+ # files during Bureau-run cleanup)
+ workspace: ~/code
+
+ # MCP server clone location (relative paths resolve from main repo root,
+ # shared across Bureau worktrees)
+ mcp_clones: .mcp-servers
+
+
+# ─────────────────────────────────────────────────────────────────────────────
+# Auto-approval rules
+# ─────────────────────────────────────────────────────────────────────────────
+
+# Auto-approval settings
+# When true, agents won't prompt for permission before using MCP tools
+auto_approved:
+ mcp_tools: false
+ bash:
+ enabled: false
+ ruleset:
+ allow:
+ - "ls"
+ - "rg"
+ - "git status"
+ - "git diff"
+ - "git log"
+ - "npm run test"
+ - "python"
+ - "sed -i"
+ - "tee"
+ - "cat"
+ - "printf"
+ - "mkdir -p"
+ # deny:
+ # - "rm"
+ # - "git add"
+ # - "git commit"
+ # - "git reset"
+ # - "git checkout"
+ # - "git merge"
+ # - "git rebase"
+ # - "git push"
+ # - "git pull"
+ # - "git clean"
+ # - "pip install"
+ # - "npm install"
+ # - "pnpm install"
+ # - "yarn add"
+ # - "sudo"
+ # - "dd"
+ # - "mkfs"
+
+prune_disabled_mcps: true
+
+
+# ─────────────────────────────────────────────────────────────────────────────
+# Coding standards
+# ─────────────────────────────────────────────────────────────────────────────
+
+# Coding standards documents read by agents at startup and used by assess mode
+# Override: provide your own files in local.yml to replace these defaults
+# code_standards:
+# - protocols/context/static/code-standards.md
+
+# Assess mode skill configuration
+assess_mode:
+ default_target: git-diff
+ default_diff: HEAD
+
+
+# ─────────────────────────────────────────────────────────────────────────────
+# Retention & cleanup
+# ─────────────────────────────────────────────────────────────────────────────
+
+# Retention periods (per memory backend), after which memories older than
+# this threshold will be moved to trash automatically by the cleanup process
+# Formats: never, 24h (hours), 30d (days), 2w (weeks), 3m (months), 1y (years)
+retention_period_for:
+ claude_mem: 30d # Claude-mem SQLite database (Claude Code only)
+ serena: 90d # Serena project memories (.serena/memories/)
+ qdrant: 180d # Qdrant vector database (used by all enabled CLIs)
+ memory_mcp: 365d # Memory MCP JSONL file (used by all enabled CLIs)
+
+# Cleanup interval (for stale memories)
+cleanup:
+ min_interval: 24h
+
+# Grace period after stale items are moved to trash before permanent deletion
+trash:
+ grace_period: 30d
+
+
+# ─────────────────────────────────────────────────────────────────────────────
+# Startup timeouts
+# ─────────────────────────────────────────────────────────────────────────────
+
+# Timeouts (in seconds) when starting up
+# (increase for slower machines)
+startup_timeout_for:
+ mcp_servers: 200 # HTTP MCP servers
+ docker_daemon: 120 # Docker containers
diff --git a/directives.yml b/directives.yml
deleted file mode 100644
index a8c78c4f..00000000
--- a/directives.yml
+++ /dev/null
@@ -1,108 +0,0 @@
-# Bureau user-tunable configuration
-# - Changes to this file will directly alter Bureau's behavior.
-# - See CONFIGURATION.md for details.
-#
-# This file is version-controlled and shared across all users.
-# For local overrides (not to be tracked by git), create and write to local.yml instead.
-
-# Coding agent CLIs that Bureau should configure
-# Available: claude, gemini, codex, opencode
-agents:
- - claude
- - gemini
- - codex
- - opencode
-
-# File paths for config files, connection settings, etc.
-# Note: environment variables take precedence over these values
-path_to:
- # Base workspace for user projects (override using: $BUREAU_WORKSPACE)
- # When set, the following paths are automatically derived from it (unless explicitly overridden):
- # - serena_memories_root (root for recursive scanning of Serena memory files during Bureau-run cleanup)
- # - fs_mcp_whitelist (Filesystem MCP security boundary)
- workspace: ~/code
-
- # MCP server clone location (relative paths resolve from main repo root, shared across Bureau worktrees)
- mcp_clones: .mcp-servers
-
-# MCP tool permissions
-# When true, agents won't prompt for permission before using MCP tools
-mcp:
- auto_approve: no
-
-# PAL clink configuration: controls which models and system prompts are available
-# when using PAL MCP's clink tool to spawn subagents across coding CLIs
-pal:
- # Baseline roles made available to ALL coding CLIs
- #
- # - Roles are auto-discovered based on the set in agents/role-prompts
- # - Options (also for per-CLI `extra-roles` settings below):
- # - "all" => include all role prompts (note that when this is set,
- # the per-CLI `extra-roles` settings below will have no effect)
- # - "none" => include no roles
- # - an explicitly-specified list of role prompts, referenced by their file's basename,
- # e.g. `architect` for `agents/role-prompts/architect.md`
- base-roles: all
-
- # PAL CLI-specific setting options
- # IMPORTANT: After changing any of the settings below:
- # 1. Re-run protocols/scripts/set-up-configs.sh (or bin/open-bureau wrapper)
- # 2. Restart coding CLIs (or if possible, use their MCP-related commands without
- # restarting) to reconnect to PAL
- claude:
- # Takes any valid option for Claude's `model` config setting
- # (see https://code.claude.com/docs/en/model-config)
- model: sonnet
-
- # Extra role prompts (beyond `base-roles` above) to make available to
- # only Claude when called via clink
- extra-roles: none
-
- codex:
- # Takes any valid option for Codex's `model` config setting
- # (see https://developers.openai.com/codex/local-config#configuration-options)
- model: gpt-5.2-codex
-
- # Takes any valid option for Codex's `model_reasoning_effort` config setting
- # (see https://developers.openai.com/codex/local-config#configuration-options)
- effort: medium
-
- # Extra role prompts (beyond `base-roles` above) to make available to
- # only Codex when called via clink
- extra-roles: none
-
- gemini:
- # Extra role prompts (beyond `base-roles` above) to make available to
- # only Gemini when called via clink
- extra-roles: none
-
-# Retention periods (per memory backend), after which memories older than this threshold
-# will be moved to trash automatically by the cleanup process
-# Formats: never, 24h (hours), 30d (days), 2w (weeks), 3m (months), 1y (years)
-retention_period_for:
- claude_mem: 30d # Claude-mem SQLite database (Claude Code only)
- serena: 90d # Serena project memories (.serena/memories/)
- qdrant: 180d # Qdrant vector database (used by all enabled CLIs)
- memory_mcp: 365d # Memory MCP JSONL file (used by all enabled CLIs)
-
-# Cleanup interval (for stale memories)
-cleanup:
- min_interval: 24h
-
-# Grace period after stale items are moved to trash
-# before permanent deletion
-trash:
- grace_period: 30d
-
-# Timeouts (in seconds) to wait when starting up components (increase for slower machines)
-startup_timeout_for:
- mcp_servers: 200 # For HTTP MCP servers started by Bureau
- docker_daemon: 120 # For Docker daemon startup
-
-# Ports for locally-run HTTP servers & backing DB containers
-port_for:
- qdrant_db: 8780
- qdrant_mcp: 8782
- sourcegraph_mcp: 8783
- semgrep_mcp: 8784
- serena_mcp: 8785
diff --git a/docs/CONFIGURATION.md b/docs/CONFIGURATION.md
index 88a6ffe5..9c0e92b1 100644
--- a/docs/CONFIGURATION.md
+++ b/docs/CONFIGURATION.md
@@ -40,30 +40,30 @@ Configuration is loaded and merged in this order (later sources override earlier
| Priority | File | Purpose | Tracked by git? |
|:---------|:-----|:--------|:------------------|
-| 1 (lowest) | **`charter.yml`** | Fixed system defaults | Yes |
-| 2 | **`directives.yml`** | Streamlined collection of team-/user-oriented settings that are often tweaked | Yes |
-| 3 | **`local.yml`** | Personal overrides | No |
-| 4 (highest) | **Environment variables** | Runtime overrides *(should be used rarely; for more persistent personal overrides, use `local.yml`)* | N/A |
+| 1 **(lowest)** | [`defaults.yml`](/defaults.yml) | All git-tracked package defaults (ships with Bureau) | Yes |
+| 2 | `.bureau.yml` | Optional project-level config (discovered by walk-up from working directory) | Yes (in *your* project) |
+| 3 | `local.yml` | Personal overrides | No |
+| 4 **(highest)** | Environment variables | Runtime overrides *(should be used rarely; for more persistent personal overrides, use `local.yml`)* | N/A |
### When to use each file
-#### `charter.yml`
+#### `defaults.yml`
-- Don't edit unless you're changing upstream service endpoints or package conventions.
-- These are values that rarely (if ever) need changing.
+- This is the **single source of all git-tracked defaults that ship with Bureau.**
+- It contains examples of how to set config values (to use as exemplars to follow when overriding them in `.bureau.yml` or `local.yml`).
-#### `directives.yml`
+#### `.bureau.yml`
-- *Read* to see examples of how to set config values (to then override in your `local.yml`).
-- *Edit* to change team-wide defaults like retention periods, enabled agents, ports, or paths.
+- Optional project-level config file discovered by walking up from the current working directory (like ESLint, Prettier, or Ruff configs).
+- Can override any setting from `defaults.yml`.
+- Shareable via git: commit it to your project repo so all team members using Bureau get the same project-specific settings.
+- Typical uses: project-specific workspace paths, retention periods, enabled agents, MCP catalog entries, or custom tool settings.
- - Changes here affect everyone using *that* particular Bureau installation.
+#### `local.yml`
-#### `local.yml`
+Create and write to this file for personal overrides that shouldn't be shared, e.g.:
-Create and write to this file for personal overrides that shouldn't be shared, e.g.:
-
-- custom workspace paths
+- custom workspace paths
- custom retention periods for memories (configured per-MCP)
- disabling Bureau configuration for agent CLIs you don't use
@@ -85,22 +85,319 @@ agents:
Remove an agent from the list to skip configuring it. Note that the CLI's config directory must also exist (e.g., `~/.claude/` for Claude Code).
+
### `mcp`
-**File:** `directives.yml`
+MCP catalog configuration.
+
+**Cross-cutting conventions:**
+
+- **Canonical IDs:** map keys serve as *canonical IDs* for both `mcp.runtime_services` and `mcp.client_configs`.
+
+ - Do **not** add `name` fields; these cause needless duplication and drift.
+
+- **Placeholder expansion:** all string fields support `${...}` expansion.
+
+ - **Expansion order:** OS environment variables first, then config key paths (e.g. `${path_to.workspace}`, `${mcp.runtime_services.qdrant_mcp.port}`).
+ - Unknown placeholders remain untouched.
+ - **Environment variables for MCP servers:**
+ - To pass environment variables to an MCP server process, add them as `env` entries in the server's client config.
+ - The **values** in these `env` entries can themselves contain `${...}` placeholders that get resolved from your OS environment at config-load time before being passed to the MCP server.
+ - **Example:**
+
+ ```yaml
+ mcp:
+ client_configs:
+ context7:
+ clients:
+ default:
+ transport: http
+ url: https://api.context7.dev/mcp
+ env:
+ CONTEXT7_API_KEY: "${CONTEXT7_API_KEY}" # ← Expanded from your shell's $CONTEXT7_API_KEY
+ ```
+
+- **Dependency semantics:**
+
+ - `depends_on.services` is a list of service IDs.
+ - A service is considered ready only after its `healthcheck` succeeds (if present).
+ - Startup order is topological: servers with `depends_on.services` are skipped if any dependency is disabled or missing.
+
+- **Unknown keys:** unknown keys are preserved during resolution to allow future/custom extensions.
+- **Enabled by default:** dependencies, runtime services, and client configs are all **enabled by default** when `enabled` is omitted.
-MCP tool permissions.
+ - **Adding an entry to any MCP bucket is sufficient to activate it on the next `open-bureau` run.**
+ - You *must* set `enabled: false` explicitly to define an entry without activating it.
+
+**Top-level structure:**
+
+- `auto_approved` (object):
+ - `mcp_tools` (bool, default: `false`): Whether MCP tools should be auto‑approved by setup scripts.
+ - `bash` (object):
+ - `enabled` (bool, default: `false`): Whether Bash allow/deny rules should be applied.
+ - `ruleset` (object):
+ - `allow` (list\): Literal command prefixes to allow.
+ - `deny` (list\): Literal command prefixes to deny.
+- `prune_disabled_mcps` (bool, default: `false`): When `true`, Bureau prunes previously managed MCPs that are no longer desired, using per‑CLI registry fingerprints to avoid removing user‑modified entries.
+- `mcp` (object):
+ - `dependencies` (map\): Non-daemon prerequisites (git repos, file storage) prepared before services.
+ - `runtime_services` (map\): Managed runtime services (containers, processes) that may depend on dependencies.
+ - `client_configs` (map\): MCP servers exposed to CLIs.
+
+#### `mcp.dependencies`
+
+Defines non-daemon prerequisites (git repos, file storage) that are prepared before services. Dependencies cannot depend on other dependencies — they are prepared in sorted order first, then services (which may depend on them) are started.
+
+**Config schema** for each entry in `mcp.dependencies.`:
+
+- `enabled` (bool, default: `true`): Skip dependency if `false`.
+- `kind` (string, required): One of `git_repo`, `file`.
+- All kind-specific fields (see below).
+
+**Dependency kinds:**
+
+- `git_repo`:
+ - `repo_url` (string, required)
+ - `branch` (string, optional)
+ - `path` (string, required): Clone destination.
+ - `post_clone` (`list>`, optional): Commands run in `path` after clone/update.
+- `file`:
+ - `path` (string, required): File path used by cleanup and other tools.
+
+**Example:**
+```yaml
+mcp:
+ dependencies:
+ sourcegraph_repo:
+ kind: git_repo
+ repo_url: https://github.com/user/repo.git
+ branch: main
+ path: ${path_to.mcp_clones}/repo
+ post_clone:
+ - ["uv", "sync"]
+
+ claude_mem_storage:
+ kind: file
+ path: ~/.claude-mem/claude-mem.db
+```
+#### `mcp.runtime_services`
+
+Defines managed runtime services that Bureau starts (containers, local HTTP processes). Services can depend on dependencies via `depends_on.dependencies`.
+
+**Config schema** for each entry in `mcp.runtime_services.`:
+
+- `enabled` (bool, default: `true`): Skip service if `false`.
+- `kind` (string, required): One of `docker_container`, `http_process`; see kind-specific fields below.
+- `depends_on` (object, optional):
+ - `services` (list\): Service IDs that must be started and pass `healthcheck` first.
+ - `dependencies` (list\): Dependency IDs that must be prepared first.
+- `healthcheck` (object, optional):
+ - `tcp` (int): Port to probe for readiness.
+- `env` (map\, optional): Environment vars for process services.
+- `command` (list\, optional): Command array (executable + args) for process services.
+- `settings` (map\, optional): Service-specific data used for templating.
+
+**Kind-specific fields:**
+
+- `docker_container`:
+ - `container_name` (string, optional): Docker container name.
+ - `image` (string, required): Docker image ref.
+ - `host_port` (int, required): Host port bound to container.
+ - `container_port` (int, required): Container port to expose.
+ - `mounts` (`list