Logo Code Review

Code Review

Cộng đồng
dalemoncayo
code-review

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

Tổng quan

Nhà phát hànhdalemoncayo
Kho mãfullcase-web
Tên kỹ năngcode-review
Sao
93
Bản fork
0
Tệp đi kèm
2
Liên kết
  • Hướng dẫn bằng Markdown

    Tệp SKILL.md được mô hình tải khi cần, nên chỉ tốn token khi có yêu cầu thực sự phù hợp.

  • Dùng được với mọi LLM

    Kỹ năng AI là Markdown thuần túy, không phải mã dành riêng cho một nhà cung cấp, nên dùng được với GPT, Claude, Gemini, Grok hoặc mô hình cục bộ.

  • 2 tệp đi kèm

    Các tập lệnh, mẫu và tài liệu tham khảo mà mô hình có thể đọc khi làm việc. Các tệp chỉ cho phép đọc và không bao giờ được thực thi.

  • Mã nguồn mở

    Được dalemoncayo công bố trên GitHub. Hãy đọc nội dung nguồn trước khi cài đặt.

Cài đặt

Cài đặt kỹ năng AI Code Review trong TypingMind để dùng với bất kỳ LLM nào, hoặc thêm vào một tác nhân AI khác có thể đọc SKILL.md.

1

Cài đặt trong TypingMind

TypingMind cài đặt kỹ năng trực tiếp từ thư mục GitHub — đọc SKILL.md, đóng gói các tệp tài nguyên và lưu kết quả trên máy.

  1. Mở ứng dụng và vào Plugin → Kỹ năng.
  2. Chọn "Cài đặt từ GitHub".
  3. Dán URL thư mục kỹ năng bên dưới và xác nhận.
    https://github.com/dalemoncayo/fullcase-web/tree/main/.agents/skills/code-review
  4. Bật kỹ năng trong từng cuộc trò chuyện mà bạn muốn sử dụng kỹ năng đó.
Plugin → Kỹ năng → Thêm kỹ năng → Từ URL GitHub, sau đó dán URL thư mục và nhấn Tiếp tục.
2

Cài đặt trong tác nhân AI khác

Bất kỳ tác nhân AI nào đọc được định dạng Agent Skills đều có thể dùng kỹ năng này — hãy sao chép thư mục vào thư mục kỹ năng của tác nhân 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
Khởi động lại Claude Code sau khi sao chép để ứng dụng nhận kỹ năng mới.

Sử dụng trong TypingMind

Bật Code Review trong bất kỳ cuộc trò chuyện nào trên TypingMind, mô hình sẽ tự xử lý phần còn lại. Tên và mô tả của kỹ năng nằm trong prompt hệ thống. Ngay khi có yêu cầu phù hợp, mô hình tự tải toàn bộ hướng dẫn — bạn không cần gọi thủ công và kỹ năng không tốn token cho đến khi thực sự được dùng.

Mô hình tự tải Code Review ngay khi có yêu cầu phù hợp.

Dùng được với mọi mô hình AI

Kỹ năng AI là các hướng dẫn Markdown thuần túy, không phải mã dành riêng cho một nhà cung cấp, nên Code Review không bị giới hạn ở mô hình mà kỹ năng này được viết cho. Chỉ cần cài đặt một lần trong TypingMind rồi dùng với GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama hoặc mô hình cục bộ do bạn tự chạy — tất cả đều dùng khóa API của riêng bạn.

  • Chỉ tải khi cần

    Prompt hệ thống chỉ chứa tên và mô tả. Hướng dẫn được tải khi có yêu cầu phù hợp đầu tiên, nên kỹ năng chưa dùng không tốn chi phí.

  • Đổi mô hình ngay trong cuộc trò chuyện

    Vì kỹ năng là hướng dẫn chứ không phải mã, việc đổi mô hình không làm kỹ năng ngừng hoạt động — mô hình tiếp theo vẫn đọc cùng tệp SKILL.md.

Hướng dẫn của kỹ năng

