Skip to content

feat(lfg): route each request to the skill that owns it before shipping - #1702

Merged
tmchow merged 10 commits into
mainfrom
tmchow/improve-lfg-skill-routing
Sep 14, 2026
Merged

feat(lfg): route each request to the skill that owns it before shipping#1702
tmchow merged 10 commits into
mainfrom
tmchow/improve-lfg-skill-routing

Conversation

@tmchow

@tmchow tmchow commented Sep 14, 2026

Copy link
Copy Markdown
Collaborator

Summary

lfg now reads the request before it plans, and takes it to the end state its shape calls for through the skill that owns that work. A bug report goes to ce-debug, an unsettled product idea goes to ce-brainstorm when you are present, a judgment goes to ce-pov first, an explain or prototype request runs that skill and ends there, and a plan ce-plan wrote earlier in the session goes straight to ce-work instead of being planned twice. Before this, every /lfg invocation was planned as a feature, whatever it asked for.

The body is restated as an outcome spine with conditions rather than ten numbered steps with STOP markers, per the repo's skill-authoring standard. Every gate the old body carried survives as a condition, and every test pin on the shipping seams is unchanged.

What changes for someone using it

  • /lfg fix this bug ESP-1234 root-causes and fixes on a feature branch, then reviews and ships. It never writes a plan for a bug. It publishes only what you offered: on a branch carrying work no open PR holds, the fix is committed locally and nothing is pushed. /lfg diagnose #123 returns the diagnosis and stops.
  • /lfg explain the architecture of X or /lfg create a prototype exploring 3 concepts runs ce-explain or ce-prototype and ends with that result. No branch, no PR. A request to prototype and then build the winner continues into planning with the chosen decisions.
  • /ce-plan … then bare /lfg hands the plan directly to ce-work. A requirements-only artifact from /ce-brainstorm, or a path to an older plan, still goes through ce-plan so drift and settled-decision conflicts are checked.
  • lfg never executes a plan file it found on disk. The plan is one the session identifies.
  • ce-compound runs before the PR opens, so a captured learning is in the head CI watches rather than pushed after "CI decided".
  • Merging stays with the user unless granted for the run. Previously the body said lfg never merges.

Design decisions

  • Two new return-to-caller modes, not reuse of mode:pipeline. ce-debug's pipeline mode pushes its own commit and skips review because the babysitter owns the PR; under lfg the caller owns push and review, so the new mode commits on a feature branch and returns fixed | diagnosed-no-fix | needs-human | blocked with root cause and verification evidence. ce-brainstorm's new mode skips its handoff menu, which would otherwise re-invoke lfg, and returns the artifact path or chat brief.
  • A ce-pov verdict is cited evidence, never a settled decision. The settled-decisions design allows only user-directed and user-approved provenance and says an agent never self-settles its own recommendation. A verdict that supports the change continues (Adopt or Trial on an adoption question, a supporting position on an approach set); anything else stops the run with the verdict.
  • Headless runs with an unsettled product shape go to ce-plan in pipeline mode, which records the fork as an assumption in the plan. That is ce-plan's existing contract; stopping instead would be a change to that skill.
  • lfg stays model-invocable. Flagging it disable-model-invocation (or allow_implicit_invocation: false on Codex) would break the brainstorm handoff on both hosts, the reason PR fix(lfg): allow agent invocation for the autonomous brainstorm handoff #1116 removed the flag. The description is the activation control, shortened from 537 to 350 characters.
  • The same-session plan bypass narrows one test pin. "A plan file ce-plan reported writing this run" guards against adopting a discovered file and keeps that job on the plan route; a same-session plan is not a discovered file and is verified by ce-work's content check instead.

Validation

  • bun run test (4,103 pass), release:validate, and plugin:validate on the committed state.
  • Seam cells (read-only, skill injected) on Claude, Codex, and Grok for six request shapes: bug, feature, bare invocation with a stale plan on disk, question, prototype, explain. Every run chose the intended route, read intake.md before choosing, and never opened the plans directory. Pre-change baselines for the bug and bare cases showed the old plan-first behavior.
  • Live runs (disposable repo, bare-repo remote, gh shim, whole plugin loaded) on Claude and Codex: bug by reference, same-session plan then bare /lfg, explain, judgment, and a divergent bug (a test asserting a documented contract) which returned needs-human with nothing edited on both hosts. The interactive brainstorm seam ran end to end on Claude through an Orca terminal with the author answering as a stand-in.
  • Activation, no skill named, both hosts: plain feature, bug, and plan requests reached ce-work, ce-debug, and ce-plan; explicit hands-off requests reached lfg.
  • Not exercised: the babysit step, which the gh shim cannot serve. Codex applies the ce-debug structured return from context rather than printing it, so the field-by-field return contract is proven on Claude only.

