Repository navigation
feat(dev-workflow): enable code-review agent to load project context and skills - #201
Conversation
…and skills - Add settingSources option to claude.ts to allow loading project settings - Pass settingSources: ['project'] in code-review.ts to enable skills/plugins - Add CLAUDE_SDK_AGENT env var to skip dev-workflow hooks for SDK agents - Update code-review.md to load and apply separation-of-concerns skill - Fix schema to accept null line numbers in findings Closes #200 Co-Authored-By: Claude Opus 4.5 <[email protected]>
Deploying living-architecture with
|
| Latest commit: |
c6fdf05
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://9ecb623c.living-architecture.pages.dev |
| Branch Preview URL: | https://issue-200-enable-claude-code.living-architecture.pages.dev |
|
Warning Rate limit exceeded
⌛ 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. 📒 Files selected for processing (4)
Note Other AI code review bot(s) detectedCodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review. 📝 WalkthroughWalkthroughAdds a project-level settingSources option to Claude queries, inserts a separation-of-concerns skill step into the code-review guidance, detects and short-circuits SDK-spawned agents in dev-workflow hooks, and allows null values for finding.line in workflow schemas. Changes
Sequence Diagram(s)sequenceDiagram
participant Env as Environment
participant Hooks as dev-workflow-hooks
participant STDIN as STDIN
participant Parser as JSON Parser/Validator
participant Handler as Handler (router)
participant Claude as Claude SDK
Env->>Hooks: process starts (env vars set)
Hooks->>Hooks: isRunningAsSDKSpawnedAgent()?
alt SDK-spawned agent (CLAUDE_SDK_AGENT=true)
Hooks->>Hooks: skipHooksForSDKAgents() and return
else Normal run
STDIN->>Hooks: input stream
Hooks->>Parser: parse + validate JSON
Parser->>Handler: route to appropriate handler
Handler->>Claude: claude.query(..., settingSources:['project'])
Claude-->>Handler: response
Handler-->>Hooks: output JSON
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related issues
Possibly related PRs
Suggested labels
Poem
🚥 Pre-merge checks | ✅ 2✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. 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 |
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In `@tools/dev-workflow/dev-workflow-hooks/dev-workflow-hooks.ts`:
- Around line 66-69: Extract the magic environment variable string into a shared
constant (e.g., export const CLAUDE_SDK_AGENT_ENV_VAR = 'CLAUDE_SDK_AGENT') in a
common module and import it where needed; replace direct uses of the literal
with the constant in the isRunningAsSDKSpawnedAgent implementation and in any
callers like the dev-workflow-hooks file that call isRunningAsSDKSpawnedAgent()
or skipHooksForSDKAgents(), and update claude.ts to export the constant so both
modules reference the same identifier to avoid typos and ease future changes.
- Make settingSources optional in ClaudeQueryOptions interface with @default [] JSDoc - Improve isRunningAsSDKSpawnedAgent to handle different truthy values (1, true case-insensitive) Co-Authored-By: Claude Opus 4.5 <[email protected]>
…ntation - Export CLAUDE_SDK_AGENT_ENV_VAR constant from claude.ts for reuse - Import and use constant in dev-workflow-hooks.ts to prevent typos - Add comprehensive JSDoc explaining why env var approach is necessary - Uses bracket notation for computed property key in env object Co-Authored-By: Claude Opus 4.5 <[email protected]>
- Remove reference to non-existent skill from code-review.md - Move schemas to code-review.ts where they are used - Delete now-unused workflow-runner/schemas.ts - Rename functions for domain clarity Fixes organization violation: schemas were grouped by type rather than usage. Now they live alongside code that uses them. Co-Authored-By: Claude Opus 4.5 <[email protected]>
- Update code-review.md to reference software-design-principles skill (available skill) - Replace dangerous ?? fallback with fail-fast error in parseJsonFromCodeBlockOrRaw - Add documentation explaining schemas organization in dev-workflow-hooks - Extract getReviewerNames function to separate agent name resolution from execution Follows fail-fast principle: clear errors instead of silent fallbacks. Improves separation of concerns: agent coordination logic separated. Co-Authored-By: Claude Opus 4.5 <[email protected]>
- Remove skill reference from code-review.md agent instructions - Rename parseJsonFromCodeBlockOrRaw to parseJsonFromCodeBlock (clarifies function only extracts from code blocks, fails otherwise) Co-Authored-By: Claude Opus 4.5 <[email protected]>
- Remove code comment from CLAUDE_SDK_AGENT_ENV_VAR (no-comments policy) - Add validation for reviewer agent names (fail-fast principle) - Add JSDoc documentation for SettingSource type Co-Authored-By: Claude Opus 4.5 <[email protected]>
Make ReviewerResult internal-only since it's not used outside code-review.ts Co-Authored-By: Claude Opus 4.5 <[email protected]>
|



References
User request to improve code review quality
Summary
The code-review agent in complete-task workflow runs without project context or skills. This limits its ability to apply project-specific conventions like separation-of-concerns from the claude-skillz plugin.
Full Details
Two changes needed: (1) Update tools/dev-workflow/complete-task/steps/code-review.ts to pass flags that enable Claude to load project context and skills. (2) Update .claude/agents/code-review.md to instruct the agent to use the separation-of-concerns skill for code organization analysis.
Acceptance Criteria
Amendment
feat(dev-workflow): enable Claude code-review agent to load project context and skills
Summary by CodeRabbit
New Features
Improvements
✏️ Tip: You can customize this high-level summary in your review settings.