Skip to content
arula

Stage 02 / 15 minutes / Pairs or individual

Write a specification

Turn the issue and context into observable rules without prescribing the implementation.

Common languageEveryday habitsDefine
Output
Change specification
Support
One requirement contrast
Continue when
All readiness checks pass

Repository for this lesson jhipster/jhipster-sample-app-react at 8c9d248 . All source links, commands and observations refer to this pinned revision.

Orient

Why this stage matters

Goal

Explain why write a specification affects confidence in the build.

Complete when

You can name the decision this stage supports and the risk created by skipping it.

How this supports the lab

This ties the stage to the lab’s central question: Does the evidence show that posting an operation and changing its account balance form one safe, reviewable outcome?

Builds
Common languageEveryday habits
Work stage
Define

“Update the balance” does not define signs, precision, ownership, retries or later changes to posted operations. Code written against that sentence can be internally consistent and still implement the wrong product behavior.

Inputs

Use repository sources and accepted artifacts

Goal

Identify the accepted evidence and artifacts required for this stage.

Complete when

You can explain why each source is relevant and exclude material that does not affect the work.

How this supports the lab

These sources establish what the repository does when operation and balance records can be changed independently. Later claims and tests must trace back to this evidence.

Builds
Common languageEveryday habits
Work stage
Define

Issue

Use the requested outcome as the boundary, not as a complete requirement.

Context brief

Use the accepted facts, assumptions and open questions from stage 1.

Operation DTO

Check current validation and data shape.

src/main/java/io/github/jhipster/sample/service/dto/OperationDTO.java

Database constraints

Check the stored precision and relationships.

src/main/resources/config/liquibase/changelog/20150805125054_added_entity_Operation.xml

Account schema

Compare balance precision with the operation amount.

src/main/resources/config/liquibase/changelog/20150805124838_added_entity_BankAccount.xml

Worked example

Replace one vague sentence with observable behavior

Goal

Study one worked example and identify the judgment behind each step.

Complete when

You can reproduce the reasoning without copying the example’s conclusion.

How this supports the lab

The example models one part of the operation-and-balance problem. You apply the same reasoning to the remaining paths and produce evidence another engineer can review.

Builds
Common languageEveryday habits
Work stage
Define
  1. Start with: “The system updates the balance when an operation is posted.”
  2. Name the trigger, the two state changes and the failure condition.
  3. Write one acceptance example that observes both records before and after the request.
Explain the reasoning

A requirement is testable when two reviewers can agree on the expected result without choosing a class, method or framework.

The worked example resolves only the atomicity case.

Decide

Resolve the behavior the repository cannot define

Goal

Separate repository facts from decisions that require human authority.

Complete when

Each question has an accepted answer or remains blocked with a named owner.

How this supports the lab

The repository cannot decide credit, debit, retry, ownership or mutation policy. Those decisions define what balance consistency means and what can be judged safe to ship.

Builds
Common languageEveryday habits
Work stage
Define
  • Does a positive amount credit the account and a negative amount debit it?
  • What precision is accepted, and can the system round an amount?
  • Can a debit take the balance below zero?
  • Can a user post to an account the user does not own?
  • How should the system handle an identical retry?
  • Can posted operations be updated, patched or deleted?
  • Can a client edit the account balance directly?
  • What response gives the React client the authoritative result?

Use the agent

Use the agent on this repository

Goal

Use the coding agent to support write a specification while retaining control of decisions and evidence.

Complete when

You verified each response before continuing and carried only accepted findings into the artifact.

How this supports the lab

Bounded prompts help investigate and build the balance change while human checks prevent unsupported agent output from entering the evidence chain.

Builds
Common languageEveryday habits
Work stage
Define

These are task patterns for the pinned JHipster source, not answer scripts. Replace every bracketed field with accepted repository work. Open every cited path at the pinned revision and review each response before continuing. If you cannot supply a field, return to the earlier artifact.

Decide before prompting

  • Use the accepted context brief, not the prior chat, as source material.
  • Record who can decide each product question.
01

Surface missing decisions

Why this prompt

The repository describes current behavior. It cannot authorize new product rules.

