Cfn megaplan lite

From masharratt/claude-flow-novice · View interactive version

Cfn megaplan lite is an AI agent skill from the GitHub repository masharratt/claude-flow-novice. Balanced-cut planning mode for medium features (3-7 files, single shared-state surface). Runs a 7-level DAG at mvp depth but roughly half the wall-clock of full megaplan: both completion bars capped to 1 round, pseudo folded into arch, non-core phases on sonnet, and the live haiku probe dropped. Inh

How to use this skill

Skill file

CFN MegaPlan-Lite (balanced-cut planning mode)

Purpose: A planning orchestrator for medium features that keeps mvp-depth protections (spec hard barrier, arch on opus, Bar A verifiable-done, Bar B static coverage) but cuts full megaplan's 6-8h wall-clock roughly in half. The savings come from four levers: both completion bars capped to 1 round, pseudo folded into the arch agent, non-core phases run on sonnet, and the live haiku probe dropped.

Position in the pipeline. cfn-megaplan is still the canonical entry point. Lite is the medium-feature branch: deeper than /write-plan solo or cfn-spa-plan (both lack the two completion bars and the design phases, so neither can hand to /cfn-loop-task safely), lighter than full megaplan (no research/ops phases, no tier profiles, no live probe).

When to Use

Use /cfn-megaplan-lite for medium features: 3-7 files, a single shared-state surface (one DB table OR one API contract OR one shared type set), one user-facing flow at most.

Hard exclusion list (fix G3). Lite drops ops (threat model, observability, rollback rehearsal, canary), research, multi-tenant reasoning, and migration-rehearsal ACs. Therefore lite is explicitly NOT for:

Those need full /cfn-megaplan --tier=beta|enterprise. If you are unsure which side of the line a task falls, run full megaplan; lite is an optimization, not a default.

Upgrade is a fresh run (fix G2). A lite-planned feature that later needs ops, compliance, or a second shared-state surface is re-run as full /cfn-megaplan from scratch. Megaplan does not resume from lite artifacts. Lite artifacts (SPEC, ARCH, PSEUDO, PLAN, VERIFY) are a human head-start for the re-run, not auto-consumed inputs.

Invocation

/cfn-megaplan-lite "<task>"

No --tier. Lite is a single mode (see No tiers, below).

Hand-off: /cfn-loop-task "<task>" --mode=mvp. Lite is mvp-depth; the execution-mode vocabulary has no "lite", so --mode=mvp is correct. Precondition: planning/<slug>/PLAN_<slug>.md + planning/<slug>/VERIFY_<slug>.md + planning/<slug>/.VERIFY_<slug>.sha256 all on disk (same per-plan directory + persistence gate as megaplan).

Pipeline shape (7-level DAG)

