# 40 00 Architecture Index

> Architecture primer index. Read this first before any structural work — it points you to the specific principle you need. Progressive exploration, not bulk loading.

- Skill: `majiayu000/40-00-architecture-index` (Agent Skill, multi-file: 2 files)
- Install (CLI): `npx skillmds add majiayu000/40-00-architecture-index`
- Raw SKILL.md: https://api.skillmd.com/api/skills/majiayu000/40-00-architecture-index/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: majiayu000 (https://skillmd.com/u/majiayu000)
- Updated: 2026-09-09
- Page: https://skillmd.com/skills/majiayu000/40-00-architecture-index

---


# 40.00 Architecture Index

Architectural principles for building and modifying code. Each entry prevents a specific class of decay. **Don't read them all** — find the one that matches your situation, read it, apply it.

### General (any language)

| ID | Primer | Read before... |
|----|--------|---------------|
| `40.01` | State ownership | Creating mutable state anywhere |
| `40.02` | Module boundaries | Creating a new file or growing an existing one |
| `40.03` | Dependency direction | Importing between layers |

### TypeScript / React

| ID | Primer | Read before... |
|----|--------|---------------|
| `40.04` | Domain logic separation | Putting logic in React hooks, callbacks, or closures |
| `40.05` | Singleton patterns | Writing a factory, closure, or class for something with one instance |

## Quick decision aid

- **"Where does this state live?"** → `40.01`
- **"Should this be a new file?"** → `40.02`
- **"Can A import B?"** → `40.03`
- **"This hook is getting complex"** → `40.04` (TS)
- **"Should I make a factory/class for this?"** → `40.05` (TS)
- **"This file is 1000+ lines, how do I split it?"** → `30.04` (closure monolith decomposition)

