โ† Back to list
acbcdev

screaming-architecture

by acbcdev

Claude Code: Extensible Plugin Ecosystem for Developers ๐ŸŒŸ

โญ 0๐Ÿด 0๐Ÿ“… Jan 14, 2026

SKILL.md


name: screaming-architecture description: Organize code by feature intent, not framework layers. Structure projects to clearly communicate business purpose at first glance.

Screaming Architecture Skill

Screaming Architecture is a design philosophy where your folder structure screams the purpose of the application. Organize by feature and business domain, not by technical type.


Core Principle

Group by feature, not by type.

โŒ Bad: components/, hooks/, utils/, contexts/ (framework-focused)

โœ… Good: features/todos/, features/auth/, features/dashboard/ (feature-focused)


Project Structure

Top-Level Organization

src/
โ”œโ”€โ”€ features/           # Business features and domains
โ”‚   โ”œโ”€โ”€ todos/
โ”‚   โ”œโ”€โ”€ auth/
โ”‚   โ”œโ”€โ”€ dashboard/
โ”‚   โ””โ”€โ”€ settings/
โ”œโ”€โ”€ common/             # Truly shared utilities (used by 3+ features)
โ”‚   โ”œโ”€โ”€ ui/            # Reusable UI components
โ”‚   โ”œโ”€โ”€ hooks/         # Reusable custom hooks
โ”‚   โ”œโ”€โ”€ utils/         # Utility functions
โ”‚   โ”œโ”€โ”€ types/         # Global type definitions
โ”‚   โ””โ”€โ”€ providers/     # Global providers (Theme, Auth, etc.)
โ”œโ”€โ”€ lib/               # Framework/library integrations
โ”œโ”€โ”€ config/            # App-wide configuration
โ””โ”€โ”€ app.tsx            # Root component

Rule: Features own their code; common utilities are truly cross-cutting.


Feature Folder Structure

Each feature is self-contained with all its code together.

features/todos/
โ”œโ”€โ”€ add-todo-form/
โ”‚   โ”œโ”€โ”€ add-todo-form.tsx       # Component
โ”‚   โ”œโ”€โ”€ add-todo-form.test.tsx   # Tests
โ”‚   โ””โ”€โ”€ add-todo-form.module.css # Styles (optional)
โ”œโ”€โ”€ todo-list/
โ”‚   โ”œโ”€โ”€ todo-list.tsx
โ”‚   โ”œโ”€โ”€ todo-list.test.tsx
โ”‚   โ””โ”€โ”€ todo-item.tsx            # Sub-component
โ”œโ”€โ”€ todo-provider/
โ”‚   โ”œโ”€โ”€ todo-provider.tsx        # Context provider
โ”‚   โ””โ”€โ”€ todo-context.ts          # Context definition
โ”œโ”€โ”€ use-todo/
โ”‚   โ””โ”€โ”€ use-todo.ts              # Custom hook
โ”œโ”€โ”€ types.ts                     # Feature-scoped types
โ”œโ”€โ”€ index.ts                     # Barrel file (exports)
โ””โ”€โ”€ README.md                    # Feature documentation

Rules:

  • One file per component/hook/utility
  • Co-locate related code
  • Use barrel files (index.ts) for clean imports
  • No index.tsx - use descriptive filenames

Naming Conventions

  • Folders: kebab-case with clear feature names: add-todo-form, user-profile, payment-modal
  • Files: kebab-case.tsx (not index.tsx): todo-item.tsx, use-todos.ts, types.ts
  • Components: PascalCase in filename: AddTodoForm.tsx, TodoList.tsx
  • Hooks: use- prefix: use-todo.ts, use-todos.ts
  • Utilities: verb-noun format: format-date.ts, validate-email.ts
  • Types: Plural if exported as barrel: types.ts
  • Styles: Match component name: add-todo-form.module.css
// โœ… Good
features/todos/add-todo-form/add-todo-form.tsx
features/todos/use-todo/use-todo.ts
features/todos/types.ts

// โŒ Bad
features/todos/AddTodoForm/index.tsx
features/todos/hooks/useTodo.ts
features/todos/utils/types.ts

Barrel Files (index.ts)

Export public API from each feature using barrel files.

