Skip to content

chore: optimize CLAUDE.md and add agent config#447

Open
MarioCadenas wants to merge 1 commit into
chore/claude-worktree-setupfrom
chore/optimize-claude-config
Open

chore: optimize CLAUDE.md and add agent config#447
MarioCadenas wants to merge 1 commit into
chore/claude-worktree-setupfrom
chore/optimize-claude-config

Conversation

@MarioCadenas

Copy link
Copy Markdown
Collaborator

Summary

Optimizes CLAUDE.md and adds repo-level Claude Code config, following the Claude Code best practices guidance that CLAUDE.md is loaded every session and should hold only high-signal, non-obvious content.

Note: stacked on chore/claude-worktree-setup (which introduces .claude/settings.json + the worktree hook). Merge or retarget to main once that branch lands.

Changes

CLAUDE.md — 421 → 125 lines (~58% smaller)

  • Fixed a stale reference: generate-schema-types.tsgenerate-json-schema.ts (the old name no longer exists).
  • Corrected the pnpm build description — it also runs sync:template + doc-banner generation.
  • Replaced the hand-maintained tools/ enumeration with a pointer to package.json/tools/ so it can't drift again.
  • Cut command-list duplication and the two-stage release-pipeline detail (both live in package.json / .github/workflows/).
  • Kept every non-obvious gotcha: the docs CLI "run the index first" rule, the analytics .sql vs .obo.sql execution-context convention, interceptor order, --filter dependency commands, DCO + conventional commits, and the "after making changes" workflow.

Permission allowlist (.claude/settings.json)

  • Allowlists safe project commands (pnpm build/test/check/lint/format/typecheck/docs:build, pnpm exec biome/tsc, npx appkit, read-only git) to cut approval prompts.

Verification hook (.claude/hooks/biome-format.sh)

  • A PostToolUse hook (Edit/Write/MultiEdit) runs biome check --write on the single edited file, making formatting deterministic rather than advisory. Non-blocking; respects biome.json ignores. Full typecheck stays manual (too slow to run per-edit across the monorepo).

.gitignore

  • Ignore .claude/worktrees/ so git and pnpm knip skip the worktree-setup nested checkouts.

Test plan

  • pnpm knip and lint-staged (Biome) pass in the pre-commit hook.
  • settings.json validated as well-formed JSON.
  • Hook dry-run: parses the PostToolUse payload, gates by extension (skips .md and non-Biome files), exits cleanly.

Trim CLAUDE.md from 421 to 125 lines, keeping only non-obvious,
high-signal guidance per Claude Code best practices:
- fix stale generate-schema-types.ts reference (now generate-json-schema.ts)
- correct the pnpm build description (also syncs template + gens doc banners)
- drop command/release-pipeline duplication that lives in package.json/workflows

Add a permission allowlist for safe project commands (build/test/check/
typecheck/docs, read-only git) to reduce approval prompts.

Add a PostToolUse Biome hook (.claude/hooks/biome-format.sh) that runs
`biome check --write` on each edited file, making formatting deterministic
instead of advisory.

Gitignore .claude/worktrees/ so knip and git skip the worktree-setup
nested checkouts.

Signed-off-by: MarioCadenas <MarioCadenas@users.noreply.github.com>
@MarioCadenas MarioCadenas requested a review from a team as a code owner June 13, 2026 16:02
@MarioCadenas MarioCadenas requested review from calvarjorge and removed request for a team June 13, 2026 16:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant