fix(ce-debug): delegate commit/PR and add branch check#683
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7e20a3c151
ℹ️ 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".
… up front Phase 4 previously hand-rolled "stage and commit the change," which duplicated logic that ce-commit and ce-commit-push-pr already encode (convention detection, default-branch guard, logical splitting, conventional-commit fallback). Replace with two slash-routed options so the user picks intent: local commit only or commit + push + PR. Reusing those skills means future commit-hygiene improvements propagate automatically. Also split the Handoff menu so /ce-compound and the issue-tracker reply read as additive "first" steps that re-prompt with the remaining options once done -- they don't commit anything, so they're rarely the user's terminal action. Phase 3 gains an upfront default-branch check. Today the default-branch guard fires only at commit time inside ce-commit/ce-commit-push-pr, after the fix has already been edited; surfacing it before edits sets up the right branch from the start. Single signal -- "are we on main/master/ origin/HEAD?" -- so the check stays out of the way for the common case where the user is already on a feature branch or in a worktree.
…ges on user confirmation Two new bullets in repo Commit Conventions, both addressing recurring agent mistakes when classifying their own work: 1. **Type selection by intent, not diff shape.** Net additions on a fix (a new guard, a new check, restoring missing behavior) do not turn a `fix:` into a `feat:`. Without an explicit rule, agents look at the diff, see additions, and pick `feat:`. The new bullet defaults to `fix:` for the feat/fix tiebreaker, reserves `feat:` for capabilities that did not previously exist, and gives a regression-test heuristic. Other conventional types stay primary when they fit better. 2. **Breaking-change marker requires explicit user confirmation.** This repo uses release-please, which cuts a major version bump on any commit or PR title containing `!` or a `BREAKING CHANGE:` footer. Agents cannot make that release decision unilaterally even when a change is technically breaking, because the user may want to defer the bump, bundle the breaking change, or reframe the API. Replace the prior "must be explicit" bullet (which actively invited the marker) with a confirmation-first stance. External research turned up no public AGENTS.md / cursorrules with explicit feat-vs-fix decision logic; canonical sources stop at thin spec definitions. The fix-vs-feat phrasing borrows the SemVer reframe from Conventional Commits and the regression-test heuristic from Bruno Noriller (Medium, "feat vs fix vs refactor — which is which?").
…scription skills End users running ce-commit, ce-commit-push-pr, or ce-pr-description in their own repos hit the same misclassification trap as agents working in this repo: a defect remedy that adds code gets labeled `feat:` because the diff shape looks feature-like. The skills' priority orders for convention selection enumerated the type list but provided no rule for choosing between types when more than one could fit. Add a tight runtime rule to each skill: when conventional commits is the active convention, default to `fix:` over `feat:` for changes that remedy broken or missing behavior, and reserve `feat:` for capabilities that did not previously exist. Other types stay primary when they fit better. Each skill carries the rule inline because cross-skill shared references are not supported (per plugin AGENTS.md). Skill-level versions are tighter than the repo AGENTS.md version (no regression-test heuristic, no full type roster restated) since SKILL.md content loads on every invocation and the surrounding step already enumerates the types. End users may override the default via repo conventions or explicit instruction.
7e20a3c to
eefdad9
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: eefdad99f5
ℹ️ 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".
Address PR review feedback (#683): The default-branch detection compared the current branch name against the raw output of `git rev-parse --abbrev-ref origin/HEAD`, which returns `origin/<name>` (e.g., `origin/develop`). The local branch name is `develop`, so the comparison never matches on repos whose default branch is anything other than literal `main` or `master` — defeating the safety check on `develop`-default repos. Make the prefix-stripping explicit in the skill text so the agent normalizes before comparing, matching what ce-commit's Step 1 already does.
Summary
Bug fixes through ce-debug now offer "save locally" or "commit, push, and PR" as distinct handoff actions, routing to
/ce-commitand/ce-commit-push-prinstead of a hand-rolled stage-and-commit step. The dedicated skills already encode convention detection, default-branch guards, and conventional-commit fallback, so debug fixes inherit any future commit-hygiene improvements. Phase 4 also separates additive options (/ce-compound, issue-tracker reply) from terminal ones; the additive ones re-prompt after running so the user still gets to commit or ship. Phase 3 gains an upfront default-branch check so fixes do not accidentally land on main; the same guard already exists inside the commit skills but fires after the fix is edited.Commit conventions update
Writing this PR's title surfaced a recurring agent failure mode: a defect remedy that adds code (a new check, a new option, restored missing behavior) gets labeled
feat:because the diff shape looks feature-like. The fix lives on two surfaces:AGENTS.md(loaded for contributors) gains a fix-vs-feat disambiguation bullet with a regression-test heuristic, plus a separate bullet requiring explicit user confirmation before applying!orBREAKING CHANGE:(which release-please reads as an automatic major version bump). The prior "must be explicit" framing actively invited the marker; the replacement defaults to surfacing suspected breakage to the user instead.ce-commit,ce-commit-push-pr, andce-pr-descriptionget a tighter runtime version of the disambiguation rule, so end users running these skills in their own repos benefit too. The skill versions defer to repo conventions first; the rule is a tiebreaker, not a forcing function.The PR's own type history is a worked example: the original commit was first written as
feat(ce-debug):and corrected tofix(ce-debug):mid-review, which is exactly the misclassification the new rules prevent.