Logo Posd Code Review

Posd Code Review

Cộng đồng
mzbac
posd-code-review

Review a codebase, directory, or PR diff using John Ousterhout’s “A Philosophy of Software Design” principles. Use when the user wants design/maintainability feedback: complexity (dependencies/obscurity), deep modules, information hiding/leakage, interface design (common case), layering, error-handling strategy, comments and naming/obviousness. Do NOT use for formatting-only or lint-only requests, or when the user is explicitly asking for performance benchmarking, a pure security audit, or purely stylistic rewrites.

Tổng quan

Nhà phát hànhmzbac
Kho mãskills
Tên kỹ năngposd-code-review
Sao
27
Bản fork
1
Tệp đi kèm
Chỉ có hướng dẫn
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ộ.

  • Đầy đủ trong hướng dẫn

    Mọi thứ mô hình cần đều nằm trong hướng dẫn — không có tệp bổ sung cần đồng bộ.

  • Mã nguồn mở

    Được mzbac 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 Posd 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/mzbac/skills/tree/main/skills/posd-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/mzbac/skills.git /tmp/skills
mkdir -p .claude/skills
cp -r /tmp/skills/skills/posd-code-review .claude/skills/posd-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 Posd 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 Posd 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 Posd 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.

POSD Code Review Skill

Goal

Produce a review that reduces software complexity by:

  • Identifying dependencies and obscurity.
  • Mapping findings to symptoms: change amplification, cognitive load, and unknown unknowns.
  • Proposing refactors that create deep modules, strengthen information hiding, and make interfaces simpler for the most common use cases.
  • Offering practical, incremental improvements (“small investments”), not a wholesale rewrite.

Inputs (infer if missing)

  • Scope: PR diff / commit range / paths / whole repo.
  • Constraints: backwards compatibility, “no behavior change”, deadlines, style guides, API stability.
  • Audience: maintainers vs new contributors (affects how much explanation to include).

If scope is ambiguous, default to: review the touched area + immediate neighbors (callers/callees).

Operating mode

  • Default to read-only review: do not edit files unless asked.
  • Use evidence: cite file paths, symbols, and concrete examples.
  • Prefer small, staged refactors that can be landed safely.

Workflow

Step 0 — Build a quick mental model

  1. Identify the system’s main responsibilities and “shape”:
    • Key entrypoints, main services/packages, public APIs, domain layer, IO boundaries.
  2. Identify the primary modules/components and their interfaces:
    • What does each module promise?
    • What does the caller have to know (including “informal” constraints)?

Step 1 — Find complexity hotspots (evidence-driven)

Pick 3–10 candidate hotspots based on:

  • High churn / frequently changed files
  • High fan-in (many callers) or fan-out (many dependencies)
  • Lots of conditionals/special cases
  • Repeated logic across modules
  • High “setup tax” to use an API (many parameters, flags, ordering rules)

Suggested commands (optional, adapt to repo/tooling):

  • git status, git diff, git log --stat
  • rg -n "TODO|FIXME|HACK|workaround"
  • rg -n "throws | catch | Exception | Result<|Either<|panic!|unwrap\\("
  • Language-specific: eslint, ruff, golangci-lint, mvn test, etc. (only if requested/appropriate)

Step 2 — Review using POSD lenses (checklists below)

For each hotspot/module, analyze:

  • What complexity does it remove for callers?
  • What complexity does it push outward?
  • Where is knowledge duplicated across modules?

Step 3 — “Design it twice” for top issues

For the top 2–3 most impactful findings:

  • Provide two alternative designs.
  • Pick one and justify why it reduces overall complexity.

Step 4 — Produce an actionable report

Use the output template below. Prioritize issues that:

  • Reduce change amplification across multiple files
  • Reduce cognitive load for common tasks
  • Eliminate unknown unknowns by improving interfaces/docs
  • Shrink exception surface area

POSD Review Checklists

A) Complexity (dependencies + obscurity)

Look for:

  • Call chains that require reading multiple files to understand one change.
  • Implicit ordering constraints (“call A before B”).
  • Hidden invariants (only “known” by tribal knowledge).
  • Names that don’t reveal intent; missing “why” documentation.

Fix strategies:

  • Pull related knowledge into one module.
  • Make invariants explicit in interfaces and comments.
  • Replace “temporal coupling” with data-driven or capability-based APIs.

B) Deep modules vs shallow modules

Shallow module signals:

  • Big/complex interface for little functionality.
  • Wrappers that mostly forward calls (“pass-through” methods).
  • Many tiny classes that add interfaces without hiding complexity.

Deep module goals:

  • Small, stable interface; substantial internal work hidden behind it.
  • Callers can use the module without understanding its internals.

Fix strategies:

  • Merge overly-fragmented modules when they share knowledge.
  • Replace multiple special-purpose methods with one general-purpose method + simple parameters.
  • Move complexity into the module if it simplifies the caller.

C) Information hiding & information leakage

Leakage signals:

  • Same file format / protocol / validation rules implemented in multiple modules.
  • Duplicated constants, field names, parsing rules.
  • Two modules that must be changed together for one “design decision”.

Fix strategies:

  • Consolidate the “knowledge” into one module.
  • Introduce a focused module that owns the leaking decision.
  • Remove getters that expose internal structures; offer intention-revealing methods instead.

D) Interfaces designed for the common case

Look for:

  • APIs that require rare options to be understood to do common tasks (“overexposure”).
  • Too many parameters / flags / configuration knobs.
  • Interfaces that “punt” hard cases to the caller.

Fix strategies:

  • Provide good defaults.
  • Replace flag soups with a smaller number of cohesive operations.
  • Make common-case code short and obvious; move uncommon complexity behind optional APIs.

E) Layering: different layers, different abstractions

Look for:

  • Upper layers duplicating lower-layer APIs.
  • Pass-through methods/variables across multiple layers.
  • Decorator stacks that multiply shallow interfaces.

Fix strategies:

  • Collapse layers that don’t add a distinct abstraction.
  • Reassign responsibilities so each layer adds real value.
  • Expose lower-level APIs directly when the upper layer adds no abstraction.

F) Error handling: reduce exception surface area

Look for:

  • Defensive “throw everywhere” patterns.
  • Exceptions that callers can’t realistically handle.
  • Many special-case checks scattered across the codebase.
  • Exception-handling branches that are untested/unreachable.

Fix strategies:

  • Define errors out of existence by changing semantics so the “error” cannot occur (or becomes normal behavior).
  • Mask/collapse related failures into fewer handling sites.
  • If an error is unrecoverable, prefer a clear “panic/fail fast” boundary rather than half-handling everywhere.
  • Before introducing a new error/exception: describe exactly how the caller will handle it.

G) Comments & documentation (abstraction + non-obvious info)

Look for:

  • Public methods without an interface/contract comment.
  • Comments that restate code (noise).
  • Missing “why” on non-obvious algorithms, invariants, or tricky edge cases.
  • Implementation details leaking into interface docs (wrong abstraction level).

Fix strategies:

  • Add header/interface comments that define the contract.
  • Add “why” comments for non-obvious design decisions.
  • Remove comments that merely repeat code and refactor code to be more obvious.

H) Naming, consistency, obviousness

Look for:

  • Vague names; “hard to name” entities that likely hide an unclear abstraction.
  • Local inconsistencies (same concept named differently across files).
  • Non-obvious code where the reader must simulate mentally to understand.

Fix strategies:

  • Rename to encode intent and invariants.
  • Align naming and patterns within a subsystem.
  • Rewrite small sections for clarity; prefer readability over cleverness.

Output template (required)

Executive summary

  • 3–7 bullets: biggest complexity drivers, where they show up, what to do next.

Scorecard (0–5)

Rate each area briefly with 1–2 sentences:

  • Deep modules
  • Information hiding/leakage
  • Interface common-case usability
  • Layering/abstraction boundaries
  • Error handling strategy
  • Comments/contracts
  • Naming/consistency/obviousness

Findings (prioritized)

For each finding:

  1. Title (short)
  2. Principle violated (e.g., information leakage, shallow module, overexposure)
  3. Evidence (files/symbols; concrete snippet description)
  4. Impact
    • Change amplification? Cognitive load? Unknown unknowns?
  5. Recommendation
    • Smallest safe change first
  6. Design-it-twice alternatives (required for top 2–3 findings)
  7. Risk & test plan
    • What to verify; what tests to add/run

Suggested investment plan

  • Quick wins (small refactors/docs)
  • Medium refactors (module/interface reshaping)
  • Long-term (architecture boundary shifts)

Quality bar

  • Prefer fewer, deeper findings over a long list of nits.
  • Every recommendation must reduce overall complexity for future changes.
  • If you claim something is “complex”, explain what it forces readers/callers to know.

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

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

Review a codebase, directory, or PR diff using John Ousterhout’s “A Philosophy of Software Design” principles. Use when the user wants design/maintainability feedback: complexity (dependencies/obscurity), deep modules, information hiding/leakage, interface design (common case), layering, error-handling strategy, comments and naming/obviousness. Do NOT use for formatting-only or lint-only requests, or when the user is explicitly asking for performance benchmarking, a pure security audit, or purely stylistic rewrites.

Vì sao nên dùng Posd 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. Posd 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 Posd Code Review trong TypingMind?

Mở Plugin → Kỹ năng → Cài đặt từ GitHub trong TypingMind rồi dán https://github.com/mzbac/skills/tree/main/skills/posd-code-review. TypingMind đọc tệp SKILL.md 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 Posd 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 Posd 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 Posd 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 Posd Code Review có miễn phí không?

Kỹ năng này được mzbac 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 👇