The short answer#
A prompt asks for an action; a specification, or spec, records agreed behaviour and constraints. A plan describes the implementation approach, tasks divide the work into reviewable changes, and tests check selected claims about the result against expected outcomes. Connect them through explicit acceptance rules so the team can review the same decisions.
Start with the disagreement a prompt leaves behind#
Imagine an invented booking application. Someone asks an AI coding agent:
Add booking cancellation. Allow cancellation up to 24 hours before the start.
What happens exactly 24 hours before the booking? Can one person cancel another person's booking? Does a second request fail, or return the same result? Does cancellation also issue a refund?
These are product decisions. A developer can produce working code before anyone has agreed on them. If quality assurance (QA) derives expected results from that code, the tests can preserve the developer's guesses.
The useful distinction between the five artifacts is the question each answers:
| Artifact | Question it answers | What belongs in it for this feature |
|---|---|---|
| Prompt | What should the agent do now? | Read the cancellation rules, find ambiguity, then propose a plan. |
| Spec | What must be true for users and the system? | Who may cancel, the exact cutoff, repeat behaviour and exclusions. |
| Plan | How will we implement the agreed behaviour here? | Existing components to reuse, code boundaries, dependencies and verification approach. |
| Task | What bounded change can someone implement and review? | A named deliverable, relevant rules, completion checks and dependencies. |
| Test | What result do we expect for this input or scenario? | An executable assertion tied to an agreed rule. |
A prompt can contain a whole spec. That does not make the two responsibilities identical: the request directs an action; the spec preserves decisions for later work. An issue can hold all five artifacts if the team can find and review each part.
GitHub's Spec Kit workflow also separates a specification from its implementation plan and tasks. You can practise the distinction without installing a particular tool.
Give the spec a few rules people can challenge#
Here is a deliberately small spec for the example. The 24-hour window is an invented teaching rule, not a Workshopps cancellation policy.
Goal: let a booking owner request cancellation and receive a consistent decision.
| Rule | Agreed behaviour |
|---|---|
| C1: ownership | Only the booking owner may cancel. Reject a different requester, including for an already cancelled booking. |
| C2: repeat request | For the owner, an already cancelled booking returns already-cancelled, regardless of the time. |
| C3: cutoff | For an active booking, allow cancellation when the start is at least 24 elapsed hours after the request time. Exactly 24 hours is allowed; anything less is too-late. |
| C4: scope | Calculate a decision only. Refunds, notifications, administrator overrides and saving the state change are outside this example. |
Inputs are a trusted requester identity, a booking loaded by trusted application code, and finite timestamps in milliseconds since the Unix epoch. Request time comes from the server; the caller validates inputs. Only active and cancelled states exist in this exercise. These assumptions belong beside the rules because the example depends on them.
The rule order matters. C1 takes precedence over C2, so a repeat request from a different person is still rejected. C2 takes precedence over C3, so the owner's repeat request does not become late just because time has passed.
You do not need to prescribe a function name in the functional spec. You do need to resolve whether the boundary is inclusive. If nobody can answer that question, record it as unresolved and ask the person authorised to decide before implementing that behaviour.
Turn the rules into a plan, then a reviewable task#
For this exercise, use this implementation plan:
- Keep the decision in a pure function: the same inputs produce the same result, without reading a clock or changing storage.
- Pass request time into the function. That makes the exact boundary easy to test without waiting or changing the machine clock.
- Check ownership, then existing state, then elapsed time, following C1–C3.
- Test the boundary, both sides of it and the rule precedence. Leave persistence and transport to separate work under C4.
In an existing application, the plan would first name the real authentication, booking storage and test conventions it will reuse. This isolated exercise has no repository architecture to integrate with. A plausible plan for a fictional repository is not evidence that it fits yours.
Now write one task that implements this slice:
T1 — Implement the cancellation decision
Inputs: the agreed C1–C4 rules and the implementation plan above.
Deliverable: cancellationDecision plus executable decision tests.
Checks: cover ownership, repeat requests, exact cutoff and either side.
Precedence: wrong requester is rejected even for a cancelled booking;
the owner's repeat request returns already-cancelled even after start.
Dependency: C1–C3 must be agreed before implementation.
Done: tests pass and the reviewer can trace each case to its rule.
Outside this task: HTTP routes, database writes, refunds and messages.
The plan explains why time is passed in. The task defines the change and its evidence. A task saying “build cancellation” would leave those boundaries for the implementer to invent again.
A useful prompt at this point is:
Implement T1 using C1–C4 and the agreed plan. Preserve the rule order.
If a requirement is missing or conflicts, stop and identify it.
Return the code, test results and any unverified assumptions.
That prompt directs the current action while pointing back to the decisions it must respect.
Run the rules as a small TypeScript example#
Use Node.js 22 with tsx installed as a development dependency. Node's TypeScript guide documents that execution route. In an empty exercise folder, initialise the package and install the runner:
npm init -y
npm install --save-dev tsx
Save the following as cancellation.test.ts. It uses Node's test runner and strict assertions; running it checks behaviour for these examples, while type checking remains a separate step.
import test from "node:test";
import assert from "node:assert/strict";
type Booking = {
ownerId: string;
startsAtMs: number;
state: "active" | "cancelled";
};
type Decision =
| "allowed"
| "not-owner"
| "already-cancelled"
| "too-late";
const HOUR_MS = 60 * 60 * 1000;
function cancellationDecision(
booking: Booking,
requesterId: string,
nowMs: number,
): Decision {
if (booking.ownerId !== requesterId) return "not-owner";
if (booking.state === "cancelled") return "already-cancelled";
return booking.startsAtMs - nowMs >= 24 * HOUR_MS
? "allowed"
: "too-late";
}
// Invented teaching data; tests use an injected clock value.
const start = Date.UTC(2030, 0, 2, 12);
const booking: Booking = {
ownerId: "person-a",
startsAtMs: start,
state: "active",
};
const cutoff = start - 24 * HOUR_MS;
const cases: Array<{
name: string;
state: Booking["state"];
requester: string;
now: number;
expected: Decision;
}> = [
{ name: "C3 before cutoff", state: "active",
requester: "person-a", now: cutoff - 1, expected: "allowed" },
{ name: "C3 exact cutoff", state: "active",
requester: "person-a", now: cutoff, expected: "allowed" },
{ name: "C3 after cutoff", state: "active",
requester: "person-a", now: cutoff + 1, expected: "too-late" },
{ name: "C3 after start", state: "active",
requester: "person-a", now: start + 1, expected: "too-late" },
{ name: "C1 wrong requester", state: "active",
requester: "person-b", now: cutoff, expected: "not-owner" },
{ name: "C2 owner repeats early", state: "cancelled",
requester: "person-a", now: cutoff - 1,
expected: "already-cancelled" },
{ name: "C2 owner repeats after start", state: "cancelled",
requester: "person-a", now: start + 1,
expected: "already-cancelled" },
{ name: "C1 precedes C2", state: "cancelled",
requester: "person-b", now: start + 1, expected: "not-owner" },
];
for (const c of cases) {
test(c.name, () => {
const actual = cancellationDecision(
{ ...booking, state: c.state }, c.requester, c.now,
);
assert.equal(actual, c.expected);
});
}
Run it:
npx tsx --test cancellation.test.ts
Expect eight passing tests. To see what the evidence catches, change >= to >: the exact-cutoff case should fail. Restore it, then move the cancelled-state check above the ownership check: the C1-precedes-C2 case should fail.
The expected values come from C1–C3. Keep them explicit. Calculating the expected value with the same comparison as the function would make the test less useful for catching a wrong comparison.
These are decision tests, not proof that a cancellation service is ready. A real integration must authenticate the requester, validate inputs and save the allowed transition safely when requests race. It also needs checks that denied requests cause no write and repeat requests cause no duplicate side effects. None of those properties is established by this pure function.
What this means for your team#
Treat the role arrangement below as a starting point to adapt, not a universal division of labour. One person may hold several roles; named responsibility still helps when a decision is disputed.
| Role | Useful contribution before code is accepted |
|---|---|
| Business analyst (BA) | Clarify C1–C3 with the people who own the booking policy; expose conflicting examples. |
| Product manager (PM) | Decide scope and priorities with the policy owner, including whether refunds belong in this change. |
| Developer | Ground the plan in the actual repository, implement the task and identify technical gaps. |
| QA engineer | Challenge the rules with counterexamples and define independent expected outcomes. |
For delivery heads, put the C1–C4 review before T1 starts and name who resolves any open policy decision. Budget that review as part of delivery: otherwise an unresolved cutoff may return as implementation, test and review rework.
AI can draft each artifact. It does not settle an unresolved policy merely by generating a confident answer. Nor does a passing test establish that the chosen policy meets the user's need.
For a small change, keep the rules, plan and task in one issue, with tests alongside the code. For a disposable experiment, a short prompt and explicit examples may be enough. Add structure when others need to review, continue or accept the work; five responsibilities do not require five large documents.
When a rule changes, follow its references. If the cutoff becomes 12 hours, update C3, the implementation and its expected test cases. Check whether the plan, task or user-facing explanation also needs changing. Leaving an old test expectation in place creates a second, conflicting statement of the requirement.
Questions developers and delivery heads ask#
Can a test replace the spec?#
A test can express part of a spec precisely. A boundary case says what should happen for that input, but it does not explain every exclusion, unresolved decision or user goal. Keep enough context for reviewers to challenge what the test assumes. For the earlier question of why explicit rules help, see why AI coding needs specs.
Can the same agent write the implementation and the tests?#
Yes, but review the expected outcomes against the agreed rules. Give QA or another reviewer a chance to challenge the examples, especially the boundary and precedence cases. If both outputs inherit the same wrong assumption, green tests can agree with wrong code.
How can we practise this with a whole team?#
Take one vague requirement, agree the missing decisions, then ask another person to implement and test it using the resulting artifacts. Compare the outcome with the rules. This adapts the vague-requirement exercise in the Specs-Driven Development workshop, under the topic covering the move from vague AI requests to specification-led delivery.
Enquire about the Specs-Driven Development workshop to practise the workflow as a Live Instructor Led Workshop or an Onsite Workshop for your Teams.