Đây là nội dung SKILL.md mà mô hình tải. Hãy đọc trước khi cài đặt — kỹ năng là những hướng dẫn mà mô hình của bạn sẽ làm theo.

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.

Tệp đi kèm

Mô hình đọc các tệp này khi cần trong lúc kỹ năng được tải. Các tệp được cung cấp ở dạng có thể đọc và không bao giờ được thực thi.

Câu hỏi thường gặp

Kỹ năng AI Code Review làm được gì?

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

Vì sao nên dùng Code Review trên TypingMind?

Vì bạn chỉ cần cài một lần rồi dùng với bất kỳ mô hình nào. Code Review là nội dung Markdown chứ không phải mã dành riêng cho từng nhà cung cấp, nên cùng một kỹ năng có thể chạy trên GPT-5, Claude, Gemini, Grok hoặc mô hình trên thiết bị — và bạn có thể đổi mô hình ngay trong cuộc trò chuyện mà kỹ năng vẫn hoạt động. TypingMind dùng khóa API riêng của bạn, nên bạn thanh toán trực tiếp cho nhà cung cấp thay vì trả phí thuê bao theo suất người dùng, đồng thời kỹ năng và các cuộc trò chuyện vẫn nằm trong bộ lưu trữ của bạn.

Làm thế nào để cài Code Review trong TypingMind?

Mở Plugin → Kỹ năng → Cài đặt từ GitHub trong TypingMind rồi dán https://github.com/dalemoncayo/fullcase-web/tree/main/.agents/skills/code-review. TypingMind đọc tệp SKILL.md, đóng gói các tệp đi kèm và cài đặt thành một kỹ năng mà bạn có thể bật cho từng cuộc trò chuyện.

Những mô hình AI nào có thể dùng Code Review?

Bất kỳ mô hình nào bạn kết nối trong TypingMind. Kỹ năng AI là các hướng dẫn bằng Markdown chứ không phải mã dành riêng cho từng nhà cung cấp, nên GPT, Claude, Gemini, Grok và các mô hình chạy trên thiết bị đều có thể tải kỹ năng này khi có yêu cầu phù hợp.

Bạn có thể dùng Code Review với bao nhiêu mô hình AI?

Bao nhiêu cũng được. Miễn là mô hình hỗ trợ kỹ năng, bạn có thể dùng Code Review với mô hình đó — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama và nhiều mô hình khác — tất cả đều trên TypingMind với khóa API riêng của bạn.

Kỹ năng AI Code Review có miễn phí không?

Kỹ năng này được dalemoncayo phát hành trên GitHub. Hãy xem điều khoản giấy phép trong kho mã. Bạn chỉ trả tiền cho nhà cung cấp AI của mình theo số token đã dùng.

Kỹ năng AI là gì?

Kỹ năng AI là một gói hướng dẫn có thể tái sử dụng, chỉ cho mô hình AI cách thực hiện một tác vụ cụ thể. Kỹ năng tuân theo định dạng mở Agent Skills: một tệp SKILL.md chứa tên và mô tả, cùng các tập lệnh, mẫu hoặc tệp tham khảo mà mô hình có thể cần. Mô hình chỉ đọc hướng dẫn khi yêu cầu của bạn phù hợp với kỹ năng, nên kỹ năng đã cài đặt không phát sinh chi phí cho đến khi được sử dụng.

Kỹ năng AI khác gì với plugin hoặc máy chủ MCP?

Plugin hoặc máy chủ MCP cung cấp cho mô hình các công cụ mới để gọi — mã được chạy ở đâu đó và trả về kết quả. Còn kỹ năng AI cung cấp kiến thức và quy trình: cách tiếp cận tác vụ, các bước cần thực hiện và tiêu chí của đầu ra tốt. Kỹ năng chỉ là nội dung Markdown, nên không cần máy chủ, khóa API hay môi trường thực thi và hoạt động với mọi mô hình.

Xem tất cả

Tạo ngay không gian làm việc AI riêng

Đăng ký bản tin của chúng tôi để nhận thông báo về tính năng mới và các đợt tặng quà sắp tới 👇