Interactive specification workflow - design vision, clarify capabilities, extract behaviors. Produces spec packets, capability maps, and ADRs for /plan consumption.
IMPORTANT: All tasker working files go in $TARGET_DIR/.tasker/. Do NOT create any other directories like project-planning/, planning/, or schemas/ at the target project root. The .tasker/ directory is the ONLY location for tasker artifacts (including .tasker/schemas/ for JSON schemas).
An agent-driven interactive workflow that transforms ideas into actionable specifications with extracted capabilities, ready for /plan to decompose into tasks.
{TARGET}/README.md (project overview - what it is, how to use it){TARGET}/docs/specs/<slug>.md (human-readable){TARGET}/docs/specs/<slug>.capabilities.json (machine-readable, for /plan){TARGET}/docs/state-machines/<slug>/ (state machine artifacts, for /plan and /execute){TARGET}/docs/adrs/ADR-####-<slug>.md (0..N)$TARGET_DIR/.tasker/state.json (persistent, primary resume source)$TARGET_DIR/.tasker/spec-draft.md (working draft, written incrementally)$TARGET_DIR/.tasker/clarify-session.md (append-only log)$TARGET_DIR/.tasker/stock-takes.md (append-only log of vision evolution)$TARGET_DIR/.tasker/decisions.json (index of decisions/ADRs)$TARGET_DIR/.tasker/spec-review.json (weakness analysis)After completion, artifacts can be archived using tasker archive for post-hoc analysis.
Initialization → Scope → Clarification Loop (Discovery) → Synthesis → Architecture Sketch → Decisions/ADRs → Gate → Spec Review → Export
NEVER skip or reorder these phases.
Establish project context and session state before specification work begins.
Before asking the user anything, check for existing session state files.
Check in order:
.tasker/state.json, use CWDWhat is the target project directory?
TARGET_DIR="<determined-path>"
STATE_FILE="$TARGET_DIR/.tasker/state.json"
if [ -f "$STATE_FILE" ]; then
# Read state to determine if session is in progress
PHASE=$(jq -r '.phase.current' "$STATE_FILE")
if [ "$PHASE" != "complete" ] && [ "$PHASE" != "null" ]; then
echo "RESUME: Found active session at phase '$PHASE'"
# AUTO-RESUME - skip to Step 1c
else
echo "NEW: Previous session completed. Starting fresh."
# Proceed to Step 2 (new session)
fi
else
echo "NEW: No existing session found."
# Proceed to Step 2 (new session)
fi
If .tasker/state.json exists and phase.current != "complete":
Resuming specification session for "{spec_session.spec_slug}"
Current phase: {phase.current}, step: {phase.step}
This is automatic. Do not ask the user whether to resume.
You MUST NOT:
The user tells you everything. You ask, they answer.
Ask using AskUserQuestion:
Do you have existing specification reference materials (PRDs, requirements docs, design docs, etc.)?
Options:
Ask for the location(s):
Where are your reference materials located? (Provide path(s) - can be files or directories)
Free-form text input. User provides path(s) (e.g., docs/specs/, requirements.md, PRD.pdf).
Validate path exists:
EXISTING_SPEC_PATH="<user-provided-path>"
if [ ! -e "$TARGET_DIR/$EXISTING_SPEC_PATH" ] && [ ! -e "$EXISTING_SPEC_PATH" ]; then
echo "Warning: Path not found. Please verify the path."
fi
Create .tasker/ directory structure in target project:
TASKER_DIR="$TARGET_DIR/.tasker"
mkdir -p "$TASKER_DIR"/{inputs,artifacts,tasks,bundles,reports,fsm-draft,adrs-draft}
Create $TARGET_DIR/.tasker/state.json:
{
"version": "3.0",
"target_dir": "<absolute-path>",
"phase": {
"current": "initialization",
"completed": [],
"step": null
},
"created_at": "<timestamp>",
"updated_at": "<timestamp>",
"spec_session": {
"project_type": "new|existing",
"existing_spec_path": "<path-from-step-2-or-null>",
"spec_slug": "<slug>",
"spec_path": "<target>/docs/specs/<slug>.md",
"started_at": "<timestamp>",
"resumed_from": null
},
"scope": null,
"clarify": null,
"synthesis": null,
"architecture": null,
"decisions": null,
"review": null
}
CRITICAL: Update state.json after EVERY significant action. This enables resume from any point.
The phase-specific state objects are populated as each phase progresses (see phase definitions below).
If user provided existing spec path in Step 2b, store it in spec_session.existing_spec_path for reference during Scope phase.
For new sessions (Step 2 path):
.tasker/ directory structure created in target project$TARGET_DIR/.tasker/state.jsonFor resumed sessions (Step 1c path):
phase.current phaseEstablish bounds before discovery.
If spec_session.existing_spec_path was set during initialization:
if [ -n "$EXISTING_SPEC_PATH" ]; then
echo "Loading existing spec from: $EXISTING_SPEC_PATH"
# Read and analyze existing spec
# Pre-fill scope questions with extracted information
fi
Ask these questions using AskUserQuestion tool with structured options. If existing spec was loaded, present extracted answers for confirmation rather than blank questions:
What are we building?
Free-form text input.
What is explicitly OUT of scope?
Free-form text input (allow multiple items).
What are the acceptance bullets? (When is this "done"?)
Free-form text input (allow multiple items).
What tech stack should be used?
Free-form text input. Examples:
If user says "whatever fits best" or similar:
How will users invoke this? What makes it available?
Options to present:
If user selects CLI/API/Skill: Follow up: "What specific steps are needed to make this available to users?"
If user selects Library/module: Note in spec: "Installation & Activation: N/A - library/module only"
Why this matters: Specs that describe invocation without activation mechanism cause W8 weakness and I6 invariant failure. Capturing this early prevents dead entry points.
Update $TARGET_DIR/.tasker/state.json:
{
"phase": {
"current": "scope",
"completed": ["initialization"],
"step": "complete"
},
"updated_at": "<timestamp>",
"scope": {
"goal": "<user-provided-goal>",
"non_goals": ["<item1>", "<item2>"],
"done_means": ["<criterion1>", "<criterion2>"],
"tech_stack": "<tech-stack-or-TBD>",
"entry_point": {
"type": "cli|api|skill|library|other",
"trigger": "<command-name or /skillname or endpoint>",
"activation_steps": ["<step1>", "<step2>"]
},
"completed_at": "<timestamp>"
}
}
Write initial spec sections to $TARGET_DIR/.tasker/spec-draft.md:
# Spec: {Title}
## Goal
{goal from scope}
## Non-goals
{non_goals from scope}
## Done means
{done_means from scope}
## Tech Stack
{tech_stack from scope}
## Installation & Activation
**Entry Point:** {entry_point.trigger from scope}
**Type:** {entry_point.type from scope}
**Activation Steps:**
{entry_point.activation_steps from scope, numbered list}
**Verification:**
<!-- To be filled in during Clarify or Synthesis -->
<!-- Remaining sections will be added by subsequent phases -->
IMPORTANT: All spec content is built in this file, NOT in conversation context. Read from this file when you need prior spec content.
Exhaustively gather requirements via structured questioning.
Update $TARGET_DIR/.tasker/state.json:
{
"phase": {
"current": "clarify",
"completed": ["initialization", "scope"],
"step": "starting"
},
"updated_at": "<timestamp>",
"clarify": {
"current_category": "core_requirements",
"current_round": 1,
"categories": {
"core_requirements": { "status": "not_started", "rounds": 0 },
"users_context": { "status": "not_started", "rounds": 0 },
"integrations": { "status": "not_started", "rounds": 0 },
"edge_cases": { "status": "not_started", "rounds": 0 },
"quality_attributes": { "status": "not_started", "rounds": 0 },
"existing_patterns": { "status": "not_started", "rounds": 0 },
"preferences": { "status": "not_started", "rounds": 0 }
},
"pending_followups": [],
"requirements_count": 0,
"stock_takes_count": 0,
"started_at": "<timestamp>"
}
}
Create $TARGET_DIR/.tasker/clarify-session.md:
# Discovery: {TOPIC}
Started: {timestamp}
## Category Status
| Category | Status | Rounds | Notes |
|----------|--------|--------|-------|
| Core requirements | ○ Not Started | 0 | — |
| Users & context | ○ Not Started | 0 | — |
| Integrations | ○ Not Started | 0 | — |
| Edge cases | ○ Not Started | 0 | — |
| Quality attributes | ○ Not Started | 0 | — |
| Existing patterns | ○ Not Started | 0 | — |
| Preferences | ○ Not Started | 0 | — |
## Discovery Rounds
Create $TARGET_DIR/.tasker/stock-takes.md:
# Stock-Takes: {TOPIC}
Started: {timestamp}
This file tracks how the vision evolves as discovery progresses.
---
On resume (after compaction or restart):
$TARGET_DIR/.tasker/state.json to get clarify state$TARGET_DIR/.tasker/clarify-session.md to get discovery historyclarify.current_category and clarify.current_roundclarify.pending_followups is non-empty, continue follow-up loop firstDO NOT rely on conversation context for clarify progress. Always read from files.
No iteration cap - Continue until goals are met
Category Focus Mode - Work on ONE category at a time until it's complete or explicitly deferred
Each iteration:
Clarity Before Progress - If user response is anything except a direct answer (counter-question, confusion, pushback, tangential), provide clarification FIRST. Do NOT present new questions until prior questions have direct answers.
Stop ONLY when:
After receiving answers to a question round, DO NOT immediately move to the next round. First, validate each answer:
For each answer, check if follow-up is required:
| Trigger | Example | Required Follow-up | |---------|---------|-------------------| | Vague quantifier | "several users", "a few endpoints" | "How many specifically?" | | Undefined scope | "and so on", "etc.", "things like that" | "Can you list all items explicitly?" | | Weak commitment | "probably", "maybe", "I think" | "Is this confirmed or uncertain?" | | Missing specifics | "fast response", "secure" | "What's the specific target? (e.g., <100ms)" | | Deferred knowledge | "I'm not sure", "don't know yet" | "Should we make a default assumption, or is this blocking?" | | Contradicts earlier answer | Conflicts with prior round | "Earlier you said X, now Y. Which is correct?" |
For each answer in current round:
1. Check against validation triggers
2. If trigger found:
a. Add to pending_followups in state.json
b. Ask ONE follow-up question (not batched)
c. Wait for response
d. Remove from pending_followups, re-validate the new response
e. Repeat until answer is concrete OR user explicitly defers
3. Only after ALL answers validated → proceed to next round
Before asking a follow-up question, update state.json:
{
"clarify": {
"pending_followups": [
{
"question_id": "Q3.2",
"original_answer": "<user's vague answer>",
"trigger": "vague_quantifier",
"followup_question": "<the follow-up question being asked>"
}
]
}
}
After receiving follow-up response, remove from pending_followups and update the round in clarify-session.md.
Use AskUserQuestion with context from the original answer:
{
"question": "You mentioned '{user_quote}'. {specific_follow_up_question}",
"header": "Clarify",
"options": [
{"label": "Specify", "description": "I'll provide a specific answer"},
{"label": "Not critical", "description": "This detail isn't important for the spec"},
{"label": "Defer", "description": "I don't know yet, note as open question"}
]
}
If the user's response is anything other than a direct answer, assume clarification is required. Do NOT present new questions until the original question is resolved.
| Response Type | Example | Required Action | |---------------|---------|-----------------| | Counter-question | "What do you mean by X?" | Answer their question, then re-ask yours | | Confusion | "I'm not sure what you're asking" | Rephrase the question with more context | | Pushback | "Why do you need to know that?" | Explain why this matters for the spec | | Tangential | Talks about something else | Acknowledge, then redirect to the question | | Partial answer | Answers part, ignores rest | Note the partial, ask about the unanswered part | | Meta-comment | "This is getting detailed" | Acknowledge, offer to simplify or defer |
Process:
1. Detect non-direct response
2. Address the user's concern/question FIRST
3. Only after clarity achieved → re-present the original question (or confirm it's now answered)
4. Do NOT batch new questions until all prior questions have direct answers
Example:
Agent: "What authentication method should users use?"
User: "What options are there?"
[NON-DIRECT: User asked a counter-question]
Agent: "Common options are: (1) Email/password, (2) OAuth (Google, GitHub),
(3) Magic link, (4) SSO/SAML. Which fits your use case?"
User: "Email/password for now, maybe OAuth later."
[NOW DIRECT: Can proceed]
Agent: "What integrations are required?"
User: "We need to connect to a few external services and maybe some APIs."
[FOLLOW-UP REQUIRED: "a few" is vague, "maybe" is weak commitment]
Agent: "You mentioned 'a few external services'. Can you list all the external systems this will integrate with?"
User: "Stripe for payments, SendGrid for email, and our internal user service."
[ANSWER NOW CONCRETE: specific services named]
Agent: "You said 'maybe some APIs'. Are there additional API integrations beyond Stripe, SendGrid, and the user service?"
User: "No, that's all."
[CATEGORY GOAL PROGRESS: Integrations now has concrete list]
Each category has concrete "done" criteria. Track completion in the discovery file.
| Category | Goal (Done When) | |----------|------------------| | Core requirements | Primary workflows enumerated with inputs, outputs, and happy path steps | | Users & context | User roles identified, expertise levels known, access patterns clear | | Integrations / boundaries | All external systems named, data flows mapped, API contracts sketched | | Edge cases / failures | Error handling defined for each workflow step, retry/fallback behavior specified | | Quality attributes | Performance targets have numbers (or explicit "not critical"), security requirements stated | | Existing patterns | Relevant prior art identified OR confirmed none exists, conventions to follow listed | | Preferences / constraints | Tech stack decided, deployment target known, timeline/resource constraints stated |
Update discovery file with completion status:
## Category Status
| Category | Status | Notes |
|----------|--------|-------|
| Core requirements | ✓ Complete | 3 workflows defined |
| Users & context | ✓ Complete | 2 roles: admin, user |
| Integrations | ⋯ In Progress | DB confirmed, auth TBD |
| Edge cases | ○ Not Started | — |
| Quality attributes | ○ Not Started | — |
| Existing patterns | ✓ Complete | Follow auth module pattern |
| Preferences | ⋯ In Progress | Python confirmed, framework TBD |
A category is complete when:
Do NOT mark complete if:
Before moving to a new category:
This prevents the feeling of being "rushed" through categories.
As questions are answered and categories complete, periodically synthesize the "big picture" - what's emerging, the shape of the vision. This helps users see how their answers are building toward something coherent and provides calibration moments.
Stock-take is triggered after each category completes (before transitioning to the next category). This creates a natural rhythm of ~5-7 stock-takes during Phase 2.
A stock-take is NOT a list of answers. It's a synthesis of meaning - what's taking shape:
**Taking stock** (after {category_name}):
{1-3 sentence synthesis of what's emerging - not a summary of answers, but the picture forming}
{Any notable patterns, tensions, or tradeoffs becoming visible}
Does this still capture where we're heading?
After completing "Integrations" category:
Taking stock (after Integrations):
We're building a CLI skill system where specs drive task decomposition. The emphasis is on preventing incomplete handoffs - every behavior must trace back to stated requirements. The system is self-contained except for Git (for state persistence) and Claude Code (as the execution runtime).
There's tension between thoroughness and workflow friction that keeps surfacing - users want comprehensive specs but not interrogation.
Does this still capture where we're heading?
The question at the end is light - "Does this still feel right?" not "Please confirm items 1-7."
After category completion:
spec-draft.md (scope), clarify-session.md (discovery so far)Search for places (restaurants, cafes, etc.) via Google Places API proxy on localhost.
Interact with GitHub using the `gh` CLI. Use `gh issue`, `gh pr`, `gh run`, and `gh api` for issues, PRs, CI runs, and advanced queries.
Create or update AgentSkills. Use when designing, structuring, or packaging skills with scripts, references, and assets.
Start voice calls via the OpenClaw voice-call plugin.
Notion API for creating and managing pages, databases, and blocks.
Gemini CLI for one-shot Q&A, summaries, and generation.
Category:developer