/omni-dsdd:code-reviewfrom omni-dsdd
Proactively reviews code for quality, security, and maintainability. Use immediately after writing or modifying code.
Ships in omni-dsdd. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Ensuring high standards of code quality and security.
All path resolution and git commands use the variables below. Do not infer repo root via git rev-parse --show-toplevel for workspace boundaries.
| Variable | Meaning | Use |
|---|---|---|
CLAUDE_PLUGIN_ROOT | Omni plugin install root | Skill references, check-prerequisites |
CLAUDE_WORKING_DIR | User workspace directory (may be a Git subfolder) | git -C, project rules, fallback report path |
FEATURE_DIR | Current feature under changes/ | Report output via omni-dsdd:report-persistence |
test -n "${CLAUDE_PLUGIN_ROOT:-}" && test -d "${CLAUDE_PLUGIN_ROOT}"
test -n "${CLAUDE_WORKING_DIR:-}" && test -d "${CLAUDE_WORKING_DIR}"
If missing, resolve once at agent layer: CLAUDE_WORKING_DIR → export CLAUDE_WORKING_DIR="$(pwd)" (do not use git rev-parse --show-toplevel). CLAUDE_PLUGIN_ROOT → verify ${path}/skills/code-review/SKILL.md exists.
test -f "${CLAUDE_PLUGIN_ROOT}/skills/code-review/SKILL.md"
test -d "${CLAUDE_WORKING_DIR}"
Before resolving report paths, inherit FEATURE_DIR from the specify chain (do not guess from Git branch):
eval "$(bash "${CLAUDE_PLUGIN_ROOT}/skills/design/scripts/bash/design-resolve-context.sh" \
--plugin-root "${CLAUDE_PLUGIN_ROOT}" \
--working-dir "${CLAUDE_WORKING_DIR}" \
${FEATURE_DIR:+--feature-dir "$FEATURE_DIR"} \
--export)" 2>/dev/null || true
[[ -f "${FEATURE_DIR}/.runs/env.sh" ]] && source "${FEATURE_DIR}/.runs/env.sh"
git -C "${CLAUDE_WORKING_DIR}" ...${CLAUDE_PLUGIN_ROOT}/skills/code-review/references/<lang>/...omni-dsdd:report-persistence): prefer ${FEATURE_DIR}/.runs/evaluations/ and ${FEATURE_DIR}/code-review.md; see step 6When invoked:
git -C "${CLAUDE_WORKING_DIR}" diff --staged and git -C "${CLAUDE_WORKING_DIR}" diff. If no diff, git -C "${CLAUDE_WORKING_DIR}" log --oneline -5.omni-dsdd:report-persistence skill with:
REVIEW_TYPE = code-reviewFINDINGS, SUMMARY, VERDICT, FILES_REVIEWED, FILES_CHANGED as defined thereFEATURE_DIR is set (Step 0.2 design-resolve-context + source env.sh; only if still unknown, check-prerequisites --paths-only with --working-dir/--plugin-root — not for Git branch guessing)${FEATURE_DIR}/.runs/evaluations/code-review-summary.json${FEATURE_DIR}/code-review.mdFEATURE_DIR is unavailable, fall back to ${CLAUDE_WORKING_DIR}/.runs/evaluations/ (document in the report header)IMPORTANT: Do not flood the review with noise. Apply these filters:
Before writing a finding, answer all four questions. If any answer is "no" or "unsure", downgrade severity or drop the finding.
any in a test fixture is never CRITICAL. Severity inflation erodes trust
faster than missed findings.For any finding tagged HIGH or CRITICAL, include:
If you cannot produce all three, demote to MEDIUM or drop.
A clean review is a valid review. Do not manufacture findings to justify the
invocation. If the diff is small, well-typed, tested, and follows the project's
patterns, the correct output is a summary with zero rows and verdict APPROVE.
Manufactured findings, filler nits, speculative "consider using X", and hypothetical edge cases without a trigger are the primary failure mode of LLM reviewers and directly undermine this agent's usefulness.
Patterns that LLM reviewers commonly mis-flag. Skip unless you have evidence specific to this codebase:
try/catch, or Promise chains with .catch upstream.200, 404, 1000 ms, 60,
24, 1024, array index 0 or -1, HTTP status codes, and single-use
local constants whose meaning is obvious from the variable name.switch statements, configuration
objects, test tables, or generated code. Length is not complexity.const over let" when the variable is reassigned. Read the
whole function before flagging.if guard is in scope. Trace type flow instead of pattern-matching on ?..DataLoader or batching.void prefix before flagging.Math.random() in a non-cryptographic context
such as animation, jitter, or sampling, or flagging eval/Function in a
plugin system that is explicitly a code-loading surface.When tempted to flag one of the above, ask: "Would a senior engineer on this team actually change this in review?" If no, skip.
These MUST be flagged — they can cause real damage:
// BAD: SQL injection via string concatenation
const query = `SELECT * FROM users WHERE id = ${userId}`;
// GOOD: Parameterized query
const query = `SELECT * FROM users WHERE id = $1`;
const result = await db.query(query, [userId]);
// BAD: Rendering raw user HTML without sanitization
// Always sanitize user content with DOMPurify.sanitize() or equivalent
// GOOD: Use text content or sanitize
<div>{userComment}</div>
// BAD: Deep nesting + mutation
function processUsers(users) {
if (users) {
for (const user of users) {
if (user.active) {
if (user.email) {
user.verified = true; // mutation!
results.push(user);
}
}
}
}
return results;
}
// GOOD: Early returns + immutability + flat
function processUsers(users) {
if (!users) return [];
return users
.filter(user => user.active && user.email)
.map(user => ({ ...user, verified: true }));
}
When reviewing React/Next.js code, also check:
useEffect/useMemo/useCallback with incomplete depsuseState/useEffect in Server Components// BAD: Missing dependency, stale closure
useEffect(() => {
fetchData(userId);
}, []); // userId missing from deps
// GOOD: Complete dependencies
useEffect(() => {
fetchData(userId);
}, [userId]);
// BAD: Using index as key with reorderable list
{items.map((item, i) => <ListItem key={i} item={item} />)}
// GOOD: Stable unique key
{items.map(item => <ListItem key={item.id} item={item} />)}
When reviewing backend code:
SELECT * or queries without LIMIT on user-facing endpoints// BAD: N+1 query pattern
const users = await db.query('SELECT * FROM users');
for (const user of users) {
user.posts = await db.query('SELECT * FROM posts WHERE user_id = $1', [user.id]);
}
// GOOD: Single query with JOIN or batch
const usersWithPosts = await db.query(`
SELECT u.*, json_agg(p.*) as posts
FROM users u
LEFT JOIN posts p ON p.user_id = u.id
GROUP BY u.id
`);
Organize findings by severity. For each issue:
[CRITICAL] Hardcoded API key in source
File: src/api/client.ts:42
Issue: API key "sk-abc..." exposed in source code. This will be committed to git history.
Fix: Move to environment variable and add to .gitignore/.env.example
const apiKey = "sk-abc123"; // BAD
const clientToken = process.env.EXAMPLE_KEY; // GOOD
End every review with:
## Review Summary
| Severity | Count | Status |
|----------|-------|--------|
| CRITICAL | 0 | pass |
| HIGH | 2 | warn |
| MEDIUM | 3 | info |
| LOW | 1 | note |
Verdict: WARNING — 2 HIGH issues should be resolved before merge.
Do not withhold approval to appear rigorous. If the diff is clean, approve it.
When available, also check project-specific conventions from ${CLAUDE_WORKING_DIR}/CLAUDE.md, ${CLAUDE_WORKING_DIR}/.omni-infra/memory/constitution.md, or project rules:
Adapt your review to the project's established patterns. When in doubt, match what the rest of the codebase does.
When reviewing AI-generated changes, prioritize:
Cost-awareness check:
When reviewing, detect the language/framework of the changed files and load the corresponding reference files for detailed checklist items and code examples.
| File Extension / Pattern | Reference Directory |
|---|---|
*.cpp, *.hpp, *.cc, *.h, CMakeLists.txt | ${CLAUDE_PLUGIN_ROOT}/skills/code-review/references/cpp |
*.go, go.mod | ${CLAUDE_PLUGIN_ROOT}/skills/code-review/references/golang |
*.java, pom.xml, build.gradle | ${CLAUDE_PLUGIN_ROOT}/skills/code-review/references/java |
*.py, *.pyi | ${CLAUDE_PLUGIN_ROOT}/skills/code-review/references/python |
*.rs, Cargo.toml | ${CLAUDE_PLUGIN_ROOT}/skills/code-review/references/rust |
*.ts, *.tsx, *.js, *.jsx | ${CLAUDE_PLUGIN_ROOT}/skills/code-review/references/typescript |
*.css, *.scss, *.html, frontend components | ${CLAUDE_PLUGIN_ROOT}/skills/code-review/references/web |
When multiple languages are present in the same diff, load all applicable references (paths under the plugin root, not relative to cwd).
| Item | Path |
|---|---|
| This skill | ${CLAUDE_PLUGIN_ROOT}/skills/code-review/SKILL.md |
| Prerequisites (bash) | ${CLAUDE_PLUGIN_ROOT}/scripts/bash/check-prerequisites.sh |
| Report persistence | ${CLAUDE_PLUGIN_ROOT}/skills/report-persistence/SKILL.md |
references/common/coding-style.md (opens in a new tab)references/common/hooks.md (opens in a new tab)references/common/patterns.md (opens in a new tab)references/common/performance.md (opens in a new tab)references/common/security.md (opens in a new tab)references/common/testing.md (opens in a new tab)references/cpp/coding-style.md (opens in a new tab)references/cpp/hooks.md (opens in a new tab)references/cpp/patterns.md (opens in a new tab)references/cpp/security.md (opens in a new tab)references/cpp/testing.md (opens in a new tab)references/golang/coding-style.md (opens in a new tab)references/golang/hooks.md (opens in a new tab)references/golang/patterns.md (opens in a new tab)references/golang/security.md (opens in a new tab)references/golang/testing.md (opens in a new tab)references/java/coding-style.md (opens in a new tab)references/java/hooks.md (opens in a new tab)references/java/patterns.md (opens in a new tab)references/java/security.md (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
63 skills in this plugin
/analyze制品一致性分析技能。对 spec.md、design.md、tasks.md 做跨制品一致性分析并自动修复,不设轮数上限,全程不询问用户。残留问题完整打印后继续正常结束。用于分析制品、检查一致性、质量审查。/archive将变更指示文件中的需求/设计/接口变更回流到 DOC_DIR/specs 下的要素文档. 当需要从 feature 变更目录同步更新到 DOC_DIR/specs 下的需求、场景、实体、功能和接口文档及其清单与关联关系时使用/brainstormingYou MUST use this before any creative work - creating features, building components, adding functionality, or modifying behavior. Explores user intent, requirements and design before implementation./brainstorming-sdd-bridgeExpert workflow adapter that converts an approved brainstorming *-design.md into the standard SDD document interface consumed by tasks/implement/review/local-sandbox-fix. Use only after expert brainstorming and before tasks.npx claudepluginhub zte-aicloud/co-omnispec --plugin omni-dsddOther plugins' skills for the same job