Skip to content

docs: add CLAUDE.md guidance file for Claude Code#115

Merged
renecannao merged 1 commit into
masterfrom
docs/claude-md
May 14, 2026
Merged

docs: add CLAUDE.md guidance file for Claude Code#115
renecannao merged 1 commit into
masterfrom
docs/claude-md

Conversation

@renecannao
Copy link
Copy Markdown

Summary

  • Adds CLAUDE.md at the repo root so Claude Code sessions pick up dbdeployer-specific conventions automatically.
  • Covers build/test/lint entry points (scripts/build.sh, test/go-unit-tests.sh, scripts/sanity_check.sh and its subcommands), and the unit-test script's auto-skip of sandbox/, ts/, ts_static/ when $SANDBOX_BINARY is empty.
  • Documents the cmd/ (thin Cobra) → ops/ (business logic) split, the two filesystem roots (SandboxBinary = $HOME/opt/mysql, SandboxHome = $HOME/sandboxes), and that dbdeployer init is the canonical command for creating them.
  • Notes the provider abstraction in providers/, the embedded template layout under sandbox/templates/, and that README.md / docs/dbdeployer_completion.sh / docs/API/* are generated from mkreadme/ (matching the existing guidance in CONTRIBUTING.md).
  • Captures conventions worth respecting: the copyright header check enforced by scripts/sanity_check.sh copyright, common.Exit* for multi-line user errors with concrete next-step commands, common/fileutil.go helpers, and reusing the globals.Err* message constants.

No code changes; documentation only.

Test plan

  • File is markdown-only; no build/test impact
  • Cross-checked against CONTRIBUTING.md and scripts/sanity_check.sh for accuracy of build/test commands
  • Verified dbdeployer init does create both $SANDBOX_BINARY and $SANDBOX_HOME (ops/init.go calls os.MkdirAll on both)

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.
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 13, 2026

Warning

Rate limit exceeded

@renecannao has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 59 minutes and 37 seconds before requesting another review.

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 @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 9c0e0a79-8f72-4dd8-b1df-d7cca7c5fce7

📥 Commits

Reviewing files that changed from the base of the PR and between 857149f and e1c4235.

📒 Files selected for processing (1)
  • CLAUDE.md
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch docs/claude-md

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

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

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.

Comment thread CLAUDE.md

## 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.
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

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.

Suggested change
- 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.

@renecannao renecannao merged commit 62dedb4 into master May 14, 2026
52 checks passed
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