Preflight Phase - Pre-Build Plan Validation
This command validates the implementation plan against codebase reality before any code is written. It catches design oversights, convention conflicts, TDD violations, and integration issues that would otherwise surface during or after the build.
Step 1: Load Memory Bank Files
Read:
memory-bank/active/tasks.md
memory-bank/active/projectbrief.md
memory-bank/systemPatterns.md
memory-bank/techContext.md
memory-bank/active/creative/**/*.md (if any exist)
Step 2: Preflight Workflow
Verify Prerequisites
- Check
memory-bank/active/tasks.md for planning completion
- For Level 3-4: Verify creative phase documents exist (if creative phases were flagged)
- Read implementation plan and design decisions
TDD Plan Encoding (blocking)
- The test-first process lives in
.cursor/rules/shared/always-tdd.mdc
- This check governs units that change executable behavior. A unit delivering user-facing prose or policy (docs content, PR/issue templates, CONTRIBUTING, instructional comments, rule/skill wording, etc.) owes no tests for those artifacts; omitting tests for those artifacts passes this check
- For each implementable unit of executable work (function, slice, milestone — whatever granularity the plan uses), confirm the ordered substeps place test-writing before production code, explicitly enough that a reasonable implementer cannot follow the plan by coding first
- When a numbered step is a scheduled change-detector (a test that can only go red when someone deliberately edits the artifact it asserts on — heading, phrase, link, or checklist assertions on a document), delete that step. Keep the other steps. Record the finding and continue.
- When a unit already has both test steps and production steps and they are in the wrong order, put the test steps first. Same steps. Record the finding and continue.
- Do not invent tests. Do not emit always-tdd stages.
- FAIL when the numbered steps for an executable unit have no test steps (implementation-only under a "we follow TDD" disclaimer, or TDD only in the preamble). This still applies after a change-detector strike.
- On FAIL: cite the executable units lacking test steps. Write
FAIL (blocking).
Convention Compliance
- Verify the plan's proposed file locations, naming conventions, and patterns align with established codebase conventions documented in
memory-bank/systemPatterns.md
- Cross-reference proposed module structure against existing project organization
- Flag any deviation from established patterns with specific recommendations
Dependency Impact
- Trace the plan's touchpoints through the dependency graph
- Identify modules, consumers, or tests that will be affected but aren't accounted for in the plan
- Verify that all downstream impacts are documented and addressed
Conflict Detection
- Search for existing implementations, utilities, or patterns that overlap with or contradict the plan's approach
- Identify duplication-in-waiting - cases where the plan proposes building something the codebase already provides
- Flag any proposed changes that would break public contracts or published interfaces — internal restructuring that preserves the public API surface is not a conflict
Completeness Precheck
- Verify the plan addresses all stated requirements with concrete implementation steps mapped to each one - not aspirationally, but with specific files, functions, and approaches identified
- Flag any requirements that are acknowledged but lack a clear implementation path
- Verify test coverage is planned for all new executable behavior — not for prose or policy artifacts; the TDD Plan Encoding check governs that boundary
Radical Innovation (advisory - not blocking)
- What's the single smartest and most radically innovative and accretive and useful and compelling change you could make to the plan at this point?
- Describe the change concretely - not as a vague suggestion, but as a specific structural sketch the operator can evaluate against the cost of redesign.
- Record that idea as an advisory finding. Do not make the change to the plan, even if the idea fits the brief.
Judge, Do Not Fix
- Surface and judge. Never modify the plan under review, except the TDD step swap and change-detector strike above.
- Allowed writes only:
memory-bank/active/.preflight-status, the **Phase:** field in activeContext.md (under End of Verification), progress.md, and those two in-phase plan edits on tasks.md.
- Do not rewrite Implementation Plan units, behavior lists, or other scheduled work except that swap and that strike.
- Record every issue as a finding. FAIL when the plan must change before build (
FAIL (fixable) or FAIL (blocking)); PASS only when the plan is acceptable as-is (advisories allowed).
Write Status
- Overwrite
memory-bank/active/.preflight-status. First line is exactly one allowed value from .cursor/rules/shared/niko/memory-bank/active/preflight-status.mdc. After a blank line, write this run's findings.
Step 3: Log Progress
🚨 Printing this notice is NOT the end of this phase. After printing, continue immediately to the next step - do not stop.
Update memory-bank/active/progress.md to record that Preflight completed and what the first line of .preflight-status was.
Print the appropriate block:
PASS
# Preflight Result
✅ PASS
## Findings
1. **Findings** - bulleted list of each finding with severity
2. **Advisory items** (if any) - concrete recommendations the operator can evaluate
FAIL
# Preflight Result
❌ FAIL
## Findings
1. **Findings** - bulleted list of each finding with severity
2. **Advisory items** (if any) - concrete recommendations the operator can evaluate
Step 4: End of Verification
Update memory-bank/active/activeContext.md so **Phase:** records Preflight complete with the first line of .preflight-status (e.g. **Phase:** PREFLIGHT - COMPLETE (PASS)). Do not load a level workflow or begin another phase. Stop.
1---2name: niko-preflight3description: Niko Memory Bank System - Preflight Phase - Pre-Build Plan Validation4---56# Preflight Phase - Pre-Build Plan Validation78This command validates the implementation plan against codebase reality before any code is written. It catches design oversights, convention conflicts, TDD violations, and integration issues that would otherwise surface during or after the build.910## Step 1: Load Memory Bank Files1112Read:13- `memory-bank/active/tasks.md`14- `memory-bank/active/projectbrief.md`15- `memory-bank/systemPatterns.md`16- `memory-bank/techContext.md`17- `memory-bank/active/creative/**/*.md` (if any exist)1819## Step 2: Preflight Workflow20211. **Verify Prerequisites**22 - Check `memory-bank/active/tasks.md` for planning completion23 - For Level 3-4: Verify creative phase documents exist (if creative phases were flagged)24 - Read implementation plan and design decisions25262. **TDD Plan Encoding** *(blocking)*27 - The test-first process lives in `.cursor/rules/shared/always-tdd.mdc`28 - This check governs units that change executable behavior. A unit delivering user-facing prose or policy (docs content, PR/issue templates, CONTRIBUTING, instructional comments, rule/skill wording, etc.) owes no tests for those artifacts; omitting tests for those artifacts passes this check29 - For each implementable unit of executable work (function, slice, milestone — whatever granularity the plan uses), confirm the ordered substeps place test-writing before production code, explicitly enough that a reasonable implementer cannot follow the plan by coding first30 - When a numbered step is a scheduled change-detector (a test that can only go red when someone deliberately edits the artifact it asserts on — heading, phrase, link, or checklist assertions on a document), delete that step. Keep the other steps. Record the finding and continue.31 - When a unit already has both test steps and production steps and they are in the wrong order, put the test steps first. Same steps. Record the finding and continue.32 - Do not invent tests. Do not emit always-tdd stages.33 - FAIL when the numbered steps for an executable unit have no test steps (implementation-only under a "we follow TDD" disclaimer, or TDD only in the preamble). This still applies after a change-detector strike.34 - On FAIL: cite the executable units lacking test steps. Write `FAIL (blocking)`.35363. **Convention Compliance**37 - Verify the plan's proposed file locations, naming conventions, and patterns align with established codebase conventions documented in `memory-bank/systemPatterns.md`38 - Cross-reference proposed module structure against existing project organization39 - Flag any deviation from established patterns with specific recommendations40414. **Dependency Impact**42 - Trace the plan's touchpoints through the dependency graph43 - Identify modules, consumers, or tests that will be affected but aren't accounted for in the plan44 - Verify that all downstream impacts are documented and addressed45465. **Conflict Detection**47 - Search for existing implementations, utilities, or patterns that overlap with or contradict the plan's approach48 - Identify duplication-in-waiting - cases where the plan proposes building something the codebase already provides49 - Flag any proposed changes that would break public contracts or published interfaces — internal restructuring that preserves the public API surface is not a conflict50516. **Completeness Precheck**52 - Verify the plan addresses all stated requirements with concrete implementation steps mapped to each one - not aspirationally, but with specific files, functions, and approaches identified53 - Flag any requirements that are acknowledged but lack a clear implementation path54 - Verify test coverage is planned for all new executable behavior — not for prose or policy artifacts; the TDD Plan Encoding check governs that boundary55567. **Radical Innovation** *(advisory - not blocking)*57 - What's the single smartest and most radically innovative and accretive and useful and compelling change you could make to the plan at this point?58 - Describe the change concretely - not as a vague suggestion, but as a specific structural sketch the operator can evaluate against the cost of redesign.59 - Record that idea as an advisory finding. Do not make the change to the plan, even if the idea fits the brief.60618. **Judge, Do Not Fix**62 - Surface and judge. Never modify the plan under review, except the TDD step swap and change-detector strike above.63 - Allowed writes only: `memory-bank/active/.preflight-status`, the `**Phase:**` field in `activeContext.md` (under **End of Verification**), `progress.md`, and those two in-phase plan edits on `tasks.md`.64 - Do not rewrite Implementation Plan units, behavior lists, or other scheduled work except that swap and that strike.65 - Record every issue as a finding. FAIL when the plan must change before build (`FAIL (fixable)` or `FAIL (blocking)`); PASS only when the plan is acceptable as-is (advisories allowed).66679. **Write Status**68 - Overwrite `memory-bank/active/.preflight-status`. First line is exactly one allowed value from `.cursor/rules/shared/niko/memory-bank/active/preflight-status.mdc`. After a blank line, write this run's findings.6970## Step 3: Log Progress7172> 🚨 **Printing this notice is NOT the end of this phase.** After printing, continue immediately to the next step - do not stop.7374Update `memory-bank/active/progress.md` to record that Preflight completed and what the first line of `.preflight-status` was.7576Print the appropriate block:7778### PASS7980~~~markdown81# Preflight Result8283✅ PASS8485## Findings86871. **Findings** - bulleted list of each finding with severity882. **Advisory items** (if any) - concrete recommendations the operator can evaluate8990~~~9192### FAIL9394~~~markdown95# Preflight Result9697❌ FAIL9899## Findings1001011. **Findings** - bulleted list of each finding with severity1022. **Advisory items** (if any) - concrete recommendations the operator can evaluate103104~~~105106## Step 4: End of Verification107108Update `memory-bank/active/activeContext.md` so `**Phase:**` records Preflight complete with the first line of `.preflight-status` (e.g. `**Phase:** PREFLIGHT - COMPLETE (PASS)`). Do not load a level workflow or begin another phase. Stop.