Logo Code Review

Code Review

Cộng đồng
luongnv89
code-review

Review or improve code — one skill, four modes: bug/security review (default), performance, clean-code audit, slop cleanup. Pass mode:review|perf|clean|cleanup or infer. Don't use for writing features or generating tests (use test-coverage).

Tổng quan

Nhà phát hànhluongnv89
Kho mãskills
Tên kỹ năngcode-review
Sao
124
Bản fork
18
Tệp đi kèm
22
Giấy phépMIT
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ộ.

  • 22 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 luongnv89 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/luongnv89/skills/tree/main/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/luongnv89/skills.git /tmp/skills
mkdir -p .claude/skills
cp -r /tmp/skills/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.

Code Review

One skill for reviewing and improving code quality. Pick a mode by intent (or pass an explicit mode: parameter); each mode is a full, self-contained workflow in references/. Load only the mode you need — this protects the agent's context budget.

Modes

ModeUse when the user wants to...Reads / writesOutputWorkflow
review (default)find bugs, security holes, quality issues in a diff/PRread-onlyprioritized findings reportreferences/review-mode.md
perfmake code faster — bottlenecks, leaks, algorithmic wasteread-onlyperformance findings reportreferences/perf-mode.md
cleanaudit readability/standards vs the bbv Clean Code cheat sheetread-onlyCLEAN_CODE_AUDIT.mdreferences/clean-mode.md
cleanupactually refactor out AI slop, dead code, duplication, cruftWRITES CODEmodified source filesreferences/cleanup-mode.md

Selecting the mode

  1. Explicit wins. If the request carries mode:review|perf|clean|cleanup (or --mode <name>), use it.
  2. Otherwise infer from the request:
    • "review", "find bugs", "security", "is this correct", "look for vulnerabilities" → review
    • "slow", "faster", "optimize", "bottleneck", "memory leak", "performance" → perf
    • "clean code audit" (or "clean-code audit"), "clean code review", "check this against clean code" → clean (user-invoked only — a bare "readability" or "audit against standards" ask is ambiguous: use step 3)
    • "remove slop", "clean up the codebase", "refactor out cruft / dead code / duplication" → cleanup
  3. Ambiguous? Ask which mode, naming the options. Fall back to review only when the intent is clearly "review this" with no other signal.

Safety: cleanup writes code — the other three do not

review, perf, and clean are strictly read-only: they analyze and report, never touching source. cleanup modifies files. Therefore:

  • Never enter cleanup by weak inference. Run it only when the user explicitly asks to refactor / clean up the codebase (or passes mode:cleanup). A plain "review my code" must never rewrite files — stay in a read-only mode.
  • Confirm before the first write in cleanup, and follow that mode's own gating.

Repo Sync Before Edits

The router itself is read-only. The two modes that touch a git repo carry the mandatory sync-before-edits step in their own workflow: cleanup (writes source) in references/cleanup-mode.md and clean (writes CLEAN_CODE_AUDIT.md) in references/clean-mode.md. Before either mode edits, follow that reference's Repo Sync step — sync with remote (stash-first if the tree is dirty) so writes land on top of the latest base.

Run the mode's workflow

Read the selected mode's reference file and execute its steps exactly. Supporting files each mode uses (already colocated under this skill):

  • review → references/review-mode.md — agents agents/reviewer.md, agents/file-reviewer.md, agents/report-assembler.md; refs references/subagent-architecture.md, references/code-smells.md
  • perf → references/perf-mode.md — ref references/language-checks.md
  • clean → references/clean-mode.md — refs references/clean-code-checklist.md, references/tdd-checklist.md, references/html-report-guide.md, references/report-template.html
  • cleanup → references/cleanup-mode.md — the 8 cleaner agents in agents/ (deduplicator.md, type-consolidator.md, unused-code-killer.md, circular-dep-untangler.md, weak-type-strengthener.md, defensive-programming-remover.md, legacy-code-remover.md, slop-comment-cleaner.md)

Environment Check

If the Agent tool is available, modes that use subagents (review, cleanup) spawn them per their workflow — fresh-context validation and parallel work. If it is unavailable (e.g., Claude.ai), execute each mode's phases inline (less rigorous, but functional).

Chaining modes

Modes compose: a common flow is clean (audit → CLEAN_CODE_AUDIT.md) then cleanup (apply the refactors), or review/perf to find issues before fixing. Run one mode at a time; confirm with the user before switching into the code-writing cleanup mode.

Prerequisites

  • Require a readable target diff, PR, file set, or repository; ask for scope when none is provided.
  • Check that every reference and agent required by the selected mode is available before starting.
  • For clean or cleanup, validate repository state and follow that mode's sync, backup, dry-run, confirmation, and rollback instructions. Stop on sync errors or failed safety checks.

Acceptance Criteria

Verify every run against the selected mode's own acceptance criteria, then assert all of these router criteria:

  • Exactly one mode was selected and its reference workflow was followed end to end.
  • Read-only modes changed no source files; verify with a path-scoped git diff when applicable.
  • Every finding cites concrete evidence and the expected output artifact or report was produced.
  • Tests or validation commands required by the selected mode completed with their expected result.
  • Edge cases, limitations, skipped files, and degraded subagent coverage are disclosed.

Expected Output

Example response after a read-only review:

text
Mode: review
Result: PASS
Findings: 1 critical, 2 major, 0 minor
Output: CODE_REVIEW.md
Validation: reviewer pass complete; no source files changed

Step Completion Reports

After routing and after the selected workflow, emit a compact report:

text
◆ Code Review ([mode])
  Mode selection:      √ pass
  Workflow criteria:   √ pass
  Output verified:     √ pass
  Safety boundary:     √ pass
  Result:              PASS | FAIL | PARTIAL

Use × fail — reason for any unmet check. Never report PASS while a selected-mode acceptance criterion, expected output, required test, or safety guardrail is unresolved.

Edge Cases

  • Unknown mode: value → reject it and list the four valid modes.
  • Mixed intents across modes → ask which mode to run first; never merge workflows implicitly.
  • Missing target or inaccessible files → stop and request a concrete scope instead of guessing.
  • Agent tool unavailable → use the selected reference's inline fallback and disclose reduced coverage.
  • A read-only mode requests edits mid-run → finish the report, then require explicit approval before starting a separate cleanup run.

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ì?

Review or improve code — one skill, four modes: bug/security review (default), performance, clean-code audit, slop cleanup. Pass mode:review|perf|clean|cleanup or infer. Don't use for writing features or generating tests (use test-coverage).

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/luongnv89/skills/tree/main/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?

Có. Kỹ năng này được luongnv89 phát hành trên GitHub theo giấy phép MIT. 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 👇