// features/todos/index.ts
export { AddTodoForm } from './add-todo-form/add-todo-form';
export { TodoList } from './todo-list/todo-list';
export { TodoProvider } from './todo-provider/todo-provider';
export { useTodo } from './use-todo/use-todo';
export type { Todo, TodoContextType } from './types';

// Usage in other features
import { TodoList, useTodo } from 'features/todos';

Rules:

  • Export components, hooks, and types
  • DO NOT export internal utilities or sub-components
  • Keep barrel files organized (components first, hooks, then types)
  • One barrel file per feature (at feature root)

Type Organization

Feature-Scoped Types

Keep types with their feature in types.ts:

// features/todos/types.ts
export interface Todo {
  id: string;
  title: string;
  completed: boolean;
  createdAt: Date;
}

export interface TodoContextType {
  todos: Todo[];
  addTodo: (title: string) => void;
  removeTodo: (id: string) => void;
}

// features/todos/todo-provider/todo-provider.tsx
import type { TodoContextType } from '../types';

Shared Global Types

Put truly shared types in shared/types/:

// shared/types/api.ts
export interface ApiResponse<T> {
  data: T;
  status: number;
  error?: string;
}

// shared/types/user.ts
export interface User {
  id: string;
  name: string;
  email: string;
}

Rule: Minimize global types; prefer feature-scoped types.


Feature Dependencies

DO

  • โœ… Feature can depend on common/
  • โœ… Feature can import from another feature's barrel file
  • โœ… Features can use global providers (common/providers/)

DO NOT

  • โŒ Features should not directly import internals from other features
  • โŒ Circular dependencies between features
  • โŒ Common utilities importing from features
// โœ… Good: Import from barrel file
import { TodoList, useTodo } from 'features/todos';

// โŒ Bad: Import internal implementation
import { TodoProvider } from 'features/todos/todo-provider/todo-provider';

// โŒ Bad: Feature depending on another feature's types directly
import { Todo } from 'features/todos/types';
// Use barrel: import type { Todo } from 'features/todos';

Common Utilities

When to extract to common/:

  1. Used by 3+ features - Sign it's truly shared
  2. Generic utilities - Date formatting, string validation, API helpers
  3. Design tokens & UI components - Buttons, inputs, modals (no business logic)
  4. Custom hooks - Reusable patterns like useLocalStorage, useApi

DO NOT put in common:

// โŒ Bad: Business logic in common
common/hooks/use-todo.ts  // This is todos feature logic

// โŒ Bad: Feature-specific utilities
common/utils/format-todo-date.ts  // This is todos feature logic

// โœ… Good: Truly generic
common/utils/format-date.ts
common/hooks/use-local-storage.ts
common/ui/button.tsx

Common Patterns

Feature with Context Provider

features/auth/
โ”œโ”€โ”€ auth-provider/
โ”‚   โ”œโ”€โ”€ auth-provider.tsx
โ”‚   โ””โ”€โ”€ auth-context.ts
โ”œโ”€โ”€ login-form/
โ”‚   โ””โ”€โ”€ login-form.tsx
โ”œโ”€โ”€ use-auth/
โ”‚   โ””โ”€โ”€ use-auth.ts
โ”œโ”€โ”€ types.ts
โ””โ”€โ”€ index.ts

Feature with Multiple Views

features/dashboard/
โ”œโ”€โ”€ dashboard-header/
โ”‚   โ””โ”€โ”€ dashboard-header.tsx
โ”œโ”€โ”€ dashboard-content/
โ”‚   โ”œโ”€โ”€ dashboard-content.tsx
โ”‚   โ”œโ”€โ”€ chart-widget/
โ”‚   โ”‚   โ””โ”€โ”€ chart-widget.tsx
โ”‚   โ””โ”€โ”€ stats-widget/
โ”‚       โ””โ”€โ”€ stats-widget.tsx
โ”œโ”€โ”€ types.ts
โ””โ”€โ”€ index.ts

Feature with API Integration

