project-architecture · git:20260630.b382a2b · 2026-06-30 · sha256 e6f79cf8e044e4c1

project-architecture git:20260630.b382a2bA

Immutable. This exact content never changes and is served at /api/v1/blob/e6f79cf8e044e4c1.

No tool to install first
claude plugin marketplace add https://markdownregistry.com/mp/a/art_ekqkvsxwufwrbrwn/e6f79cf8e044e4c1a00f4abab10e5cc1210f5c7e76763b707006c5bb6114fec0.json

Then /plugin install project-architecture@markdownregistry-ekqkvsxwufwrbrwn in Claude Code. It installs this exact version, the one graded A here, pinned to the commit it was graded at, and leaves it there.

---
name: project-architecture
description: WitnessWork's three-tier feature architecture (app / features / shared) and its lint-enforced import boundaries. Use when adding or moving files, changing import lines, renaming folders under src/, deciding where new code lives, or resolving an eslint-plugin-boundaries violation.
---

# Project structure & boundaries

Source lives in `src/`, organised into three tiers, enforced at lint time by `eslint-plugin-boundaries`:

- **`src/app/`** — app-tier infra: entry point, navigation, widgets, iCloud sync, deep links. May import from **any** tier.
- **`src/features/<domain>/`** — one folder per domain (`contacts`, `conversations`, `service-reports`, `map`, `milestones`, `supporter`, `profile`, `plans`, `progress`, `home`, `settings`, `updates`, `onboarding`, …). Each holds the subset of `screens/ components/ hooks/ lib/ stores/ types/ constants/` it actually needs. A feature may import from **shared and itself only**.
- **Shared tier** — `src/components/` (`ui/` primitives + root composed blocks), `src/lib/`, `src/hooks/`, `src/stores/`, `src/types/`, `src/constants/`, `src/providers/`, `src/contexts/`, `src/assets/`, `src/locales/`, `src/shaders/`, `src/vendor/`. Importable from anywhere; may only import from **shared**.

Page-level orchestrators (`home`, `settings`, `progress`, `plans`, `updates`, `onboarding`) are classified as `app` in the boundaries config so they can compose across domains. `home` is a **pure orchestrator** — don't add components/hooks/lib under `features/home/`; put domain UI in the owning feature and import it.

Imports use the `@/*` alias (= `src/*`). Prefer `@/features/...` / `@/app/...` / `@/components/...` over relative paths.

## Run `pnpm run lint` after import / file-tree changes

**TypeScript won't catch a boundary violation — only ESLint will.** Run `pnpm run lint` after:

- Adding or moving a file (the path determines its tier).
- Changing any `import` line (it may cross a tier boundary).
- Renaming a folder under `src/features/`, `src/app/`, or `src/components/`.

## Deeper docs

- `docs/project-structure.md` — full directory map, one-line summary of every feature folder.
- `docs/architecture-features.md` — tier rules, boundaries lint config, why some features are classified as `app`, and the `components/ui/` vs `components/` (root) decision.