docs: add CLAUDE.md and .claude folder setup for contributor productivity#7627
docs: add CLAUDE.md and .claude folder setup for contributor productivity#7627carlesarnal merged 12 commits intoApicurio:mainfrom
Conversation
…curio#7626) Replace blanket `.claude` ignore with specific ignores for personal files (settings.local.json, CLAUDE.local.md) so team-shared config (commands, rules, skills, agents, settings.json) can be tracked in git.
Concise project instructions (102 lines) covering build commands, architecture, storage variants, conventions, and gotchas.
…io#7626) Allow Maven, git read commands, and GitHub CLI. Deny destructive commands and .env file reads.
…o#7626) Six modular rule files with YAML frontmatter path scoping: - code-style.md (Java conventions from checkstyle.xml) - testing.md (unit/integration test patterns) - api-conventions.md (REST API patterns) - storage.md (storage layer architecture) - ui.md (React/TypeScript frontend) - security.md (OIDC, secrets, TLS)
…curio#7626) Five refined commands (analyze-gh-issue, plan-implementation, implement-changes, review-pr, pr-description) and two new commands (run-tests, debug-ci-failure).
…#7626) Three skills that Claude can invoke automatically when relevant: - security-review: triggers on auth/OIDC/secrets discussions - storage-variant-guide: triggers when modifying storage layer - sdk-update: triggers when REST API changes affect SDKs
…o#7626) Three agents using sonnet model for cost-efficient focused tasks: - code-reviewer: correctness, checkstyle, storage consistency - security-auditor: auth, secrets, OIDC, TLS (read-only) - ci-debugger: GitHub Actions failure diagnosis
|
There is a lot of inline bash commands, which is fine but from my experience Claude is pretty good at using |
Fair, although those have been extracted from the readmes, and, generally speaking, this is meant to streamline upstream contributions to the project. |
| "Bash(gh issue *)", | ||
| "Bash(gh pr *)", |
There was a problem hiding this comment.
I think this would allow issues and PR to be created, deleted, edited, etc. Do we want to allow all that by default?
There was a problem hiding this comment.
Yes, since the comments we're shipping use some of those commands, I do think it makes sense.
.claude/settings.json
Outdated
| "Bash(curl *)", | ||
| "Bash(wget *)", |
- Add PreToolUse hook to block edits to target/ and .env files - Add PostToolUse hook to auto-run checkstyle after Java file edits - Add Notification hook for macOS desktop alerts - Remove curl/wget from deny list (unnecessary, permission system prompts)
.claude/settings.json
Outdated
| "hooks": [ | ||
| { | ||
| "type": "command", | ||
| "command": "$CLAUDE_PROJECT_DIR/.claude/hooks/checkstyle-after-edit.sh", | ||
| "timeout": 60, | ||
| "statusMessage": "Running checkstyle" | ||
| } |
There was a problem hiding this comment.
How long does this take to run? I'm worried about it slowing down claude code even further.
There was a problem hiding this comment.
I'll change it to be executed before any git commit command executed by claude, I think that's a fair compromise, wdyt?
| { | ||
| "type": "command", | ||
| "command": "$CLAUDE_PROJECT_DIR/.claude/hooks/notify.sh" | ||
| } |
There was a problem hiding this comment.
Not sure I like this being enabled by default...
There was a problem hiding this comment.
Agreed. I like it for me, but having it enabled for everyone is probably no the best idea..
|
I love the agents, rules, and skills. 👍 The commands can be used or not used, so those are fine. I'm a little skeptical of some of the hooks though. I added some inline comments. |
- Restrict gh permissions to read-only (view, list, diff, checks) - Remove checkstyle and notification hooks from default config - Document hooks as opt-in via settings.local.json in CLAUDE.md
This reverts commit 995d258.
- Move checkstyle from PostToolUse (every edit) to PreToolUse (before git commit only), checking staged Java files per module - Remove notification hook from default config, document as opt-in - Remove old checkstyle-after-edit.sh, add checkstyle-before-commit.sh
|
@EricWittmann @jsenko any objection for merging this? I think it's a good compromise in it's current form, and we can evolve it over time if we think it's not serving us well. |
|
I've provided my feedback in the other channel, but I don't have any blocking objections. |
|
No objection. |
Summary
Fixes #7626
Set up the
.claudefolder following best practices to help contributors work more effectively with the Apicurio Registry codebase using Claude Code.Root Cause
The repository had no
CLAUDE.mdcontent and the entire.claudedirectory was gitignored, preventing team-shared configuration from being committed. Contributors using Claude Code had no project-specific instructions, commands, or conventions available.Changes
.gitignore: Replace blanket.claudeignore with specific ignores for personal files (settings.local.json,CLAUDE.local.md) so team config can be trackedCLAUDE.md(102 lines): Concise project context — build commands, architecture, storage variants, conventions, gotchas.claude/settings.json: Team-shared permission policies (allow Maven/git/gh, deny destructive commands and .env reads).claude/rules/(6 files): Path-scoped coding conventions with YAML frontmatter:code-style.md— Java conventions derived from.checkstyle/checkstyle.xmltesting.md— Unit/integration test patterns, storage variant coverageapi-conventions.md— REST API patterns, SDK regenerationstorage.md— Storage layer architecture and variant guidelinesui.md— React/TypeScript frontend build processsecurity.md— OIDC, secrets, TLS considerations.claude/commands/(7 files): Project-specific slash commands:analyze-gh-issue,plan-implementation,implement-changes,review-pr,pr-descriptionrun-tests(smart test runner),debug-ci-failure(CI diagnosis).claude/skills/(3 workflows): Auto-invoked when context matches:security-review— triggers on auth/OIDC/secrets discussionsstorage-variant-guide— triggers when modifying storage layersdk-update— triggers when REST API changes affect SDKs.claude/agents/(3 subagents): Specialized personas using sonnet model:code-reviewer— correctness, checkstyle, storage consistencysecurity-auditor— auth, secrets, OIDC, TLS (read-only)ci-debugger— GitHub Actions failure diagnosisTest plan
CLAUDE.mdis under 200 lines (102 lines).claude/settings.local.jsonis NOT tracked in git/project:analyze-gh-issue,/project:run-tests,/project:debug-ci-failure