system-consistency-checker
Validate consistency across planner, OpenAPI, DB, backend, and frontend.
SKILL.md 原文预览
Skill: system-consistency-checker
Purpose
Validate the full system across all layers:
- planner
- OpenAPI
- DB schema
- backend code
- frontend code
The goal is to detect drift before it becomes production breakage.
Source of Truth Hierarchy
Use this consistency order:
- planner defines intended module scope and business rules
- OpenAPI defines the API contract
- DB schema must align with planner + OpenAPI
- backend must implement OpenAPI
- frontend must consume OpenAPI
If a layer conflicts with the contract chain, flag it.
Validation Domains
1. Planner -> API
Check:
- every planned endpoint exists in OpenAPI
- business rules are reflected
- naming stays consistent
- no major missing capability
2. API -> DB
Check:
- important API fields exist in DB
- types align reasonably
- enum/status handling is consistent
- soft delete semantics are represented
- ownership/relations are backed by schema relations
3. API -> Backend
Check:
- all endpoints implemented
- correct HTTP methods
- request DTOs align
- response VOs align
- standard success wrapper is used
- pagination wrapper is used correctly
4. Backend architecture
Check:
- controller -> service -> impl -> mapper flow
- no business logic in controller
- no entity exposure
- DTO/VO layers exist
- convertor usage is reasonable
- module structure is respected
5. API -> Frontend
Check:
- API functions exist for needed endpoints
- types reflect OpenAPI
- frontend unwraps
ApiResponse<T>correctly - paginated flows use wrapped
data - routes/pages/stores match module needs
- module files live under
frontend/src/modules/<module_name>/ - shared code lives under
frontend/src/shared/
6. DB quality
Check:
- PK/FK/index quality
- uniqueness enforcement
- deleted_at presence
- schema cleanliness
Contract Checks
Response wrapper check
All success flows must use:
{
"code": 0,
"message": "success",
"data": {}
}
Pagination wrapper check
Paginated success flows must use:
{
"code": 0,
"message": "success",
"data": {
"content": [],
"page": 1,
"size": 10,
"total": 100
}
}
Flag any layer that behaves as if pagination is a raw top-level response.
Frontend Structure Check
This project uses:
- one Vue app
- module-based feature folders
- shared generic code under shared
- admin/storefront separation through routes/layouts/guards
Flag as inconsistent if:
- code is placed in
frontend/apps/-- - module code is placed outside
frontend/src/modules/<module_name>/ - business code is incorrectly pushed into shared
Backend Structure Check
This project uses:
- backend module folders under
backend/src/main/java/com/yourapp/modules/<module_name>/
Flag as inconsistent if:
- repository is introduced without JPA requirement
- entity is exposed directly
- module files appear outside intended business module structure
Severity Guidance
CRITICAL
- missing API implementation
- wrong endpoint used by frontend
- broken wrapper contract
- DB relationship missing where critical
- path mismatch that breaks generation pipeline
HIGH
- schema inconsistency
- architecture violation
- pagination mismatch
- wrong module placement
- missing validation
MEDIUM
- naming inconsistency
- missing index
- duplication / weak organization
LOW
- style / formatting / comment quality
Reviewer Behavior Rule
When inconsistency is found:
- identify exact file/path
- state why it breaks contract or architecture
- suggest the smallest safe correction
Do not redesign the project unless the structure itself is contradictory.
Final Goal
The system should be:
- internally consistent
- contract-safe
- architecture-aligned
- maintainable
- ready for debug/fix/deploy
评论
