Design & Specify Exercises
Fill in the blanks to test your knowledge.
A user story follows the format: "As a ___, I want to ___, so that ___"
Acceptance criteria in a user story are written using ___ scenarios (Given/When/Then format)
// Gherkin scenario
: a logged-in user is on the checkout page
When: they click "Place Order"
Then: an order confirmation email is sent
And: the cart is cleared
In SDD, a ___ document describes the full technical design of a feature before development begins
// Spec-Driven Development: document types
// 1. User Story — the requirement
// 2. Use Case — the actor-system interaction
// 3. Document — the technical implementation design
// 4. Task List — the atomic work units for the AI agent
A wireframe shows the ___ layout of a screen without colors, fonts, or final imagery
An ___ is a large body of work that contains multiple related user stories
In a use case, the ___ is the person or external system that interacts with the system
Vibe coding describes using AI to generate code from ___ language descriptions rather than writing detailed specifications first
EARS stands for Easy Approach to Requirements ___, a structured format for writing unambiguous software requirements
// EARS requirement templates
// Ubiquitous: "The system shall "
// Event-driven: "WHEN [trigger] THE system shall "
// Unwanted: "IF [condition] THEN the system shall "
// Example
const requirement = "WHEN a user submits the login form WITH valid credentials, THE system shall redirect to the dashboard within 500ms";
A steering file (like CLAUDE.md or .kiro/steering/) persists project ___ across AI coding sessions so the AI stays aligned with your codebase rules
// Steering file contents example
// .kiro/steering/tech.md
## Tech Stack
- Vite + React + TypeScript
- Tailwind CSS (utility classes only)
- Supabase for database and auth
## Rules
- Never use purple color
- Always use 8px spacing system
- Components max 200 lines
In SDD, the development workflow generates atomic task lists that AI agents execute one ___ at a time
The ___ data model records what the data means (attributes, identifiers and cardinality) without choosing data types or indexes.
In crow's foot notation, a line end drawn as a circle plus a crow's foot means zero or ___.
// Mermaid erDiagram cardinality
// || exactly one
// o{ zero or
// |{ one or more
MEMBER ||--o{ LOAN : borrows
A many-to-many relationship between members and tools is resolved by promoting the hidden thing in the middle to an ___ entity.
Values such as a loan's status or whether it is overdue are ___ attributes: computed when read, never stored.
-- LOAN
-- loan number (identifier)
-- borrowed on
-- due on
-- status from the latest loan event
-- overdue from due on and today
To keep history, separate what a record is from what happened to it: keep a stable identity and record each change as a separate ___.
-- identity: what the loan IS
create table loans (id uuid primary key, loan_number text unique, due_on date);
-- one row per : what HAPPENED to the loan
create table loan_events (
loan_id uuid references loans (id),
kind text, -- out | renewed | returned
occurred_at timestamptz
);
In the physical model, a business identifier such as an asset tag is kept as a ___ column beside a surrogate uuid primary key.
create table public.tools (
id uuid primary key default gen_random_uuid(),
asset_tag text not null , -- duplicates are refused by the database
name text not null
);
Row level security must be ___ on the table itself; policies defined on a table without it change nothing.
alter table public.loan_events row level security;
create policy loan_events_insert_staff on public.loan_events
for insert to authenticated
with check (public.is_staff());
-- no update or delete policy: history is append-only
To change the shape of a live table safely, run three separate steps: expand, switch, then ___.
// Changing a live shape
const steps = [
"expand: add loan_events beside loans.status, backfill it",
"switch: move every reader and writer to loan_events",
": drop loans.status in a LATER change, once nothing reads it",
];