Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions scripts/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,11 @@ smkwlab organization 運用補助スクリプト。

| caller | 配布先ファイル | 役割 | 必要な前提 |
|--------|----------------|------|-----------|
| `claude-code-review` | `.github/workflows/claude-code-review.yml` | PR 自動レビュー(コード向け: バグ/セキュリティ/ロジック) | org secret `ANTHROPIC_API_KEY` |
| `claude-paper-review` | `.github/workflows/claude-paper-review.yml` | PR 自動レビュー(論文向け: 論理/構成/新規性/形式) | org secret `ANTHROPIC_API_KEY` |
| `ai-code-review` | `.github/workflows/ai-code-review.yml` | PR 自動コードレビュー(ワンショット・inline。Gemini/Claude) | org secret `ANTHROPIC_API_KEY` / `GEMINI_API_KEY` |
| `ai-paper-review` | `.github/workflows/ai-paper-review.yml` | PR 自動論文レビュー(ワンショット・要約。Gemini/Claude) | org secret `ANTHROPIC_API_KEY` / `GEMINI_API_KEY` |
| `claude-mention` | `.github/workflows/claude-mention.yml` | `@claude` 対話・修正依頼 | org secret `ANTHROPIC_API_KEY` |
| `claude-code-review` | `.github/workflows/claude-code-review.yml` | (旧)コードレビュー。claude-code-action 版で低速のため **`ai-code-review` に移行**。退役予定 | org secret `ANTHROPIC_API_KEY` |
| `claude-paper-review` | `.github/workflows/claude-paper-review.yml` | (旧)論文レビュー。同上、**`ai-paper-review` に移行**。退役予定 | org secret `ANTHROPIC_API_KEY` |

`scripts/distribute-workflow.sh --list-callers` で一覧できます。各 caller の前提は
`scripts/callers/<caller>.pr-note.md`(PR 本文に付く注記)にも書かれています。
Expand Down
2 changes: 2 additions & 0 deletions scripts/callers/ai-code-review.defaults
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
MODEL=claude-sonnet-4-6

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ℹ️ [LOW] [LOW] モデル名 claude-sonnet-4-6 がハードコードされています。将来的にモデルのバージョンが更新された際(例: claude-sonnet-4-7 等)、全配布先のファイルを再配布し直す必要があります。

ai-paper-review.defaults も同様です。バージョン部分を分離するか、latest エイリアスが利用可能であればそちらの使用を検討してください。

LANGUAGE=Japanese
4 changes: 4 additions & 0 deletions scripts/callers/ai-code-review.pr-note.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
PR への自動コードレビュー(ワンショット・inline)を有効化します。

- 動作には org シークレット `ANTHROPIC_API_KEY`(claude モデル時)または `GEMINI_API_KEY`(gemini モデル時)がこのリポジトリで利用可能である必要があります(未配布なら安全にスキップ)
- draft PR は `ready_for_review` まで、fork PR は secret 不在のため、いずれも安全にスキップします
27 changes: 27 additions & 0 deletions scripts/callers/ai-code-review.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Caller template: AI Code Review (one-shot, inline) — calls the ai-review reusable.
# Distributed by scripts/distribute-workflow.sh as
# .github/workflows/ai-code-review.yml in each target repository.
# The ref / model / language tokens below are substituted at distribution time.
name: AI Code Review

on:
pull_request:
types: [opened, reopened, ready_for_review] # no synchronize: avoid re-reviewing every push

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ [MEDIUM] [MEDIUM] synchronize イベントを意図的に除外していますが、これはPRに新しいコミットがプッシュされた際にレビューが再実行されないことを意味します。コードレビューの文脈では、修正後のコードが再レビューされないため、レビューの実効性が低下する可能性があります。

除外の理由はコメントに記載されていますが(avoid re-reviewing every push)、少なくとも synchronize を含めた上で、差分のみをレビューする設計の方が実用的ではないでしょうか。もし意図的な設計であれば、.pr-note.md にもその旨を明記することを推奨します。


concurrency:
group: ai-code-review-${{ github.event.pull_request.number }}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ℹ️ [LOW] [MEDIUM] concurrency.groupgithub.event.pull_request.number を使用していますが、同一リポジトリ内で ai-code-reviewai-paper-review の両方が設定されている場合、グループ名が異なるため問題はありません。しかし、リポジトリ名やワークフロー名を含めない場合、将来的に同一PR番号で別ワークフローとの衝突リスクは低いものの、より明示的に ${{ github.workflow }}-${{ github.event.pull_request.number }} とする方が安全です。

cancel-in-progress: true

jobs:
review:
uses: smkwlab/.github/.github/workflows/ai-review.yml@__REF__
permissions:
contents: read
pull-requests: write
secrets:
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
gemini_api_key: ${{ secrets.GEMINI_API_KEY }}
with:
model_code: __MODEL__
review_mode: CODE
language: __LANGUAGE__
2 changes: 2 additions & 0 deletions scripts/callers/ai-paper-review.defaults
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
MODEL=claude-sonnet-4-6
LANGUAGE=Japanese
4 changes: 4 additions & 0 deletions scripts/callers/ai-paper-review.pr-note.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
PR への論文自動レビュー(ワンショット・要約コメント)を有効化します。

- 動作には org シークレット `ANTHROPIC_API_KEY`(claude モデル時)または `GEMINI_API_KEY`(gemini モデル時)がこのリポジトリで利用可能である必要があります(未配布なら安全にスキップ)
- 論文全体に言及するフィードバックのため、inline ではなく単一の要約コメントとして投稿します
29 changes: 29 additions & 0 deletions scripts/callers/ai-paper-review.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Caller template: AI Paper Review (one-shot, summary comment) — calls the ai-review reusable.
# Distributed by scripts/distribute-workflow.sh as
# .github/workflows/ai-paper-review.yml in each target repository.
# The ref / model / language tokens below are substituted at distribution time.
name: AI Paper Review

on:
pull_request:
types: [opened, reopened, ready_for_review] # no synchronize: avoid re-reviewing every push

concurrency:
group: ai-paper-review-${{ github.event.pull_request.number }}
cancel-in-progress: true

jobs:
review:
uses: smkwlab/.github/.github/workflows/ai-review.yml@__REF__
permissions:
contents: read
pull-requests: write
secrets:
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
gemini_api_key: ${{ secrets.GEMINI_API_KEY }}
with:
model_code: __MODEL__
review_mode: ACADEMIC
single_comment: true
language: __LANGUAGE__
exclude_paths: "*.bib,*.sty,*.cls"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ℹ️ [LOW] [LOW] exclude_paths*.bib,*.sty,*.cls が固定値としてハードコードされています。配布先リポジトリによっては除外したいファイル種別が異なる場合(例: *.tex の特定ディレクトリを除外したい等)も考えられます。

__EXCLUDE_PATHS__ のようなトークンにして .defaults ファイルでデフォルト値を設定する形にすると、配布時のカスタマイズ性が向上します。

Loading