Mastery Module 10 · Planning & Orchestration

Giving Good Instructions

Last reviewed

Intermediate

What you'll learn

~20 min
  • Write prompts that include context, specificity, examples, constraints, and expected outcome
  • Iterate effectively using the describe-before-and-after pattern
  • Apply common prompt patterns (add feature, fix bug, refactor, make responsive)
  • Recognize when to be vague (exploration) vs. precise (bug fixes)
  • Move a prompt you reuse into the project as an AGENTS.md rule or a skill (a saved prompt file the agent runs by name)

By the end of this lesson, you will be able to write prompts that increase the odds of a strong first draft — and when the first try is not perfect, iterate quickly with precise follow-up instructions.

Mental model: the delegation brief

Imagine you are handing a task to a new team member on their first day. They are skilled at their job, but they know nothing about your project, your preferences, or your context. The better your brief, the closer their first attempt will be to what you need.

That is exactly the relationship between you and the AI. The AI is highly capable, but it only knows what you tell it and what your project files say. A good instruction is a good delegation brief: it gives context, names specifics, sets constraints, and describes what success looks like.

The instruction spectrum

All prompts fall somewhere on a spectrum:

Vague Precise
"make it better" <-------------------------------> "change heading font-size
to 2.5rem, color
to #e4e4e7, and
add 24px bottom
margin"

Neither extreme is always right. The sweet spot depends on the task:

  • Scaffolding a new project — moderate specificity (describe features and style, let AI choose implementation)
  • Fixing a specific bug — high specificity (describe exact behavior and expected behavior)
  • Exploring ideas — lower specificity (“try a different layout for the hero section”)
💡Adjust the AI's thinking effort

In Claude Code, raise the setting first, then send the hard prompt:

/effort high
The order total is off by one cent on some orders. Find the cause and show me the orders that prove it before you change anything.

Some AI CLI tools let you control how much the AI “thinks” before responding. All four tools this course teaches have a setting for it: /effort in Claude Code and Antigravity, /model in Codex (it sets model and effort together), and the --reasoning-effort flag in Copilot CLI. Higher effort usually improves depth and reasoning but takes longer. Match the effort to the task — quick for renaming a variable, thorough for debugging a tricky issue. For one hard question in Claude Code, type the keyword ultrathink in that prompt: the tool reads it as a setting that raises the effort for that one turn. Phrases like “think harder” are plain text to it, which is why Claude Code’s best-practices guide lists them as advice you can stop following. To see how the AI reached its answer, ask for a deliverable rather than its raw reasoning: Let the Model Think teaches the pairing (raise effort as a setting; ask for a decision record of assumptions, options and chosen path as the thing you check). See the Vibe Coding Reference for thinking controls in specific tools.

The five elements of a great prompt

1. Context

Tell the AI what already exists and what you are working on.

Without context:

Add a button.

With context:

On the product detail page, add an "Add to Cart" button below the
price. It should match the style of the existing "Buy Now" button
in the hero section.

2. Specificity

Name exact things. Colors, sizes, behaviors, text content.

Vague:

Make the header look better.

Specific:

Update the header:
- Increase height to 64px
- Add a subtle bottom border (1px solid #1e1e2a)
- Make the logo 32px square
- Center navigation links vertically
- Add a hover state: text turns #a855f7 on hover

3. Examples

Show what you mean with examples, references, or comparisons.

Style the pricing cards similar to Stripe's pricing page:
clean, minimal, with a highlighted "popular" option.
The popular card should have a purple border and a "Most Popular"
badge at the top.

4. Constraints

State what you DO NOT want, or limits on the solution.

Add form validation to the signup form.
- Do NOT use any external validation libraries
- All validation should be client-side
- Show error messages below each field, not as alerts
- Don't disable the submit button -- let users click and
show all errors at once

5. Expected outcome

Describe what “success” looks like — what you will see when it works.

When I submit an invalid form, I should see red error messages
below each field that has a problem. When I fix the errors and
resubmit, the messages should disappear and the form should
submit successfully.

Worked example: the five elements, in conversation

You do not have to type all five elements in one message. In plan mode they come out as answers to the agent’s questions. Here is how it goes for the task app.

You (plan mode):

Add a way to reorder tasks by dragging them. Ask me what you need before you plan.

Agent: Which screen is this for, and how are tasks stored today?

You: (context) The main area of my task app, next to the project sidebar. Tasks are saved in the browser.

Agent: How should dragging look and feel, and should the order be remembered?

You: (specifics) A grab handle on the left of each row, a subtle shadow while dragging, and the other rows slide out of the way. Yes, remember the order after a refresh.

Agent: Anything I must not change?

You: (constraints) Keep click-to-edit working, and do not change how tasks are stored.

Agent: (proposes a plan, and asks what success looks like)

You: (expected outcome) I drag a task above another one, the list reorders smoothly, and the order is still there after I refresh.

Approve the plan, then check it. If something is off, one small follow-up fixes it:

The grab handle is hard to see on the dark background. Make it a lighter gray and a little bigger.

Context, specifics, constraints, and the expected outcome all arrived without a single long prompt, because the agent asked for each one.

🧬In Your Field: Biotechclick to expand

Lab tool prompts use domain vocabulary. When instructing the AI to build research tools, your domain knowledge is your advantage. “Add a 96-well plate heatmap where each well is color-coded by absorbance value (blue for low, red for high)” is more specific and useful than “add a data visualization.” Many models recognize terms like “96-well plate” — use your field’s terminology, and add a brief definition or sample data schema if precision matters.

Iteration: the real skill

Even with perfect prompts, you will iterate. Here is how to iterate well:

Be specific about what is wrong

Bad: “This doesn’t look right.” Good: “The cards are too close together — add 16px gap. And the text color is too dark to read on the background.”

Reference the existing code

Bad: “Fix the bug.” Good: “The handleSubmit function doesn’t prevent the default form behavior, so the page refreshes on submit. Add e.preventDefault() at the beginning.”

Keep each follow-up small

Bad: “Fix the layout, change the colors, add animations, and make it responsive.” Good: “Fix the layout — cards should be in a 3-column grid on desktop.” Then after that works: “Now update the card colors to match the design system.”

Ask for one change, or one tightly related pair, per follow-up: an icon’s color and size is a pair, while layout plus colors plus animations is three unrelated changes. (Breaking Down Tasks’s rule: one change per prompt, so a failure names its cause.)

Describe the before and after

Bad: “The search doesn’t work.” Good: “When I type ‘react’ in the search bar, nothing happens. I expect the product list to filter to only show products with ‘react’ in the title.”

🏛️In Your Field: Government Devclick to expand

Government compliance prompts. When building tools that need to meet accessibility or compliance requirements, state those as constraints: “This form must work with keyboard navigation only — no mouse required. All form fields need visible labels (not just placeholders). Error messages must be announced by screen readers. Follow WCAG 2.2 AA guidelines (they also meet the 2.1 AA level the ADA Title II rule requires).” Constraints like these prevent rework later.

Common prompt patterns

Here are four patterns you will use repeatedly; adapt them to your project. For any prompt, you can use this general template as a starting point:

Context: [what exists, what you're working on]
Task: [what you want done]
Specifics: [exact details, names, sizes, colors]
Constraints: [what NOT to do, limits on the solution]
Expected outcome: [what you'll see when it works]

Not every prompt needs all five sections — use what fits the task. Here are the four most common patterns:

“Add [feature] to [location]”

Add a dark mode toggle to the top-right corner of the navigation bar.
When clicked, it should switch between dark (#09090b background) and
light (#ffffff background) themes. Save the preference to localStorage.

“Fix [bug]”

The mobile menu doesn't close when I click a navigation link.
After navigating to a new page, the hamburger menu stays open.
It should close automatically when any nav link is clicked.

“Refactor [thing]”

The handleFormSubmit function is 80 lines long and handles
validation, API call, and UI updates. Break it into three
separate functions: validateForm, submitToAPI, and updateUI.
Keep the same behavior.

“Make [thing] responsive”

The pricing grid looks great on desktop but breaks on mobile.
On screens below 768px, change from 3 columns to 1 column.
Stack the cards vertically with 16px gap.
📊In Your Field: MIS / Businessclick to expand

Business analysis prompts. MIS professionals often need data transformation tools. A strong prompt: “Build a CSV upload page. When the user uploads a sales CSV file, parse it and display a summary table showing: total revenue, average order value, top 5 products by revenue, and orders by month as a bar chart. The CSV has columns: order_id, product_name, quantity, unit_price, order_date.” Notice how naming the CSV columns removes all ambiguity.

🔧

When Things Go Wrong

Use the Symptom → Evidence → Request pattern: describe what you see, paste the error, then ask for a fix.

Symptom
The AI changed things I did not ask it to change
Evidence
I asked to update the header color and it also rewrote the navigation links
What to ask the AI
"Change only the header background color from #18181b to #111118. Do not modify any other styles, components, or layout. Only touch the header background."
Symptom
The AI says it made the change but nothing looks different
Evidence
The AI confirmed it updated the CSS but the page looks the same
What to ask the AI
"I still see the old header color. Check if there is a CSS specificity issue -- another style might be overriding the change. Look for inline styles, !important declarations, or more specific selectors that target the same element."
Symptom
The result works but looks nothing like what I described
Evidence
I asked for a 'clean, minimal pricing table' and got a colorful card layout
What to ask the AI
"The pricing section should be a simple table -- not cards. Three columns (Basic, Pro, Enterprise), rows for each feature with checkmarks, and a price at the top of each column. White text on dark background. No gradients, no shadows, no rounded corners on the table. Reference: similar to the GitHub pricing comparison table."

Practice: spot the five elements

Read this prompt and identify which of the five elements (Context, Specificity, Examples, Constraints, Expected Outcome) it includes:

Context: I have a React weather app with a search bar and a current-conditions card.
Request: Add a 5-day forecast section below the current conditions.
Specifics:
- Show day name, high/low temperature, and a weather icon for each day
- Use a horizontal scrollable row on mobile, a grid on desktop
Constraints:
- Use the existing OpenWeather API key already in the .env file
- Do not change the current-conditions card layout
Expected: Below the current weather, I see five cards showing the next five days
with temperatures and icons. On mobile I can swipe sideways through them.

Answer: This prompt has four of the five: Context (React weather app, existing components), Specificity (day name, high/low, icon, layout details), Constraints (use existing API key, do not change existing card), and Expected Outcome (the description of what success looks like). It has no Example: describing the result is not the same as pointing at something to match. One line would supply it: “Style each day like a smaller copy of the current-conditions card.”

KNOWLEDGE CHECK

Which prompt will produce the best result?

Run this on your machine

  1. In your agent, open a project that has something you want to change.
  2. Give one refinement turn that says what you see now and what you expected instead, for example: “When I type in the search bar, nothing happens. I expected the list to filter.”
  3. Read what the agent changes and check it in your browser.
  4. If it is not right, send a second turn that names only the difference that is left.
KNOWLEDGE CHECK

You asked the AI to 'make the page responsive' and the result is not what you wanted. What is the best follow-up?

⚠AI review supplements but does not replace human review

AI-generated code can contain security vulnerabilities, incorrect logic, or subtle bugs that the AI itself does not flag. Common examples: an AI might suggest storing passwords in plain text, skip input sanitization, or mark a false positive as a real bug. Always verify AI output by running the app, checking edge cases, and reviewing any security-sensitive code (authentication, data handling, user input) yourself. For security-critical projects, refer to resources like the OWASP Top 10 (2025 edition as of 2026-11-07) as a checklist. AI is a powerful first-draft tool, not a substitute for human judgment.

💡Post-response verification checklist

After the AI makes a change, run through this quick check:

  1. Does the app still start without errors?
  2. Does the new feature work as described?
  3. Do existing features still work? (Check 2-3 things you know worked before.)
  4. On mobile, does the layout hold together?
  5. Are there any console errors in the browser?

Keep the prompts you reuse inside the project

When you reach for the same prompt again, ask the agent to keep it in the project for you:

At the end of every feature I ask for the same check: run the build, run the tests, and list any page whose mobile layout changed. Save that as a project skill called check-feature so I can run it by name.

The agent writes a skill: a folder holding a SKILL.md file, which is plain Markdown instructions under a short header that names the skill and describes when to use it:

---
name: check-feature
description: Use after building a feature, to run the checks and report what failed.
---

You run the skill by name, as the table below shows for each tool.

A reused prompt goes to one of two places, both inside the project:

  • A standing rule, something true for every task (“use the existing Button component for every button”, “run npm test before you call a change done”), is one line in the project memory file the tool loads at the start of every session: AGENTS.md in Codex, Antigravity and Copilot CLI, CLAUDE.md in Claude Code (Let the AI Set Things Up’s rule: one AGENTS.md for every tool, and @AGENTS.md inside CLAUDE.md when you use Claude Code). Think Before You Prompt’s last step writes it: what worked becomes one AGENTS.md line.
  • A repeatable workflow, several steps you run on request (the check above, “draft the release notes”, “add a page in our layout”), is a skill.

Where each tool looks for project skills (as of 2026-11-08):

ToolProject skill pathHow you run it
Claude Code.claude/skills/<name>/SKILL.md/check-feature
Codex CLI.agents/skills/<name>/SKILL.md$check-feature (Codex runs skills with a dollar sign), or pick it from /skills
Antigravity CLI.agents/skills/<name>/SKILL.md/check-feature
Copilot CLI.github/skills/, .agents/skills/ or .claude/skills/ (Copilot reads all three; if Copilot is your only tool, use .github/skills/)type /skills to list your skills, then choose one to run it

Commit the skills folder with the rest of the project. A file the agent can read beats a note on your desktop: it loads without a paste, it runs the same way each time, and a teammate who clones the repo gets it too. For a prompt you use in every project, such as a scaffolding prompt from Project Templates, each tool also reads a personal skills folder in your home directory; Skills, Hooks & Custom Commands lists those paths and covers writing skills that hold up.

In browser chat, which cannot read a project folder, keep one PROMPTS.md file and paste from it. When you move to a CLI tool, each entry becomes a rule or a skill.

Key takeaways

  • Great prompts have five elements: context, specificity, examples, constraints, and expected outcome.
  • Match precision to the task. Be vague when exploring, moderate when scaffolding, precise when fixing bugs.
  • Iterate with the before-and-after pattern. Describe what you see now, then describe what you expect to see. This gives the AI clear diagnostic information.
  • Keep each follow-up small. When one change goes wrong, you know which one it was.
  • Keep reused prompts in the project. A prompt you reach for again becomes one line in AGENTS.md (a standing rule) or a skill in your tool’s skills folder (a repeatable workflow), where the agent can read it.
Search lessons