agentleFS
lxyerlxyer/multi-agent-collaboration-system/.agents/skills/check-cross-layer/SKILL.md

check-cross-layer

Skill1 starsChanged 7 months agoMITView on GitHub

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.

The file

We split this skill into the rules it gives an agent

2 rules. About 0 are common, 2 are distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Check if your changes considered all dimensions.

    line 8
  2. Distinctive:

    Check results for each dimension

    line 157

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

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 before writing code.


Related Documents

DocumentPurposeTiming
Pre-Implementation ChecklistQuestions before codingBefore writing code
Code Reuse Thinking GuidePattern recognitionDuring implementation
$check-cross-layer (this skill)Verification checkAfter implementation

Execution Steps

1. Identify Change Scope

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

LayerCommon Locations
API/Routesroutes/, api/, handlers/, controllers/
Service/Business Logicservices/, lib/, core/, domain/
Database/Storagedb/, models/, repositories/, schema/
UI/Presentationcomponents/, views/, templates/, pages/
Utilityutils/, 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?
    # 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
    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?
    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
    grep -r "ConceptName" src/
  • Are these usages consistent?
  • Should they share configuration/constants?

Common Issues Quick Reference

IssueRoot CausePrevention
Changed one place, missed othersDidn't search impact scopegrep before changing
Data lost at some layerDidn't check data flowTrace data source to destination
Type/schema mismatchCross-layer types inconsistentUse shared type definitions
UI/output inconsistentSame concept in multiple placesExtract shared constants
Similar utility existsDidn't search firstSearch before creating
Batch fix incompleteDidn't verify all occurrencesgrep after fixing

Output

Report:

  1. Which dimensions your changes involve
  2. Check results for each dimension
  3. Issues found and fix suggestions

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.