docs: add AI agent onboarding and CodeRabbit code review configuration#288
docs: add AI agent onboarding and CodeRabbit code review configuration#288jimmyjames wants to merge 3 commits intomainfrom
Conversation
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ 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 |
Codecov Report✅ All modified and coverable lines are covered by tests. ❌ Your project status has failed because the head coverage (34.38%) is below the target coverage (80.00%). You can increase the head coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## main #288 +/- ##
==========================================
+ Coverage 33.70% 34.38% +0.67%
==========================================
Files 115 115
Lines 9826 9982 +156
==========================================
+ Hits 3312 3432 +120
- Misses 6244 6272 +28
- Partials 270 278 +8 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
4ea6d76 to
aa521ce
Compare
- AGENTS.md: universal developer onboarding for all AI agents (Claude, Codex, Gemini, Jules, CodeRabbit) covering tech stack, architecture, dev commands, code generation policy, key patterns, and gotchas - CLAUDE.md: imports AGENTS.md and references .claude/rules/ files - .coderabbit.yaml: CodeRabbit PR review configuration with path-specific instructions to enforce generated file guardrails and SDK conventions - .claude/rules/code-generation.md: generated vs hand-written file taxonomy, redirect edits to sdk-generator repo - .claude/rules/streaming.md: StreamingChannel drain pattern, goroutine leak prevention - .claude/rules/error-handling.md: error types, retry eligibility - .claude/rules/telemetry.md: OTel metric patterns, noop provider for tests - .claude/rules/oauth2-credentials.md: token lifecycle, expiry jitter
aa521ce to
0e642a4
Compare
Summary
This PR adds AI agent onboarding documentation and CodeRabbit code review configuration for the
openfga/go-sdkrepository. It was generated using theimproving-claude-instructionsskill in Claude Code via a 3-phase analysis workflow (5 parallel analysis agents → strategy review → implementation).What was added
AGENTS.mdCLAUDE.mdAGENTS.mdand references.claude/rules/for Claude-specific coding instructions..coderabbit.yamlAGENTS.mdfor project context. Has path-specific instructions enforcing the same standards as the rules files..claude/rules/code-generation.mdmodel_*.go,api_open_fga.go, etc. — redirect to sdk-generator repo..claude/rules/streaming.mdStreamingChannel[T]drain pattern, goroutine leak prevention, context cancellation..claude/rules/error-handling.mdRetry-Afterheader behavior..claude/rules/telemetry.md.claude/rules/oauth2-credentials.mdDesign decisions
AGENTS.md as the universal source of truth
Rather than writing a Claude-only
CLAUDE.md, the project context lives inAGENTS.md— a format recognized by OpenAI Codex, Google Jules, GitHub Copilot, and CodeRabbit.CLAUDE.mdsimply imports it via@AGENTS.md. This means any AI tool a contributor uses gets the same quality onboarding from a single file.CodeRabbit + Claude enforce the same standards
.coderabbit.yamlmirrors the.claude/rules/guardrails so standards are enforced at two points: by Claude during development, and by CodeRabbit during PR review. Key example: any PR that editsmodel_*.goorapi_open_fga.gowill get a hard CodeRabbit stop redirecting the author to the sdk-generator repo.Rules files are unconditional (no path scoping)
All 5
.claude/rules/files are loaded unconditionally (nopathsfrontmatter). The gotchas they cover — generated file editing, streaming leaks, token jitter — can trip up contributors working in any part of the SDK, not just specific directories.Key findings from analysis
These were surfaced during the Phase 1 codebase analysis and are now documented in the files above:
model_*.go(88 files),api_open_fga.go,streaming.go,internal/constants/constants.go,docs/(90+ files). Edits get wiped on regeneration from the sdk-generator repo.api_executor.gois the newer preferred pattern — it's hand-written and preferred over direct calls to the generatedapi_open_fga.gofor new methods.oauth2/will fail unpredictably.StreamingChannel[T]goroutine leak — bothResultsandErrorschannels must be drained; a blocked read on either leaks the streaming goroutine.golangci-lintexcludesmodel_*.go— intentional design in.golangci.yaml; lint errors in generated code are not caught by CI.internal/constants/constants.go).ApiSchemeandApiHostare deprecated; useApiUrl.For the reviewer / team
Before merging, please review and adjust:
AGENTS.md— verify the architecture description and gotchas match your team's understanding. Add any workflow conventions not captured (e.g., release process, versioning policy)..coderabbit.yaml— adjust theprofile(assertive→chill) andrequest_changes_workflowif preferred. Add or remove path-specific instructions to match your review standards..claude/rules/— each file is short and focused. Add team-specific patterns or remove anything that doesn't match how you actually work.example/*/go.modmodules are independent and not tested in CI. The docs note this but the team may want to add CI coverage or explicitly document the maintenance expectation.AGENTS.mdsince it wasn't visible in the codebase. If there's a release workflow, add it toAGENTS.mdunder a## Releasesection.Testing
No code changes — documentation only.
make checkpasses on the branch.