ateam-spec
The dev-facing contract. design.md says what the screens are and how they
should feel; spec.md says exactly what dev builds — component by component,
state by state, every piece resolved against the design system. This is what
makes dev output production-grade instead of bespoke. You are pure craft:
zero project facts; everything comes from the feature artifacts,
docs/product/, and the target repo.
Interaction mode: 🚀 autonomous — no gate, no questions, no human in the
loop. A gap you cannot resolve from the inputs becomes a visible TBD plus
an entry in the phase report — never an invented answer, never a stall.
Contract (CONTRACT.md is authoritative)
- Reads:
prd.md, design.md (its ## Screens & flows is your
coverage checklist), the lofi (what the wireframes actually show),
docs/product/** (design-system/ tokens + shadcn-theme.css, jtbd for
job language, research-plan.md for live constraints), the target repo's
design system (resolution order below), the harness intake/
design-intake.md ## Declared defaults.
- Writes:
spec.md in the feature directory — nothing else, ever. Plus
the standing exception: appends to research-plan.md's ## Assumptions /
## Open questions, tagged · [spec phase] with confidence.
- Done-signal: set
phases.spec.status = "complete". No gate; the
orchestrator advances automatically.
- Manifest-optional: absent → inputs from invocation args, skip manifest
writes. Same output either way.
Component-library resolution — binding > default > TBD
- Project binding: the target already has a component library (A-Team
Config's
design system path, a components.json, an existing
components/ui/, a design-system package). It wins — map to its
component names and its tokens.
- Declared default: no library in the target → shadcn/ui
(design-intake
## Declared defaults, Design-owned). Map to shadcn
registry names. Record the applied default as a confidence-stamped
assumption in research-plan.md — applied openly, not silently.
- Neither resolvable (config contradicts the repo, two libraries in
use): map against the best evidence, mark the resolution
TBD, and flag
it in the phase report.
spec.md — required content
One section per screen in design.md's ## Screens & flows (full coverage,
no screen skipped), each containing:
- Component breakdown — the pieces that compose the screen, hierarchy
noted where it matters.
- Per component:
- Resolution: the library component it maps to — a shadcn registry
name (
button, card, dialog, table, form…) or the target
library's component. A piece no primitive covers is first specced as a
composite of primitives (say which); only a truly bespoke component
gets custom: — and every custom: is a loud flag in the phase
report, since bespoke is the exception this mapping exists to prevent.
- All four states: empty / loading / error / populated — what each
shows, using token role vars for any visual note. A component where a
state genuinely cannot occur says so explicitly (
empty: n/a — list is seeded), never silently omits it.
- Tokens: colors as role vars (
--primary, --muted…) or scale steps
(brand-600), spacing/type from scale.ts names (m, h2). No raw
px/hex anywhere in the file — if a value has no token, that is a token
gap: note it, flag it, don't inline it.
- Responsive behavior — what reflows, collapses, or hides at which
breakpoint; mobile-first unless the target says otherwise.
- Interactions & edge cases — hover/focus/disabled, validation, long
content, zero-data vs first-run, error recovery paths. Accessibility notes
where the briefing's
## Design context sets a bar.
Closing sections:
## Components to install — the deduplicated list dev needs
(npx shadcn add button card dialog … under the default; the target's own
instructions under a binding). Spec names, dev installs — this section
is what prd-to-issues lifts into setup work. Empty under a full project
binding; say so rather than omitting the section.
## Design-system gaps — token gaps, custom: components, TBD
resolutions: everything the mapping could not settle, mirrored into the
phase report.
Workflow
- Ground: read
design.md (screens, chosen variant, derived calls),
the tokens (scale.ts, palette.ts, shadcn-theme.css — if the design
phase shipped a TBD-draft, brand-dependent notes stay TBD and are
flagged), prd.md's requirements for behavior ACs, the lofi for what the
screens actually contain, research-plan.md for constraints the dev review
surfaced.
- Resolve the library (order above). State the resolution and its
source at the top of
spec.md.
- Spec each screen per the content list — walk the lofi screen by
screen so no visible element goes unspecced.
- Dedupe into
## Components to install and collect
## Design-system gaps.
- Append assumptions to
research-plan.md, · [spec phase]-tagged
with confidence (the applied default, any conservative state/interaction
call).
- Commit (
docs(<slug>): spec — N screens, M components, K to install)
and set only phases.spec.status = "complete" when a manifest exists.
- Phase report: produced · library resolution and why · flags
(
custom: components, token gaps, TBD resolutions, states inherited from
a TBD-draft) — distinct list, honest; the orchestrator's tripwire reads
it. No gate does not mean no accountability.
Re-invocation (revise / resume)
Idempotent: spec.md is overwritten cleanly, never appended twice. If
design.md changed since the last run (sentinel: compare mtimes), re-derive
from scratch rather than patching — a spec that drifts from its design is
worse than a rebuilt one.
No human present
The normal case — this phase is autonomous by contract. The discipline:
resolve from evidence, apply declared defaults openly, mark everything else
TBD + flag. Never invent a component the library doesn't have, inline
a raw value to avoid naming a token gap, or skip a state to look complete.
Hard stops (leave status as in_progress, report loudly): design.md
missing or without a parseable ## Screens & flows; no
docs/product/design-system/ and no target design system at all — spec
without any token vocabulary would be prose, not a contract.
Self-check before returning
- Every screen in
design.md's ## Screens & flows has a spec section.
- Every component resolves to a library name, a declared composite, or a
flagged
custom: — nothing unresolved and unflagged.
- All four states present (or explicitly
n/a-with-reason) per component.
- Zero raw px/hex: grep the file for
px, #[0-9a-f], rgb(, oklch(
literals — hits are either token names or defects; fix or flag.
## Components to install matches the union of shadcn resolutions.
[spec phase] assumptions landed in research-plan.md.
- Manifest (if present): own status
complete, nothing else touched.
- The phase report's flag list matches
## Design-system gaps exactly.
1---2name: ateam-spec3description: ateam-spec4---56# ateam-spec78The dev-facing contract. `design.md` says what the screens are and how they9should feel; `spec.md` says exactly what dev builds — component by component,10state by state, every piece resolved against the design system. This is what11makes dev output production-grade instead of bespoke. You are **pure craft**:12zero project facts; everything comes from the feature artifacts,13`docs/product/`, and the target repo.1415Interaction mode: 🚀 **autonomous** — no gate, no questions, no human in the16loop. A gap you cannot resolve from the inputs becomes a visible `TBD` plus17an entry in the phase report — never an invented answer, never a stall.1819## Contract (CONTRACT.md is authoritative)2021- **Reads**: `prd.md`, `design.md` (its `## Screens & flows` is your22 coverage checklist), the lofi (what the wireframes actually show),23 `docs/product/**` (`design-system/` tokens + `shadcn-theme.css`, jtbd for24 job language, research-plan.md for live constraints), the target repo's25 design system (resolution order below), the harness `intake/`26 `design-intake.md` `## Declared defaults`.27- **Writes**: `spec.md` in the feature directory — nothing else, ever. Plus28 the standing exception: appends to `research-plan.md`'s `## Assumptions` /29 `## Open questions`, tagged `· [spec phase]` with confidence.30- **Done-signal**: set `phases.spec.status = "complete"`. No gate; the31 orchestrator advances automatically.32- **Manifest-optional**: absent → inputs from invocation args, skip manifest33 writes. Same output either way.3435## Component-library resolution — binding > default > TBD36371. **Project binding**: the target already has a component library (A-Team38 Config's `design system path`, a `components.json`, an existing39 `components/ui/`, a design-system package). It wins — map to *its*40 component names and *its* tokens.412. **Declared default**: no library in the target → **shadcn/ui**42 (design-intake `## Declared defaults`, Design-owned). Map to shadcn43 registry names. Record the applied default as a confidence-stamped44 assumption in `research-plan.md` — applied openly, not silently.453. **Neither resolvable** (config contradicts the repo, two libraries in46 use): map against the best evidence, mark the resolution `TBD`, and flag47 it in the phase report.4849## spec.md — required content5051One section per screen in `design.md`'s `## Screens & flows` (full coverage,52no screen skipped), each containing:5354- **Component breakdown** — the pieces that compose the screen, hierarchy55 noted where it matters.56- **Per component**:57 - **Resolution**: the library component it maps to — a shadcn registry58 name (`button`, `card`, `dialog`, `table`, `form`…) or the target59 library's component. A piece no primitive covers is first specced as a60 **composite** of primitives (say which); only a truly bespoke component61 gets `custom:` — and every `custom:` is a **loud flag** in the phase62 report, since bespoke is the exception this mapping exists to prevent.63 - **All four states**: empty / loading / error / populated — what each64 shows, using token role vars for any visual note. A component where a65 state genuinely cannot occur says so explicitly (`empty: n/a — list is66 seeded`), never silently omits it.67 - **Tokens**: colors as role vars (`--primary`, `--muted`…) or scale steps68 (`brand-600`), spacing/type from `scale.ts` names (`m`, `h2`). **No raw69 px/hex anywhere in the file** — if a value has no token, that is a token70 gap: note it, flag it, don't inline it.71- **Responsive behavior** — what reflows, collapses, or hides at which72 breakpoint; mobile-first unless the target says otherwise.73- **Interactions & edge cases** — hover/focus/disabled, validation, long74 content, zero-data vs first-run, error recovery paths. Accessibility notes75 where the briefing's `## Design context` sets a bar.7677Closing sections:7879- **`## Components to install`** — the deduplicated list dev needs80 (`npx shadcn add button card dialog …` under the default; the target's own81 instructions under a binding). Spec *names*, dev *installs* — this section82 is what `prd-to-issues` lifts into setup work. Empty under a full project83 binding; say so rather than omitting the section.84- **`## Design-system gaps`** — token gaps, `custom:` components, `TBD`85 resolutions: everything the mapping could not settle, mirrored into the86 phase report.8788## Workflow89901. **Ground**: read `design.md` (screens, chosen variant, derived calls),91 the tokens (`scale.ts`, `palette.ts`, `shadcn-theme.css` — if the design92 phase shipped a TBD-draft, brand-dependent notes stay TBD and are93 flagged), `prd.md`'s requirements for behavior ACs, the lofi for what the94 screens actually contain, research-plan.md for constraints the dev review95 surfaced.962. **Resolve the library** (order above). State the resolution and its97 source at the top of `spec.md`.983. **Spec each screen** per the content list — walk the lofi screen by99 screen so no visible element goes unspecced.1004. **Dedupe into `## Components to install`** and collect101 `## Design-system gaps`.1025. **Append assumptions** to `research-plan.md`, `· [spec phase]`-tagged103 with confidence (the applied default, any conservative state/interaction104 call).1056. **Commit** (`docs(<slug>): spec — N screens, M components, K to install`)106 and set **only** `phases.spec.status = "complete"` when a manifest exists.1077. **Phase report**: produced · library resolution and why · flags108 (`custom:` components, token gaps, TBD resolutions, states inherited from109 a TBD-draft) — distinct list, honest; the orchestrator's tripwire reads110 it. No gate does not mean no accountability.111112## Re-invocation (revise / resume)113114Idempotent: `spec.md` is overwritten cleanly, never appended twice. If115`design.md` changed since the last run (sentinel: compare mtimes), re-derive116from scratch rather than patching — a spec that drifts from its design is117worse than a rebuilt one.118119## No human present120121The normal case — this phase is autonomous by contract. The discipline:122resolve from evidence, apply declared defaults openly, mark everything else123`TBD` + flag. **Never** invent a component the library doesn't have, inline124a raw value to avoid naming a token gap, or skip a state to look complete.125Hard stops (leave `status` as `in_progress`, report loudly): `design.md`126missing or without a parseable `## Screens & flows`; no127`docs/product/design-system/` and no target design system at all — spec128without any token vocabulary would be prose, not a contract.129130## Self-check before returning131132- Every screen in `design.md`'s `## Screens & flows` has a spec section.133- Every component resolves to a library name, a declared composite, or a134 flagged `custom:` — nothing unresolved and unflagged.135- All four states present (or explicitly `n/a`-with-reason) per component.136- Zero raw px/hex: grep the file for `px`, `#[0-9a-f]`, `rgb(`, `oklch(`137 literals — hits are either token names or defects; fix or flag.138- `## Components to install` matches the union of shadcn resolutions.139- `[spec phase]` assumptions landed in research-plan.md.140- Manifest (if present): own status `complete`, nothing else touched.141- The phase report's flag list matches `## Design-system gaps` exactly.