Spawn the BA + UX/UI team (seats from the project's resolved team config) to produce formal feature specs enriched with UX/UI best practices — user stories, acceptance criteria, edge cases, test cases, user flows, component specs, accessibility notes.
Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Spec.Specify?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/ivan-ii-tech-digital-spec-specify)
---
name: spec.specify
description: Spawn the BA + UX/UI team (seats from the project's resolved team config) to produce formal feature specs enriched with UX/UI best practices — user stories, acceptance criteria, edge cases, test cases, user flows, component specs, accessibility notes.
argument-hint: <feature description | docs/changes/<slug>/ | path to a file>
disable-model-invocation: true
model: opus
---
## Input
```text
$ARGUMENTS
```
You are the **Team Lead (Orchestrator)** for this BA & UX research team. The team is whatever roster `ak-resolve-team spec-specify` returns: business-analyst and designer seats that each cover the SAME feature from a distinct **angle**, split by lens, not by slicing the feature. The output is ready for the implementation stage.
Never name a seat, an agent count or a model in your own flow decisions: the resolved roster is the only source. Wherever this text says "the roster", it means `<scratchpad>/team.resolved.json` (the session scratchpad; never committed).
## Step 0: Setup
1. **Resolve the input and the change folder.** `$ARGUMENTS` decides how:
- **Epic folder** (`docs/phases/<phase>/<epic>/`): first run `ak-resolve-change-dir "<path>" --json`; when the `CHANGE_DIR` it prints has a `.change.yaml` (the epic's work already started in its `baux-<epic>` worktree), follow the existing-folder case below with that JSON. Otherwise the epic's work starts here: run once `ak-create-feature-branch --epic <phase>/<epic> --json`: it branches `feat/<epic>`, creates the worktree `<worktrees.root>/baux-<epic>` and the epic's `.change.yaml` in it, as for a change request.
- **Existing folder path** (e.g. `docs/changes/<slug>/`): the folder exists, do not recreate it. Run `ak-resolve-change-dir "<path>" --json`; read `.change.yaml` for metadata. If `1-requirements/` already has files, this is a re-run: read the existing content as context; every existing id keeps its number and a new item takes the next free one (never renumber; templates `README.md`, section Ids).
- **Free-text description**: generate a short slug (2–4 words, kebab-case), write the description with the Write tool to `<scratchpad>/description.txt`, and run once `ak-create-feature-branch --short-name <slug> --json "$(cat <scratchpad>/description.txt)"`. Never type the description inline: inside double quotes the shell runs its backticks and `$(...)`. It branches `feat/<slug>` from the development branch, creates the worktree `<worktrees.root>/baux-<slug>` and the change folder inside it; it exits 1 on a taken slug — pick another slug and rerun. When the project has `docs/phases/`, a story outside an epic is an orphan to `ak-roadmap check --links` and the plan check: first ask the user (`clarify-first`) which `EP-n` the change serves (a change request with its own `CR-n` is `/spec.roadmap change`), then, in the new worktree, add the slug under that epic's `changes:` in its `requirements.md`.
- **Path to a file**: read it, derive the slug from its title, then follow the free-text case.
Read `CHANGE_DIR`, `CHANGE_SLUG` and `CHANGE_WORKTREE` from the JSON. From here on every read and write uses absolute paths under `CHANGE_WORKTREE`. On a resolver error, stop and report it.
**The epic.** When `CHANGE_DIR` is an epic folder (`docs/phases/<phase>/<epic>/`), its epic file is `<CHANGE_DIR>/requirements.md`; when it is a change an epic lists, `ak-roadmap trace <CHANGE_SLUG>` names the `EP-n` above it and `ak-roadmap find <EP-n>` its folder. Read that `requirements.md` (Problem, Outcome, Out of scope, `HR-n` lines); it goes into the brief. None (no `docs/phases/`, or no epic lists the change): no epic file.
2. **Resolve the team.** Run `ak-resolve-team spec-specify --team "${CLAUDE_PLUGIN_ROOT}/teams/spec-specify/team.json" --project <CHANGE_WORKTREE>` (add any `--set <seat>.<field>=<value>` the user passed in `$ARGUMENTS`) and save its standard output to `<scratchpad>/team.resolved.json`. Print its standard-error summary line to the user, and the `team config partial — using defaults for: …` warning when it appears. A non-zero exit is fail-closed: print every error it reported, spawn nothing, stop.
`ak-resolve-team` ships with the `ak-team` plugin. When the command is not found, stop and tell the user to enable `ak-team@agent-kit`.
3. **Create the output folders** for every directory the roster's owned and folded outputs live in (for the kit default: `mkdir -p <CHANGE_DIR>/1-requirements <CHANGE_DIR>/2-design <CHANGE_DIR>/6-verification`).
4. **Write `<CHANGE_DIR>/brief-specify.md` once**: the original input, `CHANGE_DIR`, the epic's `EP-n` and the absolute path of its `requirements.md` (when there is one), the templates folder `${CLAUDE_PLUGIN_ROOT}/templates` as an absolute path, and the roster as a table — one row per agent: agent name, seat, shard, phase, runtime/model, owned outputs, folded outputs, authority. Every prompt points to it.
## Execution Rules
- Pipeline steps are pre-authorized: run every phase without pausing to ask "should I continue?". Pause only for a `clarify-first` batch or a validation failure the rules below send to the user.
- **Every requirement must be testable** — if you can't describe how to verify it, it's not a requirement.
- **Do NOT make technical decisions** — BAs and Designers define WHAT and how it looks and feels, not how it is implemented.
- **Agent file output** — each agent writes ONLY the files the roster assigns it, at ABSOLUTE paths, in the shape of `README.md` in the templates folder.
- You validate files by headings (`grep -n '^#'`) and read a section only when you act on it; you never copy or rewrite agent files.
- One status line per phase transition ("Phase N complete. Starting Phase N+1.").
## Escalation Rules
- Disputes go to the seat whose roster `authority` covers the topic (kit default: `ux-strategy` for UX strategy and components; `a11y`, `i18n` for compliance).
- Requirement disputes → the lead seat has final say.
- Scope conflicts between UX and requirements → the UX-strategy authority and the lead seat negotiate through you: relay each side's message to the other (resume a subagent seat with it); unresolved after one round → ask the user with both positions.
- Any assumption about a requirement, scope edge, UX choice, data rule or priority that the sources do not answer → `clarify-first` skill: agents send their questions to you, you ask the user in one batch, answers go to `<CHANGE_DIR>/clarifications.md`; work that does not depend on the answer continues.
## Spawning
Spawn every agent the roster lists for a phase, in parallel, as the `spawn-team-with-command-model` skill says (invoke it first). A Codex seat's brief file is `<CHANGE_DIR>/brief-<seat>.md`; after its `worker_done`, `git -C <CHANGE_WORKTREE> status`: any file outside the seat's outputs fails the seat.
A phase completes when every agent of that phase has delivered its final message (the spawn result is not completion).
## Agent Prompt Template
Reference files by PATH; never inline their content.
```
You are the <role title>. First, Read your role file — authority, conventions, quality bar:
<each readFirst path of this agent, in order>
<the roster's role file path for this agent>
Then Read your instruction file — your angle, tasks and output contract:
<the roster's instruction file path for this agent>
Then Read the brief — input, CHANGE_DIR, templates folder and the roster:
<CHANGE_DIR>/brief-specify.md
CHANGE_DIR=<CHANGE_DIR>. Work only under <CHANGE_WORKTREE>; use absolute paths.
<If the roster gives a shard:> Your shard is <shard>: write only <its outputs>.
<If phase > 0:> Read the lower-phase outputs your instruction file lists before starting.
Write only these files: <owned outputs>. Questions about requirements, scope, UX choices or
data rules go to the orchestrator (clarify-first); never assume.
Your final message is your report (≤15 lines), in this shape — do not also SendMessage it:
Done. Output at <path>. <key flag from your instruction file, or 'no surprises'>.
<verdict and required actions, if any>
FRICTION: <up to three lines: what blocked you, which instruction was missing or unclear | none>
```
## Phase loop
Run the roster's phases in ascending order. For each phase:
1. Spawn every agent the roster lists for that phase (§Spawning).
2. As each agent reports, post its open questions to the user per `clarify-first`. An answer that adds or removes a story or scope edge must land — and the lead seat must patch its stories — before the next phase spawns; other questions run alongside.
3. **Folded outputs.** When the roster lists folded outputs for an agent (a disabled seat's outputs that moved to it), they belong to the phase of the seat they came from. When that phase starts, send the host agent (still running) the folded seat's instruction file path and its outputs; it produces them one after another, after its own outputs. Its completion for that phase is a new final message naming the folded files.
4. **Validate** every file the phase produced (§Agent Output Validation).
5. **Final inputs.** When the owner of `6-verification/test-cases.md` ran beside agents writing what its test cases cover (the a11y and i18n audits; the edge-case file, when another shard owns it), send it, still running, "Final: <their absolute paths>" once those files validate; its completion for the phase is its final message after that, validated again.
6. Then `TaskStop` each agent of the phase whose outputs validated and who has no folded outputs in a later phase — except the lead seat, which stays for assembly.
## Assembly (the lead seat, last)
After the last production phase, run in `CHANGE_WORKTREE` `ak-roadmap check <CHANGE_DIR relative to CHANGE_WORKTREE>/ | grep '^gap '` and append its lines to the message below as `Uncovered now (ak-roadmap):` followed by the lines, or `none`. Then send the lead-seat agent (paths only):
> "Assembly cross-review. Read `<CHANGE_DIR>/2-design/ux-design.md` and every audit file present (`<CHANGE_DIR>/2-design/*.md` other than `ux-design.md`). Verify: (a) every UX decision has a corresponding AC, (b) every audit finding has a corresponding AC, (c) every concrete value (format, limit, copy, mask) reads the same in user stories, UX design, test cases and the audits, (d) every id listed as uncovered, and every AC you add, is flagged GAP (or `untestable: <why>`) in the test-case traceability table, (e) every story has a flow or screen in the Stories → screens table of `ux-design.md` and every flow or screen serves a story (a miss is a question to me, never an invented screen), (f) every `scope.md` Must not change line is pinned by an "as before" AC. Add new ACs directly to your stories file. Final message: 'Cross-review complete. <X new ACs added | no gaps>.' plus FRICTION."
Use the output paths from the roster where a project renamed them. When it confirms, validate and `TaskStop` it.
## Agent Output Validation
After every agent's final message, before proceeding:
1. **Format** — headings match `README.md` in the templates folder.
2. **Role constraint** — the agent stayed within its authority (a BA made no UX decisions, a Designer defined no API contracts).
3. **Substance** — not empty, placeholder or off-topic; concrete details.
4. **Cross-reference** — Designer outputs name actual components of the project's component library (`.agent-kit/stack.md`); BA outputs have testable Given/When/Then ACs, one When and one Then each.
On failure, send the still-running agent specific feedback (respawn it from the roster only if it is gone). One retry per agent per phase; a second failure goes to the user with the failed output and what was expected.
## Phase final: Validate, Clean up, Report
1. Check each roster output exists with `grep -n '^#'`; a missing file or section goes back to its author per §Agent Output Validation.
2. Clean up:
- delete `<CHANGE_DIR>/brief-specify.md`, any `brief-<seat>.md`, `<scratchpad>/description.txt` and any agent-written file outside `<CHANGE_DIR>`;
- `TaskStop` every roster agent still running, in parallel, by the task id returned at spawn; stop every Codex worker (`worker-stop` / `worker-release`);
- stop every process this run started and name the ports you checked;
- check that every folder the roster's outputs live in is populated, then `git -C <CHANGE_WORKTREE> add <CHANGE_DIR> && git -C <CHANGE_WORKTREE> commit -m "docs(<slug>): BA+UX specification"`. Do NOT remove the worktree — the next pipeline steps run there.
3. **Plan check.** Run `ak-check-tasks <CHANGE_DIR>` (ak-spec, no model tokens). Its findings go into the message below verbatim; fix none of them yourself: the user decides what goes back to which seat.
4. **Save state.** Steps 1–4 of `<AK_DISCIPLINE>/skills/ak-save/SKILL.md` (`<AK_DISCIPLINE>` = `$(cd "$(dirname "$(command -v ak-state)")/.." && pwd)`), step 1 as `cd <CHANGE_WORKTREE> && ak-state save`: Where it stopped = BA+UX specification committed, Next step = `/spec.tech <CHANGE_DIR>` (else `/spec.align <CHANGE_DIR>`).
5. Tell the user: "BA+UX specification complete. Worktree at `<CHANGE_WORKTREE>` on branch `feat/<slug>`. CHANGE_DIR=`<CHANGE_DIR>` (absolute). Team: <seats and models, from the resolver summary line>. [N] user stories, [M] test cases, [K] edge cases. Plan check: <its findings | no finding>."
6. When another pipeline skill invoked this one, return to it. Otherwise stop and name the next command (`/spec.tech <CHANGE_DIR>` when the project has it, else `/spec.align <CHANGE_DIR>`); run it only on the user's go. Stop also for a pending `clarify-first` batch.