docs: add CLAUDE.md guidance file for Claude Code#115
Conversation
Adds a CLAUDE.md at the repo root describing: - common build/test/lint entry points (`scripts/build.sh`, `test/go-unit-tests.sh`, `scripts/sanity_check.sh` and its subcommands), including the auto-skip behavior for sandbox/ts/ts_static tests when `$SANDBOX_BINARY` is empty - the cmd/ -> ops/ architecture (Cobra is thin glue, business logic lives in ops/) - the two filesystem roots (SandboxBinary, SandboxHome) and the fact that `dbdeployer init` is the canonical command for creating them - the provider abstraction in providers/ and the embedded-template sandbox generation under sandbox/templates/ - that README.md / docs/dbdeployer_completion.sh / docs/API/* are generated from mkreadme/ and must not be hand-edited, plus the `docs` build tag - conventions: copyright headers, common.Exit* for multi-line user errors with concrete next-step commands, common/fileutil.go helpers, globals.Err* reuse Generated-file note matches the existing guidance in CONTRIBUTING.md.
|
Warning Rate limit exceeded
You’ve run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ✨ Finishing Touches🧪 Generate unit tests (beta)
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.
Code Review
This pull request introduces CLAUDE.md, a comprehensive guide for AI coding assistants that outlines the repository's build processes, directory structure, provider architecture, and coding conventions. Feedback was provided to clarify the documentation regarding common.Exit and common.Exitf, specifically distinguishing between multi-line string arguments and printf-style formatting to ensure accurate usage guidance.
|
|
||
| ## Common conventions worth respecting | ||
|
|
||
| - Cobra commands surface user-facing errors via `common.Exit` / `common.Exitf` (multi-line messages take multiple string args). Error messages are part of the UX — when adding a "missing prerequisite" message, include the exact command (e.g. `dbdeployer init --skip-all-downloads`) the user should run. |
There was a problem hiding this comment.
The description of common.Exit and common.Exitf is slightly ambiguous regarding how they handle multi-line messages. Based on usages in defaults/defaults.go, common.Exitf follows a standard printf pattern (format string followed by arguments). It would be clearer to specify that common.Exit accepts multiple string arguments as separate lines, while common.Exitf is for formatted strings.
| - Cobra commands surface user-facing errors via `common.Exit` / `common.Exitf` (multi-line messages take multiple string args). Error messages are part of the UX — when adding a "missing prerequisite" message, include the exact command (e.g. `dbdeployer init --skip-all-downloads`) the user should run. | |
| - Cobra commands surface user-facing errors via common.Exit (takes multiple string args as lines) or common.Exitf (standard printf-style formatting). Error messages are part of the UX — when adding a "missing prerequisite" message, include the exact command (e.g. dbdeployer init --skip-all-downloads) the user should run. |
Summary
CLAUDE.mdat the repo root so Claude Code sessions pick up dbdeployer-specific conventions automatically.scripts/build.sh,test/go-unit-tests.sh,scripts/sanity_check.shand its subcommands), and the unit-test script's auto-skip ofsandbox/,ts/,ts_static/when$SANDBOX_BINARYis empty.cmd/(thin Cobra) →ops/(business logic) split, the two filesystem roots (SandboxBinary=$HOME/opt/mysql,SandboxHome=$HOME/sandboxes), and thatdbdeployer initis the canonical command for creating them.providers/, the embedded template layout undersandbox/templates/, and thatREADME.md/docs/dbdeployer_completion.sh/docs/API/*are generated frommkreadme/(matching the existing guidance inCONTRIBUTING.md).scripts/sanity_check.sh copyright,common.Exit*for multi-line user errors with concrete next-step commands,common/fileutil.gohelpers, and reusing theglobals.Err*message constants.No code changes; documentation only.
Test plan
CONTRIBUTING.mdandscripts/sanity_check.shfor accuracy of build/test commandsdbdeployer initdoes create both$SANDBOX_BINARYand$SANDBOX_HOME(ops/init.gocallsos.MkdirAllon both)