plan-foundation
Skill0 starsChanged 5 months agoMITView on GitHub
Orchestrate foundation planning (P0–P6) and certify plan-master-ready. Use for foundation status, continue, greenfield, or certify. Does not author the master implementation plan or certify implementation-ready - that is plan-master.
In this repository22 other files it gives its agents.
- ai-directorSkill
- code-implementationSkill
- code-repairSkill
- code-verifySkill
- concept-runSkill
- db-migrationSkill
- deploy-basicSkill
- deploy-filesSkill
- dev-stackSkill
- docsSkill
- feature-specSkill
- infra-terraformSkill
- plan-masterSkill
- plan-repairSkill
- plan-syncSkill
- plan-verifySkill
- process-routerSkill
- project-bootstrapSkill
- project-query-setupSkill
- session-controlSkill
- tauri-developmentSkill
- x-directorSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
21 rules. About 0 are common, 8 are distinctive, and 13 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈8
Distinctive · estimate
This author's own choices. Worth a look.
13
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 17
Operator handoff: every response that ends a turn follows the Operator handoff contract — terse output.
- Very specific: line 18
Document clarity: every generated document follows the Document clarity contract — Status + Needs header, separate Decisions/Open questions …
- Distinctive: line 40
Do not: run greenfield INTERACTIONs when the user asked for status only.
- Very specific: line 62
If {HANDOFF} missing → stop with the blocked-report shape:
- Very specific: line 66
If .cursorrules missing at repo root → stop with the same shape:
- Very specific: line 70
If REPLACE: tokens remain in .cursorrules → warn.
- Very specific: line 71
If .work/touch-scope exists and still has the template placeholder "ref": "REPLACE:PROJECT_REF" (or empty allowed_paths/allowed_patterns) → …
- Distinctive: line 78
If foundation-complete: no → stop with the blocked-report shape:
- Very specific: line 93
Read README → HANDOFF → .cursorrules.
- Distinctive: line 105
foundation-complete: yes: when P0–P6 gates pass. Report separately from plan-master-ready: reference.md § Status protocol (detailed) (S3b).
- Distinctive: line 125
Run Status protocol S1–S3 (short form - no full report unless user wants it).
- Distinctive: line 127
If partial: complete that phase's GATE checklist (artifacts + shared gate integrity).
- Very specific: line 129
Update registries (ASSUMPTIONS, RISK_REGISTRY, UNKNOWNS) when assumptions, risks, or unknowns change.
- Very specific: line 132
Update HANDOFF.md and NEXT.md when a gate passes completion model (not merely when files are written).
- Very specific: line 134
After plan-master-ready: recommend @plan-master greenfield | continue - do not author master plan in plan-foundation.
- Very specific: line 135
After master plan exists → tell user to run @plan-master status for implementation-ready (not plan-foundation).
- Distinctive: line 136
Do not write broad multi-milestone implementation without plan-master Approved master plan (or HANDOFF waiver).
- Distinctive: line 150
Use when the user asks to certify, verify for plan-master, or plan-master-ready.
- Distinctive: line 153
Run Status protocol S1–S3 (full evaluation).
- Very specific: line 154
Run @plan-master integrity on foundation artifacts (read-only if status-only.
- Very specific: line 180
Do not create *-full-plan.md in certify mode - that is plan-master's job.
≈ “Common” is an estimate: at least 1 in 5 of the 213,895 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
plan-foundation
Workflow orchestrator for project foundation - from idea through plan-master-ready certification. Stops there; plan-master owns the master roadmap and implementation-ready. Tool-agnostic (Cursor, Claude Code, opencode, Codex). Project-agnostic: paths use .ai/ as the documentation root; adapt backend folder name (apis/, src/, server/) per ADR. Product-intent capture lives in P0 of this skill: greenfield creates the P0 initial scope mini-plan at {PLANS_ROOT}/foundation/YYYYMMDD-01-<slug>-initial-scope.md (foundation doc 01). There is no separate project-init or code-foundation skill in this registry.
Hard rule - {PROMPTS_ROOT}/initial.md: User-owned scratch only. This skill must not read or create it unless the user explicitly names that path in the same invocation.
Canonical path: .ai/skills/plan-foundation/skill.md (this file). Invocation examples: reference.md.
- Operator handoff: every response that ends a turn follows the Operator handoff contract — terse output; approvals under
**Needs your approval:**citingpath:L<n>; questions numbered under**Needs your answer:**; exactly one**Next step:**command; one line when nothing is needed (Form A). Decisions and questions never mixed; empty sections omitted. - Document clarity: every generated document follows the Document clarity contract — Status + Needs header, separate Decisions/Open questions lists, one
## Next action, no placeholder scaffolding left behind.
<a id="terminology-required--prevents-confusion-with-plan-master"></a>
Role charter (anti-drift)
Guides foundation planning only — not implementation. Charter, goals/boundaries, terminology, architecture directions, plan-master relationship, lifecycle, registries, traceability, gate model, integrity, hallucination prevention, fitness/UX/AI/cross-model rules: reference.md § Foundation concepts (detailed).
Step 0 - Pick a mode (always first)
Detect from the user message. If ambiguous, ask once:
| Mode | User intent (examples) | Action |
| status | "foundation status", "plan-master-ready?", "foundation-complete?" | Status protocol - read-only; foundation-complete + plan-master-ready only |
| continue | "continue foundation", "what's next", "resume planning" | Continue protocol - detect phase → next gate |
| greenfield | new project, empty repo, "start foundation" | Greenfield protocol - P0→P6 |
| probe | "probe the project", "ask me questions", "fill the gaps", "make sure you understand", "what else do you need to know?" | Probe protocol - adaptive coverage loop; read+write planning artifacts only |
| certify | "certify plan-master-ready", "verify foundation for plan-master" | Run Plan-master readiness; update HANDOFF if pass |
Do not run greenfield INTERACTIONs when the user asked for status only.
Registry: Full matrix - .ai/skills/SKILL_DEPENDENCIES.md.
Symmetric verify/repair: @plan-verify foundation orchestrates this skill's status + @plan-master integrity on foundation artifacts; gaps → @plan-repair foundation or @plan-foundation continue.
Prerequisite gate
| Mode | Gate |
| greenfield | GF0 |
| probe | GF0 (needs {HANDOFF} + doc 01 to record into); else suggest greenfield |
| certify | CF0 |
| continue | Foundation started (≥1 foundation doc or HANDOFF notes P0); else suggest greenfield |
| status | - (read-only) |
GF0 - Bootstrap artifacts
Before P0 INTERACTIONs:
- If
{HANDOFF}missing → stop with the blocked-report shape:- Required:
{HANDOFF}exists - Detected:
.work/context/HANDOFF.mdmissing - Run first:
@project-bootstrap init(or@session-controlminimal HANDOFF only if user refuses bootstrap in the same message)
- Required:
- If
.cursorrulesmissing at repo root → stop with the same shape:- Required:
.cursorrulesat repo root - Detected: missing
- Run first:
@project-bootstrap init
- Required:
- If
REPLACE:tokens remain in.cursorrules→ warn; foundation may proceed but record unfilled tokens in the greenfield report. - If
.work/touch-scopeexists and still has the template placeholder"ref": "REPLACE:PROJECT_REF"(or emptyallowed_paths/allowed_patterns) → warn; foundation may proceed, but record it in the greenfield report and remind the user that@code-implementationwill block file writes on an undeclared/placeholder scope (touch-scope-verify.sh --strict-fail).
CF0 - Foundation-complete
Before certify:
- Evaluate Foundation-complete (artifact check).
- If foundation-complete: no → stop with the blocked-report shape:
- Required:
foundation-complete: yes(P0–P6 gates closed) - Detected:
foundation-complete: no- failing phase/gate list from status - Run first:
@plan-foundation continue(finish the failing phase, then re-invokecertify)
- Required:
Blocked-report shape
Per SKILL_DEPENDENCIES.md § Blocked report shape - header: ## @plan-foundation <command> - blocked (prerequisite). End the report with the Operator handoff close (Form A Next: … or Form B **Needs your approval:** / **Needs your answer:** / **Next step:**) per SKILL_DEPENDENCIES.md.
Status protocol
S1 - Resolve project identity
Read README → HANDOFF → .cursorrules; ask once if none. Details: reference.md § Status protocol (detailed) (S1).
S2 - Read session artifacts (if present)
Artifact read table (HANDOFF, NEXT, ADRs, registries, doc 04): reference.md § Status protocol (detailed) (S2).
S3 - Evaluate phases (evidence-based)
Phase table P0–P6, stage labels, evidence rules: reference.md § Status protocol (detailed) (S3).
S3b - Foundation-complete (artifact check)
foundation-complete: yes when P0–P6 gates pass. Report separately from plan-master-ready: reference.md § Status protocol (detailed) (S3b).
S4 - Plan-master readiness
Ten-criterion gate; HANDOFF record on pass. Full checklist: reference.md § Status protocol (detailed) (S4).
S5 - Out of scope: implementation-ready
Redirect to @plan-master status; do not score here: reference.md § Status protocol (detailed) (S5).
S6 - Status report format (mandatory)
Report template and rules: reference.md § Status protocol (detailed) (S6).
<a id="master-plan-artifact"></a>
Continue protocol
- Run Status protocol S1–S3 (short form - no full report unless user wants it).
- Find the first phase not
done. - If partial: complete that phase's GATE checklist (artifacts + shared gate integrity); produce missing artifacts.
- Present the next INTERACTION only for unanswered questions in that phase (skip if answers exist in ADRs, foundation docs, or archived decision prompts).
- Update registries (
ASSUMPTIONS,RISK_REGISTRY,UNKNOWNS) when assumptions, risks, or unknowns change. - At GATE p3+ → apply Architecture fitness review; run
plan-master integrityif contradictions found. Invoke as:@plan-master integrity(Cursor) or "Follow .ai/skills/plan-master/skill.md - integrity mode" (opencode/Codex). Returns integrity score: pass | pass with waivers | fail. - Update
HANDOFF.mdandNEXT.mdwhen a gate passes completion model (not merely when files are written). - At P6 done → evaluate Plan-master readiness → offer
p6-doneconfirm only if plan-master-ready (or list blockers). - After plan-master-ready: recommend
@plan-master greenfield|continue- do not author master plan in plan-foundation. - After master plan exists → tell user to run
@plan-master statusfor implementation-ready (not plan-foundation). - Do not write broad multi-milestone implementation without plan-master Approved master plan (or HANDOFF waiver).
Probe protocol
Adaptive gap-driven interrogation before certification. Engine: .ai/skills/probe-protocol.md.
Coverage profile, sub-modes, seven-step protocol, anti-patterns: reference.md § Probe protocol (detailed).
Certify protocol (plan-master-ready)
Use when the user asks to certify, verify for plan-master, or plan-master-ready.
- Run CF0 - Foundation-complete.
- Run Status protocol S1–S3 (full evaluation).
- Run
@plan-master integrityon foundation artifacts (read-only if status-only; update HANDOFF on certify). - Evaluate S4 - Plan-master readiness criterion by criterion with evidence.
- Output certification report:
## Plan-master-ready certification - <Project>
**Foundation-complete:** yes | no
**Plan-master-ready:** yes | no
### Criteria (S4)
| # | Criterion | Result | Evidence |
|---|-----------|--------|----------|
| 1 … 10 | | pass/fail | |
### If yes
- Record in HANDOFF: `Plan-master-ready: <date>`
- Next: `@plan-master greenfield` or `continue`
### If no
- Blockers: <ordered list>
- Next: `@plan-foundation continue` (missing artifacts) or `@plan-foundation probe` (understanding gaps - vague scope, NFRs, constraints)End the report with the Operator handoff close (Form A Next: … or Form B **Needs your approval:** / **Needs your answer:** / **Next step:**) per SKILL_DEPENDENCIES.md. The template's Next: bullets do not replace the closing block - any operator-required approval/question must ALSO appear there, enumerated, with path:line.
Do not create *-full-plan.md in certify mode - that is plan-master's job.
Certification report template and steps: reference.md § Certify protocol (detailed).
Binding: Each phase has Artifacts, GATE checklist, and shared gate integrity. Greenfield INTERACTION ids (p0-name, p0-intent, p0-probe, p1-nfr, p1-data-model, p1-integrations, p2-backend, p2-database, p2-data-services, p2-hosting, p2-tenancy, p5-local-dev, …) live in reference.md § Greenfield walkthrough. Order is binding: name → initial prompt → product probe → then NFR + data-model grills (informed recommendations) → then integrations → then technical/stack interactions, each with an evidence-derived recommendation per the Recommendation protocol.
Phase headers, artifact paths, and GATE checklists (P0–P6): reference.md § Phase gates P0–P6 (detailed).
At P6 pass: evaluate Plan-master readiness; foundation orchestration certifies plan-master-ready; plan-master authors the master plan artifact. Not at P6: implementation-ready (requires Approved master plan).
Anti-patterns
- Running greenfield INTERACTIONs during a status request
- Editing archived decision prompts
- Writing broad implementation before plan-master master plan Approved
- SPEC after code; merged SPEC edits (use amendments)
- Collapsing inference into fact (assumption ledger / ASSUMPTIONS.md)
- TBD without ADR reference or UNKNOWNS entry
- AI attribution markers
- Skipping gates without documenting waiver in HANDOFF
- File exists = phase done (without shared integrity + registries)
- Ignoring
plan-masterwhen completing P3–P6 gates - Duplicate registries inside plan-master artifact instead of linking
{PLANS_ROOT}/ASSUMPTIONS.mdetc. - Marking plan-master-ready without
plan-master integrityon foundation artifacts - Evaluating implementation-ready inside plan-foundation status (use plan-master)
- Confusing foundation-complete with plan-master-ready
- Running
@plan-master greenfieldbefore plan-master-ready: yes - Expanding
{PLANS_ROOT}/foundation/into a substitute for*-full-plan.md - Calling foundation doc 04 "the full plan" in reports (say architecture foundation or foundation doc 04)
- Skipping
p0-intent/p0-probeand jumping top1-integrationsor stack questions (product understanding must precede technical choices) - Skipping
p1-nfr/p1-data-modelbeforep2-database/p2-data-services(stack and DB recommendations without NFR/data evidence are invented defaults — see Recommendation protocol, which is mandatory for every stack interaction) - Accepting a stack/service option the operator never chose, or a choice that contradicts their stated requirements, without recording the divergence in
RISK_REGISTRY.md+UNKNOWNS.md(Recommendation protocol rules 2, 4) - Defaulting every data service to
none(cache/queue/search/object-storage) while D4/D5/D8 orp1-integrationsevidence implies the workload (Recommendation protocol rule 5) - Burying operator actions/questions in prose instead of the closing handoff block (Operator handoff contract)
Greenfield protocol
- GF0 →
p0-name→p0-intent→p0-probe(product grill; no tech yet) → P0 doc 01 + registries →p1-nfr+p1-data-model(NFR + data-model grills; no tech yet) →p1-integrations(agent-inferred + grill) → P2 stack interactions with evidence-derived recommendations (p2-backend,p2-database,p2-data-services, …) → walk P1→P6 gates → sync assumption ledger → no broad code until plan-master Approved.
Full step list: reference.md § Greenfield protocol (detailed).
Readiness snapshot
| State | Result |
| Plan-master-ready | yes after certify plan-master-ready + integrity |
| Master plan | Approved under {PLANS_ROOT}/full/ |
| Implementation-ready | Ask @plan-master status |
| Next step | @session-control start → @code-implementation plan - M1 |
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

