layer-boundary-guard

Analyzes AST dependency graphs to enforce import gravity rules across agentic_core and application layers.

Updated Oct 9, 2025
One-click install
npx skills add https://github.com/Siamese001/Agentic-Workflow --skill layer-boundary-guard
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: layer-boundary-guard
Source: https://github.com/Siamese001/Agentic-Workflow/tree/main/.windsurf/skills/layer-boundary-guard
Command: npx skills add https://github.com/Siamese001/Agentic-Workflow --skill layer-boundary-guard

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill prevents architectural violations by ensuring that code layers only import from layers with a lower or equal numeric rank, maintaining a strict dependency hierarchy and preventing "layer gravity" issues.

Core Features & Use Cases

  • Import Validation: Checks all import statements against defined gravity rules before they are committed.
  • File Creation Guardrail: Prevents new files from being created in layers that would violate dependency rules.
  • Use Case: Before adding a new utility function to agentic_core/L3_orchestration, this Skill would verify that the function does not attempt to import from L4_state or higher, thus preserving the architectural integrity of the system.

Quick Start

Use the layer-boundary-guard skill to check the proposed import statement in the current file.

Frequently Asked Questions about layer-boundary-guard

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I enforce architectural layer integrity and prevent invalid import dependencies?

To enforce architectural layer integrity, you need to validate import statements against defined gravity rules, ensuring higher-numbered layers never import from lower-numbered ones. This prevents dependency violations and maintains a strict layer hierarchy.

What are layer gravity rules in dependency management?

Layer gravity rules in dependency management dictate that code layers can only import from layers with a lower or equal numeric rank. This mechanism prevents architectural violations by maintaining a strict dependency hierarchy across application layers.

How do I validate AST dependency graphs for import violations before committing code?

You can validate AST dependency graphs by analyzing import statements and file creation operations before they are committed. This process verifies that proposed imports adhere to the specified layer hierarchy and import permissions.

Can I use a pre-commit hook to prevent file creation that violates layering rules?

Yes, using a pre-commit hook allows you to check proposed import statements and guard against new file creation in layers that would violate dependency rules. This prevents architectural violations before code is committed.

Why does my code architecture suffer from dependency violations between orchestration and state layers?

Dependency violations between orchestration and state layers occur when higher-numbered layers incorrectly import from layers they depend on. Analyzing AST dependency graphs against layer gravity rules identifies and prevents these architectural soundness issues.

Does import validation work for preventing dependency violations in agentic_core layers?

Yes, import validation works by analyzing import statements and file creation operations specifically within agentic_core and application layers. It prevents dependency violations where higher layers import from lower layers, ensuring architectural soundness.