Skip to content

feat(finishing-branch): add issue-closing keywords to PR template#657

Open
mvanhorn wants to merge 3 commits intoobra:mainfrom
mvanhorn:osc/600-feat-closing-keywords-pr-body
Open

feat(finishing-branch): add issue-closing keywords to PR template#657
mvanhorn wants to merge 3 commits intoobra:mainfrom
mvanhorn:osc/600-feat-closing-keywords-pr-body

Conversation

@mvanhorn
Copy link
Contributor

@mvanhorn mvanhorn commented Mar 9, 2026

Summary

  • Adds instructions to the finishing-a-development-branch skill to check for related GitHub issues
  • When a related issue is found (via branch name, commit messages, or plan files), includes a closing keyword (Closes #NNN) in the PR body
  • Enables automatic issue closure on merge instead of requiring manual cleanup

Fixes #600

This contribution was developed with AI assistance (Claude Code).

mvanhorn and others added 2 commits March 9, 2026 07:59
The OpenCode plugin maps TodoWrite to 'update_plan', but OpenCode's
built-in todo tool is called 'todowrite'. This mismatch causes
superpowers skills relying on TodoWrite to behave unreliably.

Also updates the same incorrect mapping in INSTALL.md and
docs/README.opencode.md.

Fixes obra#654

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The skill now prompts the agent to check for related GitHub issues
and include closing keywords (Closes #NNN) in the PR body. This
enables automatic issue closure on merge instead of requiring
manual cleanup.

Fixes obra#600

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@coderabbitai
Copy link

coderabbitai bot commented Mar 9, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 986a49da-3a09-4138-b864-843ea3721320

📥 Commits

Reviewing files that changed from the base of the PR and between 84ffc0f and 0c40f02.

📒 Files selected for processing (1)
  • skills/finishing-a-development-branch/SKILL.md
🚧 Files skipped from review as they are similar to previous changes (1)
  • skills/finishing-a-development-branch/SKILL.md

📝 Walkthrough

Walkthrough

Updated three OpenCode mappings changing TodoWrite from update_plan to todowrite, and enhanced the finishing-a-development-branch skill to detect related GitHub issues (branch name, commits, plan) and conditionally include issue-closing keywords in generated PR bodies.

Changes

Cohort / File(s) Summary
OpenCode Tool Mapping Updates
\.opencode/INSTALL.md, \.opencode/plugins/superpowers.js, docs/README.opencode.md
Replaced TodoWrite mapping value from update_plan to todowrite in OpenCode configuration and documentation.
GitHub Issue Integration
skills/finishing-a-development-branch/SKILL.md
Added pre-PR checks: parse branch names, scan commit messages, inspect plan/task descriptions for issue references; conditionally append per-issue closing lines (Closes/Fixes/Resolves) to the PR body and adjust Test Plan placeholder when applicable.

Sequence Diagram(s)

sequenceDiagram
    participant User as User/Agent
    participant Checker as Issue Checker
    participant PRGen as PR Body Generator
    participant GitHub as GitHub

    User->>Checker: Start pre-PR workflow
    Checker->>Checker: Parse branch name for issue numbers
    Checker->>Checker: Scan commit messages for issue references
    Checker->>Checker: Inspect plan/task descriptions for issue links

    alt Issue(s) Found
        Checker->>PRGen: Provide detected issue number(s)
        PRGen->>PRGen: Append per-issue closing lines (e.g., "Closes `#NNN`")
    else No Issues Found
        Checker->>PRGen: No related issues detected
        PRGen->>PRGen: Generate PR body without closing lines
    end

    PRGen->>User: Present PR body template
    User->>GitHub: Create PR (includes closing keywords if present)
    GitHub->>GitHub: Auto-close linked issues on merge (if applicable)
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐰 I nibbled through mappings, made them right,
TodoWrite hops to its new delight.
I sniffed the branch and commits with care,
Now PRs can close issues caught in my snare.
🥕 Hop—merge—close!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Out of Scope Changes check ⚠️ Warning The PR includes unrelated tool mapping updates (TodoWrite → todowrite) in three files that are out of scope for the issue #600 objective of adding issue-closing keywords. Remove the TodoWrite tool mapping changes from INSTALL.md, superpowers.js, and README.opencode.md, as these are unrelated to adding issue-closing keywords functionality.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: adding issue-closing keywords to the PR template in the finishing-a-development-branch skill.
Description check ✅ Passed The description is directly related to the changeset, explaining what was added (instructions to check for GitHub issues and include closing keywords) and why (automatic issue closure on merge).
Linked Issues check ✅ Passed The PR successfully addresses issue #600 by adding checks for related GitHub issues (via branch names, commit messages, plan files) and including closing keywords only for issues actually resolved [#600].
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Tip

Try Coding Plans. Let us write the prompt for your AI agent so you can ship faster (with fewer bugs).
Share your feedback on Discord.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@skills/finishing-a-development-branch/SKILL.md`:
- Around line 91-96: Update the "Check for related GitHub issues" guidance in
SKILL.md to explicitly instruct contributors to only add closing keywords for
issues the PR actually resolves (not for incidental references in branch names
or commits); change the bullet that says "If a related issue is found, include a
closing keyword (`Closes `#NNN``) in the PR body" to clarify that you should
verify the PR content mentions the issue as fixed and only add `Closes `#NNN`` for
those confirmed fixes (do not auto-close issues found only as incidental
references like `#654`), and add a short example or note showing correct usage
(e.g., include `Closes `#600`` only when the PR description documents the fix for
`#600`).

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: d5d1c39c-ad1d-4638-ad51-a0d3a71808f5

📥 Commits

Reviewing files that changed from the base of the PR and between e4a2375 and 84ffc0f.

📒 Files selected for processing (4)
  • .opencode/INSTALL.md
  • .opencode/plugins/superpowers.js
  • docs/README.opencode.md
  • skills/finishing-a-development-branch/SKILL.md

… issues only

Prevents agents from auto-closing unrelated issues referenced incidentally
in branch names or commit messages.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.

finishing-a-development-branch: prompt for GitHub issue-closing keywords in PR body

1 participant