Skip to content

chore: improve Claude Code configuration#1029

Merged
tbouffard merged 3 commits intomainfrom
chore/improve_claude_config
Mar 26, 2026
Merged

chore: improve Claude Code configuration#1029
tbouffard merged 3 commits intomainfrom
chore/improve_claude_config

Conversation

@redfish4ktc
Copy link
Copy Markdown

@redfish4ktc redfish4ktc commented Mar 25, 2026

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/

Summary by CodeRabbit

  • Documentation

    • Added repository-wide guidelines: coding practices, testing conventions, and commit message conventions
    • Condensed main README and pointed to new internal rules; removed prior Copilot-specific instructions
  • New Features

    • Added dedicated build, test, lint, and CI sub-agent skills for streamlined command execution and reporting
    • Added a pre-tool hook that emits warnings for heavy build/test/lint invocations
  • Chores

    • Narrowed ignored build artifact scope in project config

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/
@redfish4ktc redfish4ktc added the chore Build, CI/CD or repository tasks (issues/PR maintenance, environments, ...) label Mar 25, 2026
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 26, 2026

Walkthrough

The PR splits and consolidates assistant guidance into a new .claude/ structure: adds rules, testing/lint/build skills, a Bash hook that warns about direct build/test/lint tool usage, and replaces verbose CLAUDE/Copilot docs with concise README-style content and targeted rule files.

Changes

Cohort / File(s) Summary
Claude Assistant Rules
/.claude/rules/architecture/coding-practices.md, /.claude/rules/git/commit-conventions.md, /.claude/rules/testing/conventions.md, /.claude/rules/tooling/lsp-fallbacks.md
Added repository governance docs: coding practices for packages/core, commit message conventions, Jest/testing layout and mapping rules, and LSP fallback diagnostics guidance.
Claude Skills
/.claude/skills/build/SKILL.md, /.claude/skills/ci/SKILL.md, /.claude/skills/lint/SKILL.md, /.claude/skills/test/SKILL.md
New skill definitions that run build/ci/lint/test via sub-agents with fixed timeouts and constrained, structured result outputs (SUCCESS/FAILURE summaries, limited failure excerpts).
Pre-execution Hook
/.claude/hooks/block-build.sh
New Bash hook that parses tool invocation JSON, skips sub-agent contexts, treats lightweight flags as benign, and emits stderr warnings when heavy npm/build/test/lint Bash commands are detected; always exits 0.
Docs & README Cleanup
CLAUDE.md, /.github/copilot-instructions.md
Replaced detailed in-repo Copilot/Claude guidance with modular .claude/ docs; removed long .github/copilot-instructions.md and condensed CLAUDE.md to a shorter overview referencing new rule files.
Repo Ignore Rules
.gitignore
Changed ignore pattern to ignore package-scoped packages/**/build/ directories instead of a root-level build/ directory.

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
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The PR description is missing required checklist items, issue reference, and testing/documentation evidence needed by the template. Add completed PR Checklist with issue reference (closes #...), confirm testing was done, provide evidence of docs updates, and ensure title follows Conventional Commits format with proper type and scope.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title 'chore: improve Claude Code configuration' accurately summarizes the main change: reorganizing and improving Claude AI assistant configuration files and adding new build skills.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ 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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 with paths: 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 text or plaintext as 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 miss npm run test variant.

The current pattern ^\s*npm\s+(run\s+build|test|run\s+lint|run\s+check) captures npm test but not npm run test. While npm test is 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)'; then

This captures both npm test and npm run test, as well as npm run build, npm run lint, and npm run check.


ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 512cde8a-b75b-4de3-b673-bf1203342359

📥 Commits

Reviewing files that changed from the base of the PR and between 24357a7 and 3178859.

📒 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
  • .gitignore
  • CLAUDE.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
@sonarqubecloud
Copy link
Copy Markdown

@tbouffard tbouffard merged commit c769d39 into main Mar 26, 2026
6 checks passed
@tbouffard tbouffard deleted the chore/improve_claude_config branch March 26, 2026 15:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

chore Build, CI/CD or repository tasks (issues/PR maintenance, environments, ...)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants