diff --git a/docs/superpowers/specs/2026-06-27-directive-hotswap-harness-design.md b/docs/superpowers/specs/2026-06-27-directive-hotswap-harness-design.md new file mode 100644 index 00000000..6472d796 --- /dev/null +++ b/docs/superpowers/specs/2026-06-27-directive-hotswap-harness-design.md @@ -0,0 +1,230 @@ +# Design: Directive Hot-Swap Harness (OpenCode Directive Presets) + +**Date:** 2026-06-27 +**Status:** Draft — pending user review +**Track ID (proposed):** `directive_hotswap_harness_20260627` + +## Problem + +The codebase's directives — the instructions that tell LLMs how to behave (banned patterns, conventions, hard bans, anti-patterns) — are scattered across the entire doc tree: `AGENTS.md`, `conductor/workflow.md`, `conductor/product-guidelines.md`, `conductor/tech-stack.md`, every `conductor/code_styleguides/*.md`, `docs/Readme.md`, `docs/AGENTS.md`, all 14 `docs/guide_*.md`, etc. They're embedded in prose, tables, anti-pattern sections, "Critical Anti-Patterns" lists, "Hard Rules," styleguide sections. + +The 4 tier role prompts (`.opencode/agents/tier1-orchestrator.md`, `tier2-tech-lead.md`, `tier3-worker.md`, `tier4-qa.md`) plus the autonomous variant (`conductor/tier2/agents/tier2-autonomous.md`) currently hardcode a list of ~11 files to read before any action. This list is static — every session gets the same directives regardless of the task. There's no mechanism to: +- Test whether an alternative encoding of the same directive (imperative-ban vs. rationale-first vs. before/after) produces better LLM compliance +- Hot-swap which encoding is active without manually editing files or navigating the filesystem +- Exercise per-session control over which directives the LLM warms up with + +## Goal + +Build a **directive hot-swap harness** that lets the user: +1. Maintain multiple alternative encodings ("variants") of the same directive as separate files +2. Compose active directive sets into named "presets" (markdown bills of materials) +3. Hot-swap which preset is active via a single `warm with: ` instruction in the role prompt or session message +4. Use the existing file-reading behavior LLMs already have — no scripts, no TOML, no build steps + +## Design + +### The directive directory structure + +``` +conductor/directives/ + / + v1.md ← the baseline encoding (verbatim lift from current docs) + v2_