Code Reviewのロゴ

Code Review

コミュニティ
dalemoncayo
code-review

Shared review rules for automated PR reviews and local manual reviews. Triggered by review commands.

概要

公開者dalemoncayo
リポジトリfullcase-web
スキル名code-review
スター
93
フォーク
0
同梱ファイル
2
リンク
  • Markdown形式の指示

    モデルが必要に応じて読み込むSKILL.mdファイルです。関連するリクエストがあったときだけトークンを消費します。

  • どのLLMでも利用可能

    AIスキルはプロバイダー固有のコードではなく、通常のMarkdownなので、GPT、Claude、Gemini、Grok、ローカルモデルで利用できます。

  • 2個の同梱ファイル

    モデルが作業中に読み取れるスクリプト、テンプレート、参考資料です。ファイルは読み取り専用で、実行されることはありません。

  • オープンソース

    dalemoncayoがGitHubで公開しています。インストールする前にソースを確認してください。

インストール

AIスキルCode ReviewをTypingMindにインストールすれば、どのLLMでも利用できます。SKILL.mdを読み取れる別のAIエージェントに追加することもできます。

1

TypingMindにインストール

TypingMindはGitHubフォルダから直接スキルをインストールします。SKILL.mdを読み取り、リソースファイルをまとめてローカルに保存します。

  1. アプリを開き、「プラグイン」→「スキル」に移動します。
  2. 「GitHubからインストール」を選択します。
  3. 以下のスキルフォルダのURLを貼り付けて確定します。
    https://github.com/dalemoncayo/fullcase-web/tree/main/.agents/skills/code-review
  4. スキルを利用したいチャットごとに、そのスキルを有効にしてください。
「プラグイン」→「スキル」→「スキルを追加」→「GitHubのURLから」を選択し、フォルダのURLを貼り付けて「続行」を押します。
2

別のAIエージェントにインストール

Agent Skills形式を読み取れるAIエージェントなら、このスキルを利用できます。フォルダをそのAIエージェントのスキルディレクトリにコピーしてください。

Claude Code — .claude/skills
git clone --depth 1 https://github.com/dalemoncayo/fullcase-web.git /tmp/fullcase-web
mkdir -p .claude/skills
cp -r /tmp/fullcase-web/.agents/skills/code-review .claude/skills/code-review
コピー後、新しいスキルを読み込むためにClaude Codeを再起動してください。

TypingMindで使用

TypingMindのチャットでCode Reviewを有効にするだけで、あとはモデルが対応します。名前と説明がシステムプロンプトに含まれ、関連するリクエストがあると、モデルが指示の全文を自動で読み込みます。手動で呼び出す必要はなく、実際に使用されるまでトークンを消費しません。

関連するリクエストがあると、モデルが自動的にCode Reviewを読み込みます。

どのAIモデルでも利用可能

AIスキルはプロバイダー固有のコードではなく、通常のMarkdownで書かれた指示です。そのため、Code Reviewは作成時に想定されたモデルに縛られません。TypingMindに一度インストールすれば、ご自身のAPIキーを使って、GPT-5、Claude、Gemini、Grok、DeepSeek、Mistral、Llama、またはご自身で実行するローカルモデルで利用できます。

  • 必要なときだけ読み込み

    システムプロンプトには名前と説明だけが含まれます。関連するリクエストが初めてあったときに指示を取得するため、未使用のスキルにはコストがかかりません。

  • チャットの途中でモデルを切り替え

    スキルはコードではなく指示なので、モデルを切り替えてもそのまま使えます。次のモデルも同じSKILL.mdを読み込みます。

スキルの指示

モデルが読み込むSKILL.mdの内容です。スキルはモデルが従う指示なので、インストールする前に確認してください。

Purpose

Review code changes in fullcase-web (Next.js 16 + TypeScript + Firebase client SDK) to detect bugs, design violations, spec violations, and security risks. Serves as the shared ruleset for both automated PR reviews (referenced by subagents) and local manual reviews (direct invocation).

Review Procedure

Step 1: Obtain the review target

Obtain the diff based on the provided arguments.

When a PR number is specified:

bash
gh pr diff <PR-number>

When a branch is specified:

bash
git diff <base-branch>...<target-branch>

If the base branch is omitted, default to main.

When nothing is specified (local review of own changes):

bash
git diff
git diff --cached
git status --short

If there are untracked new files, read the file contents directly for review.

For PR reviews (via the review-pr orchestrator): the diff is provided by the caller. Skip this step.

Step 2: Load project rules

