How to write a product spec for an AI coding agent

Start with a clear goal and measurable success criteria. Ground the proposed solution in user evidence, define its behavior and give your coding agent a brief your team can implement and review. Copy the template and follow the worked example below.

Start with a clear goal and success criteria

State who should benefit, what should improve and how you will know. Write the measure, baseline, intended change, review date and guardrails before selecting features. Then define acceptance checks for the behavior the agent must deliver. The success measure tells the team whether the change helped. The acceptance checks let engineering verify that it works as agreed.

  • A clear goal — help workspace administrators recover an expired invitation without a support request.
  • An observable success criterion — in an agreed usability test, administrators can find and complete the resend task unaided. Set a threshold before testing, and keep permission failures at zero.
  • A build check — an expired link cannot grant access, even after a replacement invitation is issued.

Scrum Guide — Product Goal · GitHub Spec Kit — define what and why before implementation

What belongs in a spec for a coding agent?

Give the agent the user problem, supporting evidence, intended outcome, agreed scope, constraints and observable acceptance checks. Identify who owns unresolved decisions. Include the repository context it needs to act, then define which changes need an answer from a person. The brief is ready when another teammate can tell what to build, what to verify and when to ask.

  • Start from an actual user journey. A feature name such as ‘resend invitation’ leaves permissions, failures and old links undecided.
  • Link authoritative sources and name uncertainties. An agent's plausible explanation cannot establish a customer need or company policy.
  • Write acceptance checks before implementation so the agent and reviewer can inspect the same result.

See the practice in context

A coding session's timeline with its questions and review

Copy the spec template

Replace the bracketed fields with decisions and evidence from your product. Keep the detail needed for this change. Resolve questions that could change the implementation before marking it ready. Copying preserves the Markdown so you can save the brief alongside the code or paste it into your coding tool.

Goal

[State the user or business outcome this change should achieve, for whom, and why it matters.]

Success criteria

[Name the observable result, its measurement, baseline, target and review date. Include a guardrail for what must stay healthy. If evidence is missing, say how you will collect it before committing to a target.]

Feature and decision owner

[Name the change, who can approve a product decision, and where to ask.]

Problem and evidence

[Who struggles, in which situation, and what happens today? Link the evidence. Separate observations from assumptions.]

Agreed scope

[Describe the complete user journey, entry point, relevant roles, and important states.]

Outside this change

[Name adjacent features and changes the agent should leave for a separate decision.]

Constraints and prior decisions

[Link the applicable permissions, policies, design standards, existing behavior and prior decisions. State what the agent must preserve.]

Acceptance checks

  • Given [starting state], when [action], then [observable result].
  • Given [failure or missing data], when [action], then [recovery and stored state].
  • Given [restricted role], when [action], then [permitted result].
  • Given [retry or simultaneous action], when [action], then [consistent result].

Engineering context

[Link the repository instructions, relevant entry points and existing implementation. Include the commands that verify this change.]

Open decisions

[For each unresolved question, name its owner and the work it blocks. Mark the brief ready only after decisions needed to start are resolved.]

Validate with users

[Name the risky assumption, target participants, task or question, evidence to collect, and the result that would change the plan. Link actual findings and update the brief before implementation.]

Authority during implementation

Engineering may choose implementation details within the agreed scope and constraints. Ask the decision owner before changing the user outcome, scope, acceptance checks, permissions or policy. Show the issue, evidence, options and recommendation. Wait for an explicit answer on the affected work.

Completion evidence

Report each acceptance check and its observed result, the checks actually run, and anything still unresolved. Link the evidence and record any approved change to this brief.

Worked example — resend an expired invitation

This fictional example shows how a short feature request becomes a reviewable brief. Its 24-hour policy is an explicit choice for the scenario. Apply your own product's policy and repository references when using it.

Goal

Let workspace administrators help an invited teammate join after a link expires, without asking support to resend the invitation.

Success criteria

For this fictional example, the team sets a usability threshold of four out of five target administrators completing the resend task unaided within two minutes. Every permission and expired-link acceptance check must pass. The product owner reviews invitation completion and repeat support requests two weeks after release against the baseline collected before release. These are example criteria to adapt, and no results have been measured here.

Feature and decision owner

Resend an expired workspace invitation. The product owner decides scope changes in the feature discussion. The workspace administrator is the person using the feature.

Problem and evidence

In this illustrative scenario, an invited teammate opens an expired link and cannot join. The administrator has to ask support to issue another invitation. These are scenario assumptions for this example. For a real feature, replace them with evidence from your product and link the current policy.

Agreed scope

From the workspace's existing invitation list, an administrator can resend an expired, pending invitation. Show that sending is in progress. Confirm success after the invitation service accepts the message. The new link expires after 24 hours under this scenario's agreed policy. Keep the invited address, workspace and role attached to the invitation. The expired-link page tells the teammate to ask their administrator to resend it.

Outside this change

Bulk invitations, changing an invited person's address or role, automatic reminders, and changes to the invitation lifetime require separate decisions.

Constraints and prior decisions

