Understanding the Scope Rule
What exactly is the Scope Rule?
What exactly is the Scope Rule?
- Code used by 2+ features → MUST go in global/shared directories
- Code used by 1 feature → MUST stay local in that feature
- NO EXCEPTIONS - This rule is absolute and non-negotiable
Why is the Scope Rule so strict with 'no exceptions'?
Why is the Scope Rule so strict with 'no exceptions'?
- Eliminates decision fatigue: No debates about edge cases or “just this once” scenarios
- Ensures predictability: Every team member knows exactly where code belongs
- Prevents drift: No gradual erosion of architectural principles over time
- Enforces discipline: Strict rules lead to cleaner, more maintainable codebases
What is Screaming Architecture and why does it matter?
What is Screaming Architecture and why does it matter?
- New developers understand the domain immediately
- Structure reflects business logic, not technology
- Features are self-contained and easy to locate
- Refactoring is safer and more predictable
How does this differ from other architectural patterns?
How does this differ from other architectural patterns?
| Pattern | Approach | Problems |
|---|---|---|
| Traditional MVC | Organize by type (controllers/, models/, views/) | Hard to find related code |
| Generic Components Folder | Put everything in components/ | Becomes a dumping ground |
| Domain-Driven Design | Complex layering and abstractions | Often over-engineered for frontend |
| Scope Rule | Organize by usage scope | None - perfect traceability |
Using the Agents
Which agent should I use for my project?
Which agent should I use for my project?
- Angular 20+ → Use
scope-rule-architect-angular- Best for: Enterprise apps, standalone components, signals
- Next.js 15+ → Use
scope-rule-architect-nextjs- Best for: Full-stack React, SSR/SSG, App Router
- Astro 5+ → Use
scope-rule-architect-astro- Best for: Content sites, blogs, marketing pages, minimal JS
- React (other) → Use
scope-rule-architect-React- Best for: Create React App, Vite, custom setups
Can I use multiple agents in the same project?
Can I use multiple agents in the same project?
Do the agents work with older framework versions?
Do the agents work with older framework versions?
- Angular agent: Angular 20+ (standalone components, signals)
- Next.js agent: Next.js 15+ (App Router, Server Components)
- Astro agent: Astro 5+ (Content Collections, Islands)
How do agents integrate with MCP servers?
How do agents integrate with MCP servers?
- Angular agent → Uses Angular CLI MCP for current best practices
- Astro agent → Uses Astro Docs MCP for latest patterns
- Next.js agent → Built-in Next.js knowledge
Common Scenarios
I have a component used in 2 features now, but might be used in more later. Where should it go?
I have a component used in 2 features now, but might be used in more later. Where should it go?
What about utility functions, hooks, or helpers?
What about utility functions, hooks, or helpers?
How do I handle components that are similar but not identical?
How do I handle components that are similar but not identical?
What about third-party component libraries (Material UI, Shadcn, etc.)?
What about third-party component libraries (Material UI, Shadcn, etc.)?
How should I handle API clients and data fetching?
How should I handle API clients and data fetching?
core/ because it’s a singleton service used app-wide. Feature-specific endpoints stay local until used by multiple features.What if a component needs to be moved later?
What if a component needs to be moved later?
- Move the component to shared/
- Update all imports
- This is a normal refactoring
- Move it back to the feature
- Update imports
- Remove unnecessary abstraction
Edge Cases
What about components used in layouts or error boundaries?
What about components used in layouts or error boundaries?
How do I handle test utilities and mocks?
How do I handle test utilities and mocks?
What about TypeScript types and interfaces?
What about TypeScript types and interfaces?
Getting Help
Where can I get help with architectural decisions?
Where can I get help with architectural decisions?
- Use the agents: Ask Claude Code with the appropriate agent loaded
- GitHub Discussions: Open a discussion in the repository
- Issues: Report bugs or request clarifications
- Community: Join the Gentleman Programming community
How can I contribute or suggest improvements?
How can I contribute or suggest improvements?
- Reporting bugs
- Creating new framework agents
- Improving documentation
- Sharing architectural patterns
