enforcing-architecture
Enforcing Architecture
Set up mechanical architecture enforcement — not prompts asking the agent to "be careful," but a check script wired into hooks that runs on every file edit and catches layer violations automatically.
Output: An ARCHITECTURE.md, a check script (scripts/check-architecture.{py,mjs,sh}), and a PostToolUse hook that shows violations to the agent inline.
When to use: After project initialization, or when a project has clear layers (controllers/services/models, app/lib/data, etc.) that should not import in the wrong direction. Skip for small projects, prototypes, or single-layer apps.
Reference Files
| File | Read When |
|---|---|
references/layer-patterns.md |
Detecting architecture style or suggesting layer boundaries for a specific stack |
Workflow
- [ ] Phase 1: Detect architecture signals
- [ ] Phase 2: Interview for boundaries and rules
More from riccardogrin/skills
creating-sprites
Guides pixel-art sprite creation via OpenAI gpt-image-1.5 image generation with automated processing. Covers sizing, prompting, transparency verification, downscaling, and cropping. Use when creating game sprites or pixel art assets
18creating-skills
Guides creation of agent skills following best practices and the open format specification. Covers pattern selection, frontmatter, directory structure, reference files, validation, and iteration. Use when creating a new skill, updating SKILL.md, or asking "how to write a skill
16looping-tasks
Generates an autonomous implementation loop that executes tasks from a plan across Claude sessions, with periodic audit passes that inject follow-up tasks. Covers loop script, prompt design, and audit cadence. Use when setting up autonomous task execution or Ralph-style iterative workflows
16planning
Creates implementation-ready plans through discovery interviews, external research, and codebase analysis. Covers requirements, competitor research, architecture decisions, and change sequencing. Use when planning features, roadmaps, specs, or any work that needs discovery before coding
14listing-docs
Scans docs/ folder for markdown files with YAML front-matter and lists their summaries and read_when hints. Helps identify relevant documentation before coding. Use when starting a task, checking available docs, or asking "what docs exist
14initializing-projects
Generates a minimal, self-maintaining CLAUDE.md for projects through auto-detection and developer interview. Covers project identity, do/don't rules, hooks, and self-maintenance. Use when starting a new project or adding Claude Code support to an existing one
13