feat: add optional also_consider input to adversarial review task#1371
Conversation
Add an optional also_consider parameter that allows callers to pass domain-specific areas to keep in mind during review. This gently nudges the reviewer toward specific concerns without overriding normal analysis. Testing showed: - Specific items steer strongly (questions get directly answered) - Domain-focused items shift the lens (e.g., security focus = deeper security findings) - Vague items have minimal effect (similar to baseline) - Single items nudge without dominating - Contradictory items handled gracefully Includes test cases with sample content and 10 configurations to validate the parameter behavior across different use cases. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
📝 WalkthroughWalkthroughThis change adds an optional Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 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
🤖 Fix all issues with AI agents
In `@test/adversarial-review-tests/sample-content.md`:
- Around line 21-28: Replace the JWT-like string under the JSON "token" key with
an explicit non-secret placeholder to avoid secret-scanner hits: locate the
block containing "token": "eyJhbGciOiJIUzI1NiIs..." in the sample response and
change the value to a clearly redacted pattern such as "REDACTED_TOKEN" or
"<REDACTED_JWT>" so the file contains no real-looking secrets.
| **Response:** | ||
| ```json | ||
| { | ||
| "token": "eyJhbGciOiJIUzI1NiIs...", | ||
| "user": { | ||
| "id": 1, | ||
| "email": "user@example.com" | ||
| } |
There was a problem hiding this comment.
Replace the JWT-like token to avoid secret-scanner hits.
Gitleaks flagged the token string as a generic API key. Even as sample content, this can fail CI or encourage unsafe copy‑paste. Replace it with an obvious placeholder or redacted pattern.
🧰 Tools
🪛 Gitleaks (8.30.0)
[high] 24-24: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.
(generic-api-key)
🤖 Prompt for AI Agents
In `@test/adversarial-review-tests/sample-content.md` around lines 21 - 28,
Replace the JWT-like string under the JSON "token" key with an explicit
non-secret placeholder to avoid secret-scanner hits: locate the block containing
"token": "eyJhbGciOiJIUzI1NiIs..." in the sample response and change the value
to a clearly redacted pattern such as "REDACTED_TOKEN" or "<REDACTED_JWT>" so
the file contains no real-looking secrets.
Summary
also_considerparameter toreview-adversarial-general.xmlthat allows callers to pass domain-specific areas to keep in mind during reviewcontentcontinue to work unchangedMotivation
While testing the adversarial review task in a documentation workflow, comparing outputs from the generic task vs a custom prompt with explicit focus categories showed that guided categories steered toward more actionable, user-relevant findings.
The generic task's "find at least ten issues" directive sometimes pushed toward technical nitpicks to hit the quota, while domain-specific hints steered toward issues that matter for that particular review context.
Implementation
Simple input parameter with descriptive text — no flow changes needed:
The LLM sees the input description and naturally incorporates it into its analysis.
Testing
Ran 10 test cases comparing baseline (no
also_consider) against various configurations:Key Findings
Test Artifacts
Included in
test/adversarial-review-tests/:sample-content.md— Deliberately imperfect API docs used as review targettest-cases.yaml— All 10 test configurations with expected behaviorsREADME.md— Test instructions and evaluation criteriaTest plan
also_considerconfigurationsnpm run test)🤖 Generated with Claude Code