.cursor/skills/create-pull-request/SKILL.md
Run on the develop branch: create a new branch (name or issue number), then create a pull request with a well-structured description following the project PR template. Use when the user asks to "create a PR", "make a pull request", "open a PR", or "PRを作成して". Branch name or issue number (e.g. "feature/add-login" or "123" → feature/123) should be obtained from the user message or requested if missing. PR base (--base) must target the current integration branch (e.g. develop or the branch you branched from), never main unless the user explicitly requests a release PR.
npx skillsauth add otomatty/zedi create-pull-requestInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
This skill uses develop as the default --base branch for Zedi. Do not use main as --base unless the user explicitly asks for a release or mainline merge PR.
Skills / .cursor/skills/ (and similar workflow-only changes): Open the PR so it merges into the branch you were on when you created the topic branch (the current integration line)—typically develop after git checkout -b from develop, or a parent feature branch if you branched from there. Never open Skills-only PRs with --base main by default.
If the current branch already contains the intended commits, reuse that branch and create or update the PR from it. When creating a new branch, obtain the branch name from the user (e.g. feature/add-login) or derive it from an issue number (e.g. 123 → feature/123). If neither is provided, ask the user.
Recording BASE_BRANCH: Right before git checkout -b <topic>, note the branch name you are leaving (e.g. PARENT=$(git branch --show-current)); use that as BASE_BRANCH for gh pr create --base. If you did not create a new branch, use develop when it is the integration branch, or the branch the user specifies.
git status # current state
git branch --show-current # develop → new branch; other → reuse if has commits
gh auth status # GitHub CLI authenticated
If current branch is develop
git pull --ff-only origin develop.feature/add-login) or issue number (e.g. 123 → feature/123). If missing, ask: "ブランチ名(例: feature/add-login)またはイシュー番号(例: 123)を教えてください."BASE_BRANCH=$(git branch --show-current) (on develop, this is develop—use this for gh pr create --base, not main).git checkout -b <ブランチ名>.If current branch is not develop
git log develop..HEAD --oneline is non-empty, keep using the current branch (reuse for PR create/update).develop and pull with carried-over changes; ask the user to commit or stash first, or to branch from the current state explicitly.develop after a clean state, then follow the "If current branch is develop" path.Run Phase 1 commands in parallel (they are independent), then Phase 2.
# BASE_BRANCH: branch to merge into (never default to main for Skills / routine work).
# Prefer PARENT captured before `git checkout -b`, else develop for Zedi.
BASE_BRANCH="${BASE_BRANCH:-develop}"
CURRENT=$(git branch --show-current)
echo "Branch: $CURRENT -> $BASE_BRANCH (merge target)"
# 1b. Commit list (chronological)
git log ${BASE_BRANCH}..HEAD --format="%h %s" --reverse
# 1c. Changed files summary
git diff ${BASE_BRANCH}..HEAD --stat
# 1d. Changes grouped by directory
git diff ${BASE_BRANCH}..HEAD --dirstat=files,0
# 1e. Commit type breakdown (Conventional Commits)
git log ${BASE_BRANCH}..HEAD --format="%s" | grep -oP '^\w+(\(\w+\))?' | sort | uniq -c | sort -rn
# 1f. Related issue numbers
git log ${BASE_BRANCH}..HEAD --format="%s" | grep -oP '#\d+' | sort -u
# 1g. Check for existing PR
gh pr list --base ${BASE_BRANCH} --head ${CURRENT} --state all --json number,title,state
# 1h. Recent PRs for style reference
git log ${BASE_BRANCH} --oneline -5
# 2a. DB migrations
git diff ${BASE_BRANCH}..HEAD --name-only -- '*.sql' '**/drizzle/**' '**/migrations/**'
# 2b. Environment variable changes
git diff ${BASE_BRANCH}..HEAD -- '*.env.example' '*.env.sample'
# 2c. Package dependency changes
git diff ${BASE_BRANCH}..HEAD -- '**/package.json' '**/bun.lockb' '**/pnpm-lock.yaml'
# 2d. Schema / type changes
git diff ${BASE_BRANCH}..HEAD -- '**/schema/**' '**/*.d.ts'
# 2e. API route changes
git diff ${BASE_BRANCH}..HEAD --name-only -- '**/routes/**' '**/api/**'
# 2f. CI / workflow changes
git diff ${BASE_BRANCH}..HEAD --name-only -- '.github/**'
# 2g. Terraform / infra changes
git diff ${BASE_BRANCH}..HEAD --name-only -- '**/terraform/**'
cat .github/PULL_REQUEST_TEMPLATE.md
Always use the project's PR template as the output format.
Run before pushing:
bun run lint
bun run format:check
bun run test:run
If any command fails, fix the issues and amend or add a commit, then re-run until all pass.
Using the investigation results, fill in the PR template. Follow these rules:
admin/, server/api/, terraform/).(ローカル専用の docs/ はコミットに含まれないため PR の変更一覧には通常出ない)| 領域 | 主な変更 |
| ------------- | ------------------------------------ |
| `admin/` | 管理画面UI、認証ガード、AIモデル管理 |
| `server/api/` | admin用ミドルウェア、ロール追加 |
admin/src/pages/, src/components/, etc.), note that screenshots should be added.Closes #NNN for each related issue found in Phase 1-1f.Related to #NNN for issues that are referenced but not fully resolved.git push -u origin HEAD
gh pr create \
--base "${BASE_BRANCH}" \
--title "PR title here" \
--body "$(cat <<'EOF'
<assembled PR body here>
EOF
)"
If Phase 1-1g found an existing PR for the current branch, update its body instead of creating a new branch and PR:
gh pr edit <NUMBER> --body "$(cat <<'EOF'
<assembled PR body here>
EOF
)"
Derive the PR title from commit messages:
| Situation | Action |
| ---------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- |
| Not on develop (has commits) | Reuse current branch; create or update PR from it |
| On develop | Pull, create new branch (get name from user), then create or update PR |
| Branch name / issue missing | Ask user for branch name or issue number |
| Working tree dirty on branch | Commit on the new branch before investigation |
| Existing PR found | Update that PR's body instead of creating a new PR |
| Base branch not specified | Default to develop; never main unless user asks for release PR. For stacked work, use parent branch captured before git checkout -b |
| PR is very large (>50 files) | Suggest splitting, but proceed if user confirms |
| Lint/format/test fail | Fix, commit, then re-run Step 3 before pushing |
After creating or updating the PR, return:
documentation
Zenn 記事を A先輩と B後輩の対話形式で執筆する。 Q&A のように疑問点にピンポイントで答える構成で、 初心者がつまずきやすいポイントを自然に解消する。 "対話形式で記事を書いて", "会話形式の記事", "dialogue article", "対話記事", "先輩後輩の会話で記事" などで起動する。
documentation
Zenn 記事の執筆・推敲を、体験ベースで読みやすいトーンに仕上げる。 AIっぽい定型表現を排除し、実践報告として説得力のある文章を生成する。 "Zenn記事を書いて", "記事の下書き", "ブログ記事を書く", "記事を推敲して", "write a Zenn article", "draft a blog post" などで起動する。
development
Runs Stryker mutation tests only on git-changed production files under `src/` via `scripts/stryker-mutate-changed.mjs` and `bun run test:mutation:changed`. Uses `stryker.config.mutation-changed.mjs` so partial runs do not fail on global `thresholds.break`. Use when the user asks for mutation testing on changed files only, incremental mutation test, diff-based Stryker, or "差分だけミューテーション" / "mutation test for current changes". After a run, use `bun run mutation:report:summary` and attach `reports/mutation/mutation-summary.md` for AI explanation (not HTML).
development
手元の実装変更、または現在ブランチとターゲットブランチの差分を、 関連コード(テスト・依存先・呼び出し元)も含めて AI レビューし、結果をマークダウンファイルに出力する。 "レビューして", "実装をレビュー", "変更をチェック", "review my changes", "self review", "セルフレビュー", "develop との差分をレビュー", "ブランチの差分をチェック", "review branch diff" などで起動する。