# CLAUDE.md

> **Admin-modules workspace** — federated-remote Angular targeting the wiresphere admin host. Each `projects/<name>/` is its own Module Federation remote. This file loads every session and carries the always-on guardrails; the detailed, evolving guidance lives in the **aid skills** (they auto-activate) — start with `admin-overview`.

Language: English only across all artifacts — code, docs, identifiers, comments, commits, branch names. Only exception: *values* in localization JSON (`projects/<name>/src/assets/i18n/<locale>.json`); keys stay English.

## Always-on guardrails

- **Never edit transient build output.** Files under `<fiddle>/wpm_modules/` (wpm-managed source clones) and `<fiddle>/scripts/ext-admin-remotes/` (deployed artifacts) are regenerated by wpm — edits there are silently lost and never reach source. Edit the module's own repo clone and rebuild (`npm run ship`). Touch them only if the user explicitly insists. (Detail: the `workspace-conventions` skill.)
- **Component files are split, never inlined.** `@Component` uses `templateUrl` → `<name>.html` and `styleUrl`/`styleUrls` → `<name>.scss`; never inline `template:`/`styles:`. Flag any inlined component you find and offer to extract. (Detail: `workspace-conventions`.)
- **Federation config integrity.** `federation.config.js` MUST use `share(remoteShared({ self, own }))` + `externals: remoteExternals({ self, own })` from `@wiresphere/shared` — never a raw `shared: { ... }`. Every shared package exists exactly once at runtime (no module duplication). Workspace libs declare ONLY `@wiresphere/shared` (+ genuine lib-local siblings) as peerDeps — never `@angular/*`, `rxjs`, `tslib` (those flow from the BOM). (Detail: `federation-error-catalogue`, `remotes-distribution`.)
- **Reuse before inventing.** Check `ws-framework`, `shop-common`, `@wiresphere/ws-core`, `@wiresphere/shared`, and sibling `projects/` before adding a helper / component / service. (Detail: `admin-overview`, `root-injectables`.)

## Where the detail lives

Evolving guidance ships as **aid skills** (auto-activating, via the aid marketplace plugin) plus per-package skills under `node_modules/@wiresphere/*/.claude/skills/`. Consult, in order: the current `projects/<name>/`'s `MODULE.md` / `TODO.md` / `CHANGELOG.md`, then the aid skills (`admin-overview`, `routing`, `localization`, `validation`, `root-injectables`, `pipes`, `workspace-conventions`, `federation-error-catalogue`, …), then ask. Treat `MODULE.md` / `TODO.md` / `CHANGELOG.md` as starting points — verify against source and surface drift.

## When in doubt

Ask the user — don't guess. Federation errors compound; a wrong guess can corrupt a deploy in ways that take an hour to untangle.
