Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 30 additions & 4 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,39 @@ Do not commit directly to `main`. Every change goes through a PR.

1. Create a feature branch from `main`
2. Commit changes with conventional commit messages
3. Push the branch to `origin`
4. Create a PR with a clear title and description
5. Request review from at least one team member
6. Merge only after approval and passing checks
3. **Run the pre-push gate BEFORE pushing** (see CI/CD Enforcement below)
4. Push the branch to `origin`
5. Create a PR with a clear title and description
6. Request review from at least one team member
7. Merge only after approval and passing checks

PR titles follow: `[STU-N] Short description of change`

## CI/CD Enforcement (CRITICAL — read before pushing)

**Every branch pushed to origin must pass the full CI pipeline.** Pushing code that fails CI wastes reviewer time and blocks the board. These checks run on every PR and must be verified locally before pushing:

```bash
# 1. TypeScript — zero errors required
npx tsc --noEmit

# 2. Build — must compile cleanly
npm run build

# 3. Validation — requires dev server on port 3000
npm run dev & # start dev server, then:
npm run test:validate
Comment on lines +64 to +65
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Make the validation example deterministic to avoid flaky false failures.

npm run dev & followed immediately by npm run test:validate can race before port 3000 is ready. Add an explicit readiness wait (and cleanup) in the documented snippet.

Suggested doc patch
-# 3. Validation — requires dev server on port 3000
-npm run dev &  # start dev server, then:
-npm run test:validate
+# 3. Validation — requires dev server on port 3000
+npm run dev &
+DEV_PID=$!
+until curl -fsS http://localhost:3000 >/dev/null; do sleep 1; done
+npm run test:validate
+kill $DEV_PID
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
npm run dev & # start dev server, then:
npm run test:validate
# 3. Validation — requires dev server on port 3000
npm run dev &
DEV_PID=$!
until curl -fsS http://localhost:3000 >/dev/null; do sleep 1; done
npm run test:validate
kill $DEV_PID
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@CLAUDE.md` around lines 64 - 65, The docs currently show running "npm run dev
&" then immediately "npm run test:validate", which races with the server
startup; update the example to start the dev server in the background, wait
deterministically for port 3000 (e.g., a small loop polling
http://localhost:3000 or using a wait-for utility until it responds), run "npm
run test:validate" only after the readiness check succeeds, and finally clean up
by killing the background dev server process (capture the background PID and use
kill). Mention both the readiness check and PID cleanup in the CLAUDE.md
snippet.


# Or run all three together:
npm run test:all
```

**Gate rule:** If any of `tsc --noEmit`, `npm run build`, or `npm run test:validate` fails locally, do NOT push. Fix the failures first. Only push when all three pass.
Comment on lines +54 to +71
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Align the hard gate with lint and project script conventions.

The “Gate rule” currently enforces only typecheck/build/validate, but Line 81 still requires lint before pushing. This mismatch can let “gate-passing” pushes fail CI on lint. Please include lint in the mandatory gate list (and preferably use npm run test:types consistently with the rest of this doc).

Suggested doc patch
 # 1. TypeScript — zero errors required
-npx tsc --noEmit
+npm run test:types
+
+# 2. Lint — zero errors required
+npm run lint
 
-# 2. Build — must compile cleanly
+# 3. Build — must compile cleanly
 npm run build
 
-# 3. Validation — requires dev server on port 3000
+# 4. Validation — requires dev server on port 3000
 npm run dev &  # start dev server, then:
 npm run test:validate
@@
-**Gate rule:** If any of `tsc --noEmit`, `npm run build`, or `npm run test:validate` fails locally, do NOT push. Fix the failures first. Only push when all three pass.
+**Gate rule:** If any of `npm run test:types`, `npm run lint`, `npm run build`, or `npm run test:validate` fails locally, do NOT push. Fix the failures first. Only push when all four pass.

Based on learnings: "Run npm run build before pushing — project must compile cleanly".

Also applies to: 81-81

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@CLAUDE.md` around lines 54 - 71, Update the Gate rule to include linting and
use the project's script names consistently: replace the raw `tsc --noEmit` step
with `npm run test:types`, and add `npm run lint` to the mandatory pre-push
checklist alongside `npm run build` and `npm run test:validate`; ensure the Gate
rule text and the example command block list these four checks (`npm run
test:types`, `npm run build`, `npm run lint`, `npm run test:validate`) so pushes
that pass the gate cannot fail CI due to linting mismatches.


**Stale cache warning:** When switching branches, always run `rm -rf .next && npx prisma generate` before type-checking. Stale `.next` caches and outdated Prisma clients cause false errors that masquerade as real bugs.

**Lint-staged hazard:** The pre-commit hook stashes working changes. Switching branches while lint-staged is running can corrupt files with cross-branch artifacts. Verify working tree is clean before switching branches.

## TypeScript & Code Quality

- Run `npm run test:types` before committing — zero type errors required
Expand Down
Loading