From omni-dsdd
Proactively reviews code for quality, security, and maintainability. Use immediately after writing or modifying code.
How this skill is triggered — by the user, by Claude, or both
Slash command
/omni-dsdd:code-reviewThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
**Ensuring high standards of code quality and security.**
references/common/coding-style.mdreferences/common/hooks.mdreferences/common/patterns.mdreferences/common/performance.mdreferences/common/security.mdreferences/common/testing.mdreferences/cpp/coding-style.mdreferences/cpp/hooks.mdreferences/cpp/patterns.mdreferences/cpp/security.mdreferences/cpp/testing.mdreferences/golang/coding-style.mdreferences/golang/hooks.mdreferences/golang/patterns.mdreferences/golang/security.mdreferences/golang/testing.mdreferences/java/coding-style.mdreferences/java/hooks.mdreferences/java/patterns.mdreferences/java/security.mdEnsuring 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 |
npx claudepluginhub zte-aicloud/co-omnispec --plugin omni-dsddReviews uncommitted local changes, branch diffs, and GitHub PRs with AI-powered analysis. Supports focused reviews (security, performance, bugs) and filters pre-existing issues.
Runs a comprehensive code review on local source files. Use when the user asks to review, audit, inspect, evaluate, or check code.
Reviews code diffs, PRs, and files for logic errors, security issues, performance problems, duplication, and best practice violations.