CLAUDE.md
CLAUDE.mdCLAUDE.mdroot
Quality
97/100
Scores the file, not the repository.Length
780 words
39 headings · 7 code blocksRepository
0
— · pushed 4 days agoLast changed
3 days ago
First indexed 3 days ago.1# CLAUDE.md23Claude adapter for Middle Earth AI instructions. This file is generated from canonical `.ai/`.45## Equality rule67- Cursor, Claude, and Codex are configured as equals.8- Capability parity is mandatory across all three.9- Canonical source remains tool-agnostic in `.ai/`.1011## Claude runtime1213- Baseline settings: `.claude/settings.json`14- Skills: `.claude/skills/*/SKILL.md`15- Agents: `.claude/agents/*.md`1617## Required workflow18191. Update canonical docs under `.ai/`.202. Run `pnpm ai:sync`.213. Run `pnpm ai:check`.2223## Canonical references2425- `.ai/README.md`26- `.ai/DEFINITIONS.md`27- `.ai/STANDARDS.md`28- `.ai/PARITY_MATRIX.md`29- `.ai/PROJECT_CONTEXT.md`3031## Capability counts3233- Rules: 1134- Skills: 835- Agents/Roles: 23637# Middle Earth Project Context3839Project-specific knowledge for AI assistants working on Middle Earth. This content is appended to the generated CLAUDE.md adapter.4041## Project Overview4243Middle Earth is a monorepo for Carrot Foundation's publishable libraries. It contains shared packages consumed by other Carrot repos. There are no applications — only publishable libraries.4445- **@carrot-foundation/eslint-config-carrot** — Shared ESLint configuration46- **@carrot-foundation/web-logger** — Pino-based logger utility for web applications47- **@carrot-foundation/web-ui** — React UI component library (MUI-based, atomic design)4849## Technology Stack5051- **Monorepo**: Nx 21.6.3 workspace with pnpm 10.2.052- **Node**: 22.20.0 (see `.nvmrc`)53- **Language**: TypeScript 5.3.3 (strict mode, verbatimModuleSyntax)54- **Frontend**: React 19, Next.js 15.5.4, MUI 7.x55- **Logging**: Pino 10.x56- **Build**: SWC (swc/cli, swc/core)57- **Testing**: Jest 29.4.1 with @nx/jest58- **Linting**: ESLint 8.56.0 (Airbnb, SonarJS, Unicorn, Security, Perfectionist, Prettier)59- **Release**: Semantic Release 22.0.12 with independent versioning60- **Git Hooks**: Husky 9.x with lint-staged61- **Commit Linting**: Commitlint with cz-git6263## Architecture6465### Directory Structure6667```68libs/publishable/69 eslint-config-carrot/ # @carrot-foundation/eslint-config-carrot70 web/71 logger/ # @carrot-foundation/web-logger72 ui/ # @carrot-foundation/web-ui73 src/lib/74 atoms/ # Basic components (Button, Icons)75 molecules/ # Composed components (Share)76 theme/ # Theme configuration and providers77```7879### Path Aliases8081Defined in `tsconfig.base.json`:8283- `@middle-earth/libs/publishable/eslint-config-carrot`84- `@middle-earth/libs/publishable/web/logger`85- `@middle-earth/libs/publishable/web/ui`8687### UI Library (web-ui)8889- Follows **atomic design**: atoms, molecules, theme90- Built on **MUI 7.x** with custom theme91- Uses **React 19** features9293### Key Constraints9495- **Libraries only**: No application code — all libraries in `libs/publishable/`96- **Publishable**: All libraries are published to npm under `@carrot-foundation/`97- **Independent versioning**: Each library versioned separately via semantic-release98- **Path aliases required**: Use `@middle-earth/libs/publishable/*`, NOT relative `../../..`99100## Common Commands101102### Development103104```bash105# Build a library106pnpm nx build <project-name>107108# Run tests109pnpm nx test <project-name>110111# Run linting112pnpm nx lint <project-name>113```114115### Affected Commands116117```bash118# Lint affected projects119pnpm lint:affected # nx affected --target lint --fix120121# Test affected projects (not available — use nx directly)122pnpm nx affected --target test123124# Build affected projects (not available — use nx directly)125pnpm nx affected --target build126```127128### Utilities129130```bash131# Commitizen (guided commit message)132pnpm commit # czg133134# Validate package.json files135pnpm pkgJsonLint # npmPkgJsonLint .136137# Spell check138pnpm spellcheck # cspell (if configured)139```140141## Code Standards142143**Baseline standards**: see `.ai/rules/` for all rules.144145### TypeScript146147- **Strict mode**: `strict: true`, `verbatimModuleSyntax`, `noUnusedLocals`, `noUnusedParameters`148- **Imports**: Use path aliases (`@middle-earth/libs/publishable/*`), NOT relative `../../..`149- **No `any`**: Favor precise types and narrowing150- **Return types**: Explicit for exported functions and public APIs151- **File organization**: `*.constants.ts`, `*.helpers.ts`, `*.types.ts`152153### Testing154155- **Jest** as test runner (NOT Vitest)156- **Unit tests**: `*.spec.ts(x)` in `__tests__/` folders157- **Mocking**: `jest.mock` for modules, `jest.spyOn` for side effects158- **Table-driven tests**: `it.each` for input/output matrices159- **Coverage**: Aim for 100% where feasible160161## Commit Message Guidelines162163### Quick Reference164165- **Format**: `<type>(optional scope): <description>`166- **Types**: `feat`, `fix`, `refactor`, `docs`, `test`, `style`, `perf`, `build`, `ci`, `chore`, `revert`167- **Imperative mood**: "add", "fix", "update" (NOT "added", "fixed", "updated")168- **Lowercase**: Description starts with lowercase letter169- **No period**: Description does NOT end with a period170171### Middle Earth Scopes172173- **`config`**: Root-level configuration files (nx.json, tsconfig.base.json, ESLint, commitlint)174- **`lib`**: Libraries in `libs/publishable/`175- **`release`**: Versioning, releases, publishing176- **`ai`**: AI instructions and rules177178### Examples179180```181feat(lib): add Button component to UI library182chore(config): update ESLint rules for TypeScript files183chore(release): bump eslint-config-carrot to 0.9.0184refactor(lib): simplify logger initialization185```186187## Nx Configuration188189- **Plugins**: @nx/eslint/plugin, @nx/jest/plugin190- **Default Base**: main branch191- **Build**: `@nx/js:swc` compiler192- **Targets per library**: build, lint, test, types, package, publish, release193- **Project Tags**: `type:lib`194195## Important Notes196197- **Package Manager**: pnpm ONLY (enforced by `preinstall` script)198- **Node Version**: 22.20.0 (check `.nvmrc`)199- **Husky Hooks**: Git hooks for pre-commit linting via lint-staged200- **Renovate**: Dependency updates automated with config in `renovate.json`201- **No Docker**: Libraries only — no container builds202- **No Infrastructure**: No Terraform, no AWS resources203204## Troubleshooting205206### Clear Caches207208```bash209pnpm nx reset210```211212### Dependency Issues213214```bash215rm -rf node_modules pnpm-lock.yaml216pnpm install217```218
Also in carrot-foundation/middle-earth
Diff this repo’s formatsOne repository carrying more than one format is the comparison this product exists for: does anyone actually write different content in each file, or is one a copy of the other?
| Repository | Format | Stack | Covers | Score | Changed |
|---|---|---|---|---|---|
| carrot-foundation/middle-earth.cursor/rules/bmad.mdc · 0 | Cursor rules | gitdo-not | 51/100 | 3 days ago | |
| carrot-foundation/middle-earth.cursor/rules/branch-naming.mdc · 0 | Cursor rules | lint-formatstylegitdo-not | 45/100 | 3 days ago | |
| carrot-foundation/middle-earth.cursor/rules/code-comments.mdc · 0 | Cursor rules | styletypesdocs | 48/100 | 3 days ago | |
| carrot-foundation/middle-earth.cursor/rules/code-preservation.mdc · 0 | Cursor rules | do-not | 32/100 | 3 days ago | |
| carrot-foundation/middle-earth.cursor/rules/code-style.mdc · 0 | Cursor rules | lint-formatstylearchdependencies+1 | 56/100 | 3 days ago | |
| carrot-foundation/middle-earth.cursor/rules/commit.mdc · 0 | Cursor rules | testlint-formattypesgit | 58/100 | 3 days ago | |
| carrot-foundation/middle-earth.cursor/rules/documentation.mdc · 0 | Cursor rules | lint-formatstylearchdocs | 42/100 | 3 days ago | |
| carrot-foundation/middle-earth.cursor/rules/pull-request-description.mdc · 0 | Cursor rules | git | 39/100 | 3 days ago | |
| carrot-foundation/middle-earth.cursor/rules/pull-request.mdc · 0 | Cursor rules | lint-formatgitagent-behaviour | 69/100 | 3 days ago | |
| carrot-foundation/middle-earth.cursor/rules/testing.mdc · 0 | Cursor rules | teststyletesting-strategy | 73/100 | 3 days ago | |
| carrot-foundation/middle-earth.cursor/rules/typescript.mdc · 0 | Cursor rules | buildlint-formatstylearch+1 | 59/100 | 3 days ago | |
| carrot-foundation/middle-earthAGENTS.md · 0 | AGENTS.md | setupbuildtestlint-format+7 | 97/100 | 3 days ago |
Diff against .cursor/rules/bmad.mdc Diff against .cursor/rules/branch-naming.mdc Diff against .cursor/rules/code-comments.mdc Diff against .cursor/rules/code-preservation.mdc Diff against .cursor/rules/code-style.mdc Diff against .cursor/rules/commit.mdc Diff against .cursor/rules/documentation.mdc Diff against .cursor/rules/pull-request-description.mdc Diff against .cursor/rules/pull-request.mdc Diff against .cursor/rules/testing.mdc Diff against .cursor/rules/typescript.mdc Diff against AGENTS.md
Similar configs
Same format, overlapping stack, ranked by quality.
| Repository | Format | Stack | Covers | Score | Changed |
|---|---|---|---|---|---|
| Adit-Jain-srm/NightmareNetCLAUDE.md · 45 | CLAUDE.md | buildtestlint-formatstyle+6 | 100/100 | 3 days ago | |
| bagisto/bagistoCLAUDE.md · 28k | CLAUDE.md | setupbuildteststyle+5 | 100/100 | 3 days ago | |
| microsoft/playwrightCLAUDE.md · 94k | CLAUDE.md | buildtestlint-formatstyle+7 | 100/100 | 3 days ago | |
| dotCMS/corecore-web/CLAUDE.md · 949 | CLAUDE.md | teststylearchtesting-strategy+3 | 100/100 | 3 days ago | |
| nimbalyst/nimbalystpackages/android/CLAUDE.md · 1.4k | CLAUDE.md | setupbuildstylearch+2 | 100/100 | 3 days ago | |
| filamentphp/filamentCLAUDE.md · 32k | CLAUDE.md | buildtestlint-formatstyle+7 | 100/100 | 3 days ago | |
| dotCMS/coreCLAUDE.md · 949 | CLAUDE.md | setupbuildteststyle+7 | 99/100 | today | |
| lollipopkit/flutter_server_boxCLAUDE.md · 8.3k | CLAUDE.md | buildteststylearch+2 | 98/100 | 3 days ago |
