chore: improve Claude Code configuration#1029
Conversation
Make the AI assistant more effective by providing focused, actionable instructions instead of a monolithic reference document. - Slim down CLAUDE.md from 500+ lines to 63 lines - Extract coding practices, testing conventions, commit conventions, and LSP fallbacks into path-scoped .claude/rules/ files so they load only when relevant files are being edited - Add 4 build skills (/build, /test, /lint, /ci) using sub-agents to keep verbose output out of the main context window - Add build warning hook to nudge toward skill usage - Remove outdated .github/copilot-instructions.md (superseded by CLAUDE.md and .claude/rules/) - Narrow .gitignore build/ pattern to /packages/**/build/
WalkthroughThe PR splits and consolidates assistant guidance into a new Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant Claude as Claude Agent
participant Hook as Pre-exec Hook (block-build.sh)
participant SubAgent
User->>Claude: invoke Bash tool / run command
Claude->>Hook: provide tool invocation JSON
Hook->>Hook: parse tool_name and command (jq)
alt command is lightweight or agent-context
Hook-->>Claude: no warning (exit 0)
Claude->>SubAgent: (optional) proceed with execution
else heavy build/test/lint command detected
Hook-->>Claude: write warnings to stderr (exit 0)
Claude->>SubAgent: route to corresponding `/build`/`/test`/`/lint` skill
end
SubAgent-->>Claude: structured result (SUCCESS/FAILURE + excerpt + duration)
Claude-->>User: final succinct report
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (3)
.claude/rules/tooling/lsp-fallbacks.md (1)
1-3: Consider adding frontmatter with path scope for consistency.Other rules files in this PR (e.g.,
commit-conventions.md,conventions.md,coding-practices.md) include a YAML frontmatter block withpaths:to scope when the rules load. This file lacks that frontmatter, which may cause it to load unconditionally or not integrate properly with Claude's path-scoped rules system.📝 Suggested frontmatter addition
+--- +paths: + - "packages/core/src/**" + - "**/*.ts" +--- # LSP Fallbacks (tsserver via mcp_ide) Read this BEFORE any LSP operation. Update this file when new failures are discovered..claude/skills/ci/SKILL.md (1)
15-35: Consider adding a language identifier to the fenced code block.The static analysis tool flagged the missing language specifier. Since this is a prompt template rather than executable code, you could use
textorplaintextas the identifier for consistency with markdown best practices.📝 Suggested fix
-``` +```text Run the full CI validation sequence from the project root, stopping at the first failure:.claude/hooks/block-build.sh (1)
20-29: Regex may missnpm run testvariant.The current pattern
^\s*npm\s+(run\s+build|test|run\s+lint|run\s+check)capturesnpm testbut notnpm run test. Whilenpm testis the conventional shorthand, users might use the explicit form. Consider whether this should also be caught.📝 Suggested pattern adjustment
-if echo "$COMMAND" | grep -qE '^\s*npm\s+(run\s+build|test|run\s+lint|run\s+check)'; then +if echo "$COMMAND" | grep -qE '^\s*npm\s+(run\s+(build|test|lint|check)|test)'; thenThis captures both
npm testandnpm run test, as well asnpm run build,npm run lint, andnpm run check.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 512cde8a-b75b-4de3-b673-bf1203342359
📒 Files selected for processing (12)
.claude/hooks/block-build.sh.claude/rules/architecture/coding-practices.md.claude/rules/git/commit-conventions.md.claude/rules/testing/conventions.md.claude/rules/tooling/lsp-fallbacks.md.claude/skills/build/SKILL.md.claude/skills/ci/SKILL.md.claude/skills/lint/SKILL.md.claude/skills/test/SKILL.md.github/copilot-instructions.md.gitignoreCLAUDE.md
💤 Files with no reviewable changes (1)
- .github/copilot-instructions.md
- Use [[ ]] instead of [ ] in block-build.sh for idiomatic bash and robustness - Fix npm command regex to catch both 'npm test' and 'npm run test' variants - Add language specifier (text) to code blocks in skill markdown files for linting
|



Make the AI assistant more effective by providing focused, actionable instructions instead of a monolithic reference document.
Summary by CodeRabbit
Documentation
New Features
Chores