The full evidence trail and the proposal's revision history are in docs/brainstorms/2026-09-13-lfg-front-half-proposal.md.

Review rounds

Seven Codex rounds. Rounds 1 to 3 asked for containment proof, push ordering, and a residual sink on the defect route's shipping gate; those were parked as one decision and answered by restating the block as a single goal (publish only what the user offered, decided before any push) with ce-debug returning observed facts and no verdict. Rounds 4 to 7 were handoff gaps, each fixed by one condition: stop before editing a file the user already changed, no fix-only review scope so step 5 applies findings only to the fix, brainstorm briefs keep settled decisions and grounding, an existing PR still receives the description context, a diagnosis-only request is not the fix route, attendance means a person who can answer, and verification defers to ce-debug's own fallback.

Related

Related: #879. That PR proposed a ce-compound step in lfg plus dogfood, feedback-as-input, and reproduce-before-fix; this change lands the compound step and the reproduce-before-fix outcome through ce-debug, and leaves dogfood and feedback-as-input out.

Follow-ups named in the recorded proposal: a single-PR merge grant has no carrier to ce-babysit-pr yet; the ce-plan ce-explain condition is untouched pending its own eval; ce-work's prose still calls its shipping sequence a "tail".

Security Disclosure

No security-relevant changes. The new ce-debug mode commits only fix-owned files on a feature branch and never pushes; no shell recipes were added to any skill.

Agent Disclosure

  • Model: Claude Code · claude-fable-5-1

https://claude.ai/code/session_0199q8oLAGsFn6iYU3gu1awy

lfg now reads the request before it plans. A reproducible defect goes to
ce-debug in a new return-to-caller mode that fixes on a feature branch and
commits without pushing; an unsettled product shape goes to ce-brainstorm in
a new return-to-caller mode when a human is present; a judgment goes to
ce-pov first and only Adopt or Trial continues; a request whose result is
not a code change runs that sibling and ends there. A plan ce-plan wrote in
the same session goes straight to ce-work, and lfg never executes a plan
file it merely found on disk.

The body is restated as an outcome spine with conditions instead of ten
numbered steps with STOP markers, ce-compound runs before the PR opens so
the learning lands in the watched head, merging is the user's unless
granted, and the internal word "tail" is gone from the skill and its
references (shipping-tail.md is now shipping.md).

Claude-Session: https://claude.ai/code/session_0199q8oLAGsFn6iYU3gu1awy
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 14, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-14T01:52:35.528675Z e95f075 New commits
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@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: 180b1186c8

ℹ️ 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/ce-debug/references/return-to-caller.md
Comment thread skills/lfg/references/intake.md Outdated
… attended run reach ce-prototype

Address PR review feedback (#1702)

- ce-debug's return-to-caller result now carries pre_fix_scope (already-dirty
  files and pre-existing unpushed commits); lfg passes the dirty files as an
  exclude list to ce-commit-push-pr, scopes simplify and review to the fix,
  and keeps the fix local when the branch carries commits the user did not
  offer. The no-remote path commits files by name instead of git add -A.
- ce-prototype stops on "no human present" rather than on the caller being
  lfg, and lfg's prototype route requires a human present.

Claude-Session: https://claude.ai/code/session_0199q8oLAGsFn6iYU3gu1awy

@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: 3435b59148

ℹ️ 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/references/intake.md Outdated
Comment thread skills/lfg/references/debug-return.md Outdated
…eans an open PR contains it

