| name | foundation |
| description | Runs the foundation council — five perspective agents (user-advocate, investor-advocate, architect, security-auditor, skeptic), a synthesizer, and a spine hydrator — before any feature or task work begins. Produces README.md as the project anchor, docs/foundation/* council artifacts, a hydrated CLAUDE.md or AGENTS.md, and docs/refs/*.md progressive-disclosure references. Mandatory before feature-planner, implement-task, or task-loop — those refuse to start until OPEN-DECISIONS.md is clean. Use after init. |
Foundation
You are the foundation orchestrator. You do not write the README. You do not produce a critique. You capture a short pitch from the user, dispatch five independent perspective agents in parallel, dispatch the synthesizer that turns the five drafts into the project's anchor documents, then dispatch the spine hydrator that turns the generic project spine into a project-specific progressive-disclosure index.
This skill exists because the plugin's other skills (feature-planner, task-loop, implement-task) presuppose that the team — human + agents — knows what is being built, for whom, and under what constraints. Foundation produces that shared ground and wires the project spine so future agents know where to look without loading every document.
Platform adaptation
- Claude Code: invoke as
/agentic-ai-features:foundation and dispatch the named agentic-ai-features:* sub-agent types.
- Codex: invoke the
foundation skill. If council dispatch is needed, first ensure the user explicitly authorizes sub-agent delegation, then use multi_agent_v1.spawn_agent with the matching agents/*.md role brief included in each prompt.
- If isolated agents are unavailable or unauthorized: stop with
unable to dispatch <name> or a human gate. Do not run the council seats inline.
Preconditions
Before doing anything, check:
-
A project spine exists at the cwd root: CLAUDE.md for Claude Code or AGENTS.md for Codex. If neither exists, stop and emit: Project spine missing — run init first.
-
No prior foundation output at the cwd root. Specifically, stop and refuse to overwrite if any of these already exist:
README.md
docs/foundation/PERSPECTIVES.md
docs/foundation/OPEN-DECISIONS.md
docs/foundation/PITCH.md
If any exist, emit: Foundation already initialised (<path> found) — refusing to overwrite. To refresh, delete the foundation outputs manually and re-run. (Re-running over a live foundation would discard council history.) and stop.
-
The five perspective agents, synthesizer, and spine hydrator are dispatchable: agentic-ai-features:user-advocate, agentic-ai-features:investor-advocate, agentic-ai-features:architect, agentic-ai-features:security-auditor, agentic-ai-features:skeptic, agentic-ai-features:foundation-synthesizer, agentic-ai-features:foundation-spine-hydrator. In Codex, this means separate sub-agent invocations using the corresponding agents/*.md role briefs. If any cannot be dispatched in this environment, stop with unable to dispatch <name> — do not fall back to running them inline. The whole point of this skill is independent contexts.
Step 1 — Pitch capture
Ask the user 5 to 7 short questions. In Claude Code, use the AskUserQuestion tool when you can offer concrete option sets; in Codex, ask concise plain-text questions unless a native question tool is available. Do not invent answers; if the user genuinely doesn't know, write "unknown" into the pitch and a council seat will flag it.
Cover at minimum:
- One-sentence pitch. "What is this project?"
- Target user / customer. "Who is the primary user? What role, what context, what are they doing five minutes before they encounter this?"
- Core problem. "What pain are we removing? What's the current workaround?"
- Differentiation. "Why this and not the obvious alternative (existing tool, manual workaround, open-source repo)?"
- Hard constraints. "What must be true (compliance, latency, cost, on-prem, data residency, model choice, license)?"
- Success metric. "If this works in 6 months, what number or observable state proves it?"
- Anti-scope. "What is this explicitly not — to keep the scope tight?"
If the user gives 1–2-word answers everywhere, that itself is foundation feedback — note it; the council will surface that the pitch is thin.
Write the answers, verbatim, to docs/foundation/PITCH.md in this shape:
# Project Pitch
> Captured by /agentic-ai-features:foundation on <ISO date>. The five council perspectives ground their findings in this document.
## One-sentence pitch
<answer>
## Target user
<answer>
## Core problem
<answer>
## Differentiation
<answer>
## Hard constraints
<answer>
## Success metric
<answer>
## Anti-scope
<answer>
Do not editorialise. The pitch is the user's own words.
Step 2 — Council dispatch (parallel, isolated)
In one message, dispatch five Agent tool calls in parallel. In Codex, use separate sub-agent calls only after explicit delegation authorization and include the relevant agents/*.md role brief in each prompt.
subagent_type: "agentic-ai-features:user-advocate", description: "Foundation council — user advocate", prompt: "Read docs/foundation/PITCH.md and the existing repo. Apply your role brief. Write your verdict to docs/foundation/perspectives/user-advocate.md. Do not coordinate with other seats."
subagent_type: "agentic-ai-features:investor-advocate", same shape, output to investor-advocate.md.
subagent_type: "agentic-ai-features:architect", same shape, output to architect.md.
subagent_type: "agentic-ai-features:security-auditor", same shape, output to security-auditor.md.
subagent_type: "agentic-ai-features:skeptic", same shape, output to skeptic.md.
Never run a seat inline. Never sequence them; the parallel dispatch is what guarantees independence — a sequential seat would be tempted to read prior drafts.
(The skeptic agent's brief explicitly allows reading other drafts if they exist. Because all five run in one parallel dispatch, none of them are written yet when the skeptic starts — so the skeptic stays independent. This is by design.)
Wait for all five to return. Capture each return summary.
If any seat fails to dispatch or fails to write its file, stop and surface the failure. Do not attempt to substitute — a missing seat means a missing perspective, which is the failure this skill exists to prevent.
Step 3 — Verify the five drafts
Read each of the five output files. Each must contain the four sections (Findings, Concerns, Recommendations, Open Questions) with non-empty bullets. If any is empty or placeholder-shaped, stop and surface: the seat returned without doing its job; the human must decide whether to retry that seat or accept the gap.
Step 4 — Synthesis dispatch
Dispatch one synthesizer Agent tool call. In Codex, use a fresh multi_agent_v1.spawn_agent invocation with agents/foundation-synthesizer.md included as the role brief.
subagent_type: "agentic-ai-features:foundation-synthesizer"
description: "Foundation synthesis"
prompt: "Read docs/foundation/PITCH.md and the five council drafts under docs/foundation/perspectives/. Use templates/README.md as the skeleton. Write README.md, docs/foundation/PERSPECTIVES.md, docs/foundation/OPEN-DECISIONS.md. Follow the rules in your role brief — surface disagreement, do not invent, 3–7 OPEN-DECISIONS items, stable IDs."
Wait for return. Verify the three output files exist and are non-empty.
Step 5 — Spine hydration dispatch
Dispatch one spine-hydrator Agent tool call. In Codex, use a fresh multi_agent_v1.spawn_agent invocation with agents/foundation-spine-hydrator.md included as the role brief.
subagent_type: "agentic-ai-features:foundation-spine-hydrator"
description: "Foundation spine hydration"
prompt: "Read the project spine (CLAUDE.md or AGENTS.md), README.md, docs/foundation/PITCH.md, docs/foundation/PERSPECTIVES.md, and docs/foundation/OPEN-DECISIONS.md. Use the matching template under templates/ only for structure and platform wording. Hydrate the project spine into a project-specific progressive-disclosure index and create or update concise docs/refs/*.md files. Do not decide or tick open decisions. Do not modify README.md or docs/foundation/*."
Wait for return. Verify:
- the active project spine (
CLAUDE.md or AGENTS.md) exists and is non-empty;
- no init-template placeholders remain outside intentional task-format examples (
<Rule 1>, <cmd>, <touching path X or behavior Y>, <Milestone 1>, "Replace this paragraph");
- every
docs/refs/*.md path listed in the spine exists and is non-empty;
docs/foundation/OPEN-DECISIONS.md still contains the same unchecked decisions the synthesizer produced.
If the hydrator cannot write or safely merge the spine because existing project-specific content conflicts with the foundation output, stop and surface the conflict. Do not hand-edit the spine inline as the orchestrator.
Step 6 — Gate report
Emit one report to the user with this exact shape:
Foundation council complete.
Pitch: docs/foundation/PITCH.md
Perspectives:
- docs/foundation/perspectives/user-advocate.md → <one-line summary or "see file">
- docs/foundation/perspectives/investor-advocate.md → ...
- docs/foundation/perspectives/architect.md → ...
- docs/foundation/perspectives/security-auditor.md → ...
- docs/foundation/perspectives/skeptic.md → ...
Synthesis:
- README.md (project anchor — read this first)
- docs/foundation/PERSPECTIVES.md (consolidated council protocol)
- docs/foundation/OPEN-DECISIONS.md (N open decisions)
Spine:
- CLAUDE.md or AGENTS.md (hydrated agent index)
- docs/refs/*.md (progressive-disclosure references)
Foundation gate: ACTIVE while OPEN-DECISIONS.md has unchecked items.
While the gate is active, /agentic-ai-features:feature-planner, /agentic-ai-features:implement-task,
and /agentic-ai-features:task-loop refuse to start.
Next steps:
1. Open README.md — does it match your project? Adjust the parts the council got wrong.
2. Open CLAUDE.md or AGENTS.md — does the agent index point at the right project refs?
3. Open docs/foundation/OPEN-DECISIONS.md — resolve every item by replacing
"- [ ]" with "- [x]" once you have made the call, and writing the decision inline.
4. Then run /agentic-ai-features:feature-planner.
Do not pretend the gate is cleared. Do not auto-tick checkboxes. The human ticking the boxes is the gate.
Failure modes
- Project spine missing → stop, point at
init (/agentic-ai-features:init in Claude Code, init skill in Codex).
- Foundation output already exists → stop, refuse to overwrite (idempotency rule).
- A seat fails to dispatch → stop, surface which one.
- A seat returns empty / placeholder → stop, surface the gap.
- Synthesizer produces a README with 3+ empty sections → its own brief tells it to stop and report; if it did, surface that — the pitch was too thin, the user must enrich
docs/foundation/PITCH.md and re-run.
- Spine hydrator leaves init-template placeholders or missing refs → stop, surface the gap. Future agents would otherwise start from a generic index.
- User answers Step 1 with "I don't know" everywhere → proceed; that is itself a finding the council will surface in their Open Questions and the synthesizer will lift into OPEN-DECISIONS.
Boundaries
- Do not write the README yourself. The synthesizer agent does that.
- Do not hydrate the project spine inline. The spine hydrator agent does that.
- Do not vote, summarise, or add a sixth opinion in the orchestrating context.
- Do not commit. Leave all files in the working tree.
- Do not run
feature-planner, task-loop, or implement-task. This skill ends at the gate report.
- One foundation per project. Do not support re-running over an existing foundation; that is a manual operation the user does by deleting the outputs deliberately.