Skip to content

ghcp-handoff: fix verify bugs + wire skill into gstack routing#2

Draft
bminier wants to merge 6 commits intodevfrom
claude/review-ghcp-handoff-skill-g7MDK
Draft

ghcp-handoff: fix verify bugs + wire skill into gstack routing#2
bminier wants to merge 6 commits intodevfrom
claude/review-ghcp-handoff-skill-g7MDK

Conversation

@bminier
Copy link
Copy Markdown
Owner

@bminier bminier commented Apr 20, 2026

Summary

Four real bugs in the verify path, plus the skill wasn't wired into gstack's routing. Fixed in 6 bisected commits.

Bugs fixed

  • PR body check falsely passes on prose mentions. checkPrBody was doing a case-insensitive substring search, so "this PR includes a Summary of changes" satisfied the "Summary" section requirement. Now requires a Markdown heading (## Summary) or bold label (**Summary:**, **Summary**:). One test for this case was already failing — it passes now.
  • Dep-deviation check flags package.json metadata as new dependencies. The regex over unified diff + lines flagged author, repository, engines, keywords, etc. as deps, and for TOML manifests flagged keys in any section. Rewritten to parse before/after file contents via git show and walk each manifest structurally (JSON parse for package.json, section-aware TOML walker for pyproject/Cargo, require-block scan for go.mod, gem "..." lines for Gemfile). Only keys inside the real dep sections count.
  • ghcp-detect.sh comment mismatches behavior. Promised a gh copilot fallback that was never implemented — and the extension doesn't support the -p --allow-all-tools --output-format json --no-ask-user flags the handoff invocation requires anyway. Comment now matches reality.
  • Prompt template has unused placeholders. {{project_name}}, {{repo_abs_path}}, {{user_name}}, {{forbidden_branches}} were never collected by guided mode, so they'd render literally in the Copilot prompt. Replaced with concrete wording; Render step now enumerates the real placeholder set with a pre-flight grep for any remaining {{...}}.

gstack integration

  • Routing rule in SKILL.md.tmpl so /ghcp-handoff is suggested for "hand off to copilot" / "delegate scaffold" / "ghcp-handoff" (sibling to /codex).
  • README power-tools table row next to /codex.
  • README install-instructions skill list.
  • CLAUDE.md project-structure listing.
  • CHANGELOG Unreleased entry extended with a Fixed section covering the four bugs.

Commit layout

  1. ghcp-handoff: require heading match for PR body section check
  2. ghcp-handoff: parse manifests structurally instead of regex-matching diffs
  3. ghcp-handoff: drop misleading gh copilot fallback claim in detect script
  4. ghcp-handoff: drop unused template placeholders, document the rendered set
  5. wire /ghcp-handoff into gstack routing rules and docs
  6. regenerate SKILL.md files after ghcp-handoff + routing updates

Test plan

  • bun test ghcp-handoff/test/ — 35 pass, 0 fail (was 34 pass / 1 fail).
  • bun run gen:skill-docs — clean, no unresolved placeholders.
  • New test coverage for all four bug categories.
  • Manual smoke test of /ghcp-handoff verify <pr> on a real PR — skipped; unit tests cover the two verify scripts.
  • Paid evals not run — no eval changes.

claude added 6 commits April 20, 2026 03:25
checkPrBody previously did a case-insensitive substring search, so a
sentence like "this PR includes a Summary of changes" counted as the
required Summary section. Match Markdown headings and bold labels only
(e.g. ## Summary, **Summary:**, **Summary**:), and add tests for the
prose-only and bold-label cases.
…diffs

The previous dep-check regex-matched + lines in unified diffs, so any
top-level package.json key (author, repository, engines, keywords, etc.)
and any TOML key in any pyproject.toml / Cargo.toml section got flagged
as a new dependency. Fetch before/after file contents via git show,
then parse them structurally:

- package.json: JSON.parse both sides, diff keys across dependencies,
  devDependencies, peerDependencies, and optionalDependencies.
- pyproject.toml / Cargo.toml: walk lines tracking the active [section]
  header, collect keys only when the section matches a dep-section
  regex (tool.poetry.*dependencies, dependencies, dev-dependencies,
  build-dependencies, target.*.dependencies, etc.).
- go.mod: match require-block module lines.
- Gemfile: match gem "name" entries.

Replaces extractAddedDeps with parseManifestDeps + diffManifestDeps.
Tests cover the metadata-key false-positive case and each supported
manifest.
The comment promised a "gh copilot" fallback that was never implemented.
It would have been wrong anyway — the gh extension doesn't support the
-p --allow-all-tools --output-format json --no-ask-user flags the
handoff invocation requires. Make the comment match reality: only the
standalone copilot CLI counts as available.
…d set

prompt-template.md referenced {{project_name}}, {{repo_abs_path}},
{{user_name}}, and {{forbidden_branches}} — none of which Step 2B's
guided-mode question flow collected. On render they would have been
left as literal text in the prompt sent to Copilot. Replace them with
concrete wording that matches the sample fixture ("the repo root",
"the reviewer", explicit forbidden-branch list), and update the Render
step in SKILL.md.tmpl to enumerate the actual placeholder set plus a
pre-flight grep for any remaining {{...}} markers.
The skill lived in the repo but was invisible to the router: the main
SKILL.md.tmpl routing block, the README power-tools table, the README
install-instructions skill list, and CLAUDE.md's project-structure
listing all skipped it. Add entries in each so the router suggests
/ghcp-handoff for "hand off to copilot" / "delegate scaffold" requests,
and expand the Unreleased CHANGELOG entry with the fixes from this
branch.
Mechanical regen via bun run gen:skill-docs — picks up the
/ghcp-handoff routing rule in the top-level SKILL.md and the Render-step
changes in ghcp-handoff/SKILL.md.tmpl.
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.

2 participants