| name | code-review |
| description | Review code changes for correctness, conventions, performance, security, and test coverage. Use for: PR review, regression-risk analysis, Biome/TypeScript convention checks, API auth and validation review, block/tool contract audits, and severity-ordered findings. |
Code Review Skill - Zelaxy
Purpose
Perform repository-accurate code reviews that prioritize bugs, regressions, security risks, and missing tests over style-only comments.
Non-Negotiable Review Output Format
When asked to "review":
- List findings first, ordered by severity (
critical, high, medium, low).
- Include exact file and line references for each finding.
- Explain impact and concrete fix suggestion.
- Add open questions/assumptions after findings.
- Add summary last.
If no issues are found, explicitly say so and call out residual risks/testing gaps.
Non-Negotiable Rule: Code-Test Sync
If a change modifies behavior:
- Confirm tests were updated or justify why unchanged.
- Run relevant tests.
- Report exact test commands and outcomes.
- Treat missing test coverage as a review finding.
When to Use
- PR/diff reviews
- Auditing API routes for auth, validation, and tenant isolation
- Reviewing block/tool additions or executor changes
- Validating correctness after performance/security refactors
Review Workflow (Required)
- Inspect diff and identify touched domains (
api, executor, blocks, tools, stores, db, ui).
- Validate against hard contracts (types/interfaces/registry patterns).
- Run static checks and targeted tests for touched areas.
- Report severity-ordered findings with file/line evidence.
- Call out missing tests, docs drift, and rollout risk.
Repo-Enforced Conventions
Biome and formatting
From biome.json:
- Indentation: 2 spaces
- Line width: 100
- Quote style: single quotes (including JSX)
- Semicolons:
asNeeded (do not enforce "always")
- Import organize groups:
:NODE:, react, react/**
:PACKAGE:
@/components/**
@/lib/**
@/app/**
:ALIAS:
:RELATIVE:
Rule nuance reviewers must respect:
noExplicitAny is disabled.
noUnusedVariables and noUnusedFunctionParameters are disabled.
- Some strict style rules are enabled (
useAsConstAssertion, noInferrableTypes, etc.).
TypeScript strictness
apps/zelaxy/tsconfig.json: strict: true
packages/ts-sdk/tsconfig.json: strict: true
Reviewer focus should be runtime correctness and contract safety, not forcing style rules that the repo does not enforce.
Domain-Specific Review Checks
API routes (apps/zelaxy/app/api/**)
- Auth model matches route intent:
- user routes usually
getSession()
- internal/system routes may use
x-api-key (env.INTERNAL_API_SECRET)
- Request validation uses Zod parse/safeParse before DB/tool calls.
- Tenant boundaries enforced (
userId, workspaceId, organizationId where required).
- Error handling does not leak secrets/tokens.
- Response shape stays consistent with local module pattern.
- Some routes use
createErrorResponse/createSuccessResponse
- Others return
NextResponse.json({ success: ... })
- Do not force a single response wrapper repo-wide.
Blocks (apps/zelaxy/blocks/**)
- New/changed blocks satisfy
BlockConfig and SubBlockConfig contracts.
- Block type is present in
blocks/registry.ts.
- Inputs/outputs/subblocks remain consistent with handler expectations.
- Docs parity check for block additions/renames:
apps/docs/content/docs/blocks/*.mdx
- Watch for slug/type drift (underscore vs hyphen mapping in docs slugs).
Tools (apps/zelaxy/tools/**)
- Tool definitions satisfy
ToolConfig/ToolResponse expectations.
- Tool is registered in
tools/registry.ts.
- Parameter visibility (
user-or-llm | user-only | llm-only | hidden) is deliberate.
- OAuth/credential paths use secure token retrieval flows (no hardcoded secrets).
- Transform/post-process logic handles failure paths and preserves typed output shape.
Executor (apps/zelaxy/executor/**)
- Preserve layer-based execution semantics (parallel per dependency layer).
- Preserve streaming contracts (
StreamingExecution, stream processing behavior).
- Validate loop/parallel edge-case handling (
stopOnError, iteration state, branch failures).
- Check for shared context mutation that can cause cross-branch regressions.
- Require regression tests for execution-path changes.
Database and queries (apps/zelaxy/db/**, apps/zelaxy/lib/**)
- Ensure tenant/user scope is present on data reads/writes when required.
- Avoid performance regressions (unbounded queries, missing filters).
- Raw SQL is acceptable when justified (for example vector/hybrid search paths) but must be parameter-safe and tested.
- Schema/migration changes require matching application usage updates.
UI and state (apps/zelaxy/app/**, apps/zelaxy/components/**, apps/zelaxy/stores/**)
- Verify no hydration hazards in SSR paths.
- Check selector breadth in Zustand usage to avoid avoidable rerenders.
- Confirm accessibility regressions are not introduced in interactive components.
- Respect existing typography/theme conventions per surface (Inter and Geist are both used in repo contexts).
Commands for Review Validation
Prefer non-destructive checks first:
bun run check
bun run type-check
bun run test
Targeted examples:
cd apps/zelaxy
bun run test -- app/api/chat/route.test.ts
bun run test -- executor/utils.test.ts
cd packages/ts-sdk
bun run test
High-Value Findings to Prioritize
- Authorization bypass or missing tenant scoping.
- Missing/incorrect validation before side effects.
- Behavior changes without test updates.
- Executor control-flow regressions (loop/parallel/stream).
- Registry drift (block/tool implemented but not wired).
- Docs drift for block/tool surface changes.
- Performance regressions on hot paths.
- Error handling that hides failures or leaks sensitive details.
Common False Positives to Avoid
- "No console usage ever" as an absolute rule. Repo contains intentional console usage in some runtime paths and scripts.
- "No any allowed" as a hard blocker.
noExplicitAny is disabled; judge by risk, boundaries, and unsafe propagation.
- "Every API must return identical wrapper shape." Follow local module conventions.
- "Inter-only typography." The repo uses both Inter and Geist depending on surface.
Completion Checklist
- Findings are severity-ordered and evidence-backed.
- File/line references are included for each finding.
- Test coverage gaps are called out explicitly.
- Executed commands and outcomes are reported.
- Residual risks/open questions are documented.