Read AGENTS.md at the project root to understand project-specific rules. AGENTS.md is the canonical source of truth for the architecture, Firestore data model, folder responsibilities, and code-style rules.

Step 3: Execute review

Review the diff based on the "Review Criteria" below. If there are no findings, report "No issues found".

Step 4: Quality check

Before outputting findings, self-check against the following:

  • Does the finding match a pattern in references/bad-review.md?
  • Is it something ESLint / Prettier / tsc --noEmit would catch?
  • Is it a personal preference with no objective basis?

Exclude any findings that match.

Also reference .codex/prompts/codex-output-schema.json as a quality guide for finding structure (severity, priority, confidence, code location).

Step 5: Output

Output only findings that pass the quality check.


Review Criteria

Must detect

  1. Bugs / Logic errors — Unintended behavior, missed edge cases, unhandled null / undefined, missing await, stale closures, unsubscribed Firestore / Storage listeners
  2. Security — Hardcoded secrets, unsafe input, PII leaks, auth-guard bypasses, storage path abuse, open redirects, dangerouslySetInnerHTML without sanitization, firebase-admin on client
  3. Design violations — Firebase SDK imported directly into components, Server Actions / Route Handlers used for Firestore or Storage, types defined outside types/, manual edits to components/ui/, raw <img> instead of next/image, custom CSS in globals.css
  4. Firestore data-model violations — Dates stored as Date / ISO strings (must be serverTimestamp() / Timestamp), missing memberIds update on membership change, inconsistent collection paths vs. the canonical paths in AGENTS.md, non-atomic multi-doc writes where writeBatch / runTransaction is required
  5. Flow defects — (dashboard)/layout.tsx auth guard weakened, pendingInvite sessionStorage handling broken, invite token not validated before writing membership

