check-cross-layer
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.
What this skill does
# Cross-Layer Check 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](.trellis/spec/guides/pre-implementation-checklist.md) **before** writing code. --- ## Related Documents | Document | Purpose | Timing | |----------|---------|--------| | [Pre-Implementation Checklist](.trellis/spec/guides/pre-implementation-checklist.md) | Questions before coding | **Before** writing code | | [Code Reuse Thinking Guide](.trellis/spec/guides/code-reuse-thinking-guide.md) | Pattern recognition | During implementation | | **`$check-cross-layer`** (this skill) | Verification check | **After** implementation | --- ## Execution Steps ### 1. Identify Change Scope ```bash git status git diff --name-only ``` ### 2. Select Applicable Check Dimensions Based on your change type, execute relevant checks below: --- ## Dimension A: Cross-Layer Data Flow (Required when 3+ layers) **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**: - [ ] Read flow: Database -> Service -> API -> UI - [ ] Write flow: UI -> API -> Service -> Database - [ ] Types/schemas correctly passed between layers? - [ ] Errors properly propagated to caller? - [ ] Loading/pending states handled at each layer? **Detailed Guide**: `.trellis/spec/guides/cross-layer-thinking-guide.md` --- ## Dimension B: Code Reuse (Required when modifying constants/config) **Trigger**: - Modifying UI constants (label, icon, color) - Modifying any hardcoded value - Seeing similar code in multiple places - Creating a new utility/helper function - Just finished batch modifications across files **Checklist**: - [ ] Search first: How many places define this value? ```bash # Search in source files (adjust extensions for your project) grep -r "value-to-change" src/ ``` - [ ] If 2+ places define same value -> Should extract to shared constant - [ ] After modification, all usage sites updated? - [ ] If creating utility: Does similar utility already exist? **Detailed Guide**: `.trellis/spec/guides/code-reuse-thinking-guide.md` --- ## Dimension B2: New Utility Functions **Trigger**: About to create a new utility/helper function **Checklist**: - [ ] Search for existing similar utilities first ```bash grep -r "functionNamePattern" src/ ``` - [ ] If similar exists, can you extend it instead? - [ ] If creating new, is it in the right location (shared vs domain-specific)? --- ## Dimension B3: After Batch Modifications **Trigger**: Just modified similar patterns in multiple files **Checklist**: - [ ] Did you check ALL files with similar patterns? ```bash grep -r "patternYouChanged" src/ ``` - [ ] Any files missed that should also be updated? - [ ] Should this pattern be abstracted to prevent future duplication? --- ## Dimension C: Import/Dependency Paths (Required when creating new files) **Trigger**: Creating new source files **Checklist**: - [ ] Using correct import paths (relative vs absolute)? - [ ] No circular dependencies? - [ ] Consistent with project's module organization? --- ## Dimension D: Same-Layer Consistency **Trigger**: - Modifying display logic or formatting - Same domain concept used in multiple places **Checklist**: - [ ] Search for other places using same concept ```bash grep -r "ConceptName" src/ ``` - [ ] Are these usages consistent? - [ ] Should they share configuration/constants? --- ## Common Issues Quick Reference | 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 | --- ## Output Report: 1. Which dimensions your changes involve 2. Check results for each dimension 3. Issues found and fix suggestions
Related in General
modeling-omnistudio-epc-catalog
IncludedSalesforce Industries CME EPC product-modeling skill for Product2-based catalog creation. Use when creating EPC products, configuring product attributes, building offer bundles with Product Child Items, or reviewing EPC DataPack JSON metadata for product catalog changes. TRIGGER when: user creates or updates Product2 EPC records, AttributeAssignment payloads, AttributeMetadata/AttributeDefaultValues, Offer bundles, or ProductChildItem relationships. DO NOT TRIGGER when: designing OmniScripts/FlexCards/Integration Procedures (use building-omnistudio-omniscript, building-omnistudio-flexcard, or building-omnistudio-integration-procedure), implementing Apex business logic (use generating-apex), or troubleshooting deployment pipelines (use deploying-metadata).
relationship-science-coach
IncludedUse this skill for direct, practical adult relationship coaching: couples conflict, repair, trust, marriage, dating, flirting, attachment patterns, emotional connection, sex, desire differences, eroticism, kink negotiation, affection, love languages, breakups, and long-term passion. Draw on Gottman, EFT and Hold Me Tight, attachment science, modern sex research, Perel, Nagoski, Kerner, Schnarch, Love and Stosny, and flexible love-language tools. Be concrete and low-hedge. Redirect only for imminent danger, abuse, coercive control, minors, non-consent, self-harm, stalking, or medical/legal/psychiatric decisions.
building-sf-integrations
IncludedSalesforce integration architecture and runtime plumbing with 120-point scoring. Use this skill to set up Named Credentials, External Credentials, External Services, REST/SOAP callout patterns, Platform Events, and Change Data Capture. TRIGGER when: user sets up Named Credentials, External Services, REST/SOAP callouts, Platform Events, CDC, or touches .namedCredential-meta.xml files. DO NOT TRIGGER when: Connected App/OAuth config (use configuring-connected-apps), Apex-only logic (use generating-apex), or data import/export (use handling-sf-data).
venue-templates
IncludedAccess comprehensive LaTeX templates, formatting requirements, and submission guidelines for major scientific publication venues (Nature, Science, PLOS, IEEE, ACM), academic conferences (NeurIPS, ICML, CVPR, CHI), research posters, and grant proposals (NSF, NIH, DOE, DARPA). This skill should be used when preparing manuscripts for journal submission, conference papers, research posters, or grant proposals and need venue-specific formatting requirements and templates.
let-fate-decide
IncludedDraws the 12 Houses of the Zodiac Tarot spread to inject entropy into planning when prompts are vague, ambiguous, or casually delegated. Interprets the spread to guide next steps. Use when the user says 'let fate decide', 'YOLO', 'whatever', 'idk', or other nonchalant phrases, makes Yu-Gi-Oh references, or when you are about to arbitrarily pick between multiple reasonable approaches. Prefer over ask-questions-if-underspecified when the user's tone is casual or playful rather than precision-seeking.
net-ops
IncludedCross-platform network troubleshooting (Windows, macOS, Linux) via local or remote shell. Use for: DNS broken, can't resolve hostnames, nslookup/dig works but apps fail, NRPT, WFP, scutil, /etc/resolver, systemd-resolved, /etc/resolv.conf, NetworkManager, VPN DNS leak residue (ProtonVPN/Mullvad/WireGuard/AnyConnect), AV/firewall blocking DNS or DoH, Tailscale DNS interaction, intermittent connectivity, remote diagnostics over SSH.