|
| 1 | +--- |
| 2 | +description: Org best practices loader — runs for all files |
| 3 | +globs: "**/*" |
| 4 | +--- |
| 5 | + |
| 6 | +# Org Best Practices |
| 7 | + |
| 8 | +Before starting any task in this repo, load org standards in this order: |
| 9 | + |
| 10 | +## Step 1: General Coding Standards |
| 11 | +Read `.claude/best-practices/coding-standards.md`. |
| 12 | +If not found, skip and note it to the user. |
| 13 | + |
| 14 | +## Step 2: Repo-Type Standards |
| 15 | +Determine the repo type: |
| 16 | +1. Check for `.claude/repo-type` and read its contents (single word, e.g. `python_app`) |
| 17 | +2. If not found, infer from project files: |
| 18 | + - `pyproject.toml` or `setup.py` → `python_app` |
| 19 | + - `package.json` + `next.config.*` → `nextjs_app` |
| 20 | + - `package.json` alone → `node_service` |
| 21 | + - `Dockerfile` only → `generic_service` |
| 22 | +3. If type cannot be determined, skip and note it to the user. |
| 23 | + |
| 24 | +Once type is known, read `.claude/best-practices/<repo_type>/best-practices.md`. |
| 25 | +If not found, skip and note it to the user. |
| 26 | + |
| 27 | +## Step 3: Conflict Resolution |
| 28 | +- `coding-standards.md` wins on: style, naming, structure, and DRY principles |
| 29 | +- Repo-type standards win on: tooling, framework patterns, and implementation details |
| 30 | +- If a genuine conflict cannot be resolved by the above, flag it to the user before proceeding |
| 31 | + |
| 32 | +## Step 4: Confirm (first task only) |
| 33 | +On the first task of the session, briefly tell the user: |
| 34 | +- Which standards files were loaded |
| 35 | +- The detected repo type |
| 36 | +- Any files that were missing or could not be determined |
| 37 | +Do not repeat this on subsequent tasks. |
0 commit comments