August 18, 2025
Agent coding tools like Copilot aren’t just autocomplete for single files anymore, they can now build fullstack applications. They can reason across files, propose refactors, draft tests, even argue about architecture. But none of that matters if your asks are mush. The difference between “meh, plausible code” and “wow, exactly what I meant” is about prompt craftsmanship and quickly becoming a necessary skill.
This is a practical, opinionated guide to prompting for agentic project development. Leaning on patterns you’ll also see echoed in community gems like awesome-copilot, with a special focus on chatmodes
(the “hats” you ask your AI to wear).
Natural language is imprecise, while code is not. Even though coding agents are getting smarter by the month agentic systems fill in the gaps with their own assumptions, which can lead to unexpected results.:
bound scope
, agents invent scope.name constraints
, they average the internet.share context
, they’ll build generic, "just okay" solutions.Rule 0: Treat language as an interface. Your prompt is the API contract. You state inputs, outputs, invariants, and success criteria.
Use this spine for 90% of dev asks:
ROLE -> CONTEXT -> TASK -> CONSTRAINTS -> FORMAT -> ACCEPTANCE
ROLE (chatmode):
the hat it should wear.CONTEXT:
code, file tree, conventions, dependencies.TASK:
action, not vibes. (“Implement”, “Refactor”, “Diagnose”.)CONSTRAINTS:
frameworks, patterns, performance, security, style.FORMAT:
how you want the result (code block, diff, checklist).ACCEPTANCE:
tests, examples, or explicit “done when” criteria.Example:
Role:
You are a refactoring assistant.Context:
Node 18, no 3rd-party CSV libs. Current function below.Task:
Reduce cognitive complexity ofparseCsv()
without changing behavior.Constraints:
Keep streaming interface, preserve error messages, time complexity ≤ current.Format:
Return a unified diff patch.Acceptance:
Include 3 table-driven Jest tests that pass on quoted fields, empty lines, and BOM.
This template prevents “model improv hour” and drives the agent toward the exact deliverable you need.
Currently with Copilot, you are able to define a chatmodes
folder within .github
at the root of your project. Right next to the workflows folder. From there you can define chatmodes
by creating .md
files describing a role for copilot to use. Once created, reload VS Code and you can select the chatmode from the Copilot chat interface.
Per awesome-copilot
Define chat behavior, available tools, and codebase interaction patterns within specific boundaries for each request
Same model, different behavior, if you name the mode
. Five high-leverage modes for dev work:
Implementer
“Write the thing.” Great for scaffolds and boilerplate.
Ask for: code + minimal notes.
Explainer
“Teach me what this does (and where it breaks).”
Ask for: concise summary, failure cases, complexity, example I/O.
Refactorer
“Improve clarity/perf without behavior change.”
Ask for: a diff
+ rationale bullets.
Bug Hunter
“Skeptically review for edge cases and defects.”
Ask for: numbered findings + repro snippets.
Spec Writer
“Write the contract before code.”
Ask for: structured requirements, API signatures, acceptance tests.
Pro tip:
If an answer feels off, don’t just “ask again.” Switch modes.
Explainer -> reveals misunderstanding. Bug Hunter -> pressure tests. Spec Writer -> aligns on the target before touching code.
Do
Bullet your asks.
Models parse lists better than paragraphs.Bound the canvas.
“One function” vs. “new service” is a critical difference.Show the neighborhood.
Include file tree, key interfaces, or conventions.Ask for a plan first
when tasks are multi-step: “Give a 5-bullet plan, then wait.”Prefer diffs over blobs
for refactors, easier to review and revert.Pin success.
“Done when these tests pass” beats “looks good.”Don’t
Don’t say “optimize”
without an axis (latency, memory, readability).Don’t stack 10 asks
in one go, chain them.Don’t rely on memory.
Restate constraints in each thread/session.Don’t copy-paste to prod.
Run, test, and profile, treat AI code as code.Vague Verb:
“Improve this.” -> Specific Verb:
“Reduce allocations, target ≤1 allocation per loop.”Unbounded Scope:
“Add analytics.” -> Scoped:
“Emit pageview + timing via track()
only on client routes.”Context Starvation:
“Write tests.” -> Contexted:
“Jest + React Testing Library, existing jest.setup.ts
below, mock network with MSW.”Style Drift:
“Build auth middleware.” -> “Match existing Result<T, E>
pattern, no exceptions, return Unauthorized
sentinel.”Before:
“Write a POST /weather endpoint.”
Better:
“Express TS POST /weather
accepts { city }
, calls OpenWeatherMap, returns { temp, conditions }
, handles network errors.”
Best:
Role:
ImplementerTask:
Add POST /weather
Context:
Node 20, zod
for validation, fetch
available, error style uses ProblemDetails
.Constraints:
Timeout 2s, no retries, log X-Request-Id
.Format:
Code block + 3 Jest tests (happy path, timeout, 400 invalid city).Acceptance:
Tests pass, function pure except I/O.Before:
“Clean this file.”Better:
“Refactor for readability.”Best:
“Refactor priceCalculator.ts
to lower cognitive complexity (≤10 per function). Don’t change numerical results. Return a unified diff, then list any renamed helpers.”Agentic systems thrive on tight feedback loops
. Treat the model like an eager junior dev:
Draft:
“Give me a minimal first pass.”Constrain:
“Great—consolidate error branches and add input guards.”Harden:
“Now property-based tests for edge cases.”Polish:
“Docstring each public function with examples.”Each turn adds a constraint or acceptance check. You’re not “wasting prompts”, you’re converging
.
Ask for artifacts that prove
alignment, not paragraphs that claim it:
Diffs
, not dumps.Tests
, not promises.Bench scripts
, not anecdotes.Threat notes
, not “we considered security.”If it matters, make it machine-checkable. Make it verify endpoints with curl commands, or have it run unit tests.
ROLE:
Implementer / Explainer / Refactorer / Bug Hunter / Spec WriterCONTEXT:
File tree, key snippets, conventionsTASK:
One clear verb and objectCONSTRAINTS:
Frameworks, patterns, perf/security boundsFORMAT:
Code block, diff, checklist, tableACCEPTANCE:
Tests/examples/metrics that define “done”
Example skeleton:
You are a <MODE>.
Context: <FILES/CONVENTIONS/SNIPPETS>.
Task: <ACTION>.
Constraints: <RULES/BOUNDS>.
Format: <DIFF | CODE + TESTS | CHECKLIST>.
Acceptance: <TESTS/CRITERIA>.
Agentic development isn’t “let the robot figure it out.” It’s you
steering a powerful collaborator with crisp contracts. Name the hat (chatmode), bound the canvas, feed real context, and anchor to verifiable acceptance. Do that, and your copilot stops guessing—and starts delivering exactly what you asked for. If you're interested in reading more of my thoughts, check out my blog at The Glitched Goblet.