docs: add explicit package.json script references to regime docs
Update .claude documentation to reference the actual npm scripts from package.json, making it crystal clear what commands to run and what they do under the hood. **Added:** - Exact script definitions from package.json - What each script does (tsc, Biome, ESLint) - Tool descriptions (TypeScript, Biome, ESLint) - Quick reference sections for fast lookup **Why:** Makes it easier for Claude Code sessions to know exactly which commands to run without ambiguity. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -15,14 +15,26 @@
|
||||
npm run pre-commit
|
||||
```
|
||||
|
||||
This command runs:
|
||||
1. `tsc --noEmit` - Type checking (must have 0 errors)
|
||||
2. `npm run format` - Auto-format all code
|
||||
3. `npm run lint:fix` - Auto-fix lint issues
|
||||
This single command runs all quality checks in the correct order:
|
||||
1. `npm run type-check` - TypeScript type checking (must have 0 errors)
|
||||
2. `npm run format` - Auto-format all code with Biome
|
||||
3. `npm run lint:fix` - Auto-fix linting issues with Biome + ESLint
|
||||
4. `npm run lint` - Verify 0 errors, 0 warnings
|
||||
|
||||
**DO NOT COMMIT** until all checks pass with zero errors and zero warnings.
|
||||
|
||||
## Available Scripts
|
||||
|
||||
```bash
|
||||
npm run type-check # TypeScript: tsc --noEmit
|
||||
npm run format # Biome: format all files
|
||||
npm run format:check # Biome: check formatting without fixing
|
||||
npm run lint # Biome + ESLint: check for errors/warnings
|
||||
npm run lint:fix # Biome + ESLint: auto-fix issues
|
||||
npm run check # Biome: full check (format + lint + imports)
|
||||
npm run pre-commit # Run all checks (type + format + lint)
|
||||
```
|
||||
|
||||
## Workflow
|
||||
|
||||
When asked to make ANY changes:
|
||||
@@ -48,13 +60,26 @@ See `.claude/CODE_QUALITY_REGIME.md` for complete documentation.
|
||||
This project does not use git pre-commit hooks for religious reasons.
|
||||
You (Claude Code) are responsible for enforcing code quality before commits.
|
||||
|
||||
## Key Scripts
|
||||
## Quick Reference: package.json Scripts
|
||||
|
||||
- `npm run pre-commit` - Run all quality checks (use before every commit)
|
||||
- `npm run type-check` - TypeScript type checking
|
||||
- `npm run format` - Format code with Biome
|
||||
- `npm run lint` - Check linting
|
||||
- `npm run lint:fix` - Fix linting issues automatically
|
||||
**Primary workflow:**
|
||||
```bash
|
||||
npm run pre-commit # ← Use this before every commit
|
||||
```
|
||||
|
||||
**Individual checks (if needed):**
|
||||
```bash
|
||||
npm run type-check # TypeScript: tsc --noEmit
|
||||
npm run format # Biome: format code (--write)
|
||||
npm run lint # Biome + ESLint: check only
|
||||
npm run lint:fix # Biome + ESLint: auto-fix
|
||||
```
|
||||
|
||||
**Additional tools:**
|
||||
```bash
|
||||
npm run format:check # Check formatting without changing files
|
||||
npm run check # Biome check (format + lint + organize imports)
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
|
||||
@@ -42,7 +42,18 @@ npm run lint && npm run type-check
|
||||
npm run pre-commit
|
||||
```
|
||||
|
||||
This runs all checks in the correct order and fails if any step fails.
|
||||
**What it does:**
|
||||
```json
|
||||
"pre-commit": "npm run type-check && npm run format && npm run lint:fix && npm run lint"
|
||||
```
|
||||
|
||||
This single command runs:
|
||||
1. `npm run type-check` → `tsc --noEmit` (TypeScript errors)
|
||||
2. `npm run format` → `npx @biomejs/biome format . --write` (auto-format)
|
||||
3. `npm run lint:fix` → `npx @biomejs/biome lint . --write && npx eslint . --fix` (auto-fix)
|
||||
4. `npm run lint` → `npx @biomejs/biome lint . && npx eslint .` (verify clean)
|
||||
|
||||
Fails fast if any step fails.
|
||||
|
||||
## The Regime Rules
|
||||
|
||||
@@ -87,19 +98,29 @@ When asked to commit:
|
||||
3. Fix all issues before proceeding with the commit
|
||||
4. Only create commits when all checks pass
|
||||
|
||||
## Scripts Reference
|
||||
## Complete Scripts Reference
|
||||
|
||||
From `apps/web/package.json`:
|
||||
|
||||
```json
|
||||
{
|
||||
"type-check": "tsc --noEmit",
|
||||
"format": "npx @biomejs/biome format . --write",
|
||||
"lint": "npx @biomejs/biome lint . && npx eslint .",
|
||||
"lint:fix": "npx @biomejs/biome lint . --write && npx eslint . --fix",
|
||||
"check": "npx @biomejs/biome check .",
|
||||
"pre-commit": "npm run type-check && npm run format && npm run lint:fix && npm run lint"
|
||||
"scripts": {
|
||||
"type-check": "tsc --noEmit",
|
||||
"format": "npx @biomejs/biome format . --write",
|
||||
"format:check": "npx @biomejs/biome format .",
|
||||
"lint": "npx @biomejs/biome lint . && npx eslint .",
|
||||
"lint:fix": "npx @biomejs/biome lint . --write && npx eslint . --fix",
|
||||
"check": "npx @biomejs/biome check .",
|
||||
"pre-commit": "npm run type-check && npm run format && npm run lint:fix && npm run lint"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
**Tools used:**
|
||||
- TypeScript: `tsc --noEmit` (type checking only, no output)
|
||||
- Biome: Fast formatter + linter (Rust-based, 10-100x faster than Prettier)
|
||||
- ESLint: React Hooks rules only (`rules-of-hooks` validation)
|
||||
|
||||
## Emergency Override
|
||||
|
||||
If you absolutely MUST commit with failing checks:
|
||||
|
||||
Reference in New Issue
Block a user