Skip to content
Merged
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions .claude/hooks/on-stop.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ if (!existsSync(ng)) {
process.exit(1);
}

run('Lint', ng, ['lint']);
run('Build', ng, ['build']);
run('Tests', ng, ['test', '--watch=false']);

Expand Down
14 changes: 13 additions & 1 deletion CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,18 @@ src/app/
- **Tests**: co-located `.spec.ts` files, test service logic not implementation details
- **No barrel files** (`index.ts`) except in `db/`

## Angular 21 Patterns

Always use current Angular idioms β€” never fall back to pre-v17 alternatives:

- **Control flow**: `@if`, `@for`, `@switch` in templates β€” never `*ngIf`, `*ngFor`, `*ngSwitch`
- **Inputs**: `input()` / `input.required()` signal-based β€” never `@Input()`
- **Outputs**: `output()` β€” never `@Output()` + `EventEmitter`
- **Two-way binding**: `model()` β€” never `@Input()`/`@Output()` pairs for two-way
- **Queries**: `viewChild()`, `viewChildren()`, `contentChild()` β€” never `@ViewChild`/`@ContentChild`
- **RxJS cleanup**: `takeUntilDestroyed()` (inject `DestroyRef` implicitly) β€” never manual `ngOnDestroy` + `Subject` teardown
- **Reactive side effects**: `effect()` for signal-driven side effects β€” never manual subscriptions just to react to signal changes

## Branching Strategy

- `main` β€” production; protected, no direct pushes or commits
Expand Down Expand Up @@ -73,7 +85,7 @@ If the scope isn't clear yet, omit the name and let Claude generate a random one

1. **Branch** β€” start on a `feat/`, `fix/`, or `chore/` branch (worktree or plain checkout).
2. **Code + tests** β€” Claude writes logic and the accompanying `.spec.ts` tests in the same pass. No untested logic ships.
3. **Hooks run automatically** β€” `after-edit` lints on every file save; `on-stop` runs Playwright when component files change.
3. **Hooks run automatically** β€” `after-edit` formats with Prettier on every file save; `on-stop` lints, builds, tests, and runs Playwright when component files change.
4. **Self-review** β€” before opening a PR, run `/review` to have Claude check the diff for issues, gaps in test coverage, and CLAUDE.md convention violations.
5. **Open the PR** β€” Claude creates it with `gh pr create`, following the title convention (`type: description`) and including a summary + test plan in the body.
6. **CI gate** β€” GitHub Actions must go green (lint β†’ build β†’ tests) before merge.
Expand Down
Loading