ghcp-handoff: fix verify bugs + wire skill into gstack routing#2
Draft
ghcp-handoff: fix verify bugs + wire skill into gstack routing#2
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
checkPrBodywas 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.+lines flaggedauthor,repository,engines,keywords, etc. as deps, and for TOML manifests flagged keys in any section. Rewritten to parse before/after file contents viagit showand 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.shcomment mismatches behavior. Promised agh copilotfallback that was never implemented — and the extension doesn't support the-p --allow-all-tools --output-format json --no-ask-userflags the handoff invocation requires anyway. Comment now matches reality.{{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
SKILL.md.tmplso/ghcp-handoffis suggested for "hand off to copilot" / "delegate scaffold" / "ghcp-handoff" (sibling to/codex)./codex.CLAUDE.mdproject-structure listing.Commit layout
ghcp-handoff: require heading match for PR body section checkghcp-handoff: parse manifests structurally instead of regex-matching diffsghcp-handoff: drop misleading gh copilot fallback claim in detect scriptghcp-handoff: drop unused template placeholders, document the rendered setwire /ghcp-handoff into gstack routing rules and docsregenerate SKILL.md files after ghcp-handoff + routing updatesTest plan
bun test ghcp-handoff/test/— 35 pass, 0 fail (was 34 pass / 1 fail).bun run gen:skill-docs— clean, no unresolved placeholders./ghcp-handoff verify <pr>on a real PR — skipped; unit tests cover the two verify scripts.