docs: add CLAUDE.md for Claude Code guidance#235
Conversation
📝 WalkthroughWalkthroughA new documentation file CLAUDE.md is added, providing comprehensive guidance for Claude Code interactions within the repository. The document covers commands, architecture, bootstrap flow, key interfaces, token naming conventions, coding conventions, anti-patterns, and branch workflow guidelines. No code or API changes are introduced. Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Poem
🚥 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. ✨ 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.
Actionable comments posted: 1
🧹 Nitpick comments (1)
CLAUDE.md (1)
79-90: Clarify whethermodule.Get[T](r, …)andr.Get()are the same or distinct APIs.Line 79 shows the package-level generic helper
module.Get[T](r, "token.name"), while Line 90 says "Resolve deps viar.Get()" — which reads as a method call on the resolver. A reader following the Conventions section would writer.Get()(losing the type parameter) rather than the generic form shown in Key Interfaces. Either unify the notation tomodule.Get[T](r, token)throughout, or add a brief note distinguishing the two if both are valid call sites.📝 Proposed fix (if `module.Get[T]` is the canonical API)
- Resolve deps via `r.Get()` inside `Build` functions; always check `err` before use + Resolve deps via `module.Get[T](r, "token.name")` inside `Build` functions; always check `err` before use🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@CLAUDE.md` around lines 79 - 90, Clarify the API distinction: state that module.Get[T](r, token) is the canonical, type-safe helper to resolve dependencies and should be used inside Build functions (e.g., use module.Get[T](r, "token.name") rather than r.Get()), and update the Conventions line "Resolve deps via r.Get() inside Build" to explicitly recommend using module.Get[T](r, token) (or, if both exist, add a short note explaining that r.Get() is an untyped/resolver method while module.Get[T] is the preferred generic wrapper). Reference module.Get[T], r.Get, and Build in the correction.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@CLAUDE.md`:
- Around line 35-52: The fenced architecture tree block in CLAUDE.md is missing
a language tag (triggers MD040); update the opening fenced code block delimiter
for the tree (the ``` that precedes the "modkit/" tree) to include a language
specifier such as text (i.e., change ``` to ```text) so the block is explicitly
marked as plain text.
---
Nitpick comments:
In `@CLAUDE.md`:
- Around line 79-90: Clarify the API distinction: state that module.Get[T](r,
token) is the canonical, type-safe helper to resolve dependencies and should be
used inside Build functions (e.g., use module.Get[T](r, "token.name") rather
than r.Get()), and update the Conventions line "Resolve deps via r.Get() inside
Build" to explicitly recommend using module.Get[T](r, token) (or, if both exist,
add a short note explaining that r.Get() is an untyped/resolver method while
module.Get[T] is the preferred generic wrapper). Reference module.Get[T], r.Get,
and Build in the correction.
| ``` | ||
| modkit/ | ||
| ├── modkit/ # Core framework packages (the library) | ||
| │ ├── module/ # Public API: ModuleDef, ProviderDef, Token, Resolver | ||
| │ ├── kernel/ # Graph builder, visibility enforcer, lazy singleton container, bootstrap | ||
| │ ├── http/ # Chi-based HTTP adapter: Router, RegisterRoutes, Serve, middleware | ||
| │ ├── logging/ # Logger interface + slog adapter + nop | ||
| │ ├── config/ # Typed env config module helpers | ||
| │ ├── data/ # DB providers: sqlmodule (shared contract), postgres, sqlite sub-packages | ||
| │ └── testkit/ # Test harness: bootstrap helpers, provider overrides | ||
| ├── examples/ # Runnable apps (separate go.mod each) | ||
| │ ├── hello-simple/ # Minimal bootstrap, no Docker | ||
| │ ├── hello-mysql/ # Full CRUD: auth, users, middleware, sqlc, swagger | ||
| │ ├── hello-postgres/ | ||
| │ └── hello-sqlite/ | ||
| ├── cmd/modkit/ # CLI tool (cobra): `modkit new app <name>` | ||
| └── docs/ # Guides and architecture reference | ||
| ``` |
There was a problem hiding this comment.
Add a language specifier to the fenced code block.
The architecture tree block is missing a language tag, which triggers markdownlint MD040. Using text satisfies the rule without implying any specific syntax.
📝 Proposed fix
-```
+```text
modkit/
├── modkit/ # Core framework packages (the library)📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| ``` | |
| modkit/ | |
| ├── modkit/ # Core framework packages (the library) | |
| │ ├── module/ # Public API: ModuleDef, ProviderDef, Token, Resolver | |
| │ ├── kernel/ # Graph builder, visibility enforcer, lazy singleton container, bootstrap | |
| │ ├── http/ # Chi-based HTTP adapter: Router, RegisterRoutes, Serve, middleware | |
| │ ├── logging/ # Logger interface + slog adapter + nop | |
| │ ├── config/ # Typed env config module helpers | |
| │ ├── data/ # DB providers: sqlmodule (shared contract), postgres, sqlite sub-packages | |
| │ └── testkit/ # Test harness: bootstrap helpers, provider overrides | |
| ├── examples/ # Runnable apps (separate go.mod each) | |
| │ ├── hello-simple/ # Minimal bootstrap, no Docker | |
| │ ├── hello-mysql/ # Full CRUD: auth, users, middleware, sqlc, swagger | |
| │ ├── hello-postgres/ | |
| │ └── hello-sqlite/ | |
| ├── cmd/modkit/ # CLI tool (cobra): `modkit new app <name>` | |
| └── docs/ # Guides and architecture reference | |
| ``` |
🧰 Tools
🪛 markdownlint-cli2 (0.21.0)
[warning] 35-35: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@CLAUDE.md` around lines 35 - 52, The fenced architecture tree block in
CLAUDE.md is missing a language tag (triggers MD040); update the opening fenced
code block delimiter for the tree (the ``` that precedes the "modkit/" tree) to
include a language specifier such as text (i.e., change ``` to ```text) so the
block is explicitly marked as plain text.
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Summary
CLAUDE.mdto give Claude Code (and similar AI coding assistants) structured guidance when working in this repositorymakecommands, the multi-module workspace layout, bootstrap flow, key interfaces, token naming conventions, anti-patterns, and the worktree/PR workflow policyTest plan
Summary by CodeRabbit