agentleFS
PiloTracerPiloTracer/pilo.ai.logicbison/skills/plan-foundation/skill.md

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.

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
  1. Very specific:

    Operator handoff: every response that ends a turn follows the Operator handoff contract — terse output.

    line 17
  2. Very specific:

    Document clarity: every generated document follows the Document clarity contract — Status + Needs header, separate Decisions/Open questions …

    line 18
  3. Distinctive:

    Do not: run greenfield INTERACTIONs when the user asked for status only.

    line 40
  4. Very specific:

    If {HANDOFF} missing → stop with the blocked-report shape:

    line 62
  5. Very specific:

    If .cursorrules missing at repo root → stop with the same shape:

    line 66
  6. Very specific:

    If REPLACE: tokens remain in .cursorrules → warn.

    line 70
  7. Very specific:

    If .work/touch-scope exists and still has the template placeholder "ref": "REPLACE:PROJECT_REF" (or empty allowed_paths/allowed_patterns) → …

    line 71
  8. Distinctive:

    If foundation-complete: no → stop with the blocked-report shape:

    line 78
  9. Very specific:

    Read README → HANDOFF → .cursorrules.

    line 93
  10. Distinctive:

    foundation-complete: yes: when P0–P6 gates pass. Report separately from plan-master-ready: reference.md § Status protocol (detailed) (S3b).

    line 105
  11. Distinctive:

    Run Status protocol S1–S3 (short form - no full report unless user wants it).

    line 125
  12. Distinctive:

    If partial: complete that phase's GATE checklist (artifacts + shared gate integrity).

    line 127
  13. Very specific:

    Update registries (ASSUMPTIONS, RISK_REGISTRY, UNKNOWNS) when assumptions, risks, or unknowns change.

    line 129
  14. Very specific:

    Update HANDOFF.md and NEXT.md when a gate passes completion model (not merely when files are written).

    line 132
  15. Very specific:

    After plan-master-ready: recommend @plan-master greenfield | continue - do not author master plan in plan-foundation.

    line 134
  16. Very specific:

    After master plan exists → tell user to run @plan-master status for implementation-ready (not plan-foundation).

    line 135
  17. Distinctive:

    Do not write broad multi-milestone implementation without plan-master Approved master plan (or HANDOFF waiver).

    line 136
  18. Distinctive:

    Use when the user asks to certify, verify for plan-master, or plan-master-ready.

    line 150
  19. Distinctive:

    Run Status protocol S1–S3 (full evaluation).

    line 153
  20. Very specific:

    Run @plan-master integrity on foundation artifacts (read-only if status-only.

    line 154
  21. Very specific:

    Do not create *-full-plan.md in certify mode - that is plan-master's job.

    line 180

≈ “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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
skill.md

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:** citing path: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:

ModeUser 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
greenfieldnew 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

ModeGate
greenfieldGF0
probeGF0 (needs {HANDOFF} + doc 01 to record into); else suggest greenfield
certifyCF0
continueFoundation started (≥1 foundation doc or HANDOFF notes P0); else suggest greenfield
status- (read-only)

GF0 - Bootstrap artifacts

Before P0 INTERACTIONs:

  1. If {HANDOFF} missing → stop with the blocked-report shape:
    • Required: {HANDOFF} exists
    • Detected: .work/context/HANDOFF.md missing
    • Run first: @project-bootstrap init (or @session-control minimal HANDOFF only if user refuses bootstrap in the same message)
  2. If .cursorrules missing at repo root → stop with the same shape:
    • Required: .cursorrules at repo root
    • Detected: missing
    • Run first: @project-bootstrap init
  3. If REPLACE: tokens remain in .cursorrules → warn; foundation may proceed but record unfilled tokens in the greenfield report.
  4. If .work/touch-scope exists and still has the template placeholder "ref": "REPLACE:PROJECT_REF" (or empty allowed_paths/allowed_patterns) → warn; foundation may proceed, but record it in the greenfield report and remind the user that @code-implementation will block file writes on an undeclared/placeholder scope (touch-scope-verify.sh --strict-fail).

CF0 - Foundation-complete

Before certify:

  1. Evaluate Foundation-complete (artifact check).
  2. 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-invoke certify)

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

  1. Run Status protocol S1–S3 (short form - no full report unless user wants it).
  2. Find the first phase not done.
  3. If partial: complete that phase's GATE checklist (artifacts + shared gate integrity); produce missing artifacts.
  4. Present the next INTERACTION only for unanswered questions in that phase (skip if answers exist in ADRs, foundation docs, or archived decision prompts).
  5. Update registries (ASSUMPTIONS, RISK_REGISTRY, UNKNOWNS) when assumptions, risks, or unknowns change.
  6. At GATE p3+ → apply Architecture fitness review; run plan-master integrity if 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.
  7. Update HANDOFF.md and NEXT.md when a gate passes completion model (not merely when files are written).
  8. At P6 done → evaluate Plan-master readiness → offer p6-done confirm only if plan-master-ready (or list blockers).
  9. After plan-master-ready: recommend @plan-master greenfield | continue - do not author master plan in plan-foundation.
  10. After master plan exists → tell user to run @plan-master status for implementation-ready (not plan-foundation).
  11. 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.

  1. Run CF0 - Foundation-complete.
  2. Run Status protocol S1–S3 (full evaluation).
  3. Run @plan-master integrity on foundation artifacts (read-only if status-only; update HANDOFF on certify).
  4. Evaluate S4 - Plan-master readiness criterion by criterion with evidence.
  5. 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-master when completing P3–P6 gates
  • Duplicate registries inside plan-master artifact instead of linking {PLANS_ROOT}/ASSUMPTIONS.md etc.
  • Marking plan-master-ready without plan-master integrity on foundation artifacts
  • Evaluating implementation-ready inside plan-foundation status (use plan-master)
  • Confusing foundation-complete with plan-master-ready
  • Running @plan-master greenfield before 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-probe and jumping to p1-integrations or stack questions (product understanding must precede technical choices)
  • Skipping p1-nfr / p1-data-model before p2-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 or p1-integrations evidence implies the workload (Recommendation protocol rule 5)
  • Burying operator actions/questions in prose instead of the closing handoff block (Operator handoff contract)

Greenfield protocol

  1. 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

StateResult
Plan-master-readyyes after certify plan-master-ready + integrity
Master planApproved under {PLANS_ROOT}/full/
Implementation-readyAsk @plan-master status
Next step@session-control start → @code-implementation plan - M1

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.