Post-implementation verification across multiple code dimensions: cross-layer data flow, code reuse analysis, import path validation, and same-layer consistency checks. Identifies missed update sites, type mismatches, and duplicated constants. Use when changes span 3+ architectural layers, after modifying shared constants or configs, after batch file modifications, or when creating new utility functions.
Check if your changes considered all dimensions. Most bugs come from "didn't think of it", not lack of technical skill.
Note: This is a post-implementation safety net. Ideally, read the Pre-Implementation Checklist before writing code.
| Document | Purpose | Timing |
|---|---|---|
| Pre-Implementation Checklist | Questions before coding | Before writing code |
| Code Reuse Thinking Guide |
| Pattern recognition |
| During implementation |
$check-cross-layer (this) | Verification check | After implementation |
git status
git diff --name-only
Based on your change type, execute relevant checks below:
Trigger: Changes involve 3 or more layers
| Layer | Common Locations |
|---|---|
| API/Routes | routes/, api/, handlers/, controllers/ |
| Service/Business Logic | services/, lib/, core/, domain/ |
| Database/Storage | db/, models/, repositories/, schema/ |
| UI/Presentation | components/, views/, templates/, pages/ |
| Utility | utils/, helpers/, common/ |
Checklist:
Detailed Guide: .trellis/spec/guides/cross-layer-thinking-guide.md
Trigger:
Checklist:
# Search in source files (adjust extensions for your project)
grep -r "value-to-change" src/
Detailed Guide: .trellis/spec/guides/code-reuse-thinking-guide.md
Trigger: About to create a new utility/helper function
Checklist:
grep -r "functionNamePattern" src/
Trigger: Just modified similar patterns in multiple files
Checklist:
grep -r "patternYouChanged" src/
Trigger: Creating new source files
Checklist:
Trigger:
Checklist:
grep -r "ConceptName" src/
| Issue | Root Cause | Prevention |
|---|---|---|
| Changed one place, missed others | Didn't search impact scope | grep before changing |
| Data lost at some layer | Didn't check data flow | Trace data source to destination |
| Type/schema mismatch | Cross-layer types inconsistent | Use shared type definitions |
| UI/output inconsistent | Same concept in multiple places | Extract shared constants |
| Similar utility exists | Didn't search first | Search before creating |
| Batch fix incomplete | Didn't verify all occurrences | grep after fixing |
Report: