Skip to main content

Task Instruction Patterns

Good prompts reduce retries and improve review quality.

Use a compact, structured instruction:

Goal:
Constraints:
Scope:
Validation:
Output format:

Example

Goal: Add user docs for notifications and troubleshooting.
Constraints: Keep existing API behavior unchanged; English docs only.
Scope: userdocs/docs/operations/*
Validation: Provide steps to build docs and verify sidebar links.
Output format: Patch summary + modified file list.

Patterns That Work Well

  • One clear goal per turn
  • Explicit file/module scope
  • Explicit verification expectation
  • Explicit non-goals to avoid overreach

Patterns to Avoid

  • Multiple unrelated goals in one instruction
  • Ambiguous constraints like "improve everything"
  • Missing validation requirements

Follow-up Prompt Pattern

When refining output:

Keep current structure. Only adjust X.
Do not change Y.
Add tests or checks for Z.