Skip to content

Commit 46ec520

Browse files
authored
Merge pull request #9 from kinopeee/devin/1763390113-restore-pr6-v2
feat: 外部コンテキストインジェクション防御機能の追加と多言語対応への再編成
2 parents 78af805 + 86b96f8 commit 46ec520

28 files changed

Lines changed: 1973 additions & 72 deletions

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11
.DS_Store
2-
#.cursor/commands/
2+
3+
# .cursor 内のすべてのファイルを無視する
4+
/.cursor/*

README.md

Lines changed: 111 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,70 +1,134 @@
1-
# cursorrules 「v5」
1+
# cursorrules "v5"
22

3-
[English](README.en.md) | 日本語
3+
🇬🇧 **English** | 🇯🇵 **日本語**
44

5-
このリポジトリは、Cursor用のカスタムインストラクションを管理するためのものです。
5+
---
66

7-
## 前提
7+
## 🌏 Select Your Language / 言語を選択
88

9-
- この`v5`は、Cursor Agent に最適化されたカスタムインストラクションです
10-
- Cursor Agent が自走(人の介入を受けずに自律処理)ができる前提として、Auto-Run の設定が適切に行われている必要があります。
11-
- 最新の更新内容については[更新履歴](CHANGELOG.md)を参照してください。
9+
This repository provides custom instructions and custom commands optimized for Cursor.
10+
このリポジトリは、Cursor 用に最適化されたカスタムインストラクションやカスタムコマンドを提供します。
1211

13-
## 概要
12+
### 📂 Language-specific Documentation
1413

15-
- Cursor のエージェント機能がリリースされてから、様々なパターンの処理を通して感じたのが「分析力の不足」でした。そのため、モデル(当時のClaude 3.5 Sonnet)が本来持っている分析能力を引き出せるように工夫し始めたのが、私のカスタムインストラクション作成の始まりです。
16-
- 当初のテーマは、分析能力向上と自走力を高めることがでしたが、その後、モジュールやリソースの重複生成、意図せぬ、AIによるデザインの変更、エラー処理の無限ループなどの防止にも取り組み、モデルの刷新と性能向上と相まって、それなりの成果を残せたように思います。
17-
- このバージョンアップグレードのフォーカスは GPT-5.1 最適化です:
18-
1. チェックリスト式の実装計画を立ててから着手。実行後はチェックリストごとに完了を確認することで、より計画性の高いタスク遂行が可能になっています。
19-
1. タスクを軽量・標準・重要の3段階に分類し、軽量タスクでは1〜2文の簡潔な報告にとどめ、重いタスクほど手順と検証を厚くするようになっています。
20-
1. 並行処理できるタスクは並行処理を行うことで、処理速度が向上します。
21-
- さらに、`read_file``apply_patch``run_terminal_cmd` などのツール利用ポリシーを明文化し、常に安全な手順・権限でタスクを進めるワークフローを整備しています。
22-
- `v5` は、初期にAnthropic Prompt Generatorで作成、それ以降、その時期の最新モデルによる評価、実践による改善を繰り返してきました。カスタマイズの際も、お使いになるAIによる評価を行うことを推奨します。
23-
- 詳細な更新内容(タスク分類、エラー処理の段階化、ツール利用ポリシーなど)については[CHANGELOG.md](CHANGELOG.md)を参照してください。
14+
- 🇯🇵 **日本語版**: [ja/README.md](ja/README.md)
15+
- 🇬🇧 **English**: [en/README.md](en/README.md)
2416

25-
- また、本リポジトリ自体がベストプラクティス例として、コミットメッセージ/PRメッセージのルールファイルおよびコミット・プッシュ・PR作成のワークフローコマンドのサンプルを含んでいます。
17+
---
2618

27-
## 使用方法
19+
## ⚡ Quick Start
2820

29-
1. `.cursor/rules` がまだ存在しない場合は、フォルダを作成してください。
30-
2. パスが存在する場合は、そこに `v5.en.mdc`(英語)または `v5.mdc`(日本語)を保存してください。
31-
3. テスト方針ルールを有効にしたい場合は、同じフォルダに `test-strategy.mdc`(日本語)または `test-strategy.en.mdc`(英語)を保存してください。
32-
4. コミットメッセージ規約を有効にしたい場合は、同じフォルダに `commit-message-format.mdc`(日本語)または `commit-message-format.en.mdc`(英語)を保存してください。
33-
5. PR メッセージ規約を有効にしたい場合は、同じフォルダに `pr-message-format.mdc`(日本語)または `pr-message-format.en.mdc`(英語)を保存してください。
34-
- これらのテスト方針ルールの適用条件はデフォルトで「always」となっているため、所定のパスに存在していれば、それ以降のチャットで自動的に参照されます。
35-
- 日本語版・英語版の両方で `alwaysApply: true` が設定されているため、利用したい言語やテストルールをデフォルトで有効にするかどうかに応じて、この設定を調整してください。
36-
- これらを有効にすると、テストコードの実装・修正タスクでは、本リポジトリで定義した等価分割・境界値分析やカバレッジ要件などのテスト方針ルールが自動的に適用されます。
21+
### For Japanese Users (日本語ユーザー向け)
3722

38-
ルールファイル(`.cursor/rules/*.mdc`)とワークフローコマンド(`.cursor/commands/*.md`)の役割分担と使い方については、[doc/rules-and-workflows.md](doc/rules-and-workflows.md) を参照してください。
23+
```bash
24+
# リポジトリをクローン
25+
git clone https://github.com/kinopeee/cursorrules.git
3926

40-
### ガードレール関連ファイル
27+
# 日本語版の設定をプロジェクトにコピー
28+
cp -r cursorrules/ja/.cursor ~/your-project/
29+
```
4130

42-
- `commit-message-format.mdc` / `commit-message-format.en.mdc`
43-
- **役割**: コミットメッセージのフォーマット(Prefix、サマリ、箇条書き本文など)と禁止事項を定義するファイルです。
44-
- **特徴**: Conventional Commits をベースにしつつ、`language` による言語指定や差分ベースのメッセージ生成といった、このリポジトリ向けのガイドラインを含みます。
31+
詳細は [ja/README.md](ja/README.md) をご覧ください。
4532

46-
- `pr-message-format.mdc` / `pr-message-format.en.mdc`
47-
- **役割**: PR タイトルおよび本文のフォーマット(Prefix 付きタイトル、構造化された「概要」「変更内容」「テスト内容」など)と禁止事項を定義するファイルです。
48-
- **特徴**: コミットメッセージ規約と整合する形で PR メッセージを構造化し、レビューや変更意図の把握をしやすくするためのガイドラインを提供します。
33+
### For English Users
4934

50-
- `test-strategy.mdc` / `test-strategy.en.mdc`
51-
- **役割**: テストコードの実装・修正タスク向けに、等価分割・境界値分析やカバレッジ要件などのテスト方針ルールを定義するファイルです。
52-
- **特徴**: 本番コードに意味のある変更が入る場合は対応する自動テストの追加・更新を求めるなど、品質面のガードレールとして機能します。
35+
```bash
36+
# Clone the repository
37+
git clone https://github.com/kinopeee/cursorrules.git
5338

39+
# Copy English configuration to your project
40+
cp -r cursorrules/en/.cursor ~/your-project/
41+
```
5442

55-
## 翻訳ガイド
43+
See [en/README.md](en/README.md) for details.
5644

57-
カスタムインストラクションを他言語へ翻訳する際の推奨プロンプトについては、[TRANSLATION_GUIDE.md](TRANSLATION_GUIDE.md) を参照してください。
45+
---
5846

59-
## 注意事項
47+
## 📋 What's Included / 含まれるもの
6048

61-
- User Rules、Memories に v5 と矛盾する指示が存在すると、モデルが混乱して、効果が減少します。それぞれの内容を十分にご確認ください。
49+
All rule files and workflow commands are available in both Japanese and English.
50+
すべてのルールファイルとワークフローコマンドに日本語版と英語版があります。
6251

63-
## ライセンス
52+
### ✅ Rule Files (`.cursor/rules/*.mdc`)
6453

65-
MITライセンスの下で公開されています。詳細については[LICENSE](LICENSE)ファイルを参照してください。
54+
- **v5.mdc** – Core coding support rules / コーディング支援ルール
55+
- **commit-message-format.mdc** – Commit message conventions / コミットメッセージ規約
56+
- **pr-message-format.mdc** – PR message conventions / PRメッセージ規約
57+
- **test-strategy.mdc** – Test strategy rules / テスト戦略ルール
58+
- **prompt-injection-guard.mdc** – Injection defense / インジェクション防御
6659

67-
## サポート
60+
### ⚙️ Workflow Commands (`.cursor/commands/*.md`)
6861

69-
- このリポジトリのサポートはありませんが、フィードバックは歓迎いたします。また、Cursor関連情報をX(Twitter)で発信しているので、ご興味あればご覧ください。
70-
[X(Twitter)](https://x.com/kinopee_ai)
62+
- **commit-only.md** – Commit only / コミットのみ
63+
- **commit-push.md** – Commit & push / コミット&プッシュ
64+
- **commit-push-pr.md** – Commit, push & PR / コミット&プッシュ&PR
65+
66+
> **📍 File Locations / ファイル配置**
67+
>
68+
> - **Repository**: `./ja/.cursor/` (日本語) / `./en/.cursor/` (English)
69+
> - **Your Project**: Copy to `.cursor/` in your project root
70+
>
71+
> For details, see [ja/README.md](ja/README.md) or [en/README.md](en/README.md).
72+
73+
---
74+
75+
## 🎯 Key Features / 主な特徴
76+
77+
### 🇯🇵 日本語
78+
79+
- **GPT-5.1 & Opus 4.5 最適化**: 適応的推論を活かした効率的なタスク実行
80+
- **3段階タスク分類**: 軽量・標準・重要タスクに応じた最適なプロセス
81+
- **並列実行**: 独立したタスクを並列処理して処理速度を向上
82+
- **安全なツール利用**: read_file/apply_patch/run_terminal_cmd の明確なポリシー
83+
- **包括的なガードレール**: コミット規約、PR規約、テスト戦略、セキュリティ防御
84+
85+
### 🇬🇧 English
86+
87+
- **GPT-5.1 & Opus 4.5 Optimized**: Efficient task execution leveraging adaptive reasoning
88+
- **3-Tier Task Classification**: Optimal processes for lightweight/standard/critical tasks
89+
- **Parallel Execution**: Improved throughput by parallelizing independent tasks
90+
- **Safe Tool Usage**: Clear policies for read_file/apply_patch/run_terminal_cmd
91+
- **Comprehensive Guardrails**: Commit conventions, PR conventions, test strategy, security defense
92+
93+
---
94+
95+
## 📖 Documentation / ドキュメント
96+
97+
### 🇯🇵 日本語
98+
99+
- [使い方ガイド](ja/README.md)
100+
- [変更履歴](ja/CHANGELOG.md)
101+
- [ルールとワークフロー](ja/doc/rules-and-workflows.md)
102+
- [プロンプトインジェクション防御](ja/doc/prompt-injection-guard.md)
103+
104+
### 🇬🇧 English
105+
106+
- [Usage Guide](en/README.md)
107+
- [Changelog](en/CHANGELOG.md)
108+
- [Rules and Workflows](en/doc/rules-and-workflows.md)
109+
- [Prompt Injection Guard](en/doc/prompt-injection-guard.md)
110+
111+
---
112+
113+
## 📄 License / ライセンス
114+
115+
MIT License - See [LICENSE](LICENSE) for details.
116+
MITライセンス - 詳細は [LICENSE](LICENSE) を参照してください。
117+
118+
---
119+
120+
## 💬 Support / サポート
121+
122+
### 🇯🇵 日本語
123+
124+
このリポジトリに公式サポートはありませんが、フィードバックは歓迎します。
125+
Cursor関連情報を X (Twitter) で発信しています: [@kinopee_ai](https://x.com/kinopee_ai)
126+
127+
### 🇬🇧 English
128+
129+
There is no official support for this repository, but feedback is welcome.
130+
Follow on X (Twitter) for Cursor-related updates: [@kinopee_ai](https://x.com/kinopee_ai)
131+
132+
---
133+
134+
## Made with ❤️ for Cursor IDE users worldwide
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ It does **not** handle pushing to the remote or enforcing branch strategies (suc
88
## Preconditions
99

1010
- There are modified files.
11-
- The commit message format is defined by a rule file such as `.cursor/rules/commit-message-format.en.mdc` (or `.mdc` for other languages).
11+
- The commit message format is defined by a rule file such as `.cursor/rules/commit-message-format.mdc`.
1212

1313
## Steps (non-interactive)
1414

@@ -48,7 +48,7 @@ git commit -m "<Prefix>: <summary (imperative / concise)>"
4848

4949
## Notes
5050

51-
- The commit message format and message generation principles should follow `.cursor/rules/commit-message-format.en.mdc` (or the appropriate language-specific rule file).
51+
- The commit message format and message generation principles should follow `.cursor/rules/commit-message-format.mdc`.
5252
- Branch strategy (e.g. disallowing direct commits to main) and pushing to the remote (`git push`) are **out of scope** for this command. Define those in project-specific README / CONTRIBUTING / separate commands as needed.
5353

5454

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,12 +163,12 @@ git log origin/main..HEAD --oneline
163163
164164
## PR title and message rules
165165

166-
- Detailed PR title and body format should follow `.cursor/rules/pr-message-format.en.mdc` (or the appropriate language-specific rule file).
166+
- Detailed PR title and body format should follow `.cursor/rules/pr-message-format.mdc`.
167167
- This command assumes you write PR messages using the structured format defined in that rule (e.g. Overview / Changes / Tests).
168168

169169
## Notes
170170

171-
- Commit message formatting and generation principles should follow `.cursor/rules/commit-message-format.en.mdc`.
171+
- Commit message formatting and generation principles should follow `.cursor/rules/commit-message-format.mdc`.
172172
- Always review diffs with `git status` and `git diff` before running this command.
173173

174174
## Troubleshooting
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ git push -u origin "$BRANCH"
7979

8080
## Notes
8181

82-
- Commit message formatting and generation principles should follow `.cursor/rules/commit-message-format.en.mdc` (or another language-specific rule file).
82+
- Commit message formatting and generation principles should follow `.cursor/rules/commit-message-format.mdc`.
8383
- Always review diffs with `git status` or `git diff` before executing this command.
8484

8585

File renamed without changes.

0 commit comments

Comments
 (0)