Skip to content
Back to skills

Coordination

ASecurity

Enforce architecture layer boundaries defined in AGENTS.md — detect and fix import violations

  • 24 stars
  • 0 votes
  • 0 copies
  • 3 views
  • Added October 14, 2026
developmentjavascripttypescriptpythongojavaphpbashnodefastapiapi

Works with

  • cli
  • api

Security analysis

A100/100

Pro scans all 12 files and shows the line behind each finding

Scanned November 22, 2026

npx -y skills add andreibesleaga/GABBE --skill coordination --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Coordination?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Coordination
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/andreibesleaga-coordination-3fadaec5/badge)](https://www.skillsdirectory.com/skills/andreibesleaga-coordination-3fadaec5)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: agentic-linter
description: Enforce architecture layer boundaries defined in AGENTS.md — detect and fix import violations
triggers: [architecture lint, boundary, import violation, layer check, ADD, circular dependency, dependency check]
tags: [coordination]
context_cost: medium
---
# Agentic Linter Skill

## Goal
Enforce the architectural layer rules defined in AGENTS.md Section 3. Act as a semantic linter that detects boundary violations and proposes concrete fixes using the Dependency Inversion Principle.

## Steps

1. **Load architecture rules from AGENTS.md**
   - Read AGENTS.md Section 3 (Architecture Rules / Layer Definitions)
   - Map each layer to its allowed imports
   - Note any project-specific forbidden patterns

2. **Run import graph analysis**

   **For TypeScript/JavaScript (Node.js):**
   ```bash
   # Check circular dependencies
   npx madge@8.0.0 --circular --extensions ts,js src/

   # Check layer violations (if .dependency-cruiser.cjs configured)
   npx dependency-cruiser --config .dependency-cruiser.cjs src/
   ```

   **For PHP/Laravel:**
   ```bash
   # Deptrac for DDD layer enforcement
   vendor/bin/deptrac analyse --config-file deptrac.yaml
   ```

   **For Python/FastAPI:**
   ```bash
   # Import Linter (layer rules defined in .import-linter.ini)
   lint-imports
   ```

   **Manual check (if tools not installed):**
   - Read each file in inner layers (domain, application)
   - Scan imports for references to outer layers (infrastructure, HTTP, database)

3. **Classify violations**
   - **Circular dependency:** A → B → A (any length cycle)
   - **Layer inversion:** Inner layer imports outer layer (domain imports infrastructure)
   - **God object:** Class with > 20 public methods (file length is limited by Constitution Article III, not checked here)
   - **Framework leak:** Domain entity imports from web framework or ORM

4. **For each violation, propose a concrete fix**

   **Circular dependency fix:**
   ```typescript
   // PROBLEM: UserService imports OrderService, OrderService imports UserService

   // SOLUTION: Extract shared interface
   // src/domain/ports/user-query-port.ts
   export interface IUserQueryPort {
     findById(id: string): Promise<User | null>;
   }
   // UserService implements IUserQueryPort
   // OrderService depends on IUserQueryPort (not UserService directly)
   ```

   **Layer inversion fix (Dependency Inversion Principle):**
   ```typescript
   // PROBLEM: domain/User.ts imports from infrastructure/PrismaClient

   // SOLUTION: Create interface in inner layer
   // src/domain/ports/user-repository.ts
   export interface IUserRepository {
     save(user: User): Promise<void>;
     findById(id: string): Promise<User | null>;
   }

   // src/infrastructure/prisma-user-repository.ts
   // implements IUserRepository (infrastructure depends on domain, not reverse)
   ```

5. **Apply fixes** (if instructed, or propose for human review)
   - Create the interface file in the inner layer
   - Update the outer layer implementation to implement the interface
   - Update dependency injection wiring in main/composition root
   - Run tests to verify nothing broke

6. **Re-run analysis** — confirm violations are resolved

7. **Generate configuration file** (if requested)
   ```javascript
   // .dependency-cruiser.cjs — generated configuration
   module.exports = {
     forbidden: [
       {
         name: 'domain-not-to-infrastructure',
         severity: 'error',
         from: { path: '^src/domain' },
         to: { path: '^src/infrastructure' }
       },
       {
         name: 'no-circular',
         severity: 'error',
         from: {},
         to: { circular: true }
       }
     ]
   };
   ```

## Constraints
- Do not just report violations — always provide a concrete fix proposal
- Fix proposals must not change the external behavior of the code
- New interface files should be placed in the innermost layer that uses them
- After applying fixes, all existing tests must still pass

## Output Format
Violation report with file:line references + concrete fix for each. Run summary: "[N] violations found, [N] fixed, [N] proposed for review."

## Limits and safety
- Run the analysis tools on a branch or working copy. Do not run project scripts you have not read just to trace imports.
- Do not edit `.dependency-cruiser.cjs`, `deptrac.yaml` or the import-linter config to make a violation disappear; changing them needs the human's yes.
- Propose fixes first. Apply them only when asked, on a branch, and run the full tests before and after.
- A fix must keep access checks and input escaping unchanged; show the diff of any method whose visibility changes.

Files in this skill

  • agent-interop.skill.md3.7 KB
  • agent-protocol.skill.md3.1 KB
  • agent-workflow-patterns.skill.md8.1 KB
  • agentic-linter.skill.md5.5 KB
  • agentic-patterns.skill.md5.4 KB
  • meta-optimize.skill.md4 KB
  • meta-prompting.skill.md2.6 KB
  • multi-agent-orch.skill.md7.5 KB
  • persona-selector.skill.md6.2 KB
  • self-optimize.skill.md5.5 KB
  • swarm-consensus.skill.md3.8 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in development →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.