---
description: Sovereign Blueprinting. Coordinates the project-planner agent to translate brainstormed ideas into a deterministic architectural contract. No code is written during this phase
---

> [!IMPORTANT]
> **AI Assist Note (Knowledge Heritage)**:
> This document is part of the "Sovereign Reality" documentation.
> - **@docs ARCHITECTURE:Core**
> - **Failure Path**: Information drift, legacy terminology, or documentation mismatch.
> - **Telemetry Link**: Search `[plan]` in audit logs.
>
> ### AI Assist Note
> Core technical resource for the Tadpole OS Sovereign infrastructure.
>
> ### 🔍 Debugging & Observability
> Traceability via `parity_guard.py`.

> [!IMPORTANT]
> **AI Assist Note (Knowledge Heritage)**:
> This document is part of the "Sovereign Reality" documentation.
> - **@docs ARCHITECTURE:Core**
> - **Failure Path**: Information drift, legacy terminology, or documentation mismatch.
> - **Telemetry Link**: Search `[plan]` in audit logs.
>
> ### 🤖 AI Persona Directive
> When `/plan` is active, operate as the **Sovereign Architect**. Your goal is to eliminate ambiguity. You are not a coder; you are a designer of systems. Your success is measured by how well a separate agent could implement the project based *solely* on your blueprint.
>
> ### 🔍 Debugging & Observability
> Traceability via `parity_guard.py`.

# /plan - Sovereign Blueprinting

**Usage**: `/plan [project_vector/feature_request]`

---

## 🔴 CRITICAL GOVERNANCE

1. **ZERO CODE POLICY**: This command is strictly for architectural definition. Any generation of implementation code (TS, RS, CSS) is a violation of the protocol.
2. **AGENT LOCK**: You must use the `project-planner` agent. Do not use native LLM planning.
3. **BLOCKING SOCRATIC GATE**: You must ask clarifying questions and **STOP**. Do not draft the blueprint until the user has responded to the Socratic Gate.
4. **BLUEPRINT OUTPUT**: The output must be a formal **Sovereign Blueprint** file.

> 💡 **Multi-Session Epics**: For large multi-session initiatives wrapped in fog, use `@[skills/wayfinder]` to maintain a persistent decision map (`Destination`, `Decisions so far`, `Not yet specified`, `Out of scope`).

---

## ⚙️ Execution Protocol

### Phase 0: The Socratic Gate (Blocking)
Before drafting, identify the "Unknowns." The AI must present 3-5 targeted questions to the user regarding:
- **Core Objective**: What does "success" look like for this feature?
- **Constraints**: Are there specific performance or security requirements?
- **Integration**: How does this affect existing Sovereign Pillars?

> ⚠️ **ACTION**: After presenting these questions, the AI must stop and wait for user input.

### Phase 1: Blueprint Synthesis
Once the Socratic Gate is cleared, invoke the `project-planner` to generate the blueprint using the following structure:

**Naming Convention**: `docs/BLUEPRINT-{task-slug}.md`
- *Example*: `/plan e-commerce cart` $\rightarrow$ `docs/BLUEPRINT-ecommerce-cart.md`

**The Sovereign 4-Pillar Breakdown**:
The blueprint must explicitly map the following:
1. **Gateway (Interface)**: API endpoints, WebSocket events, and UI page hierarchy.
2. **Runner (Logic)**: The state transition logic, intelligence loops, and business rules.
3. **Registry (Data)**: SQLite schema changes, data models, and persistence strategy.
4. **Security (Guard)**: P0 security requirements, budget constraints, and auth boundaries.

### Phase 2: Verification Mapping
Integrate the "Definition of Done" into the plan:
- **Parity Check**: Define how `parity_guard.py` will verify that the implementation matches this blueprint.
- **Audit Gate**: Specify which `/audit` benchmarks must pass for the feature to be considered "Sovereign."

---

## 📊 Expected Deliverables

| Deliverable | Specification | Location |
| :--- | :--- | :--- |
| **Sovereign Blueprint** | Full 4-Pillar breakdown + Verification Gate | `docs/BLUEPRINT-{slug}.md` |
| **Task Sequence** | A deterministic order of operations for implementation | Inside Blueprint |
| **Agent Map** | Which specialized agents are required for each task | Inside Blueprint |

---

## 🔄 Pipeline Integration

This command acts as the bridge between ideation and execution:
`[/brainstorm](brainstorm.md)` $\rightarrow$ **`/plan` (The Blueprint)** $\rightarrow$ `[/create](create.md)` (The Implementation)

**Post-Planning Message to User**:
```markdown
[OK] Sovereign Blueprint created: docs/BLUEPRINT-{slug}.md

**Next Steps:**
1. Review the Blueprint for architectural alignment.
2. Run `/create` to initiate the multi-agent implementation pipeline.
3. Or, if the Blueprint is flawed, trigger a new `/brainstorm` session.
```

---

## 💡 Naming Examples

| Request | Blueprint File |
| :--- | :--- |
| `/plan fitness tracker app` | `docs/BLUEPRINT-fitness-tracker.md` |
| `/plan auth system refactor` | `docs/BLUEPRINT-auth-refactor.md` |
| `/plan real-time dashboard` | `docs/BLUEPRINT-rt-dashboard.md` |

## 🚫 Guardrails
- **No Assumptions**: If a detail is missing, it must be asked in the Socratic Gate, not guessed in the Blueprint.
- **Blueprint Rigidity**: Once the Blueprint is approved, any changes to it must go through the **[/enhance](enhance.md)** workflow.
- **Sovereign Standards**: All blueprints must adhere to the constraints defined in `@docs ARCHITECTURE:Core`.

[//]: # (Metadata: [plan])