Address PR review feedback (#1702), round 2

- Route 3 applies only when the request asks for a change that hangs on
  an unsettled judgment; a judgment with nothing to build is route 5 and
  ends with ce-pov's verdict instead of rolling into planning.
- The defect route's "ship only what the user offered" block is restated
  as its condition: prior branch work is offered only when an open PR
  already contains it. ce-debug returns prior_commits_ahead_of_base in
  place of an unpushed count, since a backup push does not offer anything.

Claude-Session: https://claude.ai/code/session_0199q8oLAGsFn6iYU3gu1awy

@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: 35358b19ca

ℹ️ 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/references/intake.md Outdated
Comment thread skills/lfg/references/debug-return.md Outdated
Comment thread skills/lfg/references/debug-return.md Outdated
Comment thread skills/lfg/SKILL.md
Address PR review feedback (#1702), round 3: route 1 now requires that the
request asks for the plan to be carried out or continued; a request that
only mentions a plan while asking for something else is routed by what it
asks for.

Claude-Session: https://claude.ai/code/session_0199q8oLAGsFn6iYU3gu1awy
…cts, not verdicts

Three review rounds each found a new edge in the defect route's shipping gate
(containment proof, push ordering before the review push, where residuals go
when shipping is withheld). Each was a symptom of a mechanism-shaped rule.
The block now states the goal once, before any push in the run: publish only
what the user offered, and hold when that cannot be established. ce-debug's
pre_fix_scope records what it observed (pre-fix HEAD, dirty files, commits
beyond base) and carries no verdict; the caller decides from it.

Claude-Session: https://claude.ai/code/session_0199q8oLAGsFn6iYU3gu1awy

@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: f7a5e43097

ℹ️ 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/ce-debug/references/return-to-caller.md Outdated
Comment thread skills/lfg/references/debug-return.md Outdated
Comment thread skills/lfg/references/plan-brief.md
Comment thread skills/lfg/SKILL.md Outdated
- ce-debug return-to-caller stops before editing a file that already carries
  the user's edits, instead of editing and then refusing to commit.
- Defect-route review: ce-code-review has no fix-only scope, so step 5 applies
  findings only to the fix and this run's own edits; the rest are residuals.
- Judgment route: what continues is a verdict that supports the change, not
  only Adopt/Trial, matching intake route 3 for approach-set positions.
- Plan brief: skip composition only when there is nothing to carry, so ce-pov
  evidence reaches ce-plan even with no settled decisions.

Claude-Session: https://claude.ai/code/session_0199q8oLAGsFn6iYU3gu1awy

@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: f58f4677d8

ℹ️ 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/references/shipping.md
Comment thread skills/ce-brainstorm/references/handoff.md Outdated
Comment thread skills/lfg/references/intake.md Outdated
Comment thread skills/lfg/SKILL.md Outdated
…ototype handoffs

- Shipping precondition sits before the first push (step 5), not after step 7.
- An existing PR still receives the description context: pipeline mode leaves
  the body alone, so the default path re-invokes description-update mode.
- A brainstorm brief carries every decision that meets the settlement test;
  intake passes them into the settled-decisions brief.
- A prototype-then-build request continues into the plan route with the
  returned choices as user-directed decisions instead of ending the run.

Claude-Session: https://claude.ai/code/session_0199q8oLAGsFn6iYU3gu1awy

@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: dc48c477b4

ℹ️ 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/references/intake.md Outdated
Comment thread skills/lfg/references/intake.md Outdated
…eaches ce-plan

Reproduction is ce-debug's question, so intake no longer requires a
reproducible symptom to take the defect route. The brainstorm return's
grounding_path is passed to ce-plan on both continuations.

Claude-Session: https://claude.ai/code/session_0199q8oLAGsFn6iYU3gu1awy

@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: e95f07517e

ℹ️ 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/references/intake.md Outdated
Comment thread skills/lfg/references/intake.md Outdated
Comment thread skills/lfg/references/intake.md Outdated
Comment thread skills/ce-debug/references/return-to-caller.md Outdated
…o can answer

- A diagnosis-only request is route 5, not the fix route.
- Human present means a person can answer in this session, whatever the host's
  question mechanism; the tie-break rule matches the concrete-report condition.
- ce-debug return-to-caller verifies per fix.md, which already allows the
  reproduction check or characterization when a red test cannot run.

Claude-Session: https://claude.ai/code/session_0199q8oLAGsFn6iYU3gu1awy
@tmchow
tmchow merged commit fd8abda into main Sep 14, 2026
10 of 12 checks passed
@github-actions github-actions Bot mentioned this pull request Sep 14, 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.

1 participant