Prompts are formed iteratively

A complex task rarely has a perfect formulation on the first attempt. A working prompt is refined through an observable problem, separation of facts and assumptions, explicit boundaries, exceptions, acceptance criteria, and a verification plan.

  1. Describe the problem through observable behavior.
  2. Separate facts from assumptions.
  3. Clarify the scope, exceptions, and constraints.
  4. Define the acceptance criteria and verification plan.
  5. Reread the task statement before moving to code.

A technical interview instead of premature code

If the business problem is clear but the technical boundaries are not, first ask Claude to ask questions and investigate the context without editing. Answer with facts, record the final specification, and only then move to implementation.

  • The model can identify gaps, but it does not make final decisions.
  • Claude’s unconfirmed assumptions do not automatically become requirements.
  • It is better to separate the clarification phase from the implementation session.
First prompt for clarification
Analyze the problem description without editing code.
Ask questions about scope, constraints, and verification.
Separate confirmed facts from hypotheses.
After the answers, suggest a structure for TASK_SPEC.md.

Main antipatterns

AntipatternBetter approach
“Fix everything”One problem, scope, and non-goals
No criteriaDescribe the expected behavior
Verification after codePlan verification in advance
Feature together with refactoringSeparate the changes
Trusting a confident conclusionCheck the diff and evidence
A polluted long sessionRecord the spec and start a clean session

Separate preparation and implementation sessions

Preparation sessionImplementation session
Problem analysisApproved specification
Questions and answersConfirmed evidence
TASK_SPEC.md and EVIDENCE_LOG.mdPlanning, changes, and verification
Unconfirmed hypothesesReviewable diff and test results

The final route for a quality task

  • Before implementation, it is known what changes and what remains unchanged.
  • Confirmed facts are separated from working hypotheses.
  • There is a verification method for every criterion.
  • The final result is accepted based on the diff, checks, and human review.
Explore → Plan → Implement → Verify → Review → Commit / PR

Canonical lesson source · JavaRush

Open JavaRush material