Skip to content

Commit cf79da6

Browse files
nkoji21claude
andcommitted
refactor(skills): simplify -ja skills to thin wrappers over English counterparts
Japanese skill variants were duplicating the full instruction set from their English counterparts. Replaced with minimal wrappers that delegate to the English skill and override only the output language, reducing context overhead. Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 3708b50 commit cf79da6

3 files changed

Lines changed: 7 additions & 224 deletions

File tree

.agents/skills/git-commit-ja/SKILL.md

Lines changed: 2 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -4,63 +4,6 @@ description: Review changes and autonomously commit (Japanese)
44
user-invocable: true
55
---
66

7-
Review current changes and autonomously commit following Conventional Commits.
7+
Use /git-commit to perform the commit, but write the commit message description **in Japanese**.
88

9-
1. Run `git status`, `git diff`, and `git log --oneline -5` to understand the changes and context
10-
2. Decide the commit message autonomously
11-
3. Stage and commit using `git apply` (see below)
12-
13-
## Principle
14-
- Write **Why** (why the change was made) in the commit message. Leave What to the diff.
15-
- Each commit must be **independently revertable** without breaking other functionality.
16-
17-
## Commit Granularity
18-
- 1 commit = 1 logical change
19-
- Examine individual hunks, not entire files — split if needed
20-
- Separate refactoring and feature additions
21-
- Tests can be in the same commit as the main code
22-
- Formatting-only changes should be separate
23-
24-
## Staging with git apply
25-
26-
Never use interactive commands like `git add -p`. Instead:
27-
28-
```bash
29-
# 1. Generate patch for the target changes
30-
git diff > patch.diff
31-
32-
# 2. Verify before applying (no file changes on failure)
33-
git apply --cached --check patch.diff
34-
35-
# 3. Apply to staging area (equivalent to git add)
36-
git apply --cached patch.diff
37-
```
38-
39-
If `git apply --cached` fails, try in order:
40-
1. `git apply --cached --whitespace=fix patch.diff`
41-
2. `git apply --cached --ignore-space-change patch.diff`
42-
3. Fall back to `git add <files>` for the specific files
43-
44-
## Commit Message Format
45-
Conventional Commits v1.0.0
46-
47-
Format: `type(scope): description`
48-
- scope: optional (e.g., `alacritty`, `vim`, `git`)
49-
- **description: in Japanese** (e.g., `feat(alacritty): 透明度設定を追加`)
50-
51-
Types:
52-
- `feat`: new feature
53-
- `fix`: bug fix
54-
- `docs`: documentation only
55-
- `style`: formatting, whitespace
56-
- `refactor`: code change without bug fix or feature
57-
- `perf`: performance improvement
58-
- `test`: add/update tests
59-
- `build`: build system, dependencies
60-
- `chore`: other configs, tooling
61-
- `ci`: CI configuration
62-
63-
Required footer:
64-
```
65-
Co-Authored-By: Claude <noreply@anthropic.com>
66-
```
9+
Example: `feat(alacritty): 透明度設定を追加`

.agents/skills/git-pr-ja/SKILL.md

Lines changed: 1 addition & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -4,37 +4,4 @@ description: Review branch changes and autonomously open a PR (Japanese)
44
user-invocable: true
55
---
66

7-
Review current branch changes and autonomously create a PR as draft.
8-
9-
**Current branch:** `!`git branch --show-current``
10-
11-
**Commits since main:**
12-
```
13-
!`git log --oneline main..HEAD`
14-
```
15-
16-
**Diff stat:**
17-
```
18-
!`git diff --stat main...HEAD`
19-
```
20-
21-
1. Run `git log --oneline main..HEAD` and `git diff main...HEAD` to understand the changes
22-
2. If a PR template exists in the project, follow it
23-
3. Autonomously decide the PR title and body, then create it with `gh pr create --draft`
24-
25-
## PR Format (if no template exists)
26-
27-
close #{issue_number}
28-
(関連issueがない場合はこの行を削除)
29-
30-
## Summary
31-
なぜこの変更をしたか。実装内容ではなく動機を書く。
32-
33-
## Changes
34-
変更の方針・構造レベルの概要のみ。実装詳細はFile Changesで確認できるので書かない。
35-
36-
## Notes
37-
レビュアーに伝えるべき特記事項。不要なら削除。
38-
39-
**日本語で記述。**
40-
**簡潔に。実装詳細はdiffに任せる。**
7+
Use /git-pr to create the PR, but write the PR title and body **in Japanese**.

.agents/skills/pr-flow-ja/SKILL.md

Lines changed: 4 additions & 131 deletions
Original file line numberDiff line numberDiff line change
@@ -5,135 +5,8 @@ user-invocable: true
55
allowed-tools: Bash, Skill, Agent
66
---
77

8-
ステージ済みの変更からsquash-mergeされたPRまで、プルリクエストの全ワークフローを自動化します。
8+
Use /pr-flow to run the full PR workflow, but with the following language overrides:
99

