This document defines the Claude Code slash-command behavior for PIE.
Commands operate on durable artifacts under docs/pie/, not on chat history. Artifact files are authoritative; docs/pie/index.md is a derived registry.
docs/pie/
project.md
index.md
<intent>/
intent.md
baseline.md
baselines/
<baseline_id>.md
asks/
<ask_id>.md
exports/
spikes/
<spike>/
spike.md
spikes/
<spike>/
project.md,intent.md,spike.md, baseline files, ask records, and export seeds are authoritative.index.mdis derived and repairable. If it conflicts with authoritative artifacts, repair the index from artifacts.- Active intent and active spike are session-local. Do not store a shared active cursor in
docs/pie/index.md. - If session context is unclear, ask for the intent or spike name instead of guessing.
| Command | Purpose |
|---|---|
/pie:init |
Initialize project context, derived index, guidance files, and spike isolation. |
/pie:project |
Show or update the Project Goal, guardrails, principles, and brownfield context. |
/pie:intent <name> <description> |
Create an intent, assess project alignment, and assess readiness. |
/pie:intent |
List intents and status from the derived registry. |
/pie:intent <name> |
Select an intent for the current session and summarize durable state. |
/pie:spike [name] |
List, create, inspect, select, or continue a spike under an explicit or session-selected intent. |
/pie:distill |
Fold spike findings or long discovery context into durable intent updates. |
/pie:decision <description> |
Manually record, affirm, reject, or override a decision. |
/pie:implement |
Run the readiness gate, create baseline revision and ask, then implement directly. |
/pie:export <adapter> |
Run the readiness gate, create baseline revision and ask, then write downstream seed. |
/pie:feedback <description> |
Reconcile delivery feedback back into PIE. |
/pie:baseline |
Optional baseline preview or explicit generation without delivery. |
Create or update:
AGENTS.md
CLAUDE.md
docs/pie/project.md
docs/pie/index.md
Behavior:
- Preserve existing repository guidance.
- For greenfield projects, ask for the Project Goal and material guardrails.
- For brownfield projects, inspect durable context, propose a Project Goal and guardrails, and ask for confirmation or revision.
- Create or repair the derived PIE index.
- Enforce spike isolation:
.gitignore:spikes/;.eslintignore:spikes/anddocs/pie/, when applicable;.npmignore:spikes/anddocs/pie/, when applicable;- equivalent excludes for detected lint, test, build, or package-publish systems.
Do not add docs/pie/ to .gitignore by default. docs/pie/ is durable PIE state and should normally be committed.
Do not invent a brownfield Project Goal without confirmation.
Display docs/pie/project.md.
Show:
- Project Goal;
- guardrails;
- shared principles;
- brownfield system understanding, when present;
- known evolution themes and project-level questions, when present.
End with a light invitation to update project context. If the user updates it, revise project.md, repair index.md when needed, and flag intents that may need alignment review.
Do not store active intents, intent status, or spike status in project.md.
Forms:
/pie:intent
/pie:intent <name>
/pie:intent <name> <description>
Create behavior:
- Load
docs/pie/project.md. - Assess whether the intent aligns with the Project Goal and guardrails.
- If alignment is unclear or negative, ask whether to reframe the intent, update the Project Goal, or treat the work as a separate project.
- Create
docs/pie/<intent>/intent.md. - Assign stable
intent_id, for examplePIE-INTENT-STOCK-SCREENER. - Register the intent in the derived
docs/pie/index.md. - Select the intent for the current session only.
- Assess readiness as
ready,not_ready, orborderline. - Ask only material clarification questions.
- Recommend a spike when evidence is needed.
List or select behavior:
/pie:intentlists intents, statuses, readiness, baseline state, latest asks, and child spikes./pie:intent <name>selects the intent for the current session and summarizes durable state.
Material ambiguity test:
Would a different answer change the goal, in-scope behavior, success criteria,
non-negotiable constraints, delivery readiness, or downstream ask?
If yes, ask or track it. If no, keep it out of PIE.
Convergence behavior:
- explicit answer or accepted option: auto-record the decision, remove the ambiguity, and refresh readiness;
- explicit user decision: auto-record the decision and refresh readiness;
- accepted pending recommendation: auto-record the decision and refresh readiness;
- inferred decision or project-framing shift: propose the decision and ask for confirmation before recording as accepted;
- partial answer: update understanding but keep unresolved ambiguity visible;
- exploratory remark or non-material detail: do not update PIE artifacts.
Forms:
/pie:spike
/pie:spike <name>
Behavior:
- no name: list spikes under the session-selected intent, or ask for the intent if no session selection is clear;
- existing name: select the spike for the current session and summarize question, status, and next step;
- new name: create a focused spike under the explicit or session-selected intent.
Spike records live at:
docs/pie/<intent>/spikes/<spike>/spike.md
Spike-only code lives at:
spikes/<spike>/
Statuses:
proposed
active
completed
distilled
abandoned
Spike code is exploratory by default. Production reuse is a delivery decision, not a PIE spike status.
Before creating or running spike code, verify spike isolation from /pie:init.
Use for synthesis, not routine one-question clarification.
Use it when:
- a spike has findings;
- a long or branched conversation needs consolidation;
- several partial conclusions accumulated;
- the user wants a durable checkpoint.
Behavior:
- Use the session-selected spike or intent. If unclear, ask which intent or spike to distill.
- If a spike is selected, summarize findings and update the spike record.
- Update the parent intent with resolved unknowns, evidence, and current understanding.
- Record decisions that are already settled.
- Recommend decisions that still need approval.
- Reclassify readiness as
ready,not_ready, orborderline. - Repair
docs/pie/index.mdfrom authoritative artifacts.
Manually record, affirm, reject, or override an intent-level decision.
Use it when:
- the human explicitly wants to record a decision;
- a decision was made outside the current agent flow;
- the user wants to accept, reject, or override a recommendation;
- evidence is inconclusive but the user chooses a direction.
Decision records should separate source from status:
### Decision: Short title
- **Decision ID:** DEC-<INTENT-SLUG>-001
- **Decision:** The decision.
- **Rationale:** Why this decision is appropriate.
- **Source:** clarification_response, spike_finding, explicit_user_decision, delivery_feedback, or external_input.
- **Impact:** What changes because of this decision.
- **Status:** proposed, accepted, rejected, or superseded.Normal clarification and distillation should record settled decisions automatically.
Optional. Preview or explicitly generate a Delivery Baseline without starting delivery.
Run the readiness gate first:
ready: create or refresh the baseline.not_ready: stop with blockers.borderline: ask the user before baselining.
If baselining proceeds:
- update
docs/pie/<intent>/baseline.md; - create or refresh the next immutable snapshot under
docs/pie/<intent>/baselines/; - repair
docs/pie/index.md.
This command does not create a Delivery Ask.
Start direct implementation.
Behavior:
- Load project context and the explicit or session-selected intent.
- Run the readiness gate.
- If
not_ready, report blockers and stop. - If
borderline, name the judgment call and ask the user before proceeding. - If proceeding, create or refresh
baseline.md. - Create immutable baseline revision under
baselines/. - Create direct implementation ask under
asks/. - Mark intent
in_delivery. - Implement from the baseline revision.
Do not invent missing intent to begin implementation.
Export to a downstream delivery framework.
Current adapters:
/pie:export speckit
/pie:export lid
Behavior:
- Load project context and the explicit or session-selected intent.
- Run the readiness gate.
- If
not_ready, report blockers and stop. - If
borderline, name the judgment call and ask the user before proceeding. - If proceeding, create or refresh
baseline.md. - Create immutable baseline revision under
baselines/. - Create export ask under
asks/. - Load the adapter spec.
- Write the seed under
docs/pie/<intent>/exports/. - Include a
PIE Originblock. - Mark intent
in_delivery.
Repeated export to the same adapter should default to updating the known downstream target while still creating a new ask record.
Use when direct implementation or downstream delivery reveals learning that may change intent.
Behavior:
- Identify the intent from an ask ID, explicit context, or session selection. If unclear, ask.
- Record feedback source lineage when known: ask ID, baseline ID, framework, and downstream target.
- Classify feedback into one of:
- routine delivery detail;
- intent-impacting feedback;
- ambiguous feedback.
- Routine delivery detail: summarize briefly and do not churn artifacts.
- Intent-impacting feedback: update the intent, readiness, derived index, and downstream impact.
- Ambiguous feedback: ask the user whether to treat it as routine delivery detail or material feedback that reopens intent discovery.
- Recommend clarification, spike, baseline revision, seed regeneration, or project update as needed.