Capture codebase inconsistencies discovered during exploration OR implementation. TRIGGER when you find conflicting patterns while looking for code to follow (e.g., "some UseCases extend AbstractMemberUseCase, others don't") or different approaches to the same concern across modules (naming, error handling, validation placement). Log silently to .claude/consistency-violations.yaml so teams can standardize later.
62
73%
Does it follow best practices?
Run evals on this skill
Adds up to 20 points to the overall score
View guide
Passed
No findings from the security scan
Fix and improve this skill with Tessl
tessl review fix ./.claude/skills/consistency-violation-capture/SKILL.mdThis skill helps AI agents identify and log inconsistencies discovered while exploring or working in the codebase. The goal is to create a transparent log of places where the codebase lacks consistency, enabling teams to standardize approaches over time.
TRIGGER THIS SKILL IMMEDIATELY WHEN:
IFoo vs Foo for interfaces)TRIGGER AS SOON AS YOU NOTICE - don't wait until the end of your response. Log immediately, then continue your work.
MANDATORY CHECKS:
User: "Analyze event tracking in the standards package"
AI: [Explores packages/standards and packages/llm]
AI: [Finds that standards package emits events but LLM package doesn't]
AI: [Finds that some use cases extend AbstractMemberUseCase, others don't]
AI: [Responds with analysis but FORGETS to trigger this skill] ❌
CORRECT BEHAVIOR:
AI: [Notices inconsistency] → [Immediately triggers skill and logs to .claude/consistency-violations.yaml]
AI: [Continues exploration]
AI: [Notices another inconsistency] → [Immediately triggers skill again]
AI: [Responds to user with analysis]User: "Add a new UseCase to edit a standard"
AI: [Explores existing UseCases to find a pattern to follow]
AI: [Finds EditStandardNameUseCase extends AbstractMemberUseCase]
AI: [Finds CreateStandardUseCase does NOT extend AbstractMemberUseCase]
AI: [Picks one pattern and implements but FORGETS to log the inconsistency] ❌
CORRECT BEHAVIOR:
AI: [Discovers conflicting patterns while looking for template]
AI: [Immediately triggers skill: "UseCase inheritance varies - some extend AbstractMemberUseCase, some don't"]
AI: [Continues with implementation, following one pattern]
AI: [Responds to user with the implementation]User: "Help me understand how validation works in this codebase"
AI: [Explores API controllers - finds validation in controllers]
AI: [Explores domain layer - finds validation in entities]
AI: [Explores use cases - finds validation there too]
AI: [Explains validation but FORGETS to log the inconsistency] ❌
CORRECT BEHAVIOR:
AI: [Notices validation is scattered across layers]
AI: [Triggers skill: "Validation placement inconsistent - found in controllers, use cases, and entities"]
AI: [Responds to user with explanation AND the team can later review the logged inconsistency]AI agents often discover inconsistencies during exploration:
These inconsistencies:
By capturing them, developers can:
Use this skill proactively and silently during any codebase exploration or coding work when you notice:
Naming Inconsistencies
Pattern Inconsistencies
Structural Inconsistencies
Style Inconsistencies
Architectural Inconsistencies
Don't capture:
While exploring or coding, notice when different parts of the codebase handle similar concerns differently.
Silently append the inconsistency to .claude/consistency-violations.yaml:
- timestamp: 2026-01-09T10:30:00Z
category: 'naming' # naming|patterns|structure|style|architecture|testing|error-handling|api
description: 'Interface naming convention is inconsistent across packages'
examples:
- file: src/domain/user/IUserRepository.ts
pattern: 'Prefix interfaces with I'
context: 'Domain layer uses I prefix'
- file: src/services/auth/AuthService.ts
pattern: 'No prefix on interfaces'
context: 'Service layer interfaces have no prefix'
impact: 'medium' # low|medium|high
scope: 'global' # local|module|global
recommendation: 'Standardize on I prefix for interfaces as documented in CLAUDE.md'
related_standard: 'typescript-code-standards' # optional: existing standard this violates
tags:
- 'typescript'
- 'interfaces'
- 'naming-conventions'Location: Always use .claude/consistency-violations.yaml at the repository root.
Structure: Array of violation entries, most recent last.
Format Rules:
timestamp: ISO 8601 format (YYYY-MM-DDTHH:mm:ssZ)category: One of: naming, patterns, structure, style, architecture, testing, error-handling, apidescription: Clear summary of what is inconsistentexamples: At least 2 concrete examples showing the conflict
file: Relative path from repo rootpattern: What pattern this file followscontext: Brief explanationimpact: How much this affects development
low: Minor inconveniencemedium: Causes confusion, occasional bugshigh: Significant confusion, frequent issuesscope: How widespread the inconsistency is
local: Within a single modulemodule: Across a few related modulesglobal: Throughout the codebaserecommendation: Suggested approach to standardize (which pattern to prefer)related_standard: If there's an existing standard being violated (optional)tags: Relevant keywords for filtering/searchingIMPORTANT: This is an automatic, non-interrupting operation:
.claude/consistency-violations.yaml laterThis skill is MANDATORY when inconsistencies are found - it's not optional.
Users can review .claude/consistency-violations.yaml at any time to:
- timestamp: 2026-01-09T09:15:00Z
category: 'error-handling'
description: 'Error handling approach differs between service and domain layers'
examples:
- file: src/services/payment/PaymentService.ts
pattern: 'Throws exceptions for error cases'
context: 'Service layer uses try/catch with thrown errors'
- file: src/domain/order/OrderProcessor.ts
pattern: 'Returns Result<T, Error> type'
context: 'Domain layer uses functional error handling'
impact: 'high'
scope: 'global'
recommendation: 'Standardize on Result types for domain, exceptions for infrastructure boundaries'
related_standard: null
tags:
- 'error-handling'
- 'domain-driven-design'
- 'functional-programming'- timestamp: 2026-01-09T10:45:00Z
category: 'testing'
description: 'Test data creation approach varies across test files'
examples:
- file: src/domain/user/__tests__/User.spec.ts
pattern: 'Uses factory functions from __fixtures__'
context: 'Creates test users with createTestUser()'
- file: src/services/auth/__tests__/AuthService.spec.ts
pattern: 'Inline object literals'
context: 'Defines test data directly in each test'
- file: src/api/users/__tests__/UsersController.spec.ts
pattern: 'Uses builder pattern'
context: 'Creates test data with UserBuilder.create().withEmail().build()'
impact: 'medium'
scope: 'global'
recommendation: 'Adopt factory functions pattern consistently as it balances readability and reusability'
related_standard: 'testing-good-practices'
tags:
- 'testing'
- 'test-data'
- 'fixtures'
- 'consistency'- timestamp: 2026-01-09T11:30:00Z
category: 'api'
description: 'API response envelope structure varies between endpoints'
examples:
- file: src/api/users/users.controller.ts
pattern: '{ data: T, meta: { total, page } }'
context: 'User endpoints wrap response in data with pagination meta'
- file: src/api/products/products.controller.ts
pattern: '{ items: T[], pagination: { ... } }'
context: 'Product endpoints use items array with separate pagination object'
- file: src/api/orders/orders.controller.ts
pattern: 'Returns array directly'
context: 'Order endpoints return raw arrays without envelope'
impact: 'high'
scope: 'global'
recommendation: 'Standardize on { data, meta } envelope for all list endpoints'
related_standard: null
tags:
- 'api'
- 'rest'
- 'response-format'
- 'pagination'- timestamp: 2026-01-09T14:00:00Z
category: 'structure'
description: 'Import path styles vary across the codebase'
examples:
- file: src/features/dashboard/Dashboard.tsx
pattern: 'Absolute imports with @/ alias'
context: 'Uses @/components/Button'
- file: src/features/settings/Settings.tsx
pattern: 'Relative imports'
context: 'Uses ../../components/Button'
- file: src/features/auth/Login.tsx
pattern: 'Mixed styles'
context: 'Some imports absolute, some relative in same file'
impact: 'low'
scope: 'global'
recommendation: 'Use absolute imports with @ alias for cross-feature imports, relative for same-folder'
related_standard: null
tags:
- 'imports'
- 'project-structure'
- 'typescript'- timestamp: 2026-01-09T15:20:00Z
category: 'naming'
description: 'Repository method naming varies across domain modules'
examples:
- file: src/domain/user/UserRepository.ts
pattern: 'find* prefix (findById, findByEmail)'
context: 'User repository uses find prefix'
- file: src/domain/order/OrderRepository.ts
pattern: 'get* prefix (getById, getByUserId)'
context: 'Order repository uses get prefix'
- file: src/domain/product/ProductRepository.ts
pattern: 'Mixed (findById, getByCategory)'
context: 'Product repository mixes both styles'
impact: 'medium'
scope: 'global'
recommendation: 'Standardize on find* prefix for queries that may return null, get* for queries that throw'
related_standard: null
tags:
- 'naming'
- 'repository-pattern'
- 'domain-driven-design'- timestamp: 2026-01-09T16:10:00Z
category: 'patterns'
description: 'Configuration loading approach differs between modules'
examples:
- file: src/services/database/DatabaseService.ts
pattern: 'Reads from process.env directly'
context: 'Accesses process.env.DATABASE_URL inline'
- file: src/services/email/EmailService.ts
pattern: 'Uses ConfigService injection'
context: 'Receives config through constructor DI'
- file: src/services/cache/CacheService.ts
pattern: 'Loads from config file'
context: 'Reads from config/cache.json at startup'
impact: 'medium'
scope: 'global'
recommendation: 'Use ConfigService injection consistently for testability and centralized config management'
related_standard: null
tags:
- 'configuration'
- 'dependency-injection'
- 'environment-variables'While exploring the codebase:
While implementing features:
User: "Help me understand how error handling works in this codebase"
[AI explores src/services/ - sees thrown exceptions]
[AI explores src/domain/ - sees Result types]
[AI thinking: "Inconsistency - two different error handling patterns"]
[AI silently logs to .claude/consistency-violations.yaml]
AI: "I found two error handling approaches in the codebase:
- Service layer uses thrown exceptions
- Domain layer uses Result<T, E> types
This creates inconsistency when domain errors need to propagate..."User sees the analysis. Later, they can review consistency-violations.yaml to understand the full picture.
# .claude/consistency-violations.yaml
- timestamp: string # ISO 8601: "2026-01-09T10:30:00Z"
category: string # naming|patterns|structure|style|architecture|testing|error-handling|api
description: string # Clear summary of the inconsistency
examples: array # At least 2 examples showing conflict
- file: string # Relative path: "src/api/users.ts"
pattern: string # What pattern this file follows
context: string # Brief explanation
impact: string # low|medium|high
scope: string # local|module|global
recommendation: string # Suggested standardization approach
related_standard: string | null # Existing standard being violated (optional)
tags: array # Keywords
- string # "naming", "error-handling", etc.Once .claude/consistency-violations.yaml accumulates entries, developers can:
signal-capture: When team decides which pattern to standardize
Consistency violation identified → Team picks preferred pattern → Use signal-capture to add standardimplicit-decision-capture: When making a choice in inconsistent area
AI must pick one pattern → Log implicit-decision-capture for the choice made
Inconsistency causes uncertainty → Log the decision with the question fieldREMEMBER: This skill is MANDATORY during codebase exploration. When you find inconsistencies, you MUST log them - this is not optional. The logging happens automatically without user interaction. Failure to trigger this skill when inconsistencies are discovered is a missed opportunity for improving codebase quality.
e198635
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.