Skip to content

fix(ce-plan): inline post-generation menu routing so option 1 actually starts /ce-work#715

Merged
tmchow merged 2 commits intoEveryInc:mainfrom
mvanhorn:fix/ce-plan-handoff-inline-routing
Apr 28, 2026
Merged

fix(ce-plan): inline post-generation menu routing so option 1 actually starts /ce-work#715
tmchow merged 2 commits intoEveryInc:mainfrom
mvanhorn:fix/ce-plan-handoff-inline-routing

Conversation

@mvanhorn
Copy link
Copy Markdown
Contributor

Closes #714.

Summary

ce-plan Phase 5.4 presents a 4-option post-generation menu where option 1 is "Start `/ce-work` (Recommended)". The per-option routing lived only in `references/plan-handoff.md`. Two failure modes followed:

  1. An agent that didn't load the reference saw the menu as a textual handoff with no associated action and stopped after the user's selection.
  2. An agent that did load the reference saw ambiguous language (`Start /ce-work -> Call /ce-work with the plan path`) that could be read as "tell the user to type /ce-work" rather than "fire the Skill tool now."

Reproduced live on 2026-04-28: user picked option 1, agent acknowledged the choice in prose, and stopped without invoking `ce-work`.

Changes

  • `plugins/compound-engineering/skills/ce-plan/SKILL.md` — Inline `Routing` block in Phase 5.4 with one explicit action per menu option, using platform-explicit invocation language ("Invoke the `ce-work` skill via the platform's skill-invocation primitive — `Skill` in Claude Code, equivalent on Codex/Gemini/Pi — passing the plan path as the skill argument. Do not merely tell the user to type `/ce-work` — fire the invocation now.")
  • `plugins/compound-engineering/skills/ce-plan/references/plan-handoff.md` — Mirror the same platform-explicit phrasing in the routing block so the inline and reference language converge. Elaborate sub-flows (Proof HITL state machine, Issue Creation tracker detection, post-HITL `ce-doc-review` resync) remain in the reference where they belong.
  • `tests/skills/ce-plan-handoff-routing.test.ts` — Regression test asserting all four inline routing lines are present and that the `Start /ce-work` routing specifically names both the skill-invocation primitive and the plan path.
  • `docs/solutions/skill-design/post-menu-routing-belongs-inline-2026-04-28.md` — Authoring principle: always-on routing for interactive menus belongs inline in SKILL.md; only conditional, multi-step sub-flows belong in references. References the existing "Skill Design Principles" rule about load-bearing rules in plugin AGENTS.md.

Why scope this way

The plugin's `AGENTS.md` "Conditional and Late-Sequence Extraction" rule says to extract conditional or late-sequence content. The bare per-option routing is late-sequence but not conditional — option 1 always means "invoke ce-work." The same AGENTS.md, in "Skill Design Principles," already says: "For load-bearing rules (those that MUST fire reliably), put strong language at the top of the relevant phase in SKILL.md, not just in the reference." This PR applies that principle to Phase 5.4 routing while keeping genuinely conditional flows (HITL, Issue Creation) in the reference.

Verification

  • `bun test tests/skills/ce-plan-handoff-routing.test.ts` — 3 pass, 0 fail (10 expect calls)
  • `bun test tests/frontmatter.test.ts` — passes (sanity)
  • `bun run release:validate` — clean ("Release metadata is in sync. compound-engineering currently has 51 agents, 35 skills, and 0 MCP servers.")
  • No version files modified (`.claude-plugin/plugin.json`, `.cursor-plugin/plugin.json`, `.codex-plugin/plugin.json`, `.claude-plugin/marketplace.json`, root `CHANGELOG.md` — all untouched per AGENTS.md rules)
  • Pre-existing failures in `tests/skills/ce-polish-beta-project-type.test.ts` (9 fails) confirmed present on `upstream/main` before any of this work; unrelated to this PR

Test plan

  • Regression test passes on the fix
  • Regression test fails on the regression (verified during authoring — initial regex bugs caught a real "Open in Proof" missing-routing case and a Start /ce-work language-not-platform-explicit case)
  • Full `bun test` run shows no new failures vs. `upstream/main`
  • `bun run release:validate` passes
  • No release-owned files modified

…y starts /ce-work

