Skip to content

Add create-pr skill encoding the project PR protocol#812

Merged
yungyuc merged 6 commits into
solvcon:masterfrom
tigercosmos:worktree-pr-skill-811
May 24, 2026
Merged

Add create-pr skill encoding the project PR protocol#812
yungyuc merged 6 commits into
solvcon:masterfrom
tigercosmos:worktree-pr-skill-811

Conversation

@tigercosmos
Copy link
Copy Markdown
Collaborator

@tigercosmos tigercosmos commented May 23, 2026

This adds a Claude Code skill at .claude/skills/create-pr/SKILL.md that helps the author open a pull request following the modmesh PR protocol from issue #811. The skill walks through confirming scope, verifying branch state, drafting the subject and body for approval, checking title and body for banned closing keywords ("close", "fix", "resolve" forms followed by #), and calling gh pr create with text loaded from quoted heredocs so a subject containing backticks, $, ", or apostrophes does not need escaping.

PRs default to draft. Opening as ready-for-review triggers a mandatory global review-request comment step, because the "ready for review" button alone is not quotable in follow-ups. After creation the skill reminds the author to add inline annotations when the diff is more than one-liner-ish, and refuses to append attribution trailers since this project treats PR text as human-authored.

The skill also requires that PR description paragraphs are written as single unbroken lines separated by blank lines, rather than hard-wrapped at 79/80 columns. The source-code line-length limit does not belong in PR text; GitHub reflows to the viewer's width, and mid-sentence breaks render as ragged prose. This PR description itself follows the rule.

This PR is opened via the new create-pr skill.

For issue #811.

The skill walks the user through opening a pull request that follows
the modmesh PR protocol: concise subject, clear global description,
"Related to #xxx" / "For issue #xxx" wording (closing keywords like
"fixes #xxx" are blocked by a case-insensitive guardrail), draft by
default, and a mandatory global review-request comment when ready.

Workflow steps: confirm scope, verify branch state, draft the title
and body for user approval, then open the PR via gh pr create using
quoted heredocs for title/body so subject text can contain backticks,
$, ", or apostrophes without escaping. After creation the skill
reminds the author to add inline annotations when the diff is more
than one-liner-ish.

For issue solvcon#811.
Update create-pr to ask for clear, short, human-readable prose in
the PR body and to reserve bullet lists for cases where prose would
genuinely be unreadable, such as long enumerations or benchmark
matrices.

For issue solvcon#811.
Make step 2 explicit about dirty working trees: switch to
git status --porcelain, show staged, unstaged, and untracked files
separately, and ask the user how to proceed before staging anything.
Forbid git add -A and git add . without confirmation so that stray
local files do not enter the PR. Abort when the branch has no
commits ahead of master.

Drop the absolute force-push ban. Force-pushing a private fork
branch before the PR exists is normal practice, and the absolute
rule blocks legitimate history cleanup during iteration. Pushing
directly to master/main and using --no-verify are still banned.

Expand the post-creation inline-annotations reminder. Instead of
just telling the user to add annotations, recommend the points that
help the reviewer most: non-obvious decisions, subtle logic,
intentional-looking dead code, known limitations and test-coverage
gaps, and tricky diffs that mix reformatting with substantive edits.

For issue solvcon#811.
The protocol requires a global PR comment that asks the maintainer
to review when the PR is ready. Previously the skill drafted that
comment, asked for approval, and posted it via gh pr comment. That
blurred the line between the skill helping with mechanics and the
skill speaking for the author.

After creation the skill now only reminds the user, in plain
language, that opening the review-request comment is their job.
The skill no longer drafts the comment text and no longer calls
gh pr comment.

For issue solvcon#811.
Copy link
Copy Markdown
Collaborator Author

@tigercosmos tigercosmos left a comment

Choose a reason for hiding this comment

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

@yungyuc Please take a look. I would suggest merging it first and revise it later based on real usage.

Comment thread .claude/skills/create-pr/SKILL.md Outdated

# Create Pull Request (modmesh)

Authoritative reference is issue solvcon/modmesh#811 and the "Pull Request
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

We can also remove this statement. I chose to keep it for now.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Please remove this reference. After merging this PR, this file becomes the authoritative reference.

skill drafts text, present it for the user's review and edits before
posting.

## Workflow
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Workflow confirmed while opening this PR.

contain the literal token `BODY` on its own line, swap the delimiter
to something unique (e.g. `BODY_EOF_811`).

5. **After creation.** Report the PR URL back to the user. Then:
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

My favor part.

@yungyuc yungyuc added the agent Work for AI agent label May 23, 2026
Copy link
Copy Markdown
Member

@yungyuc yungyuc left a comment

Choose a reason for hiding this comment

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

  • Remove the reference to issue #811.

Comment thread .claude/skills/create-pr/SKILL.md Outdated

# Create Pull Request (modmesh)

Authoritative reference is issue solvcon/modmesh#811 and the "Pull Request
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Please remove this reference. After merging this PR, this file becomes the authoritative reference.

@tigercosmos tigercosmos requested a review from yungyuc May 23, 2026 23:51
@tigercosmos
Copy link
Copy Markdown
Collaborator Author

@yungyuc please take a look. Thanks!

@tigercosmos
Copy link
Copy Markdown
Collaborator Author

I like the skill:
Screenshot 2026-05-24 at 8 53 19 AM

Copy link
Copy Markdown
Member

@yungyuc yungyuc left a comment

Choose a reason for hiding this comment

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

LGTM. I'll merge once CI finishes.

@yungyuc yungyuc merged commit acb88a8 into solvcon:master May 24, 2026
14 checks passed
@yungyuc yungyuc added the refactor Change code without changing tests label May 24, 2026
@yungyuc yungyuc mentioned this pull request May 24, 2026
@yungyuc yungyuc linked an issue May 24, 2026 that may be closed by this pull request
yungyuc added a commit that referenced this pull request May 24, 2026
Add .github/pull_request_template.md so the modmesh PR protocol is surfaced at
the moment of opening a PR rather than only in issue text.  The template
carries the review protocol described in issue #811 and used in PR #812.
@tigercosmos tigercosmos deleted the worktree-pr-skill-811 branch May 24, 2026 02:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agent Work for AI agent refactor Change code without changing tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Create PR templates

2 participants