From ba53a92792d11b57c5e61003f15e093679379446 Mon Sep 17 00:00:00 2001 From: nkoji21 <133028205+nkoji21@users.noreply.github.com> Date: Tue, 2 Jun 2026 15:35:25 +0900 Subject: [PATCH] =?UTF-8?q?docs(skills):=20PR=E4=BD=9C=E6=88=90=E3=83=AB?= =?UTF-8?q?=E3=83=BC=E3=83=AB=E3=81=AE=E9=80=B8=E8=84=B1=E3=82=92=E9=98=B2?= =?UTF-8?q?=E3=81=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude --- .agents/skills/git-pr-ja/SKILL.md | 17 ++++++++++++++++- .agents/skills/git-pr/SKILL.md | 16 +++++++++++++++- 2 files changed, 31 insertions(+), 2 deletions(-) diff --git a/.agents/skills/git-pr-ja/SKILL.md b/.agents/skills/git-pr-ja/SKILL.md index f77992b..c04fa31 100644 --- a/.agents/skills/git-pr-ja/SKILL.md +++ b/.agents/skills/git-pr-ja/SKILL.md @@ -5,4 +5,19 @@ user-invocable: true allowed-tools: Bash, Skill --- -Use /git-pr to create the PR, but write the PR title and body **in Japanese**. +Before creating a PR, read `.agents/skills/git-pr/SKILL.md` and follow it +completely. The Japanese rules below are additional hard requirements, not a +replacement for `/git-pr`. + +## Hard Requirements + +- Use `/git-pr` to create the PR. +- Create a draft PR. Use `gh pr create --draft`. +- Check whether a PR template exists before writing the body. If one exists, + follow it. +- If no template exists, use the `/git-pr` default body structure: + `close`, `Summary`, `Changes`, and `Notes`. +- Write the PR title and body in Japanese. +- Never pass a Markdown PR body inline through the shell. Write the body to a + temporary file and use `gh pr create --body-file ` or + `gh pr edit --body-file `. diff --git a/.agents/skills/git-pr/SKILL.md b/.agents/skills/git-pr/SKILL.md index f36ff91..dfb7b87 100644 --- a/.agents/skills/git-pr/SKILL.md +++ b/.agents/skills/git-pr/SKILL.md @@ -23,13 +23,27 @@ Review current branch changes and autonomously create a PR as draft. If a `--path ` argument is provided (e.g. invoked as `git-pr --path /tmp/feat-foo`), all git and gh commands must be run inside that directory by prepending `cd &&` to every Bash command. This overrides the current working directory. +## Hard Requirements + +- Always create the PR as a draft. Use `gh pr create --draft`. +- Check whether a PR template exists before writing the body. If one exists, + follow it. +- Never pass a Markdown PR body inline through the shell. Write the body to a + temporary file and use `gh pr create --body-file ` or + `gh pr edit --body-file `. +- After creating the PR, verify it with: + `gh pr view --json isDraft,title,body,baseRefName,headRefName,url` + 1. Run `git log --oneline main..HEAD` and `git diff main...HEAD` to understand the changes 2. **Granularity check** (skip if `--path` was provided — the caller already performed this check): Before writing the PR, assess whether the changes belong to a single concern: - Group changed files by what they do (feature, test, config, infra, docs, etc.) - If changes span 2+ unrelated concerns (e.g. a feature AND an infra fix), stop and tell the user which concerns were identified and suggest splitting into separate PRs. Do not create the PR until the user confirms to proceed as-is or asks you to split. - A PR is appropriately sized if a reviewer can understand it in one sitting. More than ~400 changed lines or 3+ unrelated concerns is a signal to split. 3. If a PR template exists in the project, follow it -4. Autonomously decide the PR title and body, then create it with `gh pr create --draft` +4. Autonomously decide the PR title and body, then create it with + `gh pr create --draft --body-file ` +5. Verify the created PR with + `gh pr view --json isDraft,title,body,baseRefName,headRefName,url` ## PR Format (if no template exists)