Phase 5.4 presents a 4-option menu (Start /ce-work, Create Issue,
Open in Proof, Done for now). The per-option routing lived only in
references/plan-handoff.md, so an agent that didn't load the reference
rendered the menu, captured the user's selection, and stopped — without
firing the routed action. Even an agent that loaded the reference saw
ambiguous language ("Call /ce-work with the plan path") that could be
read as "tell the user to type /ce-work" rather than "fire the Skill
tool now."

Fix:

- Inline a Routing block in SKILL.md Phase 5.4 with one explicit action
  per menu option. Use platform-explicit invocation language naming the
  skill-invocation primitive (Skill in Claude Code, equivalent on
  Codex/Gemini/Pi) and the plan path as the argument.
- Mirror the platform-explicit phrasing in references/plan-handoff.md so
  both surfaces converge. The reference still owns the elaborate
  sub-flows (Proof HITL state machine, Issue Creation tracker detection,
  post-HITL ce-doc-review resync, upload-failure fallback).
- Add tests/skills/ce-plan-handoff-routing.test.ts as a regression guard
  asserting all four inline routing lines are present and that the
  Start /ce-work routing names both the skill-invocation primitive and
  the plan path.
- Document the underlying authoring principle in docs/solutions/skill-
  design/post-menu-routing-belongs-inline-2026-04-28.md: always-on
  routing belongs inline; only conditional, multi-step sub-flows belong
  in references.

Closes EveryInc#714.
Copy link
Copy Markdown

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

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: 0aaa9da0ca

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread tests/skills/ce-plan-handoff-routing.test.ts Outdated
Copy link
Copy Markdown
Collaborator

@tmchow tmchow left a comment

Choose a reason for hiding this comment

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

Superseded by inline comments in the follow-up review.

Copy link
Copy Markdown
Collaborator

@tmchow tmchow left a comment

Choose a reason for hiding this comment

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

Two inline comments below.

Comment thread plugins/compound-engineering/skills/ce-plan/SKILL.md Outdated
Comment thread plugins/compound-engineering/skills/ce-plan/SKILL.md Outdated
…TOP-tier load + prose trim)

Three review items, all valid:

- Codex P2 (tests/skills/ce-plan-handoff-routing.test.ts): the
  inline-routing regex used `\s*` around the action separator, which
  consumed newlines, so a bullet with no action text on its own line
  could match by spilling into the next bullet's leading `-`. The first
  test in this file would silently pass on a real regression. Tighten
  the inter-token gaps to `[ \t]*` and require `[^\n]+` of action text
  on the same line. Add a dedicated negative-case test that proves the
  fix: a hand-rolled fixture with an empty-action bullet followed by a
  legitimate bullet must not match the routing regex (and a same-line
  shape still does).

- tmchow inline (SKILL.md L899): the routing block carried a second
  sentence — "stated inline below so it cannot be missed" — that was
  authoring rationale, not agent behavior. AGENTS.md Rationale
  Discipline says cut anything that wouldn't change agent behavior;
  the rationale lives in the new `docs/solutions/` entry already.
  Apply the verbatim suggestion: a two-sentence header.

- tmchow inline (SKILL.md L887): the existing "Load
  `references/plan-handoff.md` now" line was below STOP-tier — its
  "do not skip" attached to document review, not the load itself.
  Replace with the STOP-tier paragraph that matches
  `ce-brainstorm/SKILL.md:216` and `ce-ideate/SKILL.md:345` (STOP +
  non-optional + named failure mode). This is the actual root-cause
  hardening for issue EveryInc#714: an agent that doesn't load the reference
  now sees a STOP instruction, an explicit "non-optional" tag, and the
  exact failure mode (renders menu, captures selection, stops without
  firing the routed action) it would otherwise repeat.

bun test tests/skills/ce-plan-handoff-routing.test.ts: 4 pass, 0 fail
bun run release:validate: clean
Copy link
Copy Markdown

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

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: d008977792

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread plugins/compound-engineering/skills/ce-plan/SKILL.md
@tmchow tmchow self-requested a review April 28, 2026 17:32
@tmchow tmchow merged commit 0c515c0 into EveryInc:main Apr 28, 2026
2 checks passed
@github-actions github-actions Bot mentioned this pull request Apr 28, 2026
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.

fix(ce-plan): post-generation menu option 1 (Start /ce-work) doesn't actually start ce-work

2 participants