| 1 | --- |
| 2 | id: aitoearn-nx-workflow |
| 3 | trigger: "when building, serving, or testing the project" |
| 4 | confidence: 0.95 |
| 5 | domain: build |
| 6 | source: local-repo-analysis |
| 7 | --- |
| 8 | |
| 9 | # Nx Monorepo Workflow |
| 10 | |
| 11 | ## Action |
| 12 | Use Nx commands for all build and development tasks. |
| 13 | |
| 14 | ## Commands |
| 15 | |
| 16 | ### Serve Application |
| 17 | ```bash |
| 18 | pnpm nx serve <project> |
| 19 | ``` |
| 20 | |
| 21 | ### Build Application |
| 22 | ```bash |
| 23 | pnpm nx build <project> |
| 24 | ``` |
| 25 | |
| 26 | ### Run Linting |
| 27 | ```bash |
| 28 | pnpm lint -w |
| 29 | ``` |
| 30 | |
| 31 | ### Run Tests |
| 32 | ```bash |
| 33 | pnpm nx test <project> |
| 34 | ``` |
| 35 | |
| 36 | ## Available Projects |
| 37 | - `aitoearn-ai` |
| 38 | - `aitoearn-server` |
| 39 | |
| 40 | ## Build Verification Rules |
| 41 | - Always use `pnpm nx build <project>` to verify |
| 42 | - Never use `tsc` directly |
| 43 | - After renaming methods, run build to ensure all references updated |
| 44 | |
| 45 | ## Pre-commit |
| 46 | - Lint runs automatically via `lint-staged` |
| 47 | - Must pass `pnpm lint -w` before commit |
| 48 | |
| 49 | ## Evidence |
| 50 | - Nx configuration in `nx.json` |
| 51 | - Build scripts in `package.json` |
| 52 | - Enforced in CLAUDE.md development standards |
| 53 |