10-
**現在のブランチ:** `!`git branch --show-current``
11-
12-
**作業ツリーの状態:**
13-
```
14-
!`git status --short`
15-
```
16-
17-
## Phase 1: Worktree
18-
19-
`git-worktree` スキルを Skill ツールで実行する。
20-
21-
worktreeパス(例: `/tmp/feat-foo`)とブランチ名が返される。両方を保存する:
22-
- `WORKTREE_PATH` — worktreeへの絶対パス
23-
- `BRANCH_NAME` — worktree内に作成されたブランチ名
24-
25-
## Phase 2: コミット
26-
27-
コミット前の HEAD sha を記録する:
28-
```
29-
BEFORE_SHA=$(git -C $WORKTREE_PATH rev-parse HEAD)
30-
```
31-
32-
`git-commit-ja` スキルを `--path $WORKTREE_PATH` 引数付きで Skill ツールで実行する。
33-
34-
スキル完了後、コミットが実行されたか確認する:
35-
```
36-
AFTER_SHA=$(git -C $WORKTREE_PATH rev-parse HEAD)
37-
```
38-
39-
`BEFORE_SHA == AFTER_SHA` の場合、worktreeをクリーンアップして停止する:
40-
```
41-
git worktree remove --force $WORKTREE_PATH
42-
```
43-
コミットする変更がなかったこと、元のリポジトリの変更はそのまま残っていることをユーザーに伝える。
44-
45-
## Phase 3: PR作成
46-
47-
`git-pr-ja` スキルを `--path $WORKTREE_PATH` 引数付きで Skill ツールで実行する。
48-
49-
スキル完了後、PR URLを取得する:
50-
```
51-
cd $WORKTREE_PATH && gh pr view --json url --jq '.url'
52-
```
53-
54-
`gh pr create` がPR既存エラーで失敗した場合は、同じコマンドで既存のPR URLを取得する。
55-
56-
このURLを保存する — 以降の `gh pr comment``gh pr merge` の呼び出しで使用する。
57-
58-
## Phase 4: レビューループ
59-
60-
このループは最大 **3回** まで実行できる。イテレーション数を0から追跡する。
61-
62-
### 4a. レビュアーサブエージェントの起動
63-
64-
Agent ツールで `pr-reviewer` サブエージェントを以下のプロンプト(実際のPR URLに置き換え)で起動する:
65-
66-
```
67-
Review the PR at <PR_URL>. Run `gh pr diff <PR_URL>` to get the diff. Analyze it for bugs, logic errors, security issues, and style/convention violations. Return structured findings exactly as your instructions specify — the REVIEW_RESULT block only, no prose outside it.
68-
```
69-
70-
### 4b. レビューコメントの検証と投稿
71-
72-
投稿前に、サブエージェントのレスポンスに `REVIEW_RESULT` ... `END_REVIEW_RESULT` ブロックが含まれているか確認する。ブロックが存在しないか不正な場合は、代わりに以下の警告を投稿してPhase 5に進む:
73-
```
74-
gh pr comment <PR_URL> --body "[Claude Codeによる自動レビュー] 警告:レビュアーが不正な出力を返しました。自動修正をスキップします。手動でレビューしてください。"
75-
```
76-
77-
正常な場合は、結果を投稿する:
78-
```
79-
gh pr comment <PR_URL> --body "[Claude Codeによる自動レビュー]
80-
81-
<フォーマットされたレビュー結果>"
82-
```
83-
84-
結果はmarkdownリスト形式で。各項目: 重要度ラベル(`must-fix` / `suggestion` / `nitpick`)、ファイル/箇所、説明。
85-
86-
### 4c. 結果の評価
87-
88-
- **問題なし**`issues: []` を含む)または **`suggestion`/`nitpick` のみ**: Phase 5に進む。
89-
- **`must-fix` が存在し、かつ iteration < 3**:
90-
- 指摘されたファイルを読んでから編集する。各 `must-fix` 問題を修正する。
91-
- git-commit 実行前の HEAD sha を記録する:
92-
```
93-
FIX_BEFORE=$(git -C $WORKTREE_PATH rev-parse HEAD)
94-
```
95-
- `git-commit-ja` スキルを `--path $WORKTREE_PATH` 引数付きで Skill ツールで実行して修正をコミットする。
96-
- コミットが実際に行われたか確認する:
97-
```
98-
FIX_AFTER=$(git -C $WORKTREE_PATH rev-parse HEAD)
99-
```
100-
- `FIX_BEFORE == FIX_AFTER`(コミットなし)の場合: 修正をコミットできなかった旨のコメントを投稿し、worktreeをクリーンアップ(`git worktree remove --force $WORKTREE_PATH`)してから停止する。ループしないこと。
101-
- イテレーション数をインクリメントして4aに戻る。
102-
- **`must-fix` が存在し、かつ iteration == 3**:
103-
- コメントを投稿する:
104-
```
105-
gh pr comment <PR_URL> --body "[Claude Codeによる自動レビュー] 自動修正の最大回数(3回)に達しました。残りのmust-fix問題は手動対応が必要です。"
106-
```
107-
- worktreeをクリーンアップする:
108-
```
109-
git worktree remove --force $WORKTREE_PATH
110-
```
111-
- 停止する。マージには進まないこと。
112-
113-
## Phase 5: LGTM + マージ
114-
115-
LGTMコメントを投稿する:
116-
```
117-
gh pr comment <PR_URL> --body "[Claude CodeによるLGTM]
118-
119-
must-fix問題は見つかりませんでした。自動マージを開始します。"
120-
```
121-
122-
ドラフトPRをマージするために、レビュー準備完了にマークする:
123-
```
124-
gh pr ready <PR_URL>
125-
```
126-
127-
squashマージをトリガーする:
128-
```
129-
gh pr merge <PR_URL> --squash --auto
130-
```
131-
132-
マージコマンドが失敗した場合は、エラー内容をユーザーに報告して停止する。自動リトライはしないこと。
133-
134-
マージ成功後、worktreeをクリーンアップする:
135-
```
136-
git worktree remove --force $WORKTREE_PATH
137-
```
138-
139-
最終的なPR URLとマージ結果をユーザーに報告する。
10+
- Commit message descriptions: **in Japanese**
11+
- PR title and body: **in Japanese**
12+
- Review comments and status messages posted to the PR: **in Japanese**

0 commit comments

Comments
 (0)