From 5b0830b8609b656c3cde040a1b4cbb4f39a4ffec Mon Sep 17 00:00:00 2001 From: nkoji21 <133028205+nkoji21@users.noreply.github.com> Date: Fri, 5 Jun 2026 19:42:00 +0900 Subject: [PATCH] =?UTF-8?q?chore(cursor):=20Agent=20=E3=83=AF=E3=83=BC?= =?UTF-8?q?=E3=82=AF=E3=83=95=E3=83=AD=E3=83=BC=E3=81=AE=E3=82=B0=E3=83=AD?= =?UTF-8?q?=E3=83=BC=E3=83=90=E3=83=AB=E3=83=AB=E3=83=BC=E3=83=AB=E3=82=92?= =?UTF-8?q?=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit スキル未使用で gh/git を直叩きする問題と、スラッシュコマンドとの二重管理を解消する。 Co-authored-by: Cursor --- .cursor/commands/branch.md | 13 ---------- .cursor/commands/commit-en.md | 40 ------------------------------- .cursor/commands/commit.md | 40 ------------------------------- .cursor/commands/pr.md | 20 ---------------- .cursor/rules/agent-workflows.mdc | 27 +++++++++++++++++++++ .cursor/rules/communication.mdc | 4 ---- 6 files changed, 27 insertions(+), 117 deletions(-) delete mode 100644 .cursor/commands/branch.md delete mode 100644 .cursor/commands/commit-en.md delete mode 100644 .cursor/commands/commit.md delete mode 100644 .cursor/commands/pr.md create mode 100644 .cursor/rules/agent-workflows.mdc diff --git a/.cursor/commands/branch.md b/.cursor/commands/branch.md deleted file mode 100644 index daca1fe..0000000 --- a/.cursor/commands/branch.md +++ /dev/null @@ -1,13 +0,0 @@ ---- -name: branch -description: ブランチ名を提案して作成 ---- - -Ask about the task and suggest 3 appropriate branch names. - -Naming convention: -- Prefix: feat/fix/refactor/docs/chore/test -- Format: {prefix}/{specific-content-in-kebab-case} -- Examples: feat/user-auth, fix/login-error, refactor/api-client - -Create the selected branch. diff --git a/.cursor/commands/commit-en.md b/.cursor/commands/commit-en.md deleted file mode 100644 index 7801817..0000000 --- a/.cursor/commands/commit-en.md +++ /dev/null @@ -1,40 +0,0 @@ ---- -name: commit-en -description: 変更をコミット(英語、Conventional Commits準拠) ---- - -Review current changes and **propose** a commit message following Conventional Commits. -Do not run `git commit` unless the user explicitly requests execution. - -## Principle -- Write **Why** (why the change was made) in the commit message. Leave What to the diff. - -## Commit Granularity -- 1 commit = 1 logical change -- Separate refactoring and feature additions -- Tests can be in the same commit as the main code -- Formatting-only changes should be separate - -## Commit Message Format -Conventional Commits v1.0.0 - -Format: `type(scope): description` -- scope: optional (e.g., `alacritty`, `vim`, `git`) -- **description: in English** (e.g., `feat(alacritty): add opacity configuration`) - -Types: -- `feat`: new feature -- `fix`: bug fix -- `docs`: documentation only -- `style`: formatting, whitespace -- `refactor`: code change without bug fix or feature -- `perf`: performance improvement -- `test`: add/update tests -- `build`: build system, dependencies -- `chore`: other configs, tooling -- `ci`: CI configuration - -Required footer: -``` -Co-Authored-By: Cursor Agent -``` diff --git a/.cursor/commands/commit.md b/.cursor/commands/commit.md deleted file mode 100644 index 496e03d..0000000 --- a/.cursor/commands/commit.md +++ /dev/null @@ -1,40 +0,0 @@ ---- -name: commit -description: 変更をコミット(日本語、Conventional Commits準拠) ---- - -Review current changes and **propose** a commit message following Conventional Commits. -Do not run `git commit` unless the user explicitly requests execution. - -## Principle -- Write **Why** (why the change was made) in the commit message. Leave What to the diff. - -## Commit Granularity -- 1 commit = 1 logical change -- Separate refactoring and feature additions -- Tests can be in the same commit as the main code -- Formatting-only changes should be separate - -## Commit Message Format -Conventional Commits v1.0.0 - -Format: `type(scope): description` -- scope: optional (e.g., `alacritty`, `vim`, `git`) -- **description: in Japanese** (e.g., `feat(alacritty): 透明度設定を追加`) - -Types: -- `feat`: new feature -- `fix`: bug fix -- `docs`: documentation only -- `style`: formatting, whitespace -- `refactor`: code change without bug fix or feature -- `perf`: performance improvement -- `test`: add/update tests -- `build`: build system, dependencies -- `chore`: other configs, tooling -- `ci`: CI configuration - -Required footer: -``` -Co-Authored-By: Cursor Agent -``` diff --git a/.cursor/commands/pr.md b/.cursor/commands/pr.md deleted file mode 100644 index f48f1d0..0000000 --- a/.cursor/commands/pr.md +++ /dev/null @@ -1,20 +0,0 @@ ---- -name: pr -description: PRを作成(日本語) ---- - -Review current branch changes and create a PR **as draft**. - -If a PR template exists in the project, follow it. -Otherwise, use the format below. - -**Write all content in Japanese.** - -## What -変更内容を簡潔に - -## Why -変更理由 - -## Notes -レビュー時の注意点(不要なら削除) diff --git a/.cursor/rules/agent-workflows.mdc b/.cursor/rules/agent-workflows.mdc new file mode 100644 index 0000000..77e68d1 --- /dev/null +++ b/.cursor/rules/agent-workflows.mdc @@ -0,0 +1,27 @@ +--- +description: Agent Skills の利用とリポジトリテンプレート優先 +alwaysApply: true +--- + +# Agent Skills + +タスクに対応するスキルが利用可能なときは、**作業前に必ず `SKILL.md` を Read してから**実行する。スキルに手順があるコマンドを直接叩かない。 + +| タスク | スキル | 直接実行禁止 | +| --- | --- | --- | +| コミット | `git-commit-ja` | `git commit` | +| PR 作成 | `git-pr-ja` | `gh pr create` / `gh pr edit` | +| ブランチ作成 | `git-branch` | — | + +スラッシュコマンド(`.cursor/commands/`)は使わない。上記スキルに従う。 + +# リポジトリテンプレート優先 + +コミットメッセージ・PR 本文など、リポジトリにテンプレートがある場合は **必ずテンプレートを正** とする。 + +1. 作業前にリポジトリ内のテンプレートを探して Read する(例: `.github/pull_request_template.md`、`.github/commit_template`、`.gitmessage`) +2. テンプレートのセクション構成・チェックリストに沿って記載する +3. テンプレートに無いが必要な情報はセクションを追加してよい +4. テンプレートにあっても今回不要なセクションは省略してよい(空セクションを残さない) + +スキル内のデフォルトフォーマットや、File Changes で分かる実装詳細はテンプレート・Summary/Why に重複させない。特に PR の **Changes** はアプローチ概要のみ。変更ファイル名・関数名・配線内容の列挙は書かない。 diff --git a/.cursor/rules/communication.mdc b/.cursor/rules/communication.mdc index 734c391..6a4e2b1 100644 --- a/.cursor/rules/communication.mdc +++ b/.cursor/rules/communication.mdc @@ -12,7 +12,3 @@ alwaysApply: true - Question suboptimal approaches - Propose better solutions proactively - Prioritize correctness over compliance - -# Conventions - -See `/commit`, `/commit-en`, `/pr`, `/branch` for details.