CCAR-F scenarios › Claude Code for Continuous Integration · Question 48 of 60
Scenario 5 · Claude Code for Continuous Integration
Claude Code runs inside your CI/CD pipeline. It reviews pull requests automatically, proposes test cases, and posts feedback on the PR. The central challenge is writing prompts and configuration that produce actionable findings while keeping false positives low enough that developers keep trusting the output.
Prompt Engineering & Structured Output
The same kind of problem, an unparameterized SQL string built from request input, is labelled "critical" on one PR and "minor" on another, so the team can't use severity to decide what blocks a merge. The prompt currently says "assign an appropriate severity: critical, major, or minor." What is the most effective fix?
Show answer and explanation
Answer: B — Define explicit criteria for each severity level, each with concrete code examples showing what belongs at that level and why it qualifies.
Section 6 says consistent severity classification comes from explicit severity criteria with concrete code examples for each level. (a) adds a self-reported confidence number, which does nothing to make the labels consistent. (c) is a vague instruction that leaves the levels undefined. (d) removes the feature the team needs instead of fixing it.
More from this scenario
- Your pipeline posts a readable markdown summary of review findings on each PR. The…
- Developers dismiss about 30% of automated review findings. The team wants to improve the…
- Your pipeline runs `claude -p` to review each pull request, and a script then uses…
- The CI review job re-runs on every push to an open pull request. Developers complain…
- A nightly CI job asks Claude Code to propose new unit tests for recently changed…