Must NOT flag

  1. Issues detectable by linter / formatter / type-checker — Prettier, import sort, unused-imports, exhaustive-deps, any keyword alone, max-len
  2. Auto-generated / managed files — .next/, next-env.d.ts, components/ui/*, generated type declarations
  3. Naming preferences without basis — Do not flag if naming follows project conventions
  4. Code outside the diff — Unchanged code is out of scope
  5. Test coverage alone — Do not flag missing tests unless there is a concrete bug risk

Severity Definitions

LevelPriorityIconDefinitionExamples
CRITICALP0🔴Security vulnerability, data loss / leak risk, guaranteed production breakageSecret leak, auth guard bypass, dangerouslySetInnerHTML with raw user input, firebase-admin used on client
HIGHP1🔴Mandatory rule violation, definite bugFirebase SDK imported into a component, any used deliberately, date stored as ISO string, <img> instead of next/image, missing await on an async write
MEDIUMP2🟡Quality / performance improvementUnnecessary onSnapshot where getDocs suffices, missing loading/error in a hook, N+1 Firestore reads, inline object prop causing memoized-child re-renders
LOWP3🟢Minor improvement suggestionSmall refactor opportunity, non-critical naming polish, optional comment

Output Format

Each finding must be written in English.

🔴 [CRITICAL] `path/to/file.tsx:42`
Firebase SDK is imported directly inside a React component. Project rule: components consume hooks; hooks call services; only services touch the Firebase SDK.
Suggestion: Move the Firestore call into `services/<feature>-service.ts` and expose it via a hook under `hooks/`.

When there are no findings:

✅ No issues found

Project-Specific Checkpoints

Architecture & Data Access

  • Component → Hook → Service → Firestore SDK. Never skip a layer.
  • services/* contains pure async functions with zero React imports.
  • hooks/* always expose loading and error.
  • firebase-admin is forbidden. Server Actions / Route Handlers are forbidden for Firestore / Storage operations.
  • Types live in types/ and are imported via @/types.

Next.js 16 App Router

  • Route groups: (auth) public, (dashboard) protected, invite/[token] public.
  • (dashboard)/layout.tsx must be a client component and redirect via router.replace('/login') inside useEffect. Never use the server-only redirect() helper.
  • Use next/image everywhere; firebasestorage.googleapis.com and lh3.googleusercontent.com must be in next.config.ts remotePatterns.
  • Use next/font for fonts.

TypeScript

  • strict: true. Never any (explicit or implicit).
  • Use unknown + narrowing, Omit<T, 'id'|'createdAt'|'updatedAt'> for create payloads, Partial<Pick<T, ...>> for update payloads.

Firestore

  • Always serverTimestamp() or Timestamp for date fields. Never new Date() or ISO strings in stored values.
  • Use writeBatch for multi-document logical operations (e.g., invite accept).
  • Use setDoc(..., uid) — not addDoc — when a document ID must equal the user's UID.
  • Update projects/{id}.memberIds whenever a member is added/removed (security rules depend on it).

Forms & UI

  • Forms use react-hook-form + zod + shadcn Form primitives.
  • shadcn AlertDialog for all destructive confirmations.
  • Skeleton for loading states.
  • No CSS files, no CSS modules, no inline style props. No custom classes in globals.css.
  • components/ui/ is shadcn CLI output — never manually edit.

Error Handling

  • All async component actions wrapped in try/catch.
  • User-facing errors via toast.error(...); never raw Firebase error codes.
  • console.error only when process.env.NODE_ENV !== 'production'.
  • No console.log in committed code.

Security & PII

  • Firebase config only via process.env.NEXT_PUBLIC_FIREBASE_*.
  • No user emails / names / phone numbers in logs. Full UIDs too — prefer last-4-only (...ab12).
  • Storage paths must match the documented prefixes; enforce the documented MIME/size caps.
  • Validate invite tokens before writing members / memberIds.

Reference Examples

Refer to the following for review quality standards:

  • Good review examples: references/good-review.md
  • Anti-patterns to avoid: references/bad-review.md

Post-review feedback: If you discover missed issues or new pitfalls from this review, add them to the checklist via the update-review-checklist skill.

同梱ファイル

スキルが読み込まれている間、モデルは必要に応じてこれらを読み取ります。読み取り可能なファイルとして提供され、実行されることはありません。

よくある質問

AIスキル「Code Review」では何ができますか?

Shared review rules for automated PR reviews and local manual reviews. Triggered by review commands.

TypingMindでCode Reviewを使うメリットは何ですか?

一度インストールすれば、どのモデルでも使えるからです。Code Reviewはプロバイダー固有のコードではなく、通常のMarkdownで記述されているため、同じスキルをGPT-5、Claude、Gemini、Grok、ローカルモデルで利用できます。チャットの途中でモデルを切り替えても、そのまま使い続けられます。TypingMindは自分のAPIキーで動作するため、シート単位のサブスクリプションではなく、プロバイダーに直接料金を支払います。スキルとチャットは自分のストレージに保持されます。

TypingMindにCode Reviewをインストールするにはどうすればよいですか?

TypingMindで「プラグイン」→「スキル」→「GitHubからインストール」を開き、https://github.com/dalemoncayo/fullcase-web/tree/main/.agents/skills/code-reviewを貼り付けてください。TypingMindがSKILL.mdを読み込み、関連ファイルをまとめて、チャットごとに有効にできるスキルとしてインストールします。

Code Reviewを使えるAIモデルはどれですか?

TypingMindに接続したどのモデルでも利用できます。AIスキルはプロバイダー固有のコードではなく、通常のMarkdownで書かれた指示です。そのため、GPT、Claude、Gemini、Grok、ローカルモデルのいずれも、リクエストが合致したときにこのスキルを読み込めます。

Code Reviewは何個のAIモデルで使えますか?

数に制限はありません。スキルに対応したモデルであれば、GPT、Claude、Gemini、Grok、DeepSeek、Mistral、Llamaなど、どのモデルでもCode Reviewを利用できます。すべてTypingMind上で、自分のAPIキーを使って利用できます。

AIスキル「Code Review」は無料ですか?

dalemoncayoがGitHubで公開しています。ライセンス条件はリポジトリでご確認ください。支払いが必要なのは、利用したトークンに対する、ご自身が契約するAIプロバイダーへの料金だけです。

AIスキルとは何ですか?

AIスキルは、特定のタスクの実行方法をAIモデルに教える、再利用可能な指示のセットです。オープンなAgent Skills形式に従い、名前と説明を含むSKILL.mdファイルに加え、モデルが必要とするスクリプト、テンプレート、参照ファイルで構成されます。モデルはリクエストがスキルに合致したときだけ指示を読み込むため、インストール済みのスキルも、使うまでは費用がかかりません。

AIスキルは、プラグインやMCPサーバーとどう違いますか?

プラグインやMCPサーバーは、モデルが呼び出せる新しいツールを提供します。ツールとは、どこかで実行され、結果を返すコードです。一方、AIスキルは、タスクへの取り組み方、従うべき手順、望ましい出力の例といった知識や進め方をモデルに伝えます。スキルは通常のMarkdownで記述されているため、サーバー、APIキー、実行環境は不要で、どのモデルでも利用できます。

すべて見る

今すぐ自分専用のAIワークスペースを作成

ニュースレターに登録すると、新機能や今後のプレゼント企画のお知らせが届きます👇