Use the guided template for your own change and CART 1.0 as a completed example.
BUILD · B2–B4Specs: What should behave differently, and how?
A spec is the versioned source agreement for the intended behavior of a change. It connects rules, examples, failure cases, and acceptance criteria. Code, tests, and documentation refer to the same version.
How to create one
PO and Feature Partner clarify the origin of the brief, goal, fixed constraints and decision authority; from these they derive the problem, useful scope and the boundaries to confirm.
The team adds interfaces, risks, examples and test cases.
The Measurement Partner supplies the measurement requirements from V2.
Humans confirm the rules. Changes receive a version and a reason.
Keep it as small as the task
For a bug, the existing spec may only need a reproduction, expected behavior, and a regression test. Larger or riskier changes need more clarification.
“Build a login page” leaves many decisions open. A spec names the endpoint, inputs, error responses and specific success cases. AI results are then checked against these requirements.
Integer quantities; quantity 0 removes the item; do not exceed stock; money in cents; shipping costs 490 cents, free from 5,000 cents. Removing the last item sets the total to 0 and disables checkout.
Example: PUT /cart/items/{productId} with quantity; 200 on success, 400 for an invalid quantity, 404 for an unknown item and 409 for insufficient stock. In a real shop, prices and access are checked on the server.
People and AI agents must be able to identify the valid version. Otherwise code, tests, and acceptance use different foundations. A traceable history shows what changed, why, and who confirmed it. It supports debugging, impact analysis, and rollback.
How to apply versioning
One versioned source spec: For development teams, a Markdown spec in the same Git repository as code and tests is a useful option. Alternatively, use a shared document with version history and permanently referenceable versions. Avoid parallel copies.
Identify the valid version: Record a stable spec ID, version, draft or confirmed status, owner, and confirmation with name and date. The exact commit or document revision makes the version unambiguous. Simple sequential versioning is sufficient; the team agrees on the scheme.
Confirm changes deliberately: Review proposed changes with the difference from the previous version, rationale, and affected acceptance-criteria IDs. The Product Owner and Feature Partner confirm business changes; the team checks technical effects and the Measurement Partner checks affected measurement rules. AI can prepare changes but cannot approve agreements. Preserve confirmed versions.
Link work and evidence: AI tasks, tests, review, acceptance, and release reference the agreed spec version and immutable source. Where possible, change spec, tests, and code in the same pull request. Check effects on ongoing tasks and explicitly reconfirm or update them.
For a bug: If the agreed behavior is unchanged, reference the existing spec and add a regression test. A new business agreement is needed only when expected behavior changes.
Start as Product Owner with the first five points. Describe the problem and two or three concrete situations in everyday language. The team adds technical details; the Measurement Partner helps with impact measurement.
Describe the starting point: What should improve, and for whom? Add the brief or strategic initiative behind it.
Shape a small scope: What is needed now, and what can wait? Clarify given goals, budget and your decision authority.
Examples instead of jargon: “Given …, when …, then …” is enough to start. Include a normal case and a failure or boundary case.
Review together: Ask someone else to explain what they would build and test. Record uncertainties as questions with an owner.
Confirm the version: Confirm rules, accountability and version only after critical questions are resolved.
You do not have to solve technical fields alone. “Open – team to clarify by …” is more useful than an invented answer. Small tasks can stay brief.
Operational requirements appropriate to criticality
The guided specification template includes an optional section for criticality, monitoring, alert triggers, SLO / expected availability, failure behaviour and dashboard / tool. SLO and tool references are needed only where relevant.
The more critical a change, the more precise the details. Potential harm, usage frequency, dependencies and recoverability determine the depth. For non-critical changes, a very small entry or none may suffice.
For critical components, monitoring, useful alerts and testable failure behaviour are implemented and evidenced before completion. Consider operations in the Build Loop
Definition of Ready – context ready? Relevant project and context files, such as README.md, architecture notes or AGENTS.md, are reviewed before implementation and updated where needed. People and agents start with current, consistent context. File changes required by implementation belong to the Definition of Done and are checked during PR review.
Open and copy the guided specification templateMarkdown ↓
SPEC [short name / ID] · Version [0.1] · Status: Draft
START HERE AS PRODUCT OWNER
Replace the brackets with short sentences. Bullet points are enough. Keep anything unknown as “open” with a named owner. Add technical and measurement details together. Examples are guidance, not requirements.
1. Which problem are we solving, and for whom?
The task comes from [team / board / executive team / strategic initiative / other source].
It contributes to [higher-level goal and task link]. Fixed constraints are [goal, date, budget, or mandatory scope].
The Product Owner and team may decide [decision space]. Changes beyond it are confirmed by [responsible person / decision body].
As [target group], I want to [complete a task], so that [benefit].
Today, [observable problem] occurs. This is supported by [feedback, observation, or data; otherwise: still to verify].
Example: customers want to correct their selection so they order the right quantity. Quantity changes are currently cumbersome.
2. What should improve?
By enabling [small change], expect [observable improvement] because [assumption].
Value is indicated when [signal or metric] changes from [baseline / still open] to [target / to agree together].
[Unwanted side effect] must not increase.
Example: more customers reach checkout, while price errors must not increase. Agree on measurement details with the Measurement Partner.
3. What is the smallest useful scope?
This change enables [a few specific capabilities at most].
Deliberately defer [requests outside the scope].
Slice: can the spec be understood with bounded context, implemented without a large system explanation, and verified independently?
If not: [smaller specs with their own tests and required context]. The Product Owner and team confirm the split.
Invest at most [team effort] and [AI budget]. At [review point], decide whether to continue or shape the scope.
Agree on this boundary with [team / responsible person].
4. Show the intended behavior through examples.
AK-01: Given [starting state], when [action], then [visible, testable result].
AK-02: Given [boundary case], when [action], then [expected response].
AK-03: Given [failure case], when [invalid action], then [feedback and unchanged state].
After [further action], [new state] must be visible.
Example: given an item with quantity 1, when it is added again, then one line item with quantity 2 is shown.
Check: what happens when empty, at 0, above limits, without permission, or after repeated clicks? Include only relevant cases. Do not renumber acceptance-criteria IDs later.
5. What still needs a decision?
Open question: [question]. [Name] resolves it by [date]. It blocks [affected implementation / nothing].
Business confirmation by: [Product Owner / Feature Partner, date]. Until then, this spec remains a draft.
ADD WITH THE TEAM
6. Technical agreement—the team leads; the Product Owner clarifies business effects.
Affected interface / inputs: [contract or link].
Results, errors, permissions, and privacy: [rules / open decisions].
Tests: [acceptance-criteria IDs, counterexamples, integration and regression tests].
Business acceptance: [person, scenarios, test version, and date / trigger].
Release, operational checks, and rollback: [plan, owner, and triggers].
For small tasks, a reference to existing standards may be enough.
Reliability & Observability · OPTIONAL
Fill in only relevant details. Low-risk changes need little or no additional information; a reference to applicable standards may be sufficient.
Scale depth to criticality, potential harm, frequency of use, dependencies, and recoverability.
Criticality: [high / medium / low]
Monitoring: [Which metrics, logs, or traces are required?]
Alert when: [Which specific deviation triggers an alert? Clarify response, ownership, and escalation.]
SLO / expected availability: [optional, only when relevant to the component]
Failure behavior: [retry, fallback, rollback, degradation, manual intervention, or another response]
Dashboard / tool: [optional link to Datadog, Grafana, Sentry, or another system]
Accountable people confirm criticality, acceptable risk, alert thresholds, SLOs, escalation, and approval.
7. Evaluate impact—with support from the Measurement Partner.
Primary metric / numerator / denominator: [definition].
Source / events / comparison / period: [plan].
Guardrail metrics and decision rule: [limits, outstanding data].
Scorecard: [link]. [Person] decides continuation at [review point].
8. Record a reliable version.
Owner: [name]. Versioned source spec: [link].
Confirmed version and immutable source: [version + commit link / document revision].
AI tasks, tests, review, and acceptance reference [this version].
The release connects [spec version, verified code version, and evidence].
Change history: [version, date, change, rationale, affected acceptance-criteria IDs, confirmation].
When changes occur, check effects on ongoing AI tasks and explicitly record the agreed version.
QUICK CHECK BEFORE IMPLEMENTATION · DEFINITION OF READY
Can another person use these examples to tell what correct behavior is?
Are scope, accountability, and investment boundaries clear?
Are critical open questions resolved and rules confirmed by people?
Is everyone using the same spec version?
Context ready? Relevant project and context files, e.g. README.md, architecture notes and AGENTS.md, have been reviewed and updated where needed. People and agents receive only relevant, current and consistent context.
Reviewed files / valid version: [links and version / commit; necessary corrections completed before starting].
For the Definition of Done: update documentation and context files affected by implementation and verify them during PR review.
COMPLETED EXAMPLECART 1.0 – complete spec
All components in one place: brief, benefit, scope, rules, technical contract, tests, measurement, release and versioning. Open questions for a real implementation are explicitly identified.
SPEC CART · Version 1.0 · Reference version of the LoopsWork learning example
This completed example spec describes the shopping cart rules already shown. Roles, budget, and measurement plan are illustrative assumptions. It is not a real product approval or evidence of a production implementation.
Reference source: https://loopswork.dev/en/docs/#cart-spec
Owner: Online Shop Product Owner (example role). Business confirmation: Feature Partner and Product Owner; technical agreement: Delivery Team; measurement plan: Measurement Partner.
In this learning workflow, CART 1.0 is confirmed once B3 is complete. Add a real confirmation date and immutable Git commit or document revision when adopting it into a project. The website URL alone does not replace that fixed version.
1. Problem and target group
Illustrative task: a department leader owns the strategic initiative “Simplify shopping” and commissions the Product Owner to deliver the cart contribution. This is an additional example assumption. The Product Owner prioritizes scope within the mandate; the team chooses implementation and division of work. Changes to the higher-level goal or budget go to the department leader.
Customers with selected items should be able to correct quantities, remove items, and understand the total price before checkout. The example assumes that cumbersome corrections and unclear shipping costs make checkout harder to start. This learning demo has no real user evidence; in a project, the Feature Partner checks the assumption through user tests and feedback.
2. Expected value and investment boundary
Hypothesis: if customers can easily change quantities and understand the total price, more eligible sessions with a filled cart will start checkout.
Example baseline: 58%. Example target: at least 62% while meeting guardrails. These figures are fictional assumptions, not measurements from this website.
For the first change: at most five team working days and €50 in AI costs. Review at half the budget spent. Team effort is not calendar duration. In this example, the Product Owner may continue, shape scope, or stop within this boundary. The responsible department leader confirms a larger budget or changed strategic goal.
3. Scope and deliberate boundaries
Included: add items, change quantities, remove line items, calculate basket value and shipping costs, display the total, and prevent checkout from an empty cart.
Excluded: discount codes, wishlist, guest-account synchronization, payment, and real order processing.
This website runs the rules locally in the browser. A production cart also needs server-side checks, access control, operations, and approvals. Requirements for a real service below are not existing website features.
4. Agreed rules and acceptance criteria
AK-01 · Add: an existing item does not create a second line item. Given coffee with quantity 1, when the same item is added again, then one line item has quantity 2.
AK-02 · Quantities: only nonnegative whole numbers are valid. Quantity 0 removes the line item. Reject negative and fractional quantities and keep the existing cart unchanged.
AK-03 · Stock: the requested quantity must not exceed available stock. With stock 5, reject quantity 6 without changing the cart. Quantity 5 is valid.
AK-04 · Money and totals: calculate money in whole cents. Basket value is the sum of quantity × valid unit price. Total price is basket value plus shipping. Update displayed totals after every successful add, change, or removal. Server-side prices are authoritative in a real service. Example: 2 × 1,490 cents + 490 cents shipping = 3,470 cents.
AK-05 · Shipping: for a nonempty cart below 5,000 cents basket value, shipping costs 490 cents. At exactly 5,000 cents or above, shipping is 0. Boundary cases: 4,999 → 490 cents shipping; 5,000 → 0. After a quantity change crosses the threshold, apply the new total immediately.
AK-06 · Empty state: after the final item is removed, basket value, shipping, and total are 0. Checkout is disabled and the empty state is clearly explained.
Invalid actions show understandable feedback and leave both items and totals unchanged. Stock limits also apply to repeated additions.
5. Technical contract for a real implementation
Draft: PUT /cart/items/{productId}
Body: { "quantity": 2 } sets the requested absolute quantity.
quantity: 0 removes the line item. Repeating the same set operation does not increase quantity again. The add action in the UI determines the new target quantity.
200: updated cart including server-side totals.
400: invalid quantity. 404: unknown item. 409: insufficient stock. These errors leave the cart unchanged.
The service validates inputs, current price, stock, and permission for the affected cart. This contract does not place an order or reserve stock.
Before production implementation, the team agrees on authentication, 401/403 handling, concurrent changes, transaction boundaries, and the exact response schema. These open technical issues are not implicit freedom for agents. They block the affected production work.
6. Tests, independent review, and acceptance
Tests reference CART 1.0 and the relevant acceptance-criteria IDs. The Reviewer uses the same fixed spec version as the implementing agent.
AK-04: run the existing calculation check for 2 coffees + shipping = 3,470 cents. In the browser, add coffee once and change quantity 1 → 2; check displayed quantity 2 and total €34.70 including shipping. On a mismatch, correct within the agreed scope and budget, then repeat the same case. Record the criteria ID, test command or steps, actual result, and screenshot link in PR Evidence. Browser checks that cannot run stay open with a reason, owner, and next step. Independent review checks coverage; domain acceptance follows in B9.
Automate checks for repeated additions, quantity 0, negative and fractional quantities, stock exactly reached and exceeded, cent calculations, both sides of the shipping threshold, and empty checkout. Check state transitions: after every action, line items, basket value, shipping, and total must agree.
For a real implementation, also test interface errors, unauthorized access, current server-side prices, and concurrent changes according to the confirmed contract.
The Delivery Team provides evidence and a human reviewer checks independently. The Feature Partner accepts real shopping flows: changing quantities, removing the final item, exceeding stock, and crossing the shipping threshold. Record spec version, code version, test cases, and gaps. Silence is not acceptance.
Executable website test cases are learning aids. They do not replace server integration, security review, or business acceptance.
7. Measurement plan and product decision
Primary metric: eligible sessions starting checkout divided by eligible sessions with a filled cart. Exclude test traffic and count repeated events only once per session.
Measurement points: successful quantity changes, cart errors, and checkout starts. Attribute actions clearly; do not collect free-text personal data.
Example measurement window: days 6–18 after activation on day 5, comparing a control group with the new version. The 1,000 sessions per group are illustrative. The Measurement Partner agrees on group assignment, comparability, and required data volume in advance.
Example guardrails: change errors at most 1%; loading time p95 at most 1.5 seconds. Also observe price complaints and completed purchases; agree on their decision thresholds before a real experiment.
On day 20, the Product Owner reviews the Scorecard with the team and partners, decides within delegated authority, and returns findings to the commissioning department leader. The leader decides strategic changes. Missing data or unresolved comparability leads to further investigation rather than automatic expansion. Address urgent harmful findings immediately.
The Scorecard with fictional results is at https://loopswork.dev/en/docs/#scorecard. This website does not collect these shop metrics.
8. Release, operations, and rollback
In the example, activate for a limited user group after business acceptance on day 5, and only with the required approvals. The release links CART 1.0, actual code version, test evidence, acceptance, and Scorecard. Assign measurement data to the release and user group.
The team and release approver check error rate, price accuracy, and data collection. Stop activation and use the agreed rollback path for incorrect prices or harmful findings. Before a real release, clarify and test the switching mechanism, accountable person, and handling of data already changed.
After rollback, code, configuration, and the associated spec version must match.
9. Open questions, accountability, and versioning
Open before real implementation: user evidence (Feature Partner), authentication and concurrent access (team), comparison design and guardrails (Measurement Partner), approval and rollback paths (team and release approver). Resolve each before implementation or the affected work starts; assign real names and dates in the project.
Version 1.0 documents the six rules already agreed in the learning example. This completed version brings them together and explains their use; it does not change the shipping threshold.
AI tasks, tests, review, and acceptance cite CART 1.0 and a fixed commit or document revision. Review a business change as a new draft with differences, rationale, affected acceptance-criteria IDs, and human confirmation. Check effects on ongoing tasks.
The CART 1.1 proposal with a 6,000-cent shipping threshold described on the example page is hypothetical and not part of this version. CART 1.0 with 5,000 cents remains valid until a new agreement is explicitly confirmed.