Skip to content

Commit 84a3f44

Browse files
cpcloudclaude
andauthored
chore: audit and fix agent config, codebase docs, and skills (#738)
## Summary - Add `nix run '.#pre-commit'` step to `/pre-commit-check` skill - Add missing `/pre-commit-check` and `/blog-post` skill triggers to AGENTS.md - Switch `/create-pr` skill from `--body-file` to HEREDOC, ban `/tmp` file writes - Update codebase docs: add Season constants/field to `types.md`, clarify handler count, cross-reference AGENTS.md from `patterns.md` - Bump verification dates on codebase docs --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 2354557 commit 84a3f44

5 files changed

Lines changed: 20 additions & 12 deletions

File tree

.claude/codebase/patterns.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<!-- Copyright 2026 Phillip Cloud -->
22
<!-- Licensed under the Apache License, Version 2.0 -->
3-
<!-- verified: 2026-03-07 -->
3+
<!-- verified: 2026-03-10 -->
44

55
# Code Patterns & Conventions
66

@@ -97,7 +97,7 @@ User edits (keyboard, calendar picker)
9797
- openAddForm(m) - enters form mode
9898
- requireZone(t, m, zoneID) - asserts zone exists
9999

100-
### Mandatory Patterns
100+
### Mandatory Patterns (see AGENTS.md "Testing" for authoritative rules)
101101
- User-flow tests via keystrokes, never just internal API calls
102102
- Form tests: openAddForm(m) + set values + sendKey(m, "ctrl+s")
103103
- Inline edit: sendKey(m, "i") + set ColCursor + sendKey(m, "e")

.claude/codebase/types.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<!-- Copyright 2026 Phillip Cloud -->
22
<!-- Licensed under the Apache License, Version 2.0 -->
3-
<!-- verified: 2026-03-07 -->
3+
<!-- verified: 2026-03-10 -->
44

55
# Key Types & Interfaces
66

@@ -53,8 +53,9 @@ Central Bubbletea state. Key fields:
5353
- Snapshot(store, id) (undoEntry, error)
5454
- SyncFixedValues(store, specs)
5555

56-
Implementations: projectHandler, quoteHandler, maintenanceHandler,
57-
incidentHandler, applianceHandler, serviceLogHandler, vendorHandler, documentHandler
56+
8 implementations (one per entity tab; formHouse is handled separately):
57+
projectHandler, quoteHandler, maintenanceHandler, incidentHandler,
58+
applianceHandler, serviceLogHandler, vendorHandler, documentHandler
5859

5960
### columnSpec (types.go)
6061
Title, Min/MaxWidth, Flex, Align, Kind (cellKind), Link (FK ref), FixedValues, HideOrder
@@ -86,7 +87,7 @@ Parent info (tab, entity, ID), Breadcrumb string, Tab (the detail sub-tab)
8687
- Quote - ProjectID, VendorID, total/labor/materials/other (cents)
8788
- Vendor - name (unique), contact, phone, email, website, notes
8889
- MaintenanceCategory - lookup table (not soft-deletable)
89-
- MaintenanceItem - name, categoryID, applianceID?, interval, dueDate, cost
90+
- MaintenanceItem - name, categoryID, applianceID?, season, interval, dueDate, cost
9091
- ServiceLogEntry - MaintenanceItemID (CASCADE), vendorID?, date, cost
9192
- Appliance - name, brand, model, serial, warranty, cost
9293
- Incident - title, status, severity, dates, applianceID?, vendorID?, cost
@@ -98,6 +99,9 @@ Parent info (tab, entity, ID), Breadcrumb string, Tab (the detail sub-tab)
9899
### Project Status Constants
99100
ProjectStatusIdeating, Planned, Quoted, InProgress, Delayed, Completed, Abandoned
100101

102+
### Season Constants
103+
SeasonSpring, SeasonSummer, SeasonFall, SeasonWinter
104+
101105
### Incident Constants
102106
- Status: Open, InProgress, Resolved
103107
- Severity: Urgent, Soon, Whenever

.claude/commands/create-pr.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,10 @@ Create a pull request for the current branch.
1010

1111
## PR conventions
1212

13-
- **Use `--body-file`**: Write the PR body to a file and pass
14-
`--body-file` instead of `--body`. This avoids shell-quoting issues
15-
that silently corrupt markdown.
13+
- **Use a HEREDOC for the body**: Pass the PR body via a HEREDOC to
14+
avoid shell-quoting issues. Do not write temporary files to `/tmp`.
15+
Example: `gh pr create --title "..." --body "$(cat <<'EOF'` ...
16+
`EOF` `)"`
1617
- **Rebase merges only**: This repo uses `gh pr merge --rebase`. No merge
1718
commits, no squash merges.
1819
- **No "Test plan" section**: CI covers tests, lint, vet, and build.

.claude/commands/pre-commit-check.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,11 @@
44
Do NOT run pre-commit hooks manually. The git hooks run automatically on
55
`git commit` (pre-commit stage) and `git push` (pre-push stage).
66

7-
Before committing, just make sure the code compiles and tests pass:
7+
Before committing, run these checks:
88

9-
1. `go build ./...` -- verify it compiles
10-
2. `go test -shuffle=on ./...` -- all packages, shuffled, no `-v`
9+
1. `nix run '.#pre-commit' -- --from-ref origin/main --to-ref HEAD --verbose` -- run all pre-commit hooks against changed files
10+
2. `go build ./...` -- verify it compiles
11+
3. `go test -shuffle=on ./...` -- all packages, shuffled, no `-v`
1112

1213
If the commit hook fails, fix the issue and commit again. Never use
1314
`--no-verify`.

AGENTS.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,8 @@ details; do not duplicate that detail here.
167167
- `/record-demo` -- after any UI/UX feature work; commit the GIF
168168
- `/new-fk-relationship` -- when adding FK links between soft-deletable entities
169169
- `/add-entity` -- when adding a new entity model (full wiring checklist)
170+
- `/pre-commit-check` -- before committing, to verify code compiles and tests pass
171+
- `/blog-post` -- when writing or updating Hugo blog content in `docs/`
170172
- `/debug-dump` -- when diagnosing rendering bugs (VHS or live TUI)
171173

172174
### Shell and tools

0 commit comments

Comments
 (0)