docs(create-pr): read live PR body before editing in update mode - #531
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
🤖 Claude Code Review
Review SummarySmall docs-only change to Assessment
NoteThe No bugs, security issues, or breaking changes. Safe to merge. 💡 Want a fresh review? Add a comment containing |
📚 Documentation Check ✅Verdict: Passed Plugin version was bumped (2.0.5 → 2.0.6) as required. The SKILL.md change is a documentation/behavioral improvement to error handling — no structural changes, no new or removed components. PR #531 Documentation CheckChanges reviewed:
Version bump: Present and correctly scoped as a patch bump — this is a documentation/behavioral improvement with no user-facing API changes. CLAUDE.md: If README.md: No structural changes (no skills added/removed), so no README update is required. Overall: All required documentation is in order. The version bump satisfies the mandatory versioning policy. Suggestions (1)
🤖 Generated by Claude Documentation Validator | Mode: |
There was a problem hiding this comment.
📋 Review verdict: APPROVE
👆 The main review comment above is the source of truth for this PR review. It is automatically updated on each review cycle, so always refer to it for the most current feedback.
This formal review submission is for the verdict only. 1 inline comment(s) are attached below.
🤖 Claude PR Metadata GenerationStatus: ❌ Error
|
🤖 Claude Code ReviewStatus: The review was completed but there was an error posting inline comments. Raw Review OutputPlease check the workflow logs for details. |
🤖 Claude Code ReviewStatus: ❌ Error
|
Superseded by new review after PR update
There was a problem hiding this comment.
📋 Review verdict: APPROVE
👆 The main review comment above is the source of truth for this PR review. It is automatically updated on each review cycle, so always refer to it for the most current feedback.
This formal review submission is for the verdict only.
Superseded by new review after PR update
There was a problem hiding this comment.
📋 Review verdict: APPROVE
👆 The main review comment above is the source of truth for this PR review. It is automatically updated on each review cycle, so always refer to it for the most current feedback.
This formal review submission is for the verdict only.
When a PR already exists and update mode edits the title/body, the skill said only to run `gh pr edit`. That invites regenerating the body from scratch, which silently destroys author hand-edits and pasted screenshots (github user-attachments) that live only in the live PR body. Tell the skill to read the current body first (`gh pr view <n> --json body -q .body`) and splice the change into it.
Per CLAUDE.md versioning policy, bump plugin version for SKILL.md documentation update to the create-pr error-handling guidance. Co-authored-by: Nick Koutrelakos <wkoutre@users.noreply.github.com>
36efdda to
f334393
Compare
Patch bumps for plugins with functional model: frontmatter changes in the claude-opus-4-7 → claude-opus-4-8 model reference update, per mandatory versioning rules in CLAUDE.md: - claude-setup: 1.0.4 → 1.0.5 - development-codebase-tools: 2.6.0 → 2.6.1 - development-planning: 2.0.6 → 2.0.7 development-planning's existing 2.0.6 on next was bumped for unrelated PRs (#531, #492, #491), not this PR's model change, so it needs its own bump. Also corrects the version table in root CLAUDE.md to match. Co-authored-by: Nick Koutrelakos <wkoutre@users.noreply.github.com> Claude-Session: https://claude.ai/code/session_01W62gurznvTz2w81B8dcwG9
What
Update-mode in the
create-prskill currently says: "gh pr editif the PR title or body also need updating." That invites regenerating the body from scratch.This adds a guard: read the live body first (
gh pr view <n> --json body -q .body), edit from it, and apply withgh pr edit <n> --body-file <tmp>.Why
A PR body can contain content that exists only in the live body — author hand-edits and pasted screenshots (
). Regenerating from the diff/template silently destroys those. Reading-then-splicing preserves them.Blast radius
One bullet in one skill's "Error Handling" section (
development-planning/skills/create-pr). Docs-only; no code or behavior in the skill's tooling changes.Test plan
gh pr editflowAI-Generated Description
What
Update-mode in the
create-prskill currently says: "gh pr editif the PR title or body also need updating." That invites regenerating the body from scratch.This adds a guard: read the live body first (
gh pr view <n> --json body -q .body), edit from it, and apply withgh pr edit <n> --body-file <tmp>.Why
A PR body can contain content that exists only in the live body — author hand-edits and pasted screenshots (
). Regenerating from the diff/template silently destroys those. Reading-then-splicing preserves them.Blast radius
One bullet in one skill's "Error Handling" section (
development-planning/skills/create-pr). Docs-only; no code or behavior in the skill's tooling changes.Test plan
gh pr editflowAI-Generated Description
## What Update-mode in the `create-pr` skill currently said: *"`gh pr edit` if the PR title or body also need updating."* That phrasing invites regenerating the body from scratch. This rewrites the bullet to add a guard: **read the live body first** (`gh pr view --json body -q .body`), edit *from* it, and apply the result with `gh pr edit --body-file `. ## Why A live PR body can contain content that exists **only** in the live body — author hand-edits and pasted screenshots (``). Regenerating from the diff/template silently destroys those. Reading-then-splicing preserves them. ## Changes | File | Change | |------|--------| | `packages/plugins/development-planning/skills/create-pr/SKILL.md` | Single bullet rewritten in the **Error Handling** section to require reading the live body before editing and to call out hand-edits / `user-attachments` images as the failure mode | | `packages/plugins/development-planning/.claude-plugin/plugin.json` | `version`: `2.0.5` → `2.0.6` (patch bump for the docs-only change to a skill, per the root `CLAUDE.md` mandatory-bump policy) | Total diff: +2 / -2 across 2 files. ## Diff ```diff - **PR already exists for this branch**: Switch to update mode; run `git push` to publish the latest commits (use `gt submit` for Graphite), then `gh pr edit` if the PR title or body also need updating + **PR already exists for this branch**: Switch to update mode; run `git push` to publish the latest commits (use `gt submit` for Graphite). If the PR title or body also need updating, **read the live body first** (`gh pr view --json body -q .body`) and edit *from* it — never regenerate the body from scratch. The author may have hand-edited the description or pasted images/screenshots (``) that exist only in the live body, not in any file; overwriting silently destroys them. Splice your change into the current body and apply with `gh pr edit --body-file `. ``` ## Why patch (not minor) Docs-only change to a single bullet in one skill's "Error Handling" section. No new skills, agents, commands, or MCP servers; no behavioral code change in the skill's tooling. That fits the patch criteria in the root policy ("Bug fixes, minor documentation updates, typo fixes"). ## Blast radius One bullet in one skill (`development-planning/skills/create-pr`) plus the mandatory plugin version bump. Docs-only; no code or behavior in the skill's tooling changes. ## Test plan - [ ] Markdown renders correctly in the SKILL.md - [ ] Guidance is consistent with the existing `gh pr edit` flow - [ ] Next `/create-pr` invocation against an existing PR reads the live body via `gh pr view --json body -q .body` before composing the new body - [ ] `plugin.json` version matches the **Current plugins** table row in root `CLAUDE.md` (note: table-row sync may land in a follow-up if not included here)