一键导入
consistency
This skill should be used when reviewing code for naming convention violations, pattern deviations, or inconsistent API styles.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
This skill should be used when reviewing code for naming convention violations, pattern deviations, or inconsistent API styles.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Canonical algorithm for consuming DECISIONS_CONTEXT index — scan index, identify relevant entries, Read full bodies on demand, cite verbatim IDs inline.
This skill should be used when evaluating implementation quality before submission, checking correctness, security, and simplicity.
This skill should be used when performing a code review to apply the standard 6-step review process.
This skill should be used when the user asks to "add accessibility", "check ARIA", "handle keyboard navigation", "add focus management", or creates UI components, forms, or interactive elements. Provides WCAG 2.2 AA patterns for keyboard navigation, ARIA roles and states, focus management, color contrast, and screen reader support.
Consumption algorithm for FEATURE_KNOWLEDGE variable — pre-computed feature context
This skill should be used when reviewing code for SOLID violations, tight coupling, or layering issues.
| name | consistency |
| description | This skill should be used when reviewing code for naming convention violations, pattern deviations, or inconsistent API styles. |
| user-invocable | false |
| allowed-tools | Read, Grep, Glob |
Domain expertise for code consistency and unnecessary simplification detection. Use alongside devflow:review-methodology for complete consistency reviews.
MATCH EXISTING PATTERNS OR JUSTIFY DEVIATION
New code should look like existing code. If the codebase uses camelCase, use camelCase. If errors return Result types, return Result types. Consistency trumps personal preference. Deviation requires explicit justification and team agreement. One codebase, one style.
Content truncation, stripped configuration, removed error context.
// VIOLATION: Oversimplified error messages
const errorMessages = {
INVALID_EMAIL: 'Invalid email', // Was: detailed format guidance
USER_NOT_FOUND: 'Not found', // Was: helpful next steps
};
// CORRECT: Preserve helpful context
const errorMessages = {
INVALID_EMAIL: 'Please enter a valid email address in the format user@domain.com',
USER_NOT_FOUND: 'We could not find an account with that email. Please check or create a new account.',
};
Naming conventions, error handling styles, import/export organization.
// EXISTING PATTERN: Result types
function existingFunction(): Result<User, Error> {
if (!valid) return Err(new ValidationError('...'));
return Ok(user);
}
// VIOLATION: Throws instead of Result
function newFunction(): User {
if (!valid) throw new Error('...'); // Different pattern!
return user;
}
// CORRECT: Match existing
function newFunction(): Result<User, Error> {
if (!valid) return Err(new ValidationError('...'));
return Ok(user);
}
Removed CLI options, changed return types, removed event emissions.
// VIOLATION: Removed event emissions break listeners
class OrderService {
async createOrder(data: OrderData) {
const order = await this.repository.create(data);
return order; // Events removed - listeners won't fire!
}
}
// CORRECT: Preserve all event emissions
class OrderService {
async createOrder(data: OrderData) {
const order = await this.repository.create(data);
this.events.emit('order.created', order);
this.events.emit('inventory.reserve', order.items);
return order;
}
}
Brace style, quote style, trailing commas, naming conventions.
// EXISTING: camelCase for functions
function getUserById(id: string) { }
function createOrder(data: OrderData) { }
// VIOLATION: Different naming style
function Process_Payment(amount: number) { } // snake_case
// CORRECT: Match existing
function processPayment(amount: number) { }
For extended examples and detection commands, see:
references/violations.md - Extended violation examples by categoryreferences/patterns.md - Extended correct pattern examplesreferences/detection.md - Bash commands for detecting issues| Severity | Description | Examples |
|---|---|---|
| CRITICAL | Breaking changes or significant content loss | API return types changed, CLI options removed, events removed |
| HIGH | Inconsistency requiring attention | Error handling pattern mismatch, naming violations, export pattern change |
| MEDIUM | Style inconsistency | Import organization, brace/quote style, formatting differences |
| LOW | Minor observations | Personal preference territory, linter should catch |
Before approving changes, verify: