Prompt precision & explicit criteria
Design prompts with explicit criteria to improve precision and reduce false positives.
This subtopic (4.1) sits in Prompt Engineering & Structured Output (D4) on Anthropic's Claude Certified Architect — Foundations (CCA-F) exam. The bank holds 21 practice questions here — 5 easy, 11 medium, and 5 hard — with 5 free to try, answers and explanations included. 3 of the free questions are below; the rest are in the practice stream.
What the exam tests here
- false positive rates undermine developer trust across all categories
- explicit criteria vs vague instructions — flag specific conditions not confidence levels
- general instructions like 'be conservative' fail to improve precision
- severity criteria with concrete code examples for consistent classification
Free practice questions: Prompt precision & explicit criteria
Your CI/CD pipeline posts Claude Code feedback as PR comments, but reviewers complain that 30% flag valid code as problematic. What prompt change most directly reduces these false positives?
Show answer & explanation
Correct answer: B. Add explicit acceptance criteria defining what constitutes a real defect.
Explicit acceptance criteria constrain the model to flag only genuine defects, directly cutting false positives. 'Increase the model temperature' increases randomness, worsening precision. 'Switch to a larger model' changes capacity but not the evaluation criteria. '--output-format json' changes output structure, not judgment quality.
Your CI/CD review job invokes Claude Code with --print and posts findings as PR comments. Reviewers complain that 30% of comments flag stylistic preferences as bugs. You want to tighten the prompt so only real defects are reported. Which instruction will most reduce false positives in the PR comments?
Show answer & explanation
Correct answer: B. Flag only issues matching: null dereference, unhandled exception path, off-by-one in loop bounds, or resource leak.
Enumerating concrete defect categories gives the model an objective checklist, eliminating subjective judgment that produces stylistic noise. 'confidence...exceeds 80 percent' asks the model to self-report calibration it cannot reliably produce. 'experienced senior engineer would consider' is exactly the vague rubric that caused the original problem. 'deviates from patterns documented in CLAUDE.md' narrows scope but targets consistency, not defect detection.
Your CI/CD pipeline uses --output-format json to parse Claude's PR comments programmatically. Reviews flag issues inconsistently. Which prompt change best reduces false positives?
Show answer & explanation
Correct answer: C. Specify exact conditions to flag: security vulnerabilities, missing null checks, and hardcoded credentials only.
Explicit, enumerated conditions ('security vulnerabilities, missing null checks, hardcoded credentials') give deterministic targeting that eliminates ambiguous flags. 'Confidence exceeds 80%' is a vague self-assessment Claude cannot reliably calibrate. 'Summarize uncertainty' adds noise without scoping what to flag. 'All style, logic, and security issues' is maximally broad, guaranteeing false positives.
2 more free questions on this subtopic in the practice stream, plus 16 in the full bank. Keep practicing →