Skip to content

refactor(ce-commit-push-pr): merge ce-pr-description into ce-commit-push-pr - #700

Merged
tmchow merged 7 commits into
mainfrom
tmchow/merge-pr-desc-skill
Apr 26, 2026
Merged

tmchow merged 7 commits into
mainfrom
tmchow/merge-pr-desc-skill

Conversation

@tmchow

@tmchow tmchow commented Apr 26, 2026

Copy link
Copy Markdown
Collaborator

Summary

Folds the standalone ce-pr-description skill into ce-commit-push-pr, dropping one skill and ~395 lines without losing any capability. The writing principles (sizing, narrative framing, voice, visual communication, badge, compression pass) move to references/pr-description-writing.md, backtick-loaded only when actually composing a body. A new soft branch in mode detection lets the user request a description on its own (or pasted PR URL/number) without going through commit/push. The {title, body_file} temp-file hand-off is gone — the internal flow composes in context and applies directly.

Test plan

  • bun test (947 pass)
  • bun run release:validate (in sync; 51 agents, 35 skills)
  • Sanity-check description-only intent in a fresh session ("write a PR description for this branch")

🤖 Generated with Claude Code

…ush-pr

Folds the standalone ce-pr-description skill into ce-commit-push-pr.
The writing principles (sizing, narrative framing, voice, visual
communication, badge, compression pass) move to a backtick-loaded
references/pr-description-writing.md so they only load when actually
composing a body. Adds a soft "description-only" branch in mode
detection: if the user asks just for a PR description (or pastes a PR
URL/number), generate it without committing or pushing. Drops the
{title, body_file} temp-file hand-off — internal flow composes in
context and applies directly. Net: one fewer skill, ~395 fewer lines.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>

@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: 158cd4ee64

ℹ️ 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".

…ription

DU-3 was reading the PR body but not gathering the branch diff/commit
list — the writing reference assumes both are already in context, so
description updates would compose from stale or empty diff context.
The description-only mode also promised to describe a pasted PR
URL/number but never threaded that ref into Step 6's gh pr view calls,
so "describe PR #123" silently described the current branch. Fixes
both gaps without restructuring either flow.

Address PR review feedback (#700)

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>

@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: 1c277f1219

ℹ️ 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".

…description-only mode

Two follow-on gaps from the same skill-merge: description-only mode
told the agent to "Run Step 1 for context", but Step 1 contains
full-workflow stop gates ("feature branch, all pushed, open PR ->
stop") that would terminate the path on the most common case
(asking for a description on an already-open PR with no local
changes). And Step 6 gathered the branch diff but never the PR
commit list, so the writing reference's commit classification fell
back to Step 1's HEAD-anchored, capped-at-10 git log block.

Description-only mode now uses the Context section data directly
and explicitly skips Step 1's decision tree. Step 6's diff-gathering
subsection now resolves both commits and diff in one merge-base-
anchored command, which DU-3 references for the same fix.

Address PR review feedback (#700)

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>

@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: 64683fbbb1

ℹ️ 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".

…-PRs

DU-3 and the description-only PR-ref branch hardcoded
origin/<baseRefName> for the diff base. For fork-based PRs (origin
is the contributor's fork, the PR targets upstream), this diffed
against the fork's stale main and produced the wrong commit range.
The fix mirrors Step 6's PR-metadata path: parse owner/repo from
the PR URL, match against git remote -v, and use that remote.

Step 6 also previously fell back to origin when no remote matched,
which had the same bug for fork-PRs without an upstream remote
configured. It now falls through to gh pr diff and gh pr view
--json commits, mirroring the API-only path the original
ce-pr-description had via Case B before the merge.

Address PR review feedback (#700)

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>

@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: 921db02d24

ℹ️ 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".

…nto Pre-A

Four rounds of Codex feedback all surfaced the same lost contract:
the original ce-pr-description had a layered resolution pipeline
(Cases A/B with SHA fetch, refs/pull/N/head fallback, API-only
fallback for fork-PRs and any local-git failure), and surgical
patches across Step 6, DU-3, and description-only mode kept restoring
one slice at a time while missing others.

Lift the entire pipeline into references/pr-description-writing.md as
a self-contained Step Pre-A. Step 6, DU-3, and description-only mode
now collapse to one-line pointers. Single source of truth, single
authoring surface for future edge cases. Net: SKILL.md shrinks 58
lines; references gains 77 (loaded on demand only).

Pre-A covers: mode (current-branch vs PR ref), base detection
(4-tier), Case A in-repo with SHA fetch + refs/pull/N/head fallback,
Case A -> Case B failure fallback, Case B API-only, empty-range
graceful exit. Restores everything the original ce-pr-description had
inline, in the location all callers naturally reach for.

Address PR review feedback (#700)

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>

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

ℹ️ 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".

tmchow and others added 2 commits April 26, 2026 02:13
Step 6 referenced references/pr-description-writing.md twice with a
paragraph between (Pre-A, then evidence, then Steps A through H),
which could prompt the agent to Read the file twice. DU-3 had a
softer version of the same risk. Both callsites now instruct one
Read up front and refer to subsequent steps by letter only, avoiding
duplicate file loads.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
Pre-A's Case A unconditionally ran git fetch before computing the
merge-base, which regressed the offline-safe behavior the previous
Step 6 had ('git rev-parse --verify ... || git fetch ...'). On
expired auth, restricted egress, or intentional offline work, the
fetch failed and Case B (also network-dependent) couldn't recover
even when the base and head refs were already local.

Fix: gate the fetch on a local-ref check so the local path runs
when refs are present. Also note that merge-base failure (shallow
clone, unrelated histories) should fall through to Case B rather
than press on.

Address PR review feedback (#700)

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
@tmchow
tmchow merged commit e8c118e into main Apr 26, 2026
2 checks passed

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

ℹ️ 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 +58 to +59
If `git merge-base` itself fails (shallow clone with insufficient history, or genuinely unrelated histories), do not press on — fall through to Case B and let the API path produce the diff and commits.

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 Avoid PR-only fallback when current-branch merge-base fails

Step Pre-A says to fall through to Case B when git merge-base fails, but Case B is defined as gh pr diff <ref>/gh pr view <ref> and therefore requires a PR reference. In the default current-branch path used for new PR creation (no explicit PR ref), shallow clones or incomplete local history can trigger this fallback and then fail because there is no <ref> to query, so title/body generation cannot continue. Keep current-branch failures on a local-git recovery path (or emit an explicit graceful-exit message) instead of routing to the PR-only API flow.

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