Skip to content

feat(ce-brainstorm, ce-plan): unify brainstorm and plan into one readiness-staged artifact#972

Draft
tmchow wants to merge 16 commits into
mainfrom
tmchow/feat-unified-brainstorm-plan-docs
Draft

feat(ce-brainstorm, ce-plan): unify brainstorm and plan into one readiness-staged artifact#972
tmchow wants to merge 16 commits into
mainfrom
tmchow/feat-unified-brainstorm-plan-docs

Conversation

@tmchow

@tmchow tmchow commented Jun 22, 2026

Copy link
Copy Markdown
Collaborator

Summary

ce-brainstorm and ce-plan now produce one artifact in docs/plans/ that moves through readiness states, instead of a brainstorm requirements doc plus a separate plan doc. ce-brainstorm writes a requirements-only skeleton; ce-plan enriches that same file in place to implementation-ready; and every downstream reader is readiness-aware, so a requirements-only skeleton can no longer be mistaken for executable work. Legacy docs/brainstorms/*-requirements.* inputs and origin: references keep resolving indefinitely — nothing is migrated.

The win: the implementing agent reads one durable authority (scope, decisions, verification, done criteria) instead of stitching two files, and requirement changes can't drift away from the plan that executes them.

The artifact contract

A unified plan carries readiness as document-completeness metadata — never a mutable work-progress status:

Field Meaning
artifact_contract: ce-unified-plan/v1 Declares the contract
artifact_readiness: requirements-only | implementation-ready Can the artifact be executed yet — not whether execution happened
product_contract_source: ce-brainstorm | ce-plan-bootstrap | legacy-requirements Where the Product Contract came from

Fixed section order (Goal Launch Block, Reader Index, Goal Capsule, Product Contract, then — when implementation-ready — Planning Contract, Implementation Units, Verification Contract, Definition of Done) with a stable Section ID Registry so consumers grep before reading the whole file.

Design decisions worth a look

  • The document is the authority; the Goal Launch Block is a thin launcher. It routes and points into the body — it does not duplicate requirements or verification. Over a long /goal run the prompt is summarized away, so durable scope must live in the doc.
  • No mutable status: lifecycle. Readiness answers "executable?", not "done?"; progress stays in git, task trackers, and commits. Tests reject progress-like values (active, in_progress, completed, done).
  • ce-work gained an execution-engine lane (skills/ce-work/references/execution-engines.md): inline/subagent (default, and the only callable engine on Claude Code) vs goal-mode vs dynamic-workflow, gated on a host-capability probe, with explicit resume-the-correct-tail rules. A caller-owned-tail mode lets lfg own simplify/review/PR/CI while ce-work owns implementation strategy.
  • Readiness-aware downstream routing. Blank ce-work won't auto-execute a requirements-only/knowledge-work/approach-plan artifact; ce-doc-review classifies by readiness and reviews Product vs Planning Contract by section slice instead of sending the whole artifact to every persona; ce-code-review classifies readiness before flagging unit completeness; ce-proof publishes markdown only.
  • Goal-mode refinements from OpenAI's /goal guide by Dominik Kundel (readable mirror): prefer measurable exit thresholds for optimization-shaped goals, and require dead-end/experimental-code cleanup before "done." The Codex draft-PR progress pattern is deliberately not adopted — it conflicts with the rule that the goal never opens a PR.

Validation

Non-observable change (skill prose, references, tests, docs — no runtime UI/CLI surface), so no demo artifact. Verified against current main:

  • bun test1600 pass, 0 fail (includes a new unified-plan-artifact-contract suite and added HTML nav/anchor invariants).
  • bun run release:validate — metadata in sync (0 agents, 27 skills).

Rebased onto main's skills-only / root-native refactor (#967); all changes are root-native under skills/, docs/, and tests/.


Compound Engineering
Claude Code

@tmchow tmchow marked this pull request as draft June 22, 2026 17:25

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 51a84d91da

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread skills/lfg/SKILL.md
Comment thread skills/ce-code-review/SKILL.md
Comment thread skills/ce-plan/SKILL.md
tmchow added a commit that referenced this pull request Jun 22, 2026
- ce-work Phase 0 now strips a leading mode:caller-owned-tail token so
  lfg's invocation isn't mistaken for a bare prompt (P1)
- ce-code-review Stage 2b discovers docs/plans/*.{md,html} and extracts
  Product Contract > Requirements, matching its completeness contract (P2)
- ce-plan 5.1.5 scoping-synthesis gate fires for requirements-only
  unified-plan sources, not only legacy *-requirements docs (P2)
- contract tests cover all three
tmchow added a commit that referenced this pull request Jun 22, 2026
- execution-engines: add a Codex lane (top-level /goal is a thread mode,
  not an awaitable nested engine), a progress-visibility lane independent
  of final-PR tail ownership, and a compaction re-read instruction
- plan-sections: Goal Launch Block must be evaluator-complete (prompt is
  also the completion criteria) and split human vs pipeline launch;
  implementation-ready requires zero launch-blocking open questions;
  markdown is the canonical execution artifact, HTML is report-only
- ce-plan: record a Product Contract preservation note on in-place
  enrichment so the WHAT/HOW review boundary stays visible
- plan doc: fix its own Goal Launch Block to reference sections it has
  (it is a pre-contract meta-plan) and mark open questions non-blocking
- contract tests cover all of the above
@tmchow tmchow changed the title feat: unify brainstorm and plan into one readiness-staged artifact feat(ce-brainstorm, ce-plan): unify brainstorm and plan into one readiness-staged artifact Jun 23, 2026
tmchow added 16 commits June 23, 2026 00:41
Add the execution-engine selection lane that the unified-plan refactor
specified but under-implemented: a references/execution-engines.md covering
host-capability probing, goal-mode/dynamic-workflow vs inline/subagent
selection, copyable /goal and ultracode: prompts, and resume-correct-tail
rules; wire a concise engine-selection step into ce-work Phase 1.

Reconcile reference drift left by the refactor: ce-plan synthesis-summary
and ce-doc-review synthesis-and-presentation now describe the unified
Product/Planning Contract nesting and readiness-aware next-stage routing;
align the plan doc's legacy product_contract_source value.

Adopt two refinements from Kundel's /goal guide: prefer measurable exit
thresholds for optimization-shaped goals, and require dead-end/experimental
code cleanup before done. Add HTML nav/id and contract-test coverage for the
above.
- ce-work Phase 0 now strips a leading mode:caller-owned-tail token so
  lfg's invocation isn't mistaken for a bare prompt (P1)
- ce-code-review Stage 2b discovers docs/plans/*.{md,html} and extracts
  Product Contract > Requirements, matching its completeness contract (P2)
- ce-plan 5.1.5 scoping-synthesis gate fires for requirements-only
  unified-plan sources, not only legacy *-requirements docs (P2)
- contract tests cover all three
- execution-engines: add a Codex lane (top-level /goal is a thread mode,
  not an awaitable nested engine), a progress-visibility lane independent
  of final-PR tail ownership, and a compaction re-read instruction
- plan-sections: Goal Launch Block must be evaluator-complete (prompt is
  also the completion criteria) and split human vs pipeline launch;
  implementation-ready requires zero launch-blocking open questions;
  markdown is the canonical execution artifact, HTML is report-only
- ce-plan: record a Product Contract preservation note on in-place
  enrichment so the WHAT/HOW review boundary stays visible
- plan doc: fix its own Goal Launch Block to reference sections it has
  (it is a pre-contract meta-plan) and mark open questions non-blocking
- contract tests cover all of the above
…ption

The post-plan menu offered no way to get the copyable /goal prompt on
hosts where ce-work is skill-invocable (Claude Code) — picking 'Start
/ce-work' ran the skill instead. Verified (claude-code-guide + Codex's
own docs) that a skill cannot invoke /goal on either platform; it can
only emit a copyable prompt. So /goal becomes its own menu option,
mutually exclusive with 'Start /ce-work' (only one executor runs the
plan — tail-ownership guard), gated to implementation-ready code plans
and opt-in so the long prompt never auto-dumps.

Also make the menu-rendering guidance declarative — drop the runtime
'Per the AGENTS.md' authoring-file reference. Contract tests cover the
new option, the mutual-exclusion guard, and the absence of the meta-ref.
- drop the 'Done for now' option from both the ce-plan and ce-brainstorm
  handoff menus — the blocking question already waits, so pausing is
  implicit (dismiss/Esc or say you're finished); the artifact is saved
  either way. ce-brainstorm's closing summary still fires on the natural
  finish/dismiss path.
- reword 'Start /ce-work' to plain user language ('Implement this plan
  now, in this session') instead of the internal 'owns the tail' jargon
- gate the 'Give me the /goal prompt' option to hosts that actually have
  a top-level /goal command (Claude Code and Codex); omit it elsewhere
'Run deeper doc review' didn't say what it does. Rename it to 'Review
remaining findings' and rewrite the description to explain the model:
the auto-pass already applied the safe mechanical fixes; this option
walks through what it left for the user's judgment — proposed edits that
change the plan's meaning/scope (confirm or skip) and judgment calls
with no single right answer (decide, or defer into Open Questions).
Renamed the routing-key references in lockstep.
…view's open items'

'Review remaining findings' still didn't signal the user has decisions to
make. Rename to 'Decide on the review's open items' with a plain secondary
line ('Confirm or skip the suggested edits, and settle the judgment calls
the auto-pass left for you'). Routing-key references and tests updated in
lockstep.
…enus

ce-brainstorm: rename the menu to plain actions and add a skip-planning
path that doesn't force ce-work. One slot renders the most autonomous
available option — 'Create a /goal prompt' on /goal hosts (Claude Code,
Codex), else 'Build it now' via ce-work — never both, since at the
requirements stage choosing between them is confusing. ce-plan stays the
recommended path (sharpest requirements, least rework). Rename the
'Agent review of Product Contract' option to 'Pressure-test the
requirements' — at this stage no review has run yet, so it is the first
critique, not adjudicating leftovers.

ce-plan: both ce-work and /goal stay shown (the plan is real, so it's a
preference), with descriptions that state the deciding factor — shorter
work / watch-and-steer vs longer / autonomous-to-DoD. Rename 'Give me the
/goal prompt' to 'Create a /goal prompt' for consistency.

Wording informed by asking Codex (the /goal authority) why one picks
/goal vs a direct implement instruction. Tests updated for all renames.
The (recommended) marker is now dynamic: /goal carries it when the host
has a top-level /goal command (Claude Code, Codex); ce-work carries it
otherwise (when the /goal option is omitted). Exactly one option is ever
marked. Reflects that the autonomous run-to-DoD is the preferred default
when available, with ce-work as the in-session fallback.
…opy-paste

Corrects a wrong claim in execution-engines.md. Confirmed empirically:
a Codex skill CAN start goal-mode via the create_goal tool (gated by
features.goals); Claude Code exposes no goal tools at all. So:

- execution-engines.md: goal-mode is a callable engine where a goal tool
  exists. create_goal sets+activates the objective and the CURRENT session
  works toward it (not a background worker, no awaitable envelope). The
  skill does NOT call update_goal — the goal session marks its own
  completion. create_goal is standalone-only, never caller-owned-tail
  (which must return control).
- ce-plan and ce-brainstorm /goal options: on a callable-goal-tool host,
  selecting it calls create_goal directly (no copy-paste); on a
  user-typed-/goal host (Claude Code) it emits the copyable prompt; ce-work
  never also runs. ce-brainstorm's skip-planning slot falls back to ce-work
  only where there is no goal mode at all.

The literal /goal slash command remains user-typed-only everywhere; the
tool path is what makes Codex callable. Tests updated.
'Create a /goal prompt' implied a copy-paste prompt, but on a host with a
callable goal tool (Codex create_goal) there is no prompt — the session
just starts. 'Run it as a /goal' is truthful for both paths (direct start
or copy-paste), with the mechanism in the description. One label, one
routing key, across ce-plan and ce-brainstorm. Tests updated.
Rebase reconciliation: keep main's capability-based tracker routing and
its category-style menu label (e.g., GitHub Issues, Linear, Jira) instead
of the closed '(GitHub or Linear)' set, satisfying main's new contract test.
@tmchow tmchow force-pushed the tmchow/feat-unified-brainstorm-plan-docs branch from b5589eb to 9348929 Compare June 23, 2026 07:49
@tmchow tmchow marked this pull request as ready for review June 23, 2026 18:43
@tmchow

tmchow commented Jun 23, 2026

Copy link
Copy Markdown
Collaborator Author

@codex review

@tmchow tmchow marked this pull request as draft June 23, 2026 18:44

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 9348929e20

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +162 to +164
Launch prompts name the canonical **markdown** plan path: markdown is the
execution artifact for `ce-work`, `lfg`, and `/goal`; an HTML rendering is a
human-facing/report-only view and is never the goal-launch target.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Use the actual HTML plan path in launch blocks

When OUTPUT_FORMAT=html, the handoff reference says the run writes a single .html file with no markdown sibling, yet this contract requires every Goal Launch Block to name a canonical markdown path and says HTML is never the launch target. In an HTML plan, that makes the generated /goal or ce-work mode:caller-owned-tail prompt point at a nonexistent .md sibling, so choosing the post-plan execution options can fail before the executor can read the plan. Either emit launch prompts for the actual artifact path or create the markdown execution sibling before advertising it.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant