easysdd-architecture-check
The longer a design is written, the easier it is for contradictions to hide in the details — terms defined in Section 0 are quietly replaced with synonyms in Section 3; contract examples in Section 2 conflict with key decisions in Section 1; things stated as "not to be done" quietly appear in the implementation steps. Once code is implemented, the gap between "I thought the plan was written this way" and "this is how the code actually is" will gradually widen.
This skill is designed to conduct a targeted health check for such situations — it only identifies inconsistencies without making changes, leaving it up to the user to decide whether and how to fix them.
Applicable Scenarios
- Verify internal consistency of a design before it enters implementation
- Confirm alignment between code and design when a feature is nearing acceptance
- Ensure new content does not conflict with old agreements after revising a design
Not applicable:
- Users want direct fixes → redirect to
easysdd-feature-implement
or
- Users want to make decision-making calls → redirect to
- Users do not have a design → first redirect to
Single-Target Rule
Only one target can be checked each time, choose one of the two:
- : Internal consistency of the design
- : Consistency between design and code
Why is checking two targets at once not allowed? The perspectives and materials required for the two types of checks are completely different — doing both at the same time will result in insufficient depth for both, and issues will easily be mixed up making it unclear who is responsible. If a user proposes two targets, ask them to choose one, and leave the other for next time.
See
easysdd/reference/shared-conventions.md
for shared paths and naming conventions.
Workflow
Phase 1: Lock the Check Target
Confirm three things:
- Current check target ( / )
- Which single feature to check
- Check scope (which section, which module)
If the scope is too broad, ask the user to narrow it down — a report checking the entire design will make it difficult to focus on key points.
Phase 2: Read Materials
Mandatory reading for both targets:
- Full text of the design document
- Relevant documents in the architecture center directory (e.g., DESIGN.md)
- Code files directly corresponding to Sections 2/3 of the design
Phase 3: Execute Check
Target A: design-internal
Cover at least these 6 categories:
- Terminology consistency — whether terms defined in Section 0 are replaced with synonyms or have semantic drift in later sections
- Requirement alignment — whether the summary in Section 1 is consistent and does not deviate from confirmed goals
- Contract closure — whether contract examples in Section 2 have corresponding modification plans in Section 3
- Consistency between examples and decisions — whether the behavior of contract examples in Section 2 conflicts with key decisions in Section 1
- Scope guard — whether modification plans in Section 3 exceed the "explicitly not to be done" items in Section 1
- Implementation executability — whether implementation steps in Section 3 are verifiable and have no conflicting dependencies
Target B: design-vs-code
Cover at least these 6 categories:
- Type consistency — whether core types/fields defined in Section 2 of the design exist in the code and have consistent semantics
- Behavior consistency — whether the input→output stated in Section 2 of the design matches the actual code behavior
- Write path consistency — whether the write entry stated in the design has any additional bypass writes in the code
- Boundary behavior consistency — whether exception/boundary rules in Section 1 of the design are implemented in the code
- Modification boundary consistency — whether the modification scope stated in Section 3 of the design is not exceeded or missing in the code
- Implementation result consistency — whether the exit signals for each step in Section 3 of the design are verifiable in the corresponding code state
Phase 4: Output Check Report
Report format:
markdown
# Architecture Consistency Check Report
> Target: design-internal | design-vs-code
> Scope: {feature}/{module}/{section scope}
> Date: YYYY-MM-DD
> Conclusion: pass | pass-with-risk | fail
## 1. Check Summary
One-sentence summary.
## 2. Inconsistency List
|---|---|---|---|---|---|
| AC-01 | High/Medium/Low | `{file}:{line number}` or `Design Section X` | Description | Consequence | Repair suggestion (not to be executed) |
## 3. Observation Items (Out of Scope, No Modifications)
If the following structural issues are found when reading `easysdd/architecture/`, list them here and let the user decide whether to initiate another workflow to handle them:
- A certain type has ≥6 files in the root directory and is still placed flat (violates the same-type aggregation rule in `easysdd/reference/shared-conventions.md`, should trigger `easysdd-architecture-gen` for relocation)
- File names do not follow `{type}-{slug}.md`, making future aggregation impossible
- Other unreasonable points observed incidentally that are unrelated to the current check target
Omit this section if none.
## 4. Well-Consistent Items
List 2-5 key points that passed the check — a report with only negative information will cause users to lose confidence in the overall system.
## 5. Suggested Next Steps
- fail: Suggest which items to fix first before re-running this skill
- pass-with-risk: Key points to focus on regression during implementation/acceptance
- pass: Proceed to the next phase
How to define severity levels:
- High: Will lead to incorrect implementation directions, or code has substantially deviated from the design (missing key contract implementations, opposite behavior, different references for terms)
- Medium: Intent can be guessed but ambiguity remains, prone to misinterpretation downstream (synonym drift, contract examples and decisions seem aligned but have detail conflicts, unclear exit signals)
- Low: Awkward expression or readability issues, no impact on understanding (poor order, wording can be optimized)
After providing the report to the user, wait for their confirmation of the conclusion — whether to accept it, whether to ask this skill to perform another type of check, or proceed to the next step decided by the user. This skill does not make decisions on behalf of the user.
Hard Boundaries
- Check only, no fixes — modifying design/code/configuration is prohibited
- Single target — only or per check
- Evidence-based — each inconsistency must have a locatable position (file:line number or design section)
- Executable suggestions — specific to "what to change and how to change", but not implemented
- No divergence — out-of-scope issues are only recorded as "observation items" and not explored in depth
Why is direct fixing not allowed? Separating checking and fixing allows users to see the complete inconsistency list and decide priorities holistically — checking while fixing will deprive users of this judgment opportunity.
Exit Conditions
Common Pitfalls
- ❌ Conducting and checks at the same time
- ❌ Modifying code or documents immediately when issues are found
- ❌ Only saying "something is wrong here" without providing evidence location
- ❌ Giving overly abstract suggestions (e.g., "optimize the architecture")
- ❌ Expanding infinitely from one target to full repository audit