From da1ff6dc98e9d57e570174445c14f481fab5d762 Mon Sep 17 00:00:00 2001 From: Matt Godbolt Date: Tue, 13 May 2025 16:59:03 -0500 Subject: [PATCH 1/2] Update vitest instructions for claude --- CLAUDE.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/CLAUDE.md b/CLAUDE.md index 4d86679c5..28955b021 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -8,8 +8,7 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co - Lint: `npm run lint` (auto-fix), `npm run lint-check` (check only) - Type Check: `npm run ts-check` - Test: `npm run test` (all), `npm run test-min` (minimal) -- Test Single File: `npm run test -- --run base-compiler-tests.ts` -- Test Specific Pattern: `npm run test -- -t "should handle execution failures"` +- Test Single File: `npx vitest ` - Cypress Tests: `npm run cypress` - Pre-commit Check: `make pre-commit` or `npm run check` From c34a299b1cfa00268be25d9d244e413778491291 Mon Sep 17 00:00:00 2001 From: Matt Godbolt Date: Tue, 13 May 2025 20:32:59 -0500 Subject: [PATCH 2/2] Claudisms --- CLAUDE.md | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/CLAUDE.md b/CLAUDE.md index 28955b021..5db914d0b 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -8,7 +8,8 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co - Lint: `npm run lint` (auto-fix), `npm run lint-check` (check only) - Type Check: `npm run ts-check` - Test: `npm run test` (all), `npm run test-min` (minimal) -- Test Single File: `npx vitest ` +- Test Single File: `npm run test -- --run base-compiler-tests.ts` +- Test Specific Pattern: `npm run test -- -t "should handle execution failures"` - Cypress Tests: `npm run cypress` - Pre-commit Check: `make pre-commit` or `npm run check` @@ -46,6 +47,16 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co // Initialises the thing initialiseThing(); ``` +- Avoid redundant function header comments that merely repeat the function name. For example: + ``` + /** + * Sets up compiler change handling + */ + function setupCompilerChangeHandling() {...} + ``` + In this case, the function name already clearly states what it does. +- Comments should provide additional context or explain "why" something is done, not just restate "what" is being done. +- Only add function header comments when they provide meaningful information beyond what the function name and signature convey. - Use British English spellings for things like "initialise" and "colour", but only in new code. It's a preference not a hard requirement ## Testing Guidelines