Read the issue and accepted context brief. List the decisions required before observable behavior can be specified. Include sign rules, precision, ownership, retries and allowed mutations. Do not answer the questions.
Check before continuing

Assign every question to a person or role. Mark unresolved decisions as blocked.

02

Draft testable claims

Why this prompt

Small, identified claims can be traced into tests, plans and review findings.

Using only accepted decisions, draft observable behavior claims. Give each claim a stable ID. Cover success, rejection and failure behavior. Do not name classes, methods or implementation steps. Preserve unresolved items as BLOCKED with an owner.
Check before continuing

For each claim, ask what an external observer could see and whether two inputs would distinguish it.

03

Add concrete examples

Why this prompt

Examples reveal sign, rounding and boundary ambiguity that prose can hide.

Add input and outcome examples to each claim. Include a credit, debit, invalid owner, invalid account and repeated request where the accepted decisions support them. Use exact monetary values. Flag any example that requires a new decision.
Check before continuing

Calculate each expected balance by hand and confirm that no example invents policy.

04

Audit the change specification

Why this prompt

The specification must be complete enough for another engineer to interpret the same way.

Audit the draft specification for ambiguity, contradiction, missing mutation paths, implementation language and unsupported decisions. Cite the affected claim ID. Do not rewrite it.
Check before continuing

Revise the artifact, then confirm that every audit finding has a disposition.

Create

Produce the change specification for this repository

Goal

Create a reviewable change specification from accepted inputs.

Complete when

The artifact contains every required field and stays within its stated limit.

How this supports the lab

This artifact records the evidence or decision the next stage needs to move the operation-and-balance change toward a supported release judgment.

Builds
Common languageEveryday habits
Work stage
Define
  1. Write a numbered claim for each accepted behavior.
  2. Add at least one concrete acceptance example for success, rejection and retry.
  3. Record unresolved decisions with an owner. Do not hide them in notes.
  4. State implementation and product areas that remain outside the change.
  5. Check that every claim describes an observable result.
Artifact structureChange specification

Two pages, including examples and exclusions.

  1. Purpose
  2. Definitions
  3. Behavior claims
  4. Acceptance examples
  5. Failure behavior
  6. Exclusions
  7. Open decisions and owners

Challenge

Try to disprove the repository-backed work

Goal

Find a material weakness before the artifact controls later work.

Complete when

Each challenge has evidence, an impact and a recorded response.

How this supports the lab

The challenge tests whether a partial write, duplicate effect, unauthorized operation or unsupported claim could survive the proposed artifact.

Builds
Common languageEveryday habits
Work stage
Define
Peer review or self-check

Ask another pair to propose one request with no clear result and one pair of conflicting rules. If you are working alone, test each decision question with two different inputs.

Required response

The authors resolve the ambiguity, record a blocking decision or narrow the claim.

Revise

Use repository evidence before continuing

Goal

Resolve findings and make an explicit decision about readiness.

Complete when

Every readiness check passes, or the work returns to the section that must change.

How this supports the lab

The gate prevents unresolved balance-consistency risks from flowing into code or supporting a stronger shipping claim than the evidence allows.

Builds
Common languageEveryday habits
Work stage
Define

Ready to continue when

  • The specification addresses create, retry, overdraw, ownership, update, patch, delete and direct balance changes.
  • Every accepted claim has an observable result.
  • No claim depends on an unstated sign or precision rule.

If a check fails

  • Turn general terms such as valid, correct and safe into observable conditions.
  • Separate product decisions from implementation choices.
  • Record a product decision you are not authorized to make as a blocker with a named owner.

Transfer

Apply the practice to your work

Goal

Map this practice to a real codebase, role and delivery decision in your work.

Complete when

You can name the equivalent artifact, evidence, owner and next use in your team.

How this supports the lab

The lab succeeds when you can use the same evidence chain to judge an AI-assisted change in a production codebase, beyond this sample’s operation-and-balance problem.

Builds
Common languageEveryday habits
Work stage
Define
  • Name two rules in a current payment flow that engineers often infer instead of documenting.
  • Identify where your team records unresolved product decisions.

Record your answer. The lab is complete only when you can name the equivalent practice, artifact and evidence in your work.