Skip to content
architecture-lint logo

Architecture Lint Skill

architecture-lint

Detect clean architecture layer violations and check dependency rule violations. Verify dependency direction of events→facades→services→repository.

SKILL.md

Full skill instructions

Architecture Lint Skill

This skill detects code that violates clean architecture rules in the project.

Detected Violations

1. Cross-Layer Direct Access

  • Direct calls from Events layer to Service/​Repository layers ❌

    • Events layer should only call Facade layer
  • Direct calls from Facade layer to Repository layer ❌

    • Facade layer should access Repository layer through Service layer
  • Direct calls from Service layer to other Service layers ❌

    • Service coordination should be done in Facade layer

2. Transaction Management Violations

  • Transaction start/​commit/​rollback in Service layer ❌

    • db.begin(), txn.commit(), txn.rollback() only in Facade layer
  • Transaction start/​commit/​rollback in Repository layer ❌

    • Repository layer only receives and uses transactions

3. Database Connection Violations

  • Creating individual DB connections in each layer ❌
    • DB connections should be obtained from AppState and shared

Detection Method

Step 1: Identify files in each layer

src/​events/​**/​*.rs       → Events layer
src/​facades/​**/​*.rs      → Facade layer
src/​services/​**/​*.rs     → Service layer
src/​repository/​**/​*.rs   → Repository layer

Step 2: Analyze use statements and method calls

  • Search Events layer files for use crate::services:: or use crate::repository::
  • Search Facade layer files for use crate::repository::
  • Search Service layer files for .begin(), .commit(), .rollback()

Step 3: Report violations

For each violation:

  • File path
  • Line number
  • Violation details
  • Recommended fix

Output Format

## Clean Architecture Violation Report

### 🔴 Critical Violations (X items)

#### 1. Direct access from Events layer to Repository layer
- **File**: src/​events/​recruitment/​join.rs:42
- **Violation**: `use crate::repository::recruitment::RecruitmentRepository;`
- **Recommendation**: Access through Facade layer

### 🟡 Warning-level Violations (Y items)

#### 2. Transaction management in Service layer
- **File**: src/​services/​quest/​quest_service.rs:128
- **Violation**: `let txn = db.begin().await?;`
- **Recommendation**: Manage transactions in Facade layer, receive as argument in Service layer

### ✅ No Violations Detected

All layers are properly separated!

Usage Example

User: Check architecture violations
Claude: [Executes architecture-lint skill]

Implementation Guidelines

When using this skill, Claude should:

  1. Search for violation patterns with Grep tool

    • Events layer: use crate::(services|repository)::
    • Facade layer: use crate::repository::
    • Service/​Repository layers: \.begin\(\)|\.commit\(\)|\.rollback\(\)
  2. Analyze detection results

    • Exclude legitimate uses (e.g., in test code)
    • Determine violation severity
  3. Generate fix suggestions

    • Provide specific fix methods for each violation
    • Provide code examples if needed

Notes

  • Code within #[cfg(test)] is excluded from inspection
  • main.rs and setup code treated as exceptions
  • use statements in type/​trait definitions don't count as violations (only actual calls)

More skills from majiayu000

xiaohongshu logo
majiayu000/claude-arsenal

xiaohongshu

xiaohongshu

286 148
View
agent-task-conductor logo
majiayu000/claude-skill-registry

agent-task-conductor

Conduct multi-agent task orchestration and workflow coordination.

663 1
View
conductor-setup logo
majiayu000/claude-skill-registry

conductor-setup

Initialize project with Conductor artifacts (product definition,

663 1
View
animation-designer logo
majiayu000/claude-skill-registry

animation-designer

Expert in web animations, transitions, and motion design using Framer Motion and CSS

663 1
View
diagramming logo
majiayu000/claude-skill-registry

diagramming

Creates Mermaid and ASCII diagrams for flowcharts, architecture, ERDs, state machines, mindmaps, and more. Use when user mentions diagram, flowchart, mermaid, ASCII diagram, text diagram, terminal diagram, visualize, C4, mindmap, architecture diagram, sequence diagram, ERD, or needs visual docume...

663 1
View
h3-pg logo
majiayu000/claude-skill-registry-data

h3-pg

PostgreSQL bindings for H3 hexagonal grid system. Use when working with H3 cells in Postgres, including spatial indexing, geometry/geography integration, and raster analysis.

23 1
View
conductor-development logo
majiayu000/claude-skill-registry

conductor-development

Context-Driven Development skill for projects using Conductor. Use this skill when you detect a `conductor/` directory in the project, when working on tasks defined in a `plan.md` file, or when the user asks about tracks, specs, or plans. Automatically applies TDD workflow, tracks task completion...

663 1
View
conductor-status logo
majiayu000/claude-skill-registry

conductor-status

Display project status, active tracks, and next actions

663 1
View
dockerization logo
majiayu000/claude-skill-registry

dockerization

Official Stakpak application containerization standard operating procedure, a step-by-step guidline to properly dockerize applications. This is a rule book curated by the Stakpak Team.

663 1
View

Popular AI tools

Kaiber logo
Video

Kaiber

Generate, edit, and beat-sync AI video with leading models in one workspace.

Paid
View
Vimcal logo
Productivity

Vimcal

The world's fastest calendar for remote work

Free
View

Transform Your Design with AI Designer by ImgCreator.ai

Freemium
View
Akool AI logo
Content & writing

Akool AI

Revolutionizing Video Production with AI-Powered Creativity

Paid
View

Extend an image past the frame and let AI fill the new aspect ratio.

Freemium
View
StarByFace logo
Security

StarByFace

Discover your celebrity doppelgänger with StarByFace!

Free
View
C

ChainClarity explains 700+ crypto whitepapers in plain English, with layered summaries, comparisons, research tools, alerts, and a $4.99 Pro plan.

Freemium
View
Opus Clip logo
Coding & apps

Opus Clip

Opus.ai: Revolutionize Your Web Experience

Free
View