From openlogos
Review code for OpenLogos methodology compliance, including YAML validity checks. Use when reviewing code changes, checking pull requests, or performing code quality analysis.
How this skill is triggered — by the user, by Claude, or both
Slash command
/openlogos:code-reviewerThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
> Review AI-generated code by performing systematic validation against the full OpenLogos specification chain (API YAML, sequence diagram EX cases, DB DDL), ensuring code is fully consistent with design documents, covers all exception paths, and meets security requirements.
Review AI-generated code by performing systematic validation against the full OpenLogos specification chain (API YAML, sequence diagram EX cases, DB DDL), ensuring code is fully consistent with design documents, covers all exception paths, and meets security requirements.
logos/resources/api/ contains API YAML specificationslogos/resources/prd/3-technical-plan/2-scenario-implementation/ contains scenario sequence diagrams (with EX cases)logos/resources/database/ contains DB DDLFor projects without APIs (pure CLI / libraries), API consistency checks can be skipped; focus on sequence diagram coverage and exception handling instead.
Pre-check — YAML Validity (before anything else):
Before loading API specs, validate that all logos/resources/api/*.yaml files are syntactically valid YAML and conform to the OpenAPI 3.x schema. If any file fails parsing (e.g., unquoted special characters in description fields), report it as a Critical blocker immediately — do not proceed with the rest of the review until YAML errors are fixed.
Then read the following files to establish a "reference baseline" for the code review:
logos/resources/api/*.yaml): Extract endpoint inventory, record each endpoint's path, method, request body schema, response schema, and status codeslogos/resources/prd/3-technical-plan/2-scenario-implementation/): Extract all EX exception case IDs and expected behaviorslogos/resources/database/): Extract table structures, column types, constraints, and indexeslogos-project.yaml: Read tech_stack to confirm the technology stack, external_dependencies to confirm external dependenciesSummarize into a review checklist:
Review scope: S01-related code
- API endpoints: 4 (auth.yaml)
- EX exception cases: 7 (EX-2.1 ~ EX-5.2)
- DB tables: 2 (users, profiles)
- Security policies: 2 RLS rules
Compare code implementation against API YAML specification endpoint by endpoint:
Checklist:
| Check Item | Description | Severity |
|---|---|---|
| Path Match | Whether route paths in code exactly match paths in YAML | Critical |
| HTTP Method | Whether GET/POST/PUT/DELETE matches | Critical |
| Request Body Fields | Whether code reads all required fields defined in YAML requestBody.schema | Critical |
| Request Body Validation | Whether field type, format (email/uuid), minLength and other constraints are validated in code | Warning |
| Response Fields | Whether JSON field names and types returned by code match YAML responses.schema | Critical |
| Status Codes | Whether HTTP status codes returned in normal and error cases match YAML definitions | Critical |
| Error Response Format | Whether error responses follow the unified { code, message, details? } format | Warning |
| YAML Validity | All logos/resources/api/*.yaml files parse as valid YAML and valid OpenAPI 3.x — unquoted special characters (:, →, #) in description/summary values are a common failure mode | Critical |
Output format:
### API Consistency
| Endpoint | Check Item | Status | Notes |
|----------|------------|--------|-------|
| POST /api/auth/register | Request body fields | ✅ | email, password both read |
| POST /api/auth/register | Response status code | ❌ Critical | Registration success returns 200, YAML defines 201 |
| POST /api/auth/register | Error code | ❌ Warning | Duplicate email returns generic 400, YAML defines 409 |
Map all EX exception cases from sequence diagrams to error handling in code one by one:
Key checks:
Output format:
### Exception Handling Coverage
| EX ID | Exception Description | Code Coverage | Notes |
|-------|----------------------|---------------|-------|
| EX-2.1 | Email already registered | ✅ | Returns 409, format correct |
| EX-2.2 | Auth service unavailable | ❌ Critical | No try/catch wrapping the supabase.auth.signUp call |
| EX-4.1 | profiles write failure | ❌ Critical | auth.users record not rolled back after INSERT failure |
Check whether database operations in code conform to DDL design:
Checklist:
INTEGER amount field in DDL, whether code passes cents instead of dollars)Check the security implementation of the code:
| Check Item | Description | Severity |
|---|---|---|
| Authentication Check | Whether endpoints requiring authentication verify token/session before processing logic | Critical |
| Authorization Check | Whether users can only access their own data (owner check) | Critical |
| Input Validation | Whether user input has type validation and length limits (prevent injection, prevent XSS) | Critical |
| Sensitive Data | Whether responses leak password hashes, internal IDs, or stack traces | Critical |
| RLS Dependency | If relying on PostgreSQL RLS, whether code correctly sets the auth.uid() context | Warning |
| SQL Injection | Whether parameterized queries are used (string-concatenated SQL is prohibited) | Critical |
| Rate Limiting | Whether critical endpoints (login, registration) have rate limiting against brute force | Warning |
Summarize all findings by severity and generate a structured report:
# Code Review Report: S01 User Registration
## Review Scope
- Scenario: S01
- Endpoints: 4
- EX cases: 7
- Code files: src/api/auth/register.ts, src/api/auth/login.ts
## Review Summary
| Severity | Count |
|----------|-------|
| 🔴 Critical | 2 |
| 🟡 Warning | 3 |
| 🔵 Info | 1 |
## Critical Findings
### [C1] POST /api/auth/register status code mismatch
- **Spec source**: auth.yaml → register → responses.201
- **Issue**: Code returns 200, spec defines 201
- **Fix suggestion**: Change `res.status(200)` to `res.status(201)`
### [C2] EX-2.2 unhandled: Auth service unavailable
- **Spec source**: S01 sequence diagram → EX-2.2
- **Issue**: `supabase.auth.signUp()` call is not wrapped in try/catch
- **Fix suggestion**: Add try/catch, return 503 on timeout or 5xx
## Warning Findings
...
## Info Findings
...
Report principles:
The following prompts can be copied directly for use with AI:
Help me do a code reviewHelp me check if this code conforms to the API YAML specReview the code implementation related to S01Help me check if exception handling is completeHelp me check if security policies are in placeProvides behavioral guidelines to reduce common LLM coding mistakes, focusing on simplicity, surgical changes, assumption surfacing, and verifiable success criteria.
Searches, retrieves, and installs Agent Skills from prompts.chat registry using MCP tools like search_skills and get_skill. Activates for finding skills, browsing catalogs, or extending Claude.
Creates, edits, and optimizes skills for Claude Code, including drafting, evaluating with test prompts, iterating on performance, and improving skill descriptions for better triggering accuracy.
npx claudepluginhub miniidealab/openlogos --plugin openlogos