Only administrators of the invitation's workspace may resend it. Preserve the existing invitation service's rate limits. An expired or replaced link cannot grant access. A cancelled invitation stays cancelled, and a teammate who already joined receives no duplicate membership. Do not treat acceptance by the email service as proof of inbox delivery.

Acceptance checks

  • Given an expired pending invitation, when its workspace administrator resends it, then the existing list confirms that a new invitation was sent and the original role is preserved.
  • Given the new link within its 24-hour lifetime, when the intended recipient completes the existing sign-in flow and accepts, then they join the correct workspace with the invited role.
  • Given an old, replaced or expired link, when someone opens it, then it grants no access and explains the next step.
  • Given a member without administrator permission or an administrator from another workspace, when they attempt to resend, then access is denied and no invitation or email is created.
  • Given a cancelled invitation or an existing membership, when resend is requested, then it creates no new invitation or membership and the list shows the current state.
  • Given the same resend action is retried or submitted twice at once, then it produces at most one new active invitation and one send request for that action.
  • Given the email service rejects sending, when the request finishes, then the administrator sees the failure and can retry. The failed attempt grants no access and never shows a success confirmation.

Engineering context

Before starting, locate the existing invitation service, workspace role check, invitation list, expired-link page and their tests. Attach those references and the repository's actual verification commands to the real feature brief.

Open decisions

The scenario's product behavior is decided above. Its repository references and verification commands must be filled in before an agent starts implementing it.

Validate with users

Ask five administrators who recently invited teammates to recover an expired invitation in a prototype. Observe whether they find resend, understand the confirmation, and know what to tell the teammate. Ask about their most recent real experience before showing the prototype. If fewer than four complete the task unaided, revise the entry point or copy and retest. Record findings as research evidence and revise the brief. This small test checks usability for these participants and cannot establish adoption across the whole customer base.

Authority during implementation

Engineering may choose token storage and concurrency controls that satisfy the agreed behavior and existing security standards. Extending the 24-hour lifetime, allowing a non-administrator to resend, or removing a failure check requires the product owner's explicit approval. Pause the affected work while awaiting that answer.

Completion evidence

Demonstrate an administrator resending, the teammate accepting, and the old link failing. Report results for the permission, cancellation, duplicate-request and delivery-failure checks. Attach observed evidence and identify every unchecked condition.

When should the coding agent ask?

Ask when a discovery changes the promised experience, permission boundary, scope or acceptance checks. Include the evidence and a concrete choice so the owner can answer. Engineering can settle implementation details that satisfy the agreed behavior and standards.

  • Engineering choice — use a transaction to prevent two simultaneous clicks creating two invitations. It satisfies the duplicate-request acceptance check without changing the product decision.
  • Product decision — extend the link lifetime from 24 hours to seven days because some invitees return late. That changes the agreed policy and needs an explicit answer.
  • An actionable question — ‘The invitation service currently issues seven-day links. The brief requires 24 hours. I recommend supporting 24 hours for this flow and keeping the other flows intact. May I proceed with that change?’
  • While waiting — continue independent work, keep the affected change blocked, and record the owner's answer in the brief before implementing it.

Validate the risky assumptions with users

Before building, identify what would make the proposed solution fail. Talk to the people who face the problem, observe a realistic task, and record evidence that could change your choice. In the invitation example, test whether administrators can find resend and understand what happens to the old link. Set the test's success criteria before observing results, and revise the spec when the evidence disagrees with your assumption.

Teresa Torres — connect outcomes, opportunities and assumption tests

Build and validate your spec with Prodeology

Start by recording the goal and success criteria in Outcomes. Develop the proposed feature with its evidence and unresolved decisions. Use a workflow suited to the missing evidence before handing the spec to a coding agent.

  • Validate with users — Prodeology's User Interview workflow prepares an interview guide and can synthesize research documents and interview notes into themes. Conduct research with target users and bring their actual findings into the feature. Keep synthetic interview responses labeled as simulations.
  • Check the assumptions — use Assumption Mapping to identify the beliefs that need testing. Use Technical Feasibility to examine constraints and dependencies before committing to the implementation.
  • Review the decision — resolve consequential open questions and update the feature's requirements and acceptance checks with the evidence. Keep the decision owner and rationale visible.
  • Carry it into delivery — use the feature's spec and Coding Companion context when implementation begins, then use the acceptance checks to review the finished user journey.

How to review the finished change

Walk the real entry point and compare the observed behavior with every acceptance check. Ask the agent for evidence from the permission, failure and retry paths as well as the successful journey. A passing test suite is one part of that evidence. The reviewer also checks that the completed flow solves the user problem and that any changed decisions were approved.

  • If an acceptance check was skipped, record it as unchecked and decide what is needed before release.
  • If implementation reveals a different user need, revise the brief with its owner and keep the rationale available for the next session.
  • After release, compare the outcome signal with the baseline. Use what you learn to change the next decision.

Carry the decision into implementation

Keep the brief, approved changes and review evidence available to the next person or coding session. Your engineering team owns technical design, code quality and release decisions. Review the user outcome after release as well as whether the acceptance checks passed.

Build your specs with Prodeology

Connect your goal, user research, requirements and decisions before handing work to a coding agent. Use Prodeology workflows to examine assumptions and strengthen your spec.

Sign up for early access now