/attune-ai:spec <what to build, or 'resume'>from attune-ai
Guides goal-driven spec development through brainstorm, plan, review, and execute phases with gated task ladders and recorded approvals. Activates on spec-related requests.
Ships in attune-ai. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Model recommendation: Spec planning and XML-enhanced-prompt
authoring benefit from the Opus tier (claude-opus-4-8). Before
proceeding, suggest a model switch once:
"This is spec work — recommend
/model claude-opus-4-8for stronger structured reasoning. Want to switch?"
Defer to the user's choice if they've already picked a model.
IMPORTANT: Start your response with a context preamble.
Call help_lookup(topic="spec-engine", mode="preamble") and
display the returned preamble text as a blockquote. Then
tell the user they can say "tell me more" for a step-by-step
guide, or answer the scoping questions below to proceed.
If the MCP call fails, fall back to:
Spec — Walks you from idea to working code through brainstorm, plan, review, approve, and execute phases.
Use AskUserQuestion to determine the mode:
question: "What would you like to do?"
header: "Spec"
options:
- label: "Start a new spec"
description: "Brainstorm, decompose into tasks, then execute"
- label: "Resume an in-progress spec"
description: "Pick up where you left off"
- label: "Import a spec file"
description: "Load a plan from another project or path"
- label: "Execute a spec"
description: "Review and execute tasks from a saved plan"
If the user provides arguments (e.g., "resume" or a file path), skip the picker and route directly.
When the route is "Start a new spec", gather the framing as ONE form per the Socratic rule — never as sequential question turns:
python -m attune.elicitation.spec_intake
The JSON payload carries a validated form definition
(attune.elicitation.spec_intake.build_spec_intake_form) —
outcome, done-when acceptance, primary code area (options derived
from the tree's packages), and an optional slug — plus
taken_slugs for collision awareness. Render it widget-first with
the AskUserQuestion fallback (batching opts in via
metadata.source containing "form"). If the user's invocation
already stated what to build, carry it into the outcome field
instead of asking again.
Compose the answers into the session-contract block that seeds Stage 1:
echo '<answers JSON>' | python -m attune.elicitation.spec_intake --compose
A slug collision renders as a WARNING, not an error — offer to amend the existing spec before forking a new one.
When the generic command-workspace tools are available, keep the existing
tree-derived intake form above, then use adapter spec as the chair-facing
lifecycle surface:
command_workspace_open after intake validation (route=new
plus outcome, done_when, area, and slug), or with route=resume plus a
repository-relative XML plan path.command_workspace_collect_action.artifacts_created, lifecycle_gate,
task_started, execution_progress, and task_result receipts with
command_workspace_publish; never fabricate a green receipt.save_state payload with attune.spec.save_state.
The renderer is not the durable store; the embedded plan comment remains
the resume authority.BLOCKED exposes only fix-and-rerun. CHAIR_REQUIRED exposes one explicit,
bound acknowledgment. High-severity task results interrupt auto-run. If the
generic tools are unavailable, follow the existing form/text stages below
without weakening any of those semantics.
The review stage is the pilot consumer for session-adaptive defaults
(docs/specs/adaptive-session-interactions/): one unresolved choice with
two genuine alternatives (redo_plan / approve_plan) whose answer the
next step needs. Rules, in precedence order:
context_set with key
interaction_preference and value conversation; read it back with
context_get once per session (and again only when the user changes
it) rather than before every render — one read, remembered.
conversation means present the returned Markdown, not the widget;
default (or unset) means the widget where the host renders it. A one-time override does
not rewrite the stored preference. Keyboard mode (attune config set keyboard_mode true) is a separate, project-scoped opt-out for FORMS and is
not the session preference.workspace_id, revision, action_nonce,
contract_hash, title, view, action) and submit it through
command_workspace_collect_action. The Stage 2 AskUserQuestion
below is the path for hosts WITHOUT the workspace tools; with the
workspace open it is not a second path and must not be asked.If any of these cannot be honored on the current host, say which and fall back to the returned Markdown; do not invent a surface.
T4 collection is open (adaptive-session-interactions D10). On a real
review stage on the named host, read the next unfilled slot in
docs/specs/adaptive-session-interactions/t4-record.md and serve the
choice under that slot's condition (A = widget; B = set
interaction_preference to conversation, then the Markdown lane), then
append the row per t4-protocol.md before continuing. Synthetic reviews
and other hosts are exclusions, not slots.
Five stages, one flow:
.claude/plans/When the user chooses "Import a spec file":
Ask for the file path
Validate with _validate_file_path()
Copy to .claude/plans/ if not already there
Load and validate tasks:
from attune.pipeline.spec_reader import read_spec
tasks = read_spec(imported_path)
If tasks found, proceed to Review stage
If no tasks, tell the user the file has no XML
<task> blocks and offer to create a spec instead
When the user chooses "Start a new spec":
Kickoff form (one batched turn). Gather the
independent dimensions of the kickoff as a single
form via the elicit skill, instead of asking them
one button at a time. The dimensions:
outcome — what should be true when done (one line)scope — where it focuses (area / files / subsystem)concerns — which quality dimensions matter
(multi-select: correctness, security, performance,
tests, docs)Build the declarative form, then prefer the rich
widget surface so the kickoff renders as one form
with the controls each dimension deserves —
outcome/scope as multi-line textareas and
concerns as a multi-select checkbox group, instead
of three flat button turns. Render it with
elicitation_render_widget and pass the returned
html to mcp__visualize__show_widget; when the
user submits, parse the __elicitation_response__
postback and validate with
elicitation_collect_response.
Fall back to the portable AskUserQuestion mapping
— elicitation_render_form → one AskUserQuestion
call with metadata: {"source": "elicit-form"} (the
opt-in the one-question-per-turn guard requires) →
elicitation_collect_response — when the widget
surface is unavailable. Per decisions D10, treat an
elicitation decline you did not see the user
make as "surface unavailable" and fall back; never
read it as the user saying no. The elicit skill
owns both round-trips (its "Widget surface" section
and steps 2–4); this stage just supplies the three
fields.
Omit any dimension the user already stated — the
<what to build> argument usually answers outcome,
so drop that field rather than re-ask. If only one
dimension is left open, ask it as a single question —
never force a one-field form (the §4 batching rule:
batch only genuinely-open, independent dimensions).
Run the brainstorm conversation flow for the parts a form can't batch — Problem → Goals → End State build on each other, so they stay sequential — seeded by the kickoff answers.
When the end state is clear, auto-decompose the
approach into XML <task> blocks
Save to .claude/plans/{topic-slug}.md with both
prose summary and XML task blocks
Use AskUserQuestion: "Spec saved with N tasks.
Ready to review?"
When the plan belongs to a spec under docs/specs/<slug>/, run the
lifecycle gates before presenting the review:
attune gates check tasks --spec <slug> --changed <paths the plan touches>
Render every receipt to the user. G5 semantics are binding: exit 2
(BLOCKED) — do NOT proceed to review; the findings must be fixed
first. Exit 1 (CHAIR_REQUIRED) — present the receipts and proceed
only after the user explicitly acknowledges them (record the
acknowledgment in the session). Exit 0 — proceed.
Load tasks:
from attune.pipeline.spec_reader import read_spec
Present the task table:
from attune.spec import present_tasks, load_state
tasks = read_spec(plan_path)
state = load_state(plan_path)
print(present_tasks(tasks, state))
For each task, show detail:
from attune.spec import present_task_detail
print(present_task_detail(task))
Use AskUserQuestion: "Does this plan look right?"
Pushback gate — a pushback construct. If the user's
edit/rejection makes the plan weaker than what you drafted
AND you can render the concrete alternative (the
decision-routine "pushback discipline"), do not silently
comply — surface the disagreement as a pushback construct
(the user's approach tagged "your approach", your alternative
badged "I'd suggest instead", a "Why I'd push back"
rationale) via the elicit skill's widget surface
(elicitation_render_widget → show_widget), falling back to
its AskUserQuestion mapping (alternative first, rationale as
the lead-in) when the widget surface is unavailable. The
elicit skill owns the round-trip and validation — see its
"pushback construct" section. The user overrules (keeps their
edit) or switches with one pick. Skip this gate when you
genuinely agree with the edit, or when you cannot render a
concrete alternative — pushback without an artifact is hedging.
Show final summary: task count, scope, risks. Then:
Use AskUserQuestion: "Ready to start executing?"
Before the first task, when the plan belongs to a
docs/specs/<slug>/ spec, run the execution-boundary gates
(attune gates check execution --spec <slug> --changed <paths>)
with the same G5 semantics as the Stage 2 gate — hard-stop on
BLOCKED, explicit user acknowledgment on CHAIR_REQUIRED.
For each pending task:
Show progress:
from attune.spec import format_progress_bar
print(format_progress_bar(completed, total))
Show task detail with present_task_detail(task)
Implement the task — create/modify files as specified in the XML task block
Run quality gates:
from attune.pipeline import PipelineOrchestrator
orch = PipelineOrchestrator(plan_path)
result = await orch.run_gates_for_task(task)
Show result with present_task_result(task, result)
Severity-gated approval — a decision gate. You have
just run the quality gates, so you hold a recommendation,
not a neutral menu. Render this as a decision construct
(recommended option + rationale + per-option tradeoffs) via
the elicit skill's widget surface
(elicitation_render_widget → show_widget), and fall back
to its AskUserQuestion mapping (recommended option first
with " (Recommended)", each tradeoff folded into that
option's description, rationale as the lead-in) when the
widget surface is unavailable. The elicit skill owns the
round-trip and validation — see its "decision construct"
section. It stays ONE question: the cards are presentation,
not extra fields.
If "high" severity (score < 50) — recommend Fix and
retry:
recommended: "Fix and retry"rationale: name the gate(s) that failed and the score —
a high-severity task shipped forward compounds risk.option_notes:
If "medium" or "low" severity — recommend Approve and
continue:
recommended: "Approve and continue"rationale: gates passed at acceptable severity — the task
is ready to land.option_notes:
Save state after each decision:
from attune.spec import save_state
state.completed.append(task.task_id)
save_state(state)
progress constructAt a multi-task checkpoint — on resume (Stage 5), and after an
"Auto-run remaining tasks" batch finishes — report where the run
stands as a progress construct rather than prose. This is the
multi-task overview; it complements the per-task decision gate above
(that gates ONE task; this summarizes ALL of them).
Build one progress field and render it via the elicit skill's widget
surface (elicitation_render_widget → show_widget), falling back to
its AskUserQuestion mapping — see the elicit skill's "progress
construct" section:
progress_items: one {label, status, detail?} per task — done
for completed tasks, in_flight for the current task, blocked for
any task that failed a high-severity gate and was deferred
("Acknowledge risk and continue"). Use the task name as label and
the failing gate + score as detail.options: the labels of the blocked tasks (must equal the blocked
subset). The picker asks "which blocked task to fix/retry?" —
selecting one re-enters the per-task implement + gate flow for it.recommended: the blocked task to tackle first (e.g. highest
severity); badged "suggested next".rationale: a one-line run summary (e.g. "6/8 done, 2 deferred on
gate failures").When no task is blocked, build it display-only (options: [],
required: false) — it renders as a clean done/in_flight status board
with no picker.
On invocation, check for resumable plans:
from attune.spec import find_resumable_plans
plans = find_resumable_plans()
If resumable plans exist, show them with
AskUserQuestion:
elicit). Every other
prompt — the mode picker and the review / approve /
execute gates — stays a single question: they're
sequential decisions that branch on the prior answer, so
the §4 rule keeps them one at a time. A single question
may still be a decision construct (Stage 4's approval
gate) — that enriches one choice with a recommendation
and tradeoffs; it does not batch multiple fields, so
it honours the one-question rule.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub smart-ai-memory/attune-ai --plugin attune-ai28 skills in this plugin
/attune-hubDeveloper workflow hub — routes to the right skill based on what you need. Triggers on: attune, what can attune do, what can you do, capabilities, where do I start, get started./author-featureAuthor a single-source feature page — a code-verified master that projects to .help kinds + docs pages, no API credits. Triggers on: author a feature page, single-source doc, new feature master, draft docs without an api./bug-predictPredict likely bug locations from code patterns and complexity. Triggers on: predict bugs, find bugs, risky code, code risk, what might break, likely bugs, bug hotspots.Other plugins' skills for the same job