features/todos/
โ”œโ”€โ”€ add-todo-form/
โ”‚   โ””โ”€โ”€ add-todo-form.tsx
โ”œโ”€โ”€ todo-list/
โ”‚   โ””โ”€โ”€ todo-list.tsx
โ”œโ”€โ”€ api/
โ”‚   โ”œโ”€โ”€ get-todos.ts
โ”‚   โ”œโ”€โ”€ create-todo.ts
โ”‚   โ””โ”€โ”€ delete-todo.ts
โ”œโ”€โ”€ types.ts
โ””โ”€โ”€ index.ts

Benefits

BenefitWhy
ClarityFolder structure immediately shows business features, not technical layers
SearchabilityFinding todo-related code is intuitive - look in features/todos/
ScalabilityEasy to add new features without restructuring
CollaborationTeam members work on features, not layers; fewer merge conflicts
TestabilityFeatures are isolated; easier to test feature logic independently
OnboardingNew developers see business domains immediately

Anti-Patterns to Avoid

Excessive Nesting

// โŒ Too deep
features/todos/components/forms/add-todo-form/add-todo-form.tsx

// โœ… Flat
features/todos/add-todo-form/add-todo-form.tsx

Generic Folder Names

// โŒ Unclear purpose
features/app/  // What is "app"?
features/common/  // What's common here?

// โœ… Clear feature names
features/todos/
features/auth/
features/settings/

Feature-Specific Code in Shared

// โŒ This is todos logic, not shared
shared/utils/format-todo-date.ts
shared/hooks/use-todo-validation.ts

// โœ… Keep in feature
features/todos/format-todo-date.ts
features/todos/use-todo-validation.ts

Circular Dependencies

// โŒ todos imports auth, auth imports todos
features/todos/ โ†’ features/auth/
features/auth/ โ†’ features/todos/

// โœ… Both depend on shared if needed
features/todos/ โ†’ shared/
features/auth/ โ†’ shared/

Deep Component Nesting

// โŒ Sub-components buried
features/todos/todo-list/components/list/item/todo-item.tsx

// โœ… Sub-components at feature level
features/todos/todo-item.tsx
features/todos/todo-list.tsx

Quick Reference

  • Organize by feature, not technical type
  • Co-locate everything related to a feature
  • Use kebab-case for files and folders
  • Avoid index.tsx - use descriptive names
  • One barrel file per feature exports public API
  • Keep types with their feature
  • Share only what's truly generic (3+ features or framework utilities)
  • No feature should import internals from another feature
  • Flat hierarchy - avoid excessive nesting

The codebase should scream its business purpose.

Score

Total Score

55/100

Based on repository quality metrics

โœ“SKILL.md

SKILL.mdใƒ•ใ‚กใ‚คใƒซใŒๅซใพใ‚Œใฆใ„ใ‚‹

+20
โ—‹LICENSE

ใƒฉใ‚คใ‚ปใƒณใ‚นใŒ่จญๅฎšใ•ใ‚Œใฆใ„ใ‚‹

0/10
โ—‹่ชฌๆ˜Žๆ–‡

100ๆ–‡ๅญ—ไปฅไธŠใฎ่ชฌๆ˜ŽใŒใ‚ใ‚‹

0/10
โ—‹ไบบๆฐ—

GitHub Stars 100ไปฅไธŠ

0/15
โœ“ๆœ€่ฟ‘ใฎๆดปๅ‹•

1ใƒถๆœˆไปฅๅ†…ใซๆ›ดๆ–ฐ

+10
โ—‹ใƒ•ใ‚ฉใƒผใ‚ฏ

10ๅ›žไปฅไธŠใƒ•ใ‚ฉใƒผใ‚ฏใ•ใ‚Œใฆใ„ใ‚‹

0/5
โœ“Issue็ฎก็†

ใ‚ชใƒผใƒ—ใƒณIssueใŒ50ๆœชๆบ€

+5
โœ“่จ€่ชž

ใƒ—ใƒญใ‚ฐใƒฉใƒŸใƒณใ‚ฐ่จ€่ชžใŒ่จญๅฎšใ•ใ‚Œใฆใ„ใ‚‹

+5
โœ“ใ‚ฟใ‚ฐ

1ใคไปฅไธŠใฎใ‚ฟใ‚ฐใŒ่จญๅฎšใ•ใ‚Œใฆใ„ใ‚‹

+5

Reviews

๐Ÿ’ฌ

Reviews coming soon