| name | architecture-enforcement |
| description | Use when file placement, dependency direction, framework conventions, or project architecture presets must be verified before writing code. |
Architecture Enforcement
Overview
Enforce clean architecture aligned with each framework's best practices. Detect the project branch, load only its detailed reference, then verify placement and dependencies before writing code.
Announce: "I'm using the architecture-enforcement skill to verify code placement and dependencies."
Scope: This skill checks placement, dependency direction, and framework conventions. Use /sc-explore or /sc-plan when the deeper question is whether a module, interface, seam, or adapter is shaped well enough to build.
When to Use
- Before creating any new file — verify it goes in the correct directory
- Before adding imports — verify dependency direction is allowed
- During code review — check for architectural violations (P1 Critical)
- When setting up a new project — load the matching preset
Process
- Inspect
.agent/rules/project-config.md, manifests, framework config, and nearby folders. Match architecture plus backend.framework / frontend.framework.
- Load only the detected framework reference below. Load multiple guides only when the change crosses those branches. Do not preload unrelated references.
- For project setup only, copy the matching preset into
.agent/rules/project-config.md.
- Apply every gate before writing or approving the change.
If unmatched, retain the nearest project conventions; do not invent a layout. If ambiguous, inspect only candidate references needed to decide.
Preset Router
Framework Router
Gates
- Placement gate: The target belongs in the detected guide's folder and layer.
- Dependency gate: Every new import follows that guide's arrows and
NEVER rules.
- Security gate: Every framework MUST implement the patterns in HTTP/security. Load it for HTTP, middleware, auth, CORS, headers, rate limits, public endpoints, or architecture review; placement follows the detected guide.
- Review gate: Report architecture violations as P1 Critical.
Integration
Pair with writing-plans and code-review when placement is valid but module shape, interface, adapter strategy, leverage, or locality needs review. executing-plans checks placement before writing code; code-review verifies compliance. Project-config rules use presets, quality-gates rules use framework specifics, and context7-docs supplies current conventions beyond these references.