Only spec is a hard gate. After it, branches fan out. Critical path is 7 levels (versus megaplan's 8-9).

L1 spec                opus, HARD BARRIER; §1a Actors gate + §1b Interaction Intent walk + Build Flags §8
L2 decide              sonnet, light; BLOCKING forks only; register via cfn-decisions/record.sh
L3 data                sonnet, light, IF db=yes; floor forced (RLS/auth/secrets authored regardless)
L4 arch ∥ ux           arch = opus (ALSO emits PSEUDO_<slug>.md, pseudo folded); ux = sonnet, IF frontend=yes
                       └─ WIREFRAME GATE (frontend only): 1 Approve/Revise cycle, then advance
L5 design ∥ test_plan  design = sonnet light, IF frontend; test_plan = sonnet light (ops skipped -> skipped-dep)
L6 write_plan + Bar A  main chat; /write-plan --mode=mvp; check-verifiable-static.sh + bless-verify.sh; 1 round
L7 plan_review + Bar B-static  main chat; /cfn-plan-review; check-haiku-static.sh + structural + coverage; NO probe; 1 round
Step 7: deferred-decision batch  all [PARKED] items in one AskUserQuestion; re-gate after override
Step 8: batched handoff          synthesis MEGAPLANLITE_<slug>.md; /cfn-loop-task --mode=mvp

Node dependencies (the orchestrator honors these; do not spawn a node before its deps return):

| Node | Deps | Phase skill |

|---|---|---|

| spec | (none) | cfn-spec |

| decide | spec | cfn-decide |

| data | spec, decide (IF db=yes) | cfn-data |

| arch | spec, data | cfn-arch (also writes PSEUDO) |

| ux | spec, data (IF frontend=yes) | cfn-ux |

| design | ux (IF frontend=yes) | cfn-design |

| test_plan | spec, arch, ux, data | cfn-test-plan |

| write_plan | all active artifacts | /write-plan + Bar A |

| plan_review | write_plan | /cfn-plan-review + Bar B-static |

Skipped-dep rule (inherited verbatim from megaplan). See cfn-megaplan/SKILL.md (Pipeline shape, Skipped-dep rule) for the rule and the phase-prompt interface literal it owns. Lite applies it unchanged.

Reuse map (lite inherits, does not re-implement)

Lite references megaplan's bar scripts and the phase skills by relative path (.claude/skills/cfn-megaplan/bars/...), so it rides megaplan's bar improvements for free.

Bar scripts (inherited unmodified):

Phase skills (inherited): .claude/skills/cfn-spec, .claude/skills/cfn-decide, .claude/skills/cfn-data, .claude/skills/cfn-arch, .claude/skills/cfn-ux, .claude/skills/cfn-design, .claude/skills/cfn-test-plan. Skipped: cfn-research (unknowns not allowed in lite), cfn-ops (ops concerns disqualify the task from lite).

Slash commands (main chat): /write-plan, /cfn-plan-review.

Decision register: .claude/skills/cfn-decisions/record.sh.

Interface contract (fix N1)

Lite depends on megaplan's bar scripts by path. A megaplan bar refactor that changes these contracts breaks lite. Expected exit codes (confirmed against the scripts):

| Script | 0 | 1 | 2 |

|---|---|---|---|

| check-verifiable-static.sh | clean (no error findings) | error finding present (missing AC field, taxonomy mismatch, non-decidable/weasel pass, coverage gap) | parse or usage error (bad args, missing file, invalid stage) |

| bless-verify.sh | pinned (sidecar + ledger written) | refused (Bar A error findings remain, nothing pinned) | parse or usage error (no manifest, jq missing, bad JSON) |

| check-haiku-static.sh | clean (no error findings) | error finding present (weasel phrase, optional-DI on a core FR) | parse or usage error (bad args, missing file) |

The committed smoke test (tests/test-smoke.sh) asserts these paths resolve at test time; it does not assert behavior. Behavior is megaplan's contract to hold.

Model policy

Bar B-lite (static + structural + coverage, no live probe)

Bar B-lite runs three scans only:

  1. Static: .claude/skills/cfn-megaplan/bars/check-haiku-static.sh against the assembled plan (weasel phrases via .claude/skills/cfn-megaplan/bars/weasel-phrases.txt, plus optional-decision-input on core FRs), and .claude/skills/cfn-megaplan/bars/check-phase-width.sh (<=15 steps, <=8 distinct files per step-number major; over = split the phase by file cluster so loop-task lanes stay parallelizable).
  2. Structural: every FR/EC id in SPEC_<slug>.md appears in at least one plan step; every plan step cites the artifact and section it implements.
  3. Coverage: every [core] FR has an executable AC in VERIFY_<slug>.md; every branch in PSEUDO_<slug>.md maps to a step or is explicitly marked out-of-scope.

DO NOT spawn the live haiku probe. (Full megaplan now has the same behavior at its sonnet Bar B tier, the mvp/beta default; lite is always at that tier.) Rationale: lite's execution model is an opus coordinator driving sonnet-level subagents with clear scoped steps. That coordinator is the clarifying layer the live probe simulated in full megaplan. Spawning the probe here would re-introduce the serial-tail cost lite exists to cut, without adding signal the coordinator does not already supply at execution time. The static/structural/coverage scans still catch gross defects (missing paths, weasel words, unmapped branches, optional-DI on core FRs); the probe's marginal catch does not justify its wall-clock on a medium feature.

Round caps with mechanical/semantic split (fix G1)

Each bar is capped to 1 round. Within that round:

After the single round, any residual finding stops the pipeline and surfaces via AskUserQuestion (accept as-is / keep iterating / descope to full megaplan). There is no round 2 in lite; a second round means the task is too complex for the balanced cut and should escalate to full /cfn-megaplan.

No tiers, no profile (fix N2)

Lite has one mode. Directives are hardcoded in this file (which phases run, at what model, at what directive). There is no profiles/<tier>.json to load.

Why this must not be re-added. Tiers are the single biggest wall-clock lever in full megaplan: the profile resolution step, the per-tier floor/inclusion negotiation, and the conditional-branch fan-out are what push the full pipeline to 6-8h. Re-introducing tiers here re-introduces the cost lite exists to avoid. If a feature needs tiered treatment (beta/enterprise depth, ops phases, compliance floor expansion), it is a full-megaplan feature, not a lite feature. Route it there instead of parameterizing lite.

The floor is still forced: rls, auth_boundaries, secrets_handling, no_unscoped_delete, pii_if_present are authored in the data phase whenever db=yes or pii=yes, regardless of lite's single mode.

Protocol

Step 0: trimmed scope check

  1. /codebase-search "<task keywords>": if existing capability covers the task, abort and point to it.
  2. If the estimate is 8+ files, stop. Either descope to 3-7 files via AskUserQuestion, or route to full /cfn-megaplan (the task is not medium).
  3. Read the tech-debt ledger (.cfn-cache/tech-debt-ledger.json) if present; list any open cfn: shortcut in the files in scope as a backlog candidate and inject into the spec prompt. Do not re-harvest.
  4. Query prior forks: .claude/skills/decision-log/query.sh '<entities>' 5 <project> and .claude/skills/decision-log/decisions.sh search '<entities>'. Inject any RESOLVED fork into the spec prompt so it is not re-litigated.
  5. Dropped versus megaplan Step 0: no knowledge-base ingest, no retro-signal read. Lite features are medium and bounded; those signals are rarely load-bearing and cost wall-clock.

Step 1: build the slug

SLUG=$(echo "$TASK" | tr '[:upper:] ' '[:lower:]_' | tr -cd '[:alnum:]_-' | cut -c1-60)
PDIR=$(.claude/skills/cfn-megaplan/lib/plan-paths.sh ensure "$SLUG")   # planning/<slug>, created

Every artifact of this plan lands in ONE per-plan directory: planning/<slug>/, named <PHASE>_<SLUG>.md. Nothing goes loose in planning/. Writes always use $PDIR/<NAME>; reads resolve nested-then-legacy-flat through the shared resolver:

SPEC=$(.claude/skills/cfn-megaplan/lib/plan-paths.sh resolve "$SLUG" "SPEC_${SLUG}.md") \
  || echo "FATAL: no SPEC artifact at $SPEC"

Layout rule and resolver are megaplan's (.claude/skills/cfn-megaplan/lib/plan-paths.sh + cfn-megaplan/SKILL.md §Step 1) — inherited verbatim, same as the bar scripts. Lite delta: none.

Step 2: L1 spec (opus, HARD BARRIER)

Spawn cfn-spec at opus, telling it the plan dir (Plan dir: planning/<slug>/; it writes $PDIR/SPEC_<slug>.md). Nothing else starts until it returns. Parse the ## 8. Build Flags block from $PDIR/SPEC_<slug>.md (do not re-infer from prose).

Step 3: L2 decide (sonnet)

Spawn cfn-decide at sonnet. Resolve BLOCKING forks only (forks whose answer changes the schema, a contract, the FR/EC set, or a floor item). Record every resolved decision via .claude/skills/cfn-decisions/record.sh. Non-blocking forks park per the triage rule (see Open-item triage, below).

Step 4: walk L3 through L5

Spawn each level in a single message (true parallel within a level); wait for the level to return before advancing. Every phase prompt carries Plan dir: planning/<slug>/ and states the artifact path as planning/<slug>/<PHASE>_<slug>.md; dep artifact paths are resolved by the orchestrator (plan-paths.sh resolve) and pasted in as real paths, so no phase searches for its inputs.

Size gate at every join (L3 through L7). After each level returns, before the next is spawned: $HOME/.claude/skills/cfn-megaplan/bars/check-size.sh --all "$PDIR" (no --profile; lite has no profile, so the script's built-in caps apply, which are the cfn-megaplan-fast caps: a medium feature should fit them). OVER → one sonnet compress spawn for that artifact (prompt: "remove prose, keep every id/table/contract/check/AC row; target <= <cap> bytes; do not drop or renumber ids"), re-check once, still OVER → [PARKED] size-over: <artifact> <bytes>/<cap> and advance. Never blocks, never a second compress. Paste Byte cap for this artifact: <cap> into each phase prompt so the phase aims under it.

Each phase prompt carries the open-item triage block (below). Collect [PARKED] items into a running list; they do not gate the level.

Step 5: L6 write_plan + Bar A (1 round)

Run /write-plan "<task>" --mode=mvp in main chat (Skill tool). Then run Bar A:

.claude/skills/cfn-megaplan/bars/check-verifiable-static.sh "${PDIR}/VERIFY_${SLUG}.md"

Exit 1 routes to the owning phase in patch mode within the 1-round budget (mechanical findings auto-patch; semantic findings surface via AskUserQuestion). Also run the Step 4 size gate over PLAN_<slug>.md and VERIFY_<slug>.md (compress once before blessing so the hash pins the compact form). Only when clean (exit 0) do you bless:

.claude/skills/cfn-megaplan/bars/bless-verify.sh "${PDIR}/VERIFY_${SLUG}.md" --note "Bar A pass (lite)"

Then assert persistence (loop-task hard-depends on it):

[ -f "${PDIR}/PLAN_${SLUG}.md" ] || echo "FATAL: write-plan did not persist ${PDIR}/PLAN_${SLUG}.md"

MEGAPLANLITE_<slug>.md (Step 8) is an INDEX, NOT the plan; it cannot substitute for PLAN_<slug>.md.

Step 6: L7 plan_review + Bar B-static (1 round, no probe)

Run /cfn-plan-review in main chat. Then run Bar B-lite (static + structural + coverage, as defined above). Route any finding to its owning phase in patch mode (ui_control -> cfn-ux, value source -> cfn-data/cfn-arch, branch -> arch's pseudo output). The 1-round cap and the mechanical/semantic split both apply.

Step 7: deferred-decision batch

Take the [PARKED] list accumulated across L2-L5. Drop any item whose default a later phase made moot. Surface the rest via one batched AskUserQuestion (4 per call, each pre-answered by its conservative default). Accepted default -> rewrite marker [PARKED: <default> | accepted], record via cfn-decide. Override -> route to the owning phase in patch mode.

Re-gate after an override (the bars passed against the old bytes): override changed an AC row, a [core] FR, or a plan step's semantics -> re-run Bar A + Bar B-static and re-bless via bless-verify.sh. Override rounds bounded at 2.

Step 8: batched handoff

Assert the handoff files are on disk:

for F in "PLAN_${SLUG}" "VERIFY_${SLUG}"; do
  [ -f "${PDIR}/${F}.md" ] || echo "FATAL: missing ${PDIR}/${F}.md"
done
[ -f "${PDIR}/.VERIFY_${SLUG}.sha256" ] || echo "FATAL: missing ${PDIR}/.VERIFY_${SLUG}.sha256 (re-run Bar A static + bless)"
# nothing from this plan may sit loose in the planning root
ls planning/*_"${SLUG}".md 2>/dev/null && echo "WARN: plan artifacts loose in planning/ — move them into ${PDIR}/"

Write $PDIR/MEGAPLANLITE_<slug>.md (template below). Hand off:

/cfn-loop-task "<task>" --mode=mvp

Open-item triage and loop-back (cite megaplan by path)

Lite reuses megaplan's triage and patch mechanics verbatim. This is a DRY fix (B1): one source of truth lives in megaplan; lite points at it.

Failure modes (lite deltas; full list in megaplan)

See cfn-megaplan/SKILL.md §Failure modes for the full table. Lite-specific deltas:

| Failure | Lite recovery |

|---|---|

| estimate crosses 8 files mid-pipeline | stop; re-route to full /cfn-megaplan. Lite artifacts are a head-start, not consumed. |

| Bar A or Bar B finding survives 1 round | stop; surface via AskUserQuestion (accept / iterate / descope to full megaplan). No round 2 in lite. |

| 2 Bar B control-type findings on ux | re-run ux once at opus (Model policy). A third control finding re-routes to full megaplan. |

| feature smells ops/compliance mid-pipeline (PII, multi-tenant, migration) | stop; re-route to full /cfn-megaplan --tier=beta. Lite is the wrong cut. |

| PSEUDO_<slug>.md missing after L4 | the arch agent did not emit the folded pseudo output; re-spawn arch (opus) with a directive to emit it. Do not spawn a separate pseudo phase. |

Anti-patterns (lite deltas; full list in megaplan)

See cfn-megaplan/SKILL.md §Anti-patterns for the full list. Lite-specific:

Synthesis template: MEGAPLANLITE_<slug>.md

The writing agent Reads cfn-megaplan/SKILL.md §Step 7: Deferred-decision batch, synthesis + hand-off (synthesis template block) for the canonical 8-section structure (all eight ## sections REQUIRED, emit every one even if empty as _none_, do not rename headings) and emits the lite-named file instead. Same cite-and-Read pattern lite uses for the phase skills.

Lite deltas versus megaplan synthesis:

Related

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.