跳至正文
OpenAgentSkill
浏览已开放 · 目录记录日期 2026-11-21 · 自动更新和账户服务暂时关闭。
开发与测试

synthesis-code-audit

Systematic 10-dimension quality scan of code diffs, producing scored PASS/WARNING/FAIL verdicts per dimension with a machine-readable overall result. Includes PR review mode for cross-referencing findings against existing reviewer comments. Use when asked to: code audit, audit my changes, quality check, review the diff, check this code, audit my code, scan for issues, code quality scan, diff review.

Emil Peñaló · 已有静态检查记录

安装与使用

运行命令前先阅读来源与依赖说明。复制命令不会自动安装或执行。

npx skills add synthesisengineering/synthesis-skills --skill synthesis-code-audit

技能说明


name: synthesis-code-audit description: > Systematic 10-dimension quality scan of code diffs, producing scored PASS/WARNING/FAIL verdicts per dimension with a machine-readable overall result. Includes PR review mode for cross-referencing findings against existing reviewer comments. Use when asked to: code audit, audit my changes, quality check, review the diff, check this code, audit my code, scan for issues, code quality scan, diff review. license: "CC0-1.0" depends_on: [] metadata: author: "Emil Peñaló" version: "1.1.0" source_repo: "github.com/synthesisengineering/synthesis-skills" source_type: "public"

Synthesis Code Audit

A code audit is a systematic quality measurement of a diff. It is not a judgment call about whether a change should merge — that is the reviewer's job (see synthesis-pr-review). An audit produces a scored report across 10 orthogonal dimensions, each graded independently. The report tells you where the quality problems are; the reviewer decides what to do about them.


Where This Fits

Three engineering skills evaluate code at different scopes:

SkillScopeWhen to use
code-audit (this one)Quality scan of a diffAfter implementation, standalone or as input to preflight/pr-review
pr-reviewJudgment-based delta reviewEvery PR, before peer approval or lead integration
codebase-reviewFull system audit (16 categories, tiered)Periodic health check or major milestone

Code-audit produces findings. PR-review produces a verdict that may consume those findings. Codebase-review catches systemic patterns that no single diff reveals.


Principles

  1. Fresh base branch. Compare against an up-to-date base ref. Stale base branches cause false positives (flagging code already addressed upstream) and false negatives (missing new context on the base that changes interpretation).

  2. Read files in full, not just diff hunks. A diff hunk shows what changed. The surrounding file shows whether the change makes sense in context. Always read changed files in their entirety.

  3. Independent judgment with complete requirements. Give the reviewer the frozen artifact universe, user outcome, acceptance criteria, exclusions and applicable decisions. Avoid priming the verdict with the producer's preferred explanation. Independence means rederiving the result against the actual requirements, not hiding the requirements. Challenge a mistaken premise with evidence and route any amendment to its decision owner.

  4. State the reviewed scope and consequences. Grade the changed behavior and its affected consumers. A defect that prevents the promised outcome remains a blocker even when its lines predate the diff. Record unrelated findings separately without claiming that unreviewed code is clean. Apply stronger project rules, including fix-while-touching requirements, where present.


Diff Scope Detection

Determine what to audit:

  • Uncommitted changes exist — audit staged and unstaged changes against HEAD.
  • Branch has commits ahead of base — audit the range from base to HEAD.
  • Nothing to diff — report that and stop.

Large diffs (40+ files): Prioritize investigation by consequence, including configuration, generated assets and lock files when they affect execution or supply-chain integrity. Divide the frozen universe into bounded review assignments with one integration owner. Track reviewed and unreviewed paths explicitly. Partial coverage produces an incomplete audit, never an unqualified Clean verdict; finish required coverage before the package can pass.


The 10-Dimension Framework

For each dimension, evaluate the changed code and assign one of:

  • PASS — no issues, or only trivial stylistic preferences
  • WARNING — potential problem that deserves attention but does not block shipping (missing edge-case test, minor inconsistency, could-be-better pattern)
  • FAIL — concrete defect, security hole, convention violation, or missing coverage that should be fixed before merge
  • UNKNOWN — a required judgment cannot be established from the available evidence or completed review coverage

1. Project Convention Compliance

Read the project's convention documentation (style guides, architectural decision records, contribution guidelines). Check every changed file against the conventions that apply to it. Flag violations with a reference to the specific convention.

If the project has no documented conventions, skip this dimension and note it as N/A.

2. Code Reuse — Existing Before New

When the diff introduces a new component, utility, hook, or abstraction, search the codebase for existing implementations that serve the same purpose. If one exists, flag the new code and recommend using the existing implementation.

When the diff introduces a behavioral pattern (overlay management, keyboard navigation, positioning logic, state machine, API wrapper, error handling), search the broader codebase for functionally similar implementations — different code serving the same purpose is still duplication.

When multiple implementations of the same pattern are found, recommend extracting a shared primitive and migrating callers.

For any shared primitive — existing, introduced in this diff, or recommended for extraction — check whether the project's conventions document it. Undocumented shared primitives will be re-implemented by contributors who do not know they exist.

3. Consistency with Existing Patterns

Read 2-3 neighboring files in the same directory or module as each changed file. Note their naming conventions, file structure, export style, error handling approach, and architectural patterns.

Compare the diff against those observed patterns. Flag divergences that are not justified by the change's purpose.

4. Security

  • Auth checks on all new endpoints
  • No injection vectors (SQL injection, XSS, command inj
阅读完整来源 ↗