name: codex-review
description: Specialist code review for Codex-Cryptica project. Use to identify race conditions, AI parsing issues, worker proxy mismatches, and project-specific anti-patterns in Svelte 5 and TypeScript. Always initiates and incorporates the general review processes defined in code-review:code-review.
Codex Review
This skill provides a meticulous code review process tailored specifically for the Codex-Cryptica architecture. It focuses on catching subtle logic bugs that generic reviews often miss.
Review Workflow
- Examine Reactivity & Worker Safety: Verify Svelte 5 Runes usage. Ensure props aren't used to initialize
$statedirectly, that$derivedis used for synchronized data, and that any module calling runes uses the.svelte.tsextension instead of plain.ts. CRITICAL: Never reference Svelte compiler keywords (like$stateor$state.snapshot) in files bundled into Web Workers (e.g.oracle.worker.ts). Svelte runes are not compiled or supported in worker threads and will cause fatal runtime ReferenceErrors. Always runnode scripts/check-compiled-runes.jsafter building to verify compiled assets. - Check for Race Conditions: Audit all async event handlers in
.sveltefiles (e.g.,handleCommit,handleSave). EnsureisCommittingguards are present. - Verify AI Grounding: In
oracle-parser.ts, ensure regex patterns for deterministic commands use\s*$to prevent matching when additional user descriptions are provided. - Audit Worker Proxies: If a new AI method is added to
TextGenerationService, verify it is correctly exposed inoracle.worker.tsand bound inOracleStore. - Enforce Performance Heuristics: Ensure synchronous AI processing in loops (like auto-archive) is limited to small batches (< 5), and check that simple selection/click gestures do not trigger unconditional disk/database writes.
- Check Accessibility: Ensure
Autocompletecomponents haveariaLabel, icons follow the Iconify class pattern, and transition elements that fade out or hide are dynamically givenaria-hiddenattributes to keep the accessibility tree clean. - Verify HTML & JS Semantics: Ensure all action buttons have explicit
type="button", coordinate/number fallbacks use nullish coalescing (??) rather than logical OR to prevent falsy0bugs, avoid user-agent sniffing, and ensure highly-interactive canvas or map dragging interfaces use pointer displacement gates (e.g., 5px threshold) to prevent micro-movement drift on simple clicks. - Incorporate General Branch Review: Initiate and perform the complete branch changes review defined in
code-review:code-review, applying the comprehensive guidelines, reviewer persona, and critical constraints set bycode-review:code-review-commonsto audit code quality, style, and correctness.
Review Output Guidelines
When executing a code review under this skill, strictly follow these constraints for the output:
- No Compliments or Filler: Do not list things that are "correct," "good," or "well-done." Avoid general praise or introductory/concluding pleasantries.
- Attention Items Only: List only specific defects, gaps, bugs, potential runtime failures, style-guide violations, or security/performance issues that need attention or fixing.
- Concrete Code Proposals: For every single issue identified, you must provide a concrete, exact code proposal (using diff blocks or clear replacements) that resolves the issue.
Reference Patterns
For detailed examples of anti-patterns and the preferred implementations, refer to patterns.md.
Example Commands
- "Perform a /codex-review of these changes."
- "Review my Svelte 5 component for race conditions."
- "Check if my new AI command parser is robust."
- "Run codex-review and code-review:code-review on my branch changes."