diff --git a/.github/workflows/scripts/create-release-packages.sh b/.github/workflows/scripts/create-release-packages.sh
index 82601c60..19e49d39 100644
--- a/.github/workflows/scripts/create-release-packages.sh
+++ b/.github/workflows/scripts/create-release-packages.sh
@@ -42,7 +42,7 @@ generate_commands() {
mkdir -p "$output_dir"
for template in templates/commands/*.md; do
[[ -f "$template" ]] || continue
- local name description script_command body
+ local name description script_command agent_script_command body
name=$(basename "$template" .md)
# Normalize line endings
@@ -57,13 +57,30 @@ generate_commands() {
script_command="(Missing script command for $script_variant)"
fi
+ # Extract agent_script command from YAML frontmatter if present
+ agent_script_command=$(printf '%s\n' "$file_content" | awk '
+ /^agent_scripts:$/ { in_agent_scripts=1; next }
+ in_agent_scripts && /^[[:space:]]*'"$script_variant"':[[:space:]]*/ {
+ sub(/^[[:space:]]*'"$script_variant"':[[:space:]]*/, "")
+ print
+ exit
+ }
+ in_agent_scripts && /^[a-zA-Z]/ { in_agent_scripts=0 }
+ ')
+
# Replace {SCRIPT} placeholder with the script command
body=$(printf '%s\n' "$file_content" | sed "s|{SCRIPT}|${script_command}|g")
- # Remove the scripts: section from frontmatter while preserving YAML structure
+ # Replace {AGENT_SCRIPT} placeholder with the agent script command if found
+ if [[ -n $agent_script_command ]]; then
+ body=$(printf '%s\n' "$body" | sed "s|{AGENT_SCRIPT}|${agent_script_command}|g")
+ fi
+
+ # Remove the scripts: and agent_scripts: sections from frontmatter while preserving YAML structure
body=$(printf '%s\n' "$body" | awk '
/^---$/ { print; if (++dash_count == 1) in_frontmatter=1; else in_frontmatter=0; next }
in_frontmatter && /^scripts:$/ { skip_scripts=1; next }
+ in_frontmatter && /^agent_scripts:$/ { skip_scripts=1; next }
in_frontmatter && /^[a-zA-Z].*:/ && skip_scripts { skip_scripts=0 }
in_frontmatter && skip_scripts && /^[[:space:]]/ { next }
{ print }
@@ -74,11 +91,11 @@ generate_commands() {
case $ext in
toml)
- { echo "description = \"$description\""; echo; echo "prompt = \"\"\""; echo "$body"; echo "\"\"\""; } > "$output_dir/$name.$ext" ;;
+ { echo "description = \"$description\""; echo; echo "prompt = \"\"\""; echo "$body"; echo "\"\"\""; } > "$output_dir/speckit.$name.$ext" ;;
md)
- echo "$body" > "$output_dir/$name.$ext" ;;
+ echo "$body" > "$output_dir/speckit.$name.$ext" ;;
prompt.md)
- echo "$body" > "$output_dir/$name.$ext" ;;
+ echo "$body" > "$output_dir/speckit.$name.$ext" ;;
esac
done
}
@@ -112,25 +129,8 @@ build_variant() {
esac
fi
- [[ -d templates ]] && { mkdir -p "$SPEC_DIR/templates"; find templates -type f -not -path "templates/commands/*" -exec cp --parents {} "$SPEC_DIR"/ \; ; echo "Copied templates -> .specify/templates"; }
- # Inject variant into plan-template.md within .specify/templates if present
- local plan_tpl="$base_dir/.specify/templates/plan-template.md"
- if [[ -f "$plan_tpl" ]]; then
- plan_norm=$(tr -d '\r' < "$plan_tpl")
- # Extract script command from YAML frontmatter
- script_command=$(printf '%s\n' "$plan_norm" | awk -v sv="$script" '/^[[:space:]]*'"$script"':[[:space:]]*/ {sub(/^[[:space:]]*'"$script"':[[:space:]]*/, ""); print; exit}')
- if [[ -n $script_command ]]; then
- # Always prefix with .specify/ for plan usage
- script_command=".specify/$script_command"
- # Replace {SCRIPT} placeholder with the script command and __AGENT__ with agent name
- substituted=$(sed "s|{SCRIPT}|${script_command}|g" "$plan_tpl" | tr -d '\r' | sed "s|__AGENT__|${agent}|g")
- # Strip YAML frontmatter from plan template output (keep body only)
- stripped=$(printf '%s\n' "$substituted" | awk 'BEGIN{fm=0;dash=0} /^---$/ {dash++; if(dash==1){fm=1; next} else if(dash==2){fm=0; next}} {if(!fm) print}')
- printf '%s\n' "$stripped" > "$plan_tpl"
- else
- echo "Warning: no plan-template script command found for $script in YAML frontmatter" >&2
- fi
- fi
+ [[ -d templates ]] && { mkdir -p "$SPEC_DIR/templates"; find templates -type f -not -path "templates/commands/*" -not -name "vscode-settings.json" -exec cp --parents {} "$SPEC_DIR"/ \; ; echo "Copied templates -> .specify/templates"; }
+
# NOTE: We substitute {ARGS} internally. Outward tokens differ intentionally:
# * Markdown/prompt (claude, copilot, cursor, opencode): $ARGUMENTS
# * TOML (gemini, qwen): {{args}}
@@ -146,7 +146,11 @@ build_variant() {
[[ -f agent_templates/gemini/GEMINI.md ]] && cp agent_templates/gemini/GEMINI.md "$base_dir/GEMINI.md" ;;
copilot)
mkdir -p "$base_dir/.github/prompts"
- generate_commands copilot prompt.md "\$ARGUMENTS" "$base_dir/.github/prompts" "$script" ;;
+ generate_commands copilot prompt.md "\$ARGUMENTS" "$base_dir/.github/prompts" "$script"
+ # Create VS Code workspace settings
+ mkdir -p "$base_dir/.vscode"
+ [[ -f templates/vscode-settings.json ]] && cp templates/vscode-settings.json "$base_dir/.vscode/settings.json"
+ ;;
cursor)
mkdir -p "$base_dir/.cursor/commands"
generate_commands cursor md "\$ARGUMENTS" "$base_dir/.cursor/commands" "$script" ;;
diff --git a/CHANGELOG.md b/CHANGELOG.md
index d9485cb4..4706b826 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -2,16 +2,24 @@
-All notable changes to the Specify CLI will be documented in this file.
+All notable changes to the Specify CLI and templates are documented here.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
-## [LATEST_VERSION] - RELEASE_DATE
+## [0.0.18] - 2025-10-06
### Added
-- Support for using `.` as a shorthand for current directory in `specify init .` command, equivalent to `--here` flag but more intuitive for users
+- Support for using `.` as a shorthand for current directory in `specify init .` command, equivalent to `--here` flag but more intuitive for users.
+- Use the `/speckit.` command prefix to easily discover Spec Kit-related commands.
+- Refactor the prompts and templates to simplify their capabilities and how they are tracked. No more polluting things with tests when they are not needed.
+- Ensure that tasks are created per user story (simplifies testing and validation).
+- Add support for Visual Studio Code prompt shortcuts and automatic script execution.
+
+### Changed
+
+- All command files now prefixed with `speckit.` (e.g., `speckit.specify.md`, `speckit.plan.md`) for better discoverability and differentiation in IDE/CLI command palettes and file explorers
## [0.0.17] - 2025-09-22
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index bf65fa77..b5488c80 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -40,7 +40,7 @@ Here are a few things you can do that will increase the likelihood of your pull
When working on spec-kit:
-1. Test changes with the `specify` CLI commands (`/specify`, `/plan`, `/tasks`) in your coding agent of choice
+1. Test changes with the `specify` CLI commands (`/speckit.specify`, `/speckit.plan`, `/speckit.tasks`) in your coding agent of choice
2. Verify templates are working correctly in `templates/` directory
3. Test script functionality in the `scripts/` directory
4. Ensure memory files (`memory/constitution.md`) are updated if major process changes are made
diff --git a/README.md b/README.md
index 4d7a8fb0..2d648155 100644
--- a/README.md
+++ b/README.md
@@ -73,42 +73,42 @@ uvx --from git+https://github.com/github/spec-kit.git specify init **Must be set in the context of the agent you're working with prior to using `/plan` or follow-up commands. |
+| `SPECIFY_FEATURE` | Override feature detection for non-Git repositories. Set to the feature directory name (e.g., `001-photo-albums`) to work on a specific feature when not using Git branches.
**Must be set in the context of the agent you're working with prior to using `/speckit.plan` or follow-up commands. |
## π Core philosophy
@@ -314,20 +326,18 @@ You will be prompted to select the AI agent you are using. You can also proactiv
specify init --ai claude
specify init --ai gemini
specify init --ai copilot
-specify init --ai cursor
-specify init --ai qwen
-specify init --ai opencode
-specify init --ai codex
-specify init --ai windsurf
-specify init --ai q
+
# Or in current directory:
specify init . --ai claude
specify init . --ai codex
+
# or use --here flag
specify init --here --ai claude
specify init --here --ai codex
+
# Force merge into a non-empty current directory
specify init . --force --ai claude
+
# or
specify init --here --force --ai claude
```
@@ -344,19 +354,19 @@ Go to the project folder and run your AI agent. In our example, we're using `cla

-You will know that things are configured correctly if you see the `/constitution`, `/specify`, `/plan`, `/tasks`, and `/implement` commands available.
+You will know that things are configured correctly if you see the `/speckit.constitution`, `/speckit.specify`, `/speckit.plan`, `/speckit.tasks`, and `/speckit.implement` commands available.
-The first step should be establishing your project's governing principles using the `/constitution` command. This helps ensure consistent decision-making throughout all subsequent development phases:
+The first step should be establishing your project's governing principles using the `/speckit.constitution` command. This helps ensure consistent decision-making throughout all subsequent development phases:
```text
-/constitution Create principles focused on code quality, testing standards, user experience consistency, and performance requirements. Include governance for how these principles should guide technical decisions and implementation choices.
+/speckit.constitution Create principles focused on code quality, testing standards, user experience consistency, and performance requirements. Include governance for how these principles should guide technical decisions and implementation choices.
```
This step creates or updates the `.specify/memory/constitution.md` file with your project's foundational guidelines that the AI agent will reference during specification, planning, and implementation phases.
### **STEP 2:** Create project specifications
-With your project principles established, you can now create the functional specifications. Use the `/specify` command and then provide the concrete requirements for the project you want to develop.
+With your project principles established, you can now create the functional specifications. Use the `/speckit.specify` command and then provide the concrete requirements for the project you want to develop.
>[!IMPORTANT]
>Be as explicit as possible about _what_ you are trying to build and _why_. **Do not focus on the tech stack at this point**.
@@ -416,12 +426,12 @@ With the baseline specification created, you can go ahead and clarify any of the
You should run the structured clarification workflow **before** creating a technical plan to reduce rework downstream.
Preferred order:
-1. Use `/clarify` (structured) β sequential, coverage-based questioning that records answers in a Clarifications section.
+1. Use `/speckit.clarify` (structured) β sequential, coverage-based questioning that records answers in a Clarifications section.
2. Optionally follow up with ad-hoc free-form refinement if something still feels vague.
If you intentionally want to skip clarification (e.g., spike or exploratory prototype), explicitly state that so the agent doesn't block on missing clarifications.
-Example free-form refinement prompt (after `/clarify` if still needed):
+Example free-form refinement prompt (after `/speckit.clarify` if still needed):
```text
For each sample project or project that you create there should be a variable number of tasks between 5 and 15
@@ -439,7 +449,7 @@ It's important to use the interaction with Claude Code as an opportunity to clar
### **STEP 4:** Generate a plan
-You can now be specific about the tech stack and other technical requirements. You can use the `/plan` command that is built into the project template with a prompt like this:
+You can now be specific about the tech stack and other technical requirements. You can use the `/speckit.plan` command that is built into the project template with a prompt like this:
```text
We are going to generate this using .NET Aspire, using Postgres as the database. The frontend should use
@@ -525,13 +535,13 @@ You can also ask Claude Code (if you have the [GitHub CLI](https://docs.github.c
### STEP 6: Implementation
-Once ready, use the `/implement` command to execute your implementation plan:
+Once ready, use the `/speckit.implement` command to execute your implementation plan:
```text
-/implement
+/speckit.implement
```
-The `/implement` command will:
+The `/speckit.implement` command will:
- Validate that all prerequisites are in place (constitution, spec, plan, and tasks)
- Parse the task breakdown from `tasks.md`
- Execute tasks in the correct order, respecting dependencies and parallel execution markers
diff --git a/docs/installation.md b/docs/installation.md
index b30b0948..ec3c2896 100644
--- a/docs/installation.md
+++ b/docs/installation.md
@@ -62,9 +62,9 @@ uvx --from git+https://github.com/github/spec-kit.git specify init &2
- echo "Run /specify first to create the feature structure." >&2
+ echo "Run /speckit.specify first to create the feature structure." >&2
exit 1
fi
if [[ ! -f "$IMPL_PLAN" ]]; then
echo "ERROR: plan.md not found in $FEATURE_DIR" >&2
- echo "Run /plan first to create the implementation plan." >&2
+ echo "Run /speckit.plan first to create the implementation plan." >&2
exit 1
fi
# Check for tasks.md if required
if $REQUIRE_TASKS && [[ ! -f "$TASKS" ]]; then
echo "ERROR: tasks.md not found in $FEATURE_DIR" >&2
- echo "Run /tasks first to create the task list." >&2
+ echo "Run /speckit.tasks first to create the task list." >&2
exit 1
fi
diff --git a/scripts/powershell/check-prerequisites.ps1 b/scripts/powershell/check-prerequisites.ps1
index d61c3b99..d8ccd1d5 100644
--- a/scripts/powershell/check-prerequisites.ps1
+++ b/scripts/powershell/check-prerequisites.ps1
@@ -88,20 +88,20 @@ if ($PathsOnly) {
# Validate required directories and files
if (-not (Test-Path $paths.FEATURE_DIR -PathType Container)) {
Write-Output "ERROR: Feature directory not found: $($paths.FEATURE_DIR)"
- Write-Output "Run /specify first to create the feature structure."
+ Write-Output "Run /speckit.specify first to create the feature structure."
exit 1
}
if (-not (Test-Path $paths.IMPL_PLAN -PathType Leaf)) {
Write-Output "ERROR: plan.md not found in $($paths.FEATURE_DIR)"
- Write-Output "Run /plan first to create the implementation plan."
+ Write-Output "Run /speckit.plan first to create the implementation plan."
exit 1
}
# Check for tasks.md if required
if ($RequireTasks -and -not (Test-Path $paths.TASKS -PathType Leaf)) {
Write-Output "ERROR: tasks.md not found in $($paths.FEATURE_DIR)"
- Write-Output "Run /tasks first to create the task list."
+ Write-Output "Run /speckit.tasks first to create the task list."
exit 1
}
diff --git a/spec-driven.md b/spec-driven.md
index a932c2eb..0e546ff3 100644
--- a/spec-driven.md
+++ b/spec-driven.md
@@ -74,7 +74,7 @@ The key is treating specifications as the source of truth, with code as the gene
The SDD methodology is significantly enhanced through three powerful commands that automate the specification β planning β tasking workflow:
-### The `/specify` Command
+### The `/speckit.specify` Command
This command transforms a simple feature description (the user-prompt) into a complete, structured specification with automatic repository management:
@@ -83,7 +83,7 @@ This command transforms a simple feature description (the user-prompt) into a co
3. **Template-Based Generation**: Copies and customizes the feature specification template with your requirements
4. **Directory Structure**: Creates the proper `specs/[branch-name]/` structure for all related documents
-### The `/plan` Command
+### The `/speckit.plan` Command
Once a feature specification exists, this command creates a comprehensive implementation plan:
@@ -93,7 +93,7 @@ Once a feature specification exists, this command creates a comprehensive implem
4. **Detailed Documentation**: Generates supporting documents for data models, API contracts, and test scenarios
5. **Quickstart Validation**: Produces a quickstart guide capturing key validation scenarios
-### The `/tasks` Command
+### The `/speckit.tasks` Command
After a plan is created, this command analyzes the plan and related design documents to generate an executable task list:
@@ -121,7 +121,7 @@ Total: ~12 hours of documentation work
```bash
# Step 1: Create the feature specification (5 minutes)
-/specify Real-time chat system with message history and user presence
+/speckit.specify Real-time chat system with message history and user presence
# This automatically:
# - Creates branch "003-chat-system"
@@ -129,10 +129,10 @@ Total: ~12 hours of documentation work
# - Populates it with structured requirements
# Step 2: Generate implementation plan (5 minutes)
-/plan WebSocket for real-time messaging, PostgreSQL for history, Redis for presence
+/speckit.plan WebSocket for real-time messaging, PostgreSQL for history, Redis for presence
# Step 3: Generate executable tasks (5 minutes)
-/tasks
+/speckit.tasks
# This automatically creates:
# - specs/003-chat-system/plan.md
diff --git a/src/specify_cli/__init__.py b/src/specify_cli/__init__.py
index 7ab114fb..a0652539 100644
--- a/src/specify_cli/__init__.py
+++ b/src/specify_cli/__init__.py
@@ -64,7 +64,6 @@ def _github_auth_headers(cli_token: str | None = None) -> dict:
token = _github_token(cli_token)
return {"Authorization": f"Bearer {token}"} if token else {}
-# Constants
AI_CHOICES = {
"copilot": "GitHub Copilot",
"claude": "Claude Code",
@@ -79,13 +78,11 @@ AI_CHOICES = {
"roo": "Roo Code",
"q": "Amazon Q Developer CLI",
}
-# Add script type choices
+
SCRIPT_TYPE_CHOICES = {"sh": "POSIX Shell (bash/zsh)", "ps": "PowerShell"}
-# Claude CLI local installation path after migrate-installer
CLAUDE_LOCAL_PATH = Path.home() / ".claude" / "local" / "claude"
-# ASCII Art Banner
BANNER = """
βββββββββββββββ ββββββββ βββββββββββββββββββββ βββ
βββββββββββββββββββββββββββββββββββββββββββββββ ββββ
@@ -182,40 +179,26 @@ class StepTracker:
tree.add(line)
return tree
-
-
-MINI_BANNER = """
-βββββββββββββ¦ββββ¦ β¦
-ββββ ββββ£ β ββ β£ ββ¦β
-ββββ© βββββββ©β β©
-"""
-
def get_key():
"""Get a single keypress in a cross-platform way using readchar."""
key = readchar.readkey()
-
- # Arrow keys
+
if key == readchar.key.UP or key == readchar.key.CTRL_P:
return 'up'
if key == readchar.key.DOWN or key == readchar.key.CTRL_N:
return 'down'
-
- # Enter/Return
+
if key == readchar.key.ENTER:
return 'enter'
-
- # Escape
+
if key == readchar.key.ESC:
return 'escape'
-
- # Ctrl+C
+
if key == readchar.key.CTRL_C:
raise KeyboardInterrupt
return key
-
-
def select_with_arrows(options: dict, prompt_text: str = "Select an option", default_key: str = None) -> str:
"""
Interactive selection using arrow keys with Rich Live display.
@@ -233,7 +216,7 @@ def select_with_arrows(options: dict, prompt_text: str = "Select an option", def
selected_index = option_keys.index(default_key)
else:
selected_index = 0
-
+
selected_key = None
def create_selection_panel():
@@ -241,23 +224,23 @@ def select_with_arrows(options: dict, prompt_text: str = "Select an option", def
table = Table.grid(padding=(0, 2))
table.add_column(style="cyan", justify="left", width=3)
table.add_column(style="white", justify="left")
-
+
for i, key in enumerate(option_keys):
if i == selected_index:
table.add_row("βΆ", f"[cyan]{key}[/cyan] [dim]({options[key]})[/dim]")
else:
table.add_row(" ", f"[cyan]{key}[/cyan] [dim]({options[key]})[/dim]")
-
+
table.add_row("", "")
table.add_row("", "[dim]Use β/β to navigate, Enter to select, Esc to cancel[/dim]")
-
+
return Panel(
table,
title=f"[bold]{prompt_text}[/bold]",
border_style="cyan",
padding=(1, 2)
)
-
+
console.print()
def run_selection_loop():
@@ -276,7 +259,7 @@ def select_with_arrows(options: dict, prompt_text: str = "Select an option", def
elif key == 'escape':
console.print("\n[yellow]Selection cancelled[/yellow]")
raise typer.Exit(1)
-
+
live.update(create_selection_panel(), refresh=True)
except KeyboardInterrupt:
@@ -292,14 +275,11 @@ def select_with_arrows(options: dict, prompt_text: str = "Select an option", def
# Suppress explicit selection print; tracker / later logic will report consolidated status
return selected_key
-
-
console = Console()
-
class BannerGroup(TyperGroup):
"""Custom group that shows banner before help."""
-
+
def format_help(self, ctx, formatter):
# Show banner before help
show_banner()
@@ -314,23 +294,21 @@ app = typer.Typer(
cls=BannerGroup,
)
-
def show_banner():
"""Display the ASCII art banner."""
# Create gradient effect with different colors
banner_lines = BANNER.strip().split('\n')
colors = ["bright_blue", "blue", "cyan", "bright_cyan", "white", "bright_white"]
-
+
styled_banner = Text()
for i, line in enumerate(banner_lines):
color = colors[i % len(colors)]
styled_banner.append(line + "\n", style=color)
-
+
console.print(Align.center(styled_banner))
console.print(Align.center(Text(TAGLINE, style="italic bright_yellow")))
console.print()
-
@app.callback()
def callback(ctx: typer.Context):
"""Show banner when no subcommand is provided."""
@@ -341,7 +319,6 @@ def callback(ctx: typer.Context):
console.print(Align.center("[dim]Run 'specify --help' for usage information[/dim]"))
console.print()
-
def run_command(cmd: list[str], check_return: bool = True, capture: bool = False, shell: bool = False) -> Optional[str]:
"""Run a shell command and optionally capture output."""
try:
@@ -360,7 +337,6 @@ def run_command(cmd: list[str], check_return: bool = True, capture: bool = False
raise
return None
-
def check_tool_for_tracker(tool: str, tracker: StepTracker) -> bool:
"""Check if a tool is installed and update tracker."""
if shutil.which(tool):
@@ -370,7 +346,6 @@ def check_tool_for_tracker(tool: str, tracker: StepTracker) -> bool:
tracker.error(tool, "not found")
return False
-
def check_tool(tool: str, install_hint: str) -> bool:
"""Check if a tool is installed."""
@@ -388,7 +363,6 @@ def check_tool(tool: str, install_hint: str) -> bool:
else:
return False
-
def is_git_repo(path: Path = None) -> bool:
"""Check if the specified path is inside a git repository."""
if path is None:
@@ -409,7 +383,6 @@ def is_git_repo(path: Path = None) -> bool:
except (subprocess.CalledProcessError, FileNotFoundError):
return False
-
def init_git_repo(project_path: Path, quiet: bool = False) -> bool:
"""Initialize a git repository in the specified path.
quiet: if True suppress console output (tracker handles status)
@@ -425,7 +398,7 @@ def init_git_repo(project_path: Path, quiet: bool = False) -> bool:
if not quiet:
console.print("[green]β[/green] Git repository initialized")
return True
-
+
except subprocess.CalledProcessError as e:
if not quiet:
console.print(f"[red]Error initializing git repository:[/red] {e}")
@@ -433,17 +406,16 @@ def init_git_repo(project_path: Path, quiet: bool = False) -> bool:
finally:
os.chdir(original_cwd)
-
def download_template_from_github(ai_assistant: str, download_dir: Path, *, script_type: str = "sh", verbose: bool = True, show_progress: bool = True, client: httpx.Client = None, debug: bool = False, github_token: str = None) -> Tuple[Path, dict]:
repo_owner = "github"
repo_name = "spec-kit"
if client is None:
client = httpx.Client(verify=ssl_context)
-
+
if verbose:
console.print("[cyan]Fetching latest release information...[/cyan]")
api_url = f"https://api.github.com/repos/{repo_owner}/{repo_name}/releases/latest"
-
+
try:
response = client.get(
api_url,
@@ -465,7 +437,7 @@ def download_template_from_github(ai_assistant: str, download_dir: Path, *, scri
console.print(f"[red]Error fetching release information[/red]")
console.print(Panel(str(e), title="Fetch Error", border_style="red"))
raise typer.Exit(1)
-
+
# Find the template asset for the specified AI assistant
assets = release_data.get("assets", [])
pattern = f"spec-kit-template-{ai_assistant}-{script_type}"
@@ -485,7 +457,7 @@ def download_template_from_github(ai_assistant: str, download_dir: Path, *, scri
download_url = asset["browser_download_url"]
filename = asset["name"]
file_size = asset["size"]
-
+
if verbose:
console.print(f"[cyan]Found template:[/cyan] {filename}")
console.print(f"[cyan]Size:[/cyan] {file_size:,} bytes")
@@ -494,7 +466,7 @@ def download_template_from_github(ai_assistant: str, download_dir: Path, *, scri
zip_path = download_dir / filename
if verbose:
console.print(f"[cyan]Downloading template...[/cyan]")
-
+
try:
with client.stream(
"GET",
@@ -545,13 +517,12 @@ def download_template_from_github(ai_assistant: str, download_dir: Path, *, scri
}
return zip_path, metadata
-
def download_and_extract_template(project_path: Path, ai_assistant: str, script_type: str, is_current_dir: bool = False, *, verbose: bool = True, tracker: StepTracker | None = None, client: httpx.Client = None, debug: bool = False, github_token: str = None) -> Path:
"""Download the latest release and extract it to create a new project.
Returns project_path. Uses tracker if provided (with keys: fetch, download, extract, cleanup)
"""
current_dir = Path.cwd()
-
+
# Step: fetch + download combined
if tracker:
tracker.start("fetch", "contacting GitHub API")
@@ -577,18 +548,18 @@ def download_and_extract_template(project_path: Path, ai_assistant: str, script_
if verbose:
console.print(f"[red]Error downloading template:[/red] {e}")
raise
-
+
if tracker:
tracker.add("extract", "Extract template")
tracker.start("extract")
elif verbose:
console.print("Extracting template...")
-
+
try:
# Create project directory only if not using current directory
if not is_current_dir:
project_path.mkdir(parents=True)
-
+
with zipfile.ZipFile(zip_path, 'r') as zip_ref:
# List all files in the ZIP for debugging
zip_contents = zip_ref.namelist()
@@ -597,13 +568,13 @@ def download_and_extract_template(project_path: Path, ai_assistant: str, script_
tracker.complete("zip-list", f"{len(zip_contents)} entries")
elif verbose:
console.print(f"[cyan]ZIP contains {len(zip_contents)} items[/cyan]")
-
+
# For current directory, extract to a temp location first
if is_current_dir:
with tempfile.TemporaryDirectory() as temp_dir:
temp_path = Path(temp_dir)
zip_ref.extractall(temp_path)
-
+
# Check what was extracted
extracted_items = list(temp_path.iterdir())
if tracker:
@@ -611,7 +582,7 @@ def download_and_extract_template(project_path: Path, ai_assistant: str, script_
tracker.complete("extracted-summary", f"temp {len(extracted_items)} items")
elif verbose:
console.print(f"[cyan]Extracted {len(extracted_items)} items to temp location[/cyan]")
-
+
# Handle GitHub-style ZIP with a single root directory
source_dir = temp_path
if len(extracted_items) == 1 and extracted_items[0].is_dir():
@@ -621,7 +592,7 @@ def download_and_extract_template(project_path: Path, ai_assistant: str, script_
tracker.complete("flatten")
elif verbose:
console.print(f"[cyan]Found nested directory structure[/cyan]")
-
+
# Copy contents to current directory
for item in source_dir.iterdir():
dest_path = project_path / item.name
@@ -647,7 +618,7 @@ def download_and_extract_template(project_path: Path, ai_assistant: str, script_
else:
# Extract directly to project directory (original behavior)
zip_ref.extractall(project_path)
-
+
# Check what was extracted
extracted_items = list(project_path.iterdir())
if tracker:
@@ -657,7 +628,7 @@ def download_and_extract_template(project_path: Path, ai_assistant: str, script_
console.print(f"[cyan]Extracted {len(extracted_items)} items to {project_path}:[/cyan]")
for item in extracted_items:
console.print(f" - {item.name} ({'dir' if item.is_dir() else 'file'})")
-
+
# Handle GitHub-style ZIP with a single root directory
if len(extracted_items) == 1 and extracted_items[0].is_dir():
# Move contents up one level
@@ -674,7 +645,7 @@ def download_and_extract_template(project_path: Path, ai_assistant: str, script_
tracker.complete("flatten")
elif verbose:
console.print(f"[cyan]Flattened nested directory structure[/cyan]")
-
+
except Exception as e:
if tracker:
tracker.error("extract", str(e))
@@ -700,7 +671,7 @@ def download_and_extract_template(project_path: Path, ai_assistant: str, script_
tracker.complete("cleanup")
elif verbose:
console.print(f"Cleaned up: {zip_path.name}")
-
+
return project_path
@@ -775,15 +746,7 @@ def init(
Examples:
specify init my-project
specify init my-project --ai claude
- specify init my-project --ai gemini
specify init my-project --ai copilot --no-git
- specify init my-project --ai cursor
- specify init my-project --ai qwen
- specify init my-project --ai opencode
- specify init my-project --ai codex
- specify init my-project --ai windsurf
- specify init my-project --ai auggie
- specify init my-project --ai q
specify init --ignore-agent-tools my-project
specify init . --ai claude # Initialize in current directory
specify init . # Initialize in current directory (interactive AI selection)
@@ -792,29 +755,26 @@ def init(
specify init --here
specify init --here --force # Skip confirmation when current directory not empty
"""
- # Show banner first
+
show_banner()
-
+
# Handle '.' as shorthand for current directory (equivalent to --here)
if project_name == ".":
here = True
project_name = None # Clear project_name to use existing validation logic
-
- # Validate arguments
+
if here and project_name:
console.print("[red]Error:[/red] Cannot specify both project name and --here flag")
raise typer.Exit(1)
-
+
if not here and not project_name:
console.print("[red]Error:[/red] Must specify either a project name, use '.' for current directory, or use --here flag")
raise typer.Exit(1)
-
- # Determine project directory
+
if here:
project_name = Path.cwd().name
project_path = Path.cwd()
-
- # Check if current directory has any files
+
existing_items = list(project_path.iterdir())
if existing_items:
console.print(f"[yellow]Warning:[/yellow] Current directory is not empty ({len(existing_items)} items)")
@@ -822,14 +782,12 @@ def init(
if force:
console.print("[cyan]--force supplied: skipping confirmation and proceeding with merge[/cyan]")
else:
- # Ask for confirmation
response = typer.confirm("Do you want to continue?")
if not response:
console.print("[yellow]Operation cancelled[/yellow]")
raise typer.Exit(0)
else:
project_path = Path(project_name).resolve()
- # Check if project directory already exists
if project_path.exists():
error_panel = Panel(
f"Directory '[cyan]{project_name}[/cyan]' already exists\n"
@@ -841,23 +799,22 @@ def init(
console.print()
console.print(error_panel)
raise typer.Exit(1)
-
- # Create formatted setup info with column alignment
+
current_dir = Path.cwd()
-
+
setup_lines = [
"[cyan]Specify Project Setup[/cyan]",
"",
f"{'Project':<15} [green]{project_path.name}[/green]",
f"{'Working Path':<15} [dim]{current_dir}[/dim]",
]
-
+
# Add target path only if different from working dir
if not here:
setup_lines.append(f"{'Target Path':<15} [dim]{project_path}[/dim]")
-
+
console.print(Panel("\n".join(setup_lines), border_style="cyan", padding=(1, 2)))
-
+
# Check git only if we might need it (not --no-git)
# Only set to True if the user wants it and the tool is available
should_init_git = False
@@ -866,7 +823,6 @@ def init(
if not should_init_git:
console.print("[yellow]Git not found - will skip repository initialization[/yellow]")
- # AI assistant selection
if ai_assistant:
if ai_assistant not in AI_CHOICES:
console.print(f"[red]Error:[/red] Invalid AI assistant '{ai_assistant}'. Choose from: {', '.join(AI_CHOICES.keys())}")
@@ -879,7 +835,7 @@ def init(
"Choose your AI assistant:",
"copilot"
)
-
+
# Check agent tools unless ignored
if not ignore_agent_tools:
agent_tool_missing = False
@@ -927,7 +883,7 @@ def init(
console.print()
console.print(error_panel)
raise typer.Exit(1)
-
+
# Determine script type (explicit, interactive, or OS default)
if script_type:
if script_type not in SCRIPT_TYPE_CHOICES:
@@ -942,10 +898,10 @@ def init(
selected_script = select_with_arrows(SCRIPT_TYPE_CHOICES, "Choose script type (or press Enter)", default_script)
else:
selected_script = default_script
-
+
console.print(f"[cyan]Selected AI assistant:[/cyan] {selected_ai}")
console.print(f"[cyan]Selected script type:[/cyan] {selected_script}")
-
+
# Download and set up project
# New tree-based progress (no emojis); include earlier substeps
tracker = StepTracker("Initialize Specify Project")
@@ -1023,7 +979,7 @@ def init(
# Final static tree (ensures finished state visible after Live context ends)
console.print(tracker.render())
console.print("\n[bold green]Project ready.[/bold green]")
-
+
# Agent folder security notice
agent_folder_map = {
"claude": ".claude/",
@@ -1039,7 +995,7 @@ def init(
"roo": ".roo/",
"q": ".amazonq/"
}
-
+
if selected_ai in agent_folder_map:
agent_folder = agent_folder_map[selected_ai]
security_notice = Panel(
@@ -1051,7 +1007,7 @@ def init(
)
console.print()
console.print(security_notice)
-
+
# Boxed "Next steps" section
steps_lines = []
if not here:
@@ -1075,11 +1031,11 @@ def init(
steps_lines.append(f"{step_num}. Start using slash commands with your AI agent:")
- steps_lines.append(" 2.1 [cyan]/constitution[/] - Establish project principles")
- steps_lines.append(" 2.2 [cyan]/specify[/] - Create baseline specification")
- steps_lines.append(" 2.3 [cyan]/plan[/] - Create implementation plan")
- steps_lines.append(" 2.4 [cyan]/tasks[/] - Generate actionable tasks")
- steps_lines.append(" 2.5 [cyan]/implement[/] - Execute implementation")
+ steps_lines.append(" 2.1 [cyan]/speckit.constitution[/] - Establish project principles")
+ steps_lines.append(" 2.2 [cyan]/speckit.specify[/] - Create baseline specification")
+ steps_lines.append(" 2.3 [cyan]/speckit.plan[/] - Create implementation plan")
+ steps_lines.append(" 2.4 [cyan]/speckit.tasks[/] - Generate actionable tasks")
+ steps_lines.append(" 2.5 [cyan]/speckit.implement[/] - Execute implementation")
steps_panel = Panel("\n".join(steps_lines), title="Next Steps", border_style="cyan", padding=(1,2))
console.print()
@@ -1088,8 +1044,9 @@ def init(
enhancement_lines = [
"Optional commands that you can use for your specs [bright_black](improve quality & confidence)[/bright_black]",
"",
- f"β [cyan]/clarify[/] [bright_black](optional)[/bright_black] - Ask structured questions to de-risk ambiguous areas before planning (run before [cyan]/plan[/] if used)",
- f"β [cyan]/analyze[/] [bright_black](optional)[/bright_black] - Cross-artifact consistency & alignment report (after [cyan]/tasks[/], before [cyan]/implement[/])"
+ f"β [cyan]/speckit.clarify[/] [bright_black](optional)[/bright_black] - Ask structured questions to de-risk ambiguous areas before planning (run before [cyan]/speckit.plan[/] if used)",
+ f"β [cyan]/speckit.analyze[/] [bright_black](optional)[/bright_black] - Cross-artifact consistency & alignment report (after [cyan]/speckit.tasks[/], before [cyan]/speckit.implement[/])",
+ f"β [cyan]/speckit.checklist[/] [bright_black](optional)[/bright_black] - Generate quality checklists to validate requirements completeness, clarity, and consistency (after [cyan]/speckit.plan[/])"
]
enhancements_panel = Panel("\n".join(enhancement_lines), title="Enhancement Commands", border_style="cyan", padding=(1,2))
console.print()
@@ -1102,7 +1059,7 @@ def check():
console.print("[bold]Checking for installed tools...[/bold]\n")
tracker = StepTracker("Check Available Tools")
-
+
tracker.add("git", "Git version control")
tracker.add("claude", "Claude Code CLI")
tracker.add("gemini", "Gemini CLI")
@@ -1116,7 +1073,7 @@ def check():
tracker.add("codex", "Codex CLI")
tracker.add("auggie", "Auggie CLI")
tracker.add("q", "Amazon Q Developer CLI")
-
+
git_ok = check_tool_for_tracker("git", tracker)
claude_ok = check_tool_for_tracker("claude", tracker)
gemini_ok = check_tool_for_tracker("gemini", tracker)
@@ -1140,10 +1097,8 @@ def check():
if not (claude_ok or gemini_ok or cursor_ok or qwen_ok or windsurf_ok or kilocode_ok or opencode_ok or codex_ok or auggie_ok or q_ok):
console.print("[dim]Tip: Install an AI assistant for the best experience[/dim]")
-
def main():
app()
-
if __name__ == "__main__":
main()
diff --git a/templates/checklist-template.md b/templates/checklist-template.md
new file mode 100644
index 00000000..806657da
--- /dev/null
+++ b/templates/checklist-template.md
@@ -0,0 +1,40 @@
+# [CHECKLIST TYPE] Checklist: [FEATURE NAME]
+
+**Purpose**: [Brief description of what this checklist covers]
+**Created**: [DATE]
+**Feature**: [Link to spec.md or relevant documentation]
+
+**Note**: This checklist is generated by the `/speckit.checklist` command based on feature context and requirements.
+
+
+
+## [Category 1]
+
+- [ ] CHK001 First checklist item with clear action
+- [ ] CHK002 Second checklist item
+- [ ] CHK003 Third checklist item
+
+## [Category 2]
+
+- [ ] CHK004 Another category item
+- [ ] CHK005 Item with specific criteria
+- [ ] CHK006 Final item in this category
+
+## Notes
+
+- Check items off as completed: `[x]`
+- Add comments or findings inline
+- Link to relevant resources or documentation
+- Items are numbered sequentially for easy reference
diff --git a/templates/commands/analyze.md b/templates/commands/analyze.md
index c07d550b..ab11284c 100644
--- a/templates/commands/analyze.md
+++ b/templates/commands/analyze.md
@@ -5,100 +5,182 @@ scripts:
ps: scripts/powershell/check-prerequisites.ps1 -Json -RequireTasks -IncludeTasks
---
-The user input to you can be provided directly by the agent or as a command argument - you **MUST** consider it before proceeding with the prompt (if not empty).
-
-User input:
+## User Input
+```text
$ARGUMENTS
+```
-Goal: Identify inconsistencies, duplications, ambiguities, and underspecified items across the three core artifacts (`spec.md`, `plan.md`, `tasks.md`) before implementation. This command MUST run only after `/tasks` has successfully produced a complete `tasks.md`.
+You **MUST** consider the user input before proceeding (if not empty).
-STRICTLY READ-ONLY: Do **not** modify any files. Output a structured analysis report. Offer an optional remediation plan (user must explicitly approve before any follow-up editing commands would be invoked manually).
+## Goal
-Constitution Authority: The project constitution (`/memory/constitution.md`) is **non-negotiable** within this analysis scope. Constitution conflicts are automatically CRITICAL and require adjustment of the spec, plan, or tasksβnot dilution, reinterpretation, or silent ignoring of the principle. If a principle itself needs to change, that must occur in a separate, explicit constitution update outside `/analyze`.
+Identify inconsistencies, duplications, ambiguities, and underspecified items across the three core artifacts (`spec.md`, `plan.md`, `tasks.md`) before implementation. This command MUST run only after `/tasks` has successfully produced a complete `tasks.md`.
-Execution steps:
+## Operating Constraints
-1. Run `{SCRIPT}` once from repo root and parse JSON for FEATURE_DIR and AVAILABLE_DOCS. Derive absolute paths:
- - SPEC = FEATURE_DIR/spec.md
- - PLAN = FEATURE_DIR/plan.md
- - TASKS = FEATURE_DIR/tasks.md
- Abort with an error message if any required file is missing (instruct the user to run missing prerequisite command).
+**STRICTLY READ-ONLY**: Do **not** modify any files. Output a structured analysis report. Offer an optional remediation plan (user must explicitly approve before any follow-up editing commands would be invoked manually).
-2. Load artifacts:
- - Parse spec.md sections: Overview/Context, Functional Requirements, Non-Functional Requirements, User Stories, Edge Cases (if present).
- - Parse plan.md: Architecture/stack choices, Data Model references, Phases, Technical constraints.
- - Parse tasks.md: Task IDs, descriptions, phase grouping, parallel markers [P], referenced file paths.
- - Load constitution `/memory/constitution.md` for principle validation.
+**Constitution Authority**: The project constitution (`/memory/constitution.md`) is **non-negotiable** within this analysis scope. Constitution conflicts are automatically CRITICAL and require adjustment of the spec, plan, or tasksβnot dilution, reinterpretation, or silent ignoring of the principle. If a principle itself needs to change, that must occur in a separate, explicit constitution update outside `/analyze`.
-3. Build internal semantic models:
- - Requirements inventory: Each functional + non-functional requirement with a stable key (derive slug based on imperative phrase; e.g., "User can upload file" -> `user-can-upload-file`).
- - User story/action inventory.
- - Task coverage mapping: Map each task to one or more requirements or stories (inference by keyword / explicit reference patterns like IDs or key phrases).
- - Constitution rule set: Extract principle names and any MUST/SHOULD normative statements.
+## Execution Steps
-4. Detection passes:
- A. Duplication detection:
- - Identify near-duplicate requirements. Mark lower-quality phrasing for consolidation.
- B. Ambiguity detection:
- - Flag vague adjectives (fast, scalable, secure, intuitive, robust) lacking measurable criteria.
- - Flag unresolved placeholders (TODO, TKTK, ???, , etc.).
- C. Underspecification:
- - Requirements with verbs but missing object or measurable outcome.
- - User stories missing acceptance criteria alignment.
- - Tasks referencing files or components not defined in spec/plan.
- D. Constitution alignment:
- - Any requirement or plan element conflicting with a MUST principle.
- - Missing mandated sections or quality gates from constitution.
- E. Coverage gaps:
- - Requirements with zero associated tasks.
- - Tasks with no mapped requirement/story.
- - Non-functional requirements not reflected in tasks (e.g., performance, security).
- F. Inconsistency:
- - Terminology drift (same concept named differently across files).
- - Data entities referenced in plan but absent in spec (or vice versa).
- - Task ordering contradictions (e.g., integration tasks before foundational setup tasks without dependency note).
- - Conflicting requirements (e.g., one requires to use Next.js while other says to use Vue as the framework).
+### 1. Initialize Analysis Context
-5. Severity assignment heuristic:
- - CRITICAL: Violates constitution MUST, missing core spec artifact, or requirement with zero coverage that blocks baseline functionality.
- - HIGH: Duplicate or conflicting requirement, ambiguous security/performance attribute, untestable acceptance criterion.
- - MEDIUM: Terminology drift, missing non-functional task coverage, underspecified edge case.
- - LOW: Style/wording improvements, minor redundancy not affecting execution order.
+Run `{SCRIPT}` once from repo root and parse JSON for FEATURE_DIR and AVAILABLE_DOCS. Derive absolute paths:
-6. Produce a Markdown report (no file writes) with sections:
+- SPEC = FEATURE_DIR/spec.md
+- PLAN = FEATURE_DIR/plan.md
+- TASKS = FEATURE_DIR/tasks.md
- ### Specification Analysis Report
- | ID | Category | Severity | Location(s) | Summary | Recommendation |
- |----|----------|----------|-------------|---------|----------------|
- | A1 | Duplication | HIGH | spec.md:L120-134 | Two similar requirements ... | Merge phrasing; keep clearer version |
- (Add one row per finding; generate stable IDs prefixed by category initial.)
+Abort with an error message if any required file is missing (instruct the user to run missing prerequisite command).
- Additional subsections:
- - Coverage Summary Table:
- | Requirement Key | Has Task? | Task IDs | Notes |
- - Constitution Alignment Issues (if any)
- - Unmapped Tasks (if any)
- - Metrics:
- * Total Requirements
- * Total Tasks
- * Coverage % (requirements with >=1 task)
- * Ambiguity Count
- * Duplication Count
- * Critical Issues Count
+### 2. Load Artifacts (Progressive Disclosure)
-7. At end of report, output a concise Next Actions block:
- - If CRITICAL issues exist: Recommend resolving before `/implement`.
- - If only LOW/MEDIUM: User may proceed, but provide improvement suggestions.
- - Provide explicit command suggestions: e.g., "Run /specify with refinement", "Run /plan to adjust architecture", "Manually edit tasks.md to add coverage for 'performance-metrics'".
+Load only the minimal necessary context from each artifact:
-8. Ask the user: "Would you like me to suggest concrete remediation edits for the top N issues?" (Do NOT apply them automatically.)
+**From spec.md:**
-Behavior rules:
-- NEVER modify files.
-- NEVER hallucinate missing sectionsβif absent, report them.
-- KEEP findings deterministic: if rerun without changes, produce consistent IDs and counts.
-- LIMIT total findings in the main table to 50; aggregate remainder in a summarized overflow note.
-- If zero issues found, emit a success report with coverage statistics and proceed recommendation.
+- Overview/Context
+- Functional Requirements
+- Non-Functional Requirements
+- User Stories
+- Edge Cases (if present)
-Context: {ARGS}
+**From plan.md:**
+
+- Architecture/stack choices
+- Data Model references
+- Phases
+- Technical constraints
+
+**From tasks.md:**
+
+- Task IDs
+- Descriptions
+- Phase grouping
+- Parallel markers [P]
+- Referenced file paths
+
+**From constitution:**
+
+- Load `/memory/constitution.md` for principle validation
+
+### 3. Build Semantic Models
+
+Create internal representations (do not include raw artifacts in output):
+
+- **Requirements inventory**: Each functional + non-functional requirement with a stable key (derive slug based on imperative phrase; e.g., "User can upload file" β `user-can-upload-file`)
+- **User story/action inventory**: Discrete user actions with acceptance criteria
+- **Task coverage mapping**: Map each task to one or more requirements or stories (inference by keyword / explicit reference patterns like IDs or key phrases)
+- **Constitution rule set**: Extract principle names and MUST/SHOULD normative statements
+
+### 4. Detection Passes (Token-Efficient Analysis)
+
+Focus on high-signal findings. Limit to 50 findings total; aggregate remainder in overflow summary.
+
+#### A. Duplication Detection
+
+- Identify near-duplicate requirements
+- Mark lower-quality phrasing for consolidation
+
+#### B. Ambiguity Detection
+
+- Flag vague adjectives (fast, scalable, secure, intuitive, robust) lacking measurable criteria
+- Flag unresolved placeholders (TODO, TKTK, ???, ``, etc.)
+
+#### C. Underspecification
+
+- Requirements with verbs but missing object or measurable outcome
+- User stories missing acceptance criteria alignment
+- Tasks referencing files or components not defined in spec/plan
+
+#### D. Constitution Alignment
+
+- Any requirement or plan element conflicting with a MUST principle
+- Missing mandated sections or quality gates from constitution
+
+#### E. Coverage Gaps
+
+- Requirements with zero associated tasks
+- Tasks with no mapped requirement/story
+- Non-functional requirements not reflected in tasks (e.g., performance, security)
+
+#### F. Inconsistency
+
+- Terminology drift (same concept named differently across files)
+- Data entities referenced in plan but absent in spec (or vice versa)
+- Task ordering contradictions (e.g., integration tasks before foundational setup tasks without dependency note)
+- Conflicting requirements (e.g., one requires Next.js while other specifies Vue)
+
+### 5. Severity Assignment
+
+Use this heuristic to prioritize findings:
+
+- **CRITICAL**: Violates constitution MUST, missing core spec artifact, or requirement with zero coverage that blocks baseline functionality
+- **HIGH**: Duplicate or conflicting requirement, ambiguous security/performance attribute, untestable acceptance criterion
+- **MEDIUM**: Terminology drift, missing non-functional task coverage, underspecified edge case
+- **LOW**: Style/wording improvements, minor redundancy not affecting execution order
+
+### 6. Produce Compact Analysis Report
+
+Output a Markdown report (no file writes) with the following structure:
+
+## Specification Analysis Report
+
+| ID | Category | Severity | Location(s) | Summary | Recommendation |
+|----|----------|----------|-------------|---------|----------------|
+| A1 | Duplication | HIGH | spec.md:L120-134 | Two similar requirements ... | Merge phrasing; keep clearer version |
+
+(Add one row per finding; generate stable IDs prefixed by category initial.)
+
+**Coverage Summary Table:**
+
+| Requirement Key | Has Task? | Task IDs | Notes |
+|-----------------|-----------|----------|-------|
+
+**Constitution Alignment Issues:** (if any)
+
+**Unmapped Tasks:** (if any)
+
+**Metrics:**
+
+- Total Requirements
+- Total Tasks
+- Coverage % (requirements with >=1 task)
+- Ambiguity Count
+- Duplication Count
+- Critical Issues Count
+
+### 7. Provide Next Actions
+
+At end of report, output a concise Next Actions block:
+
+- If CRITICAL issues exist: Recommend resolving before `/implement`
+- If only LOW/MEDIUM: User may proceed, but provide improvement suggestions
+- Provide explicit command suggestions: e.g., "Run /specify with refinement", "Run /plan to adjust architecture", "Manually edit tasks.md to add coverage for 'performance-metrics'"
+
+### 8. Offer Remediation
+
+Ask the user: "Would you like me to suggest concrete remediation edits for the top N issues?" (Do NOT apply them automatically.)
+
+## Operating Principles
+
+### Context Efficiency
+
+- **Minimal high-signal tokens**: Focus on actionable findings, not exhaustive documentation
+- **Progressive disclosure**: Load artifacts incrementally; don't dump all content into analysis
+- **Token-efficient output**: Limit findings table to 50 rows; summarize overflow
+- **Deterministic results**: Rerunning without changes should produce consistent IDs and counts
+
+### Analysis Guidelines
+
+- **NEVER modify files** (this is read-only analysis)
+- **NEVER hallucinate missing sections** (if absent, report them accurately)
+- **Prioritize constitution violations** (these are always CRITICAL)
+- **Use examples over exhaustive rules** (cite specific instances, not generic patterns)
+- **Report zero issues gracefully** (emit success report with coverage statistics)
+
+## Context
+
+{ARGS}
diff --git a/templates/commands/checklist.md b/templates/commands/checklist.md
new file mode 100644
index 00000000..b148b2d8
--- /dev/null
+++ b/templates/commands/checklist.md
@@ -0,0 +1,289 @@
+---
+description: Generate a custom checklist for the current feature based on user requirements.
+scripts:
+ sh: scripts/bash/check-prerequisites.sh --json
+ ps: scripts/powershell/check-prerequisites.ps1 -Json
+---
+
+## Checklist Purpose: "Unit Tests for English"
+
+**CRITICAL CONCEPT**: Checklists are **UNIT TESTS FOR REQUIREMENTS WRITING** - they validate the quality, clarity, and completeness of requirements in a given domain.
+
+**NOT for verification/testing**:
+- β NOT "Verify the button clicks correctly"
+- β NOT "Test error handling works"
+- β NOT "Confirm the API returns 200"
+- β NOT checking if code/implementation matches the spec
+
+**FOR requirements quality validation**:
+- β
"Are visual hierarchy requirements defined for all card types?" (completeness)
+- β
"Is 'prominent display' quantified with specific sizing/positioning?" (clarity)
+- β
"Are hover state requirements consistent across all interactive elements?" (consistency)
+- β
"Are accessibility requirements defined for keyboard navigation?" (coverage)
+- β
"Does the spec define what happens when logo image fails to load?" (edge cases)
+
+**Metaphor**: If your spec is code written in English, the checklist is its unit test suite. You're testing whether the requirements are well-written, complete, unambiguous, and ready for implementation - NOT whether the implementation works.
+
+## User Input
+
+```text
+$ARGUMENTS
+```
+
+You **MUST** consider the user input before proceeding (if not empty).
+
+## Execution Steps
+
+1. **Setup**: Run `{SCRIPT}` from repo root and parse JSON for FEATURE_DIR and AVAILABLE_DOCS list.
+ - All file paths must be absolute.
+
+2. **Clarify intent (dynamic)**: Derive up to THREE initial contextual clarifying questions (no pre-baked catalog). They MUST:
+ - Be generated from the user's phrasing + extracted signals from spec/plan/tasks
+ - Only ask about information that materially changes checklist content
+ - Be skipped individually if already unambiguous in `$ARGUMENTS`
+ - Prefer precision over breadth
+
+ Generation algorithm:
+ 1. Extract signals: feature domain keywords (e.g., auth, latency, UX, API), risk indicators ("critical", "must", "compliance"), stakeholder hints ("QA", "review", "security team"), and explicit deliverables ("a11y", "rollback", "contracts").
+ 2. Cluster signals into candidate focus areas (max 4) ranked by relevance.
+ 3. Identify probable audience & timing (author, reviewer, QA, release) if not explicit.
+ 4. Detect missing dimensions: scope breadth, depth/rigor, risk emphasis, exclusion boundaries, measurable acceptance criteria.
+ 5. Formulate questions chosen from these archetypes:
+ - Scope refinement (e.g., "Should this include integration touchpoints with X and Y or stay limited to local module correctness?")
+ - Risk prioritization (e.g., "Which of these potential risk areas should receive mandatory gating checks?")
+ - Depth calibration (e.g., "Is this a lightweight pre-commit sanity list or a formal release gate?")
+ - Audience framing (e.g., "Will this be used by the author only or peers during PR review?")
+ - Boundary exclusion (e.g., "Should we explicitly exclude performance tuning items this round?")
+ - Scenario class gap (e.g., "No recovery flows detectedβare rollback / partial failure paths in scope?")
+
+ Question formatting rules:
+ - If presenting options, generate a compact table with columns: Option | Candidate | Why It Matters
+ - Limit to AβE options maximum; omit table if a free-form answer is clearer
+ - Never ask the user to restate what they already said
+ - Avoid speculative categories (no hallucination). If uncertain, ask explicitly: "Confirm whether X belongs in scope."
+
+ Defaults when interaction impossible:
+ - Depth: Standard
+ - Audience: Reviewer (PR) if code-related; Author otherwise
+ - Focus: Top 2 relevance clusters
+
+ Output the questions (label Q1/Q2/Q3). After answers: if β₯2 scenario classes (Alternate / Exception / Recovery / Non-Functional domain) remain unclear, you MAY ask up to TWO more targeted followβups (Q4/Q5) with a one-line justification each (e.g., "Unresolved recovery path risk"). Do not exceed five total questions. Skip escalation if user explicitly declines more.
+
+3. **Understand user request**: Combine `$ARGUMENTS` + clarifying answers:
+ - Derive checklist theme (e.g., security, review, deploy, ux)
+ - Consolidate explicit must-have items mentioned by user
+ - Map focus selections to category scaffolding
+ - Infer any missing context from spec/plan/tasks (do NOT hallucinate)
+
+4. **Load feature context**: Read from FEATURE_DIR:
+ - spec.md: Feature requirements and scope
+ - plan.md (if exists): Technical details, dependencies
+ - tasks.md (if exists): Implementation tasks
+
+ **Context Loading Strategy**:
+ - Load only necessary portions relevant to active focus areas (avoid full-file dumping)
+ - Prefer summarizing long sections into concise scenario/requirement bullets
+ - Use progressive disclosure: add follow-on retrieval only if gaps detected
+ - If source docs are large, generate interim summary items instead of embedding raw text
+
+5. **Generate checklist** - Create "Unit Tests for Requirements":
+ - Create `FEATURE_DIR/checklists/` directory if it doesn't exist
+ - Generate unique checklist filename:
+ - Use short, descriptive name based on domain (e.g., `ux.md`, `api.md`, `security.md`)
+ - Format: `[domain].md`
+ - If file exists, append to existing file
+ - Number items sequentially starting from CHK001
+ - Each `/speckit.checklist` run creates a NEW file (never overwrites existing checklists)
+
+ **CORE PRINCIPLE - Test the Requirements, Not the Implementation**:
+ Every checklist item MUST evaluate the REQUIREMENTS THEMSELVES for:
+ - **Completeness**: Are all necessary requirements present?
+ - **Clarity**: Are requirements unambiguous and specific?
+ - **Consistency**: Do requirements align with each other?
+ - **Measurability**: Can requirements be objectively verified?
+ - **Coverage**: Are all scenarios/edge cases addressed?
+
+ **Category Structure** - Group items by requirement quality dimensions:
+ - **Requirement Completeness** (Are all necessary requirements documented?)
+ - **Requirement Clarity** (Are requirements specific and unambiguous?)
+ - **Requirement Consistency** (Do requirements align without conflicts?)
+ - **Acceptance Criteria Quality** (Are success criteria measurable?)
+ - **Scenario Coverage** (Are all flows/cases addressed?)
+ - **Edge Case Coverage** (Are boundary conditions defined?)
+ - **Non-Functional Requirements** (Performance, Security, Accessibility, etc. - are they specified?)
+ - **Dependencies & Assumptions** (Are they documented and validated?)
+ - **Ambiguities & Conflicts** (What needs clarification?)
+
+ **HOW TO WRITE CHECKLIST ITEMS - "Unit Tests for English"**:
+
+ β **WRONG** (Testing implementation):
+ - "Verify landing page displays 3 episode cards"
+ - "Test hover states work on desktop"
+ - "Confirm logo click navigates home"
+
+ β
**CORRECT** (Testing requirements quality):
+ - "Are the exact number and layout of featured episodes specified?" [Completeness]
+ - "Is 'prominent display' quantified with specific sizing/positioning?" [Clarity]
+ - "Are hover state requirements consistent across all interactive elements?" [Consistency]
+ - "Are keyboard navigation requirements defined for all interactive UI?" [Coverage]
+ - "Is the fallback behavior specified when logo image fails to load?" [Edge Cases]
+ - "Are loading states defined for asynchronous episode data?" [Completeness]
+ - "Does the spec define visual hierarchy for competing UI elements?" [Clarity]
+
+ **ITEM STRUCTURE**:
+ Each item should follow this pattern:
+ - Question format asking about requirement quality
+ - Focus on what's WRITTEN (or not written) in the spec/plan
+ - Include quality dimension in brackets [Completeness/Clarity/Consistency/etc.]
+ - Reference spec section `[Spec Β§X.Y]` when checking existing requirements
+ - Use `[Gap]` marker when checking for missing requirements
+
+ **EXAMPLES BY QUALITY DIMENSION**:
+
+ Completeness:
+ - "Are error handling requirements defined for all API failure modes? [Gap]"
+ - "Are accessibility requirements specified for all interactive elements? [Completeness]"
+ - "Are mobile breakpoint requirements defined for responsive layouts? [Gap]"
+
+ Clarity:
+ - "Is 'fast loading' quantified with specific timing thresholds? [Clarity, Spec Β§NFR-2]"
+ - "Are 'related episodes' selection criteria explicitly defined? [Clarity, Spec Β§FR-5]"
+ - "Is 'prominent' defined with measurable visual properties? [Ambiguity, Spec Β§FR-4]"
+
+ Consistency:
+ - "Do navigation requirements align across all pages? [Consistency, Spec Β§FR-10]"
+ - "Are card component requirements consistent between landing and detail pages? [Consistency]"
+
+ Coverage:
+ - "Are requirements defined for zero-state scenarios (no episodes)? [Coverage, Edge Case]"
+ - "Are concurrent user interaction scenarios addressed? [Coverage, Gap]"
+ - "Are requirements specified for partial data loading failures? [Coverage, Exception Flow]"
+
+ Measurability:
+ - "Are visual hierarchy requirements measurable/testable? [Acceptance Criteria, Spec Β§FR-1]"
+ - "Can 'balanced visual weight' be objectively verified? [Measurability, Spec Β§FR-2]"
+
+ **Scenario Classification & Coverage** (Requirements Quality Focus):
+ - Check if requirements exist for: Primary, Alternate, Exception/Error, Recovery, Non-Functional scenarios
+ - For each scenario class, ask: "Are [scenario type] requirements complete, clear, and consistent?"
+ - If scenario class missing: "Are [scenario type] requirements intentionally excluded or missing? [Gap]"
+ - Include resilience/rollback when state mutation occurs: "Are rollback requirements defined for migration failures? [Gap]"
+
+ **Traceability Requirements**:
+ - MINIMUM: β₯80% of items MUST include at least one traceability reference
+ - Each item should reference: spec section `[Spec Β§X.Y]`, or use markers: `[Gap]`, `[Ambiguity]`, `[Conflict]`, `[Assumption]`
+ - If no ID system exists: "Is a requirement & acceptance criteria ID scheme established? [Traceability]"
+
+ **Surface & Resolve Issues** (Requirements Quality Problems):
+ Ask questions about the requirements themselves:
+ - Ambiguities: "Is the term 'fast' quantified with specific metrics? [Ambiguity, Spec Β§NFR-1]"
+ - Conflicts: "Do navigation requirements conflict between Β§FR-10 and Β§FR-10a? [Conflict]"
+ - Assumptions: "Is the assumption of 'always available podcast API' validated? [Assumption]"
+ - Dependencies: "Are external podcast API requirements documented? [Dependency, Gap]"
+ - Missing definitions: "Is 'visual hierarchy' defined with measurable criteria? [Gap]"
+
+ **Content Consolidation**:
+ - Soft cap: If raw candidate items > 40, prioritize by risk/impact
+ - Merge near-duplicates checking the same requirement aspect
+ - If >5 low-impact edge cases, create one item: "Are edge cases X, Y, Z addressed in requirements? [Coverage]"
+
+ **π« ABSOLUTELY PROHIBITED** - These make it an implementation test, not a requirements test:
+ - β Any item starting with "Verify", "Test", "Confirm", "Check" + implementation behavior
+ - β References to code execution, user actions, system behavior
+ - β "Displays correctly", "works properly", "functions as expected"
+ - β "Click", "navigate", "render", "load", "execute"
+ - β Test cases, test plans, QA procedures
+ - β Implementation details (frameworks, APIs, algorithms)
+
+ **β
REQUIRED PATTERNS** - These test requirements quality:
+ - β
"Are [requirement type] defined/specified/documented for [scenario]?"
+ - β
"Is [vague term] quantified/clarified with specific criteria?"
+ - β
"Are requirements consistent between [section A] and [section B]?"
+ - β
"Can [requirement] be objectively measured/verified?"
+ - β
"Are [edge cases/scenarios] addressed in requirements?"
+ - β
"Does the spec define [missing aspect]?"
+
+6. **Structure Reference**: Generate the checklist following the canonical template in `templates/checklist-template.md` for title, meta section, category headings, and ID formatting. If template is unavailable, use: H1 title, purpose/created meta lines, `##` category sections containing `- [ ] CHK### ` lines with globally incrementing IDs starting at CHK001.
+
+7. **Report**: Output full path to created checklist, item count, and remind user that each run creates a new file. Summarize:
+ - Focus areas selected
+ - Depth level
+ - Actor/timing
+ - Any explicit user-specified must-have items incorporated
+
+**Important**: Each `/speckit.checklist` command invocation creates a checklist file using short, descriptive names unless file already exists. This allows:
+
+- Multiple checklists of different types (e.g., `ux.md`, `test.md`, `security.md`)
+- Simple, memorable filenames that indicate checklist purpose
+- Easy identification and navigation in the `checklists/` folder
+
+To avoid clutter, use descriptive types and clean up obsolete checklists when done.
+
+## Example Checklist Types & Sample Items
+
+**UX Requirements Quality:** `ux.md`
+
+Sample items (testing the requirements, NOT the implementation):
+- "Are visual hierarchy requirements defined with measurable criteria? [Clarity, Spec Β§FR-1]"
+- "Is the number and positioning of UI elements explicitly specified? [Completeness, Spec Β§FR-1]"
+- "Are interaction state requirements (hover, focus, active) consistently defined? [Consistency]"
+- "Are accessibility requirements specified for all interactive elements? [Coverage, Gap]"
+- "Is fallback behavior defined when images fail to load? [Edge Case, Gap]"
+- "Can 'prominent display' be objectively measured? [Measurability, Spec Β§FR-4]"
+
+**API Requirements Quality:** `api.md`
+
+Sample items:
+- "Are error response formats specified for all failure scenarios? [Completeness]"
+- "Are rate limiting requirements quantified with specific thresholds? [Clarity]"
+- "Are authentication requirements consistent across all endpoints? [Consistency]"
+- "Are retry/timeout requirements defined for external dependencies? [Coverage, Gap]"
+- "Is versioning strategy documented in requirements? [Gap]"
+
+**Performance Requirements Quality:** `performance.md`
+
+Sample items:
+- "Are performance requirements quantified with specific metrics? [Clarity]"
+- "Are performance targets defined for all critical user journeys? [Coverage]"
+- "Are performance requirements under different load conditions specified? [Completeness]"
+- "Can performance requirements be objectively measured? [Measurability]"
+- "Are degradation requirements defined for high-load scenarios? [Edge Case, Gap]"
+
+**Security Requirements Quality:** `security.md`
+
+Sample items:
+- "Are authentication requirements specified for all protected resources? [Coverage]"
+- "Are data protection requirements defined for sensitive information? [Completeness]"
+- "Is the threat model documented and requirements aligned to it? [Traceability]"
+- "Are security requirements consistent with compliance obligations? [Consistency]"
+- "Are security failure/breach response requirements defined? [Gap, Exception Flow]"
+
+## Anti-Examples: What NOT To Do
+
+**β WRONG - These test implementation, not requirements:**
+
+```markdown
+- [ ] CHK001 - Verify landing page displays 3 episode cards [Spec Β§FR-001]
+- [ ] CHK002 - Test hover states work correctly on desktop [Spec Β§FR-003]
+- [ ] CHK003 - Confirm logo click navigates to home page [Spec Β§FR-010]
+- [ ] CHK004 - Check that related episodes section shows 3-5 items [Spec Β§FR-005]
+```
+
+**β
CORRECT - These test requirements quality:**
+
+```markdown
+- [ ] CHK001 - Are the number and layout of featured episodes explicitly specified? [Completeness, Spec Β§FR-001]
+- [ ] CHK002 - Are hover state requirements consistently defined for all interactive elements? [Consistency, Spec Β§FR-003]
+- [ ] CHK003 - Are navigation requirements clear for all clickable brand elements? [Clarity, Spec Β§FR-010]
+- [ ] CHK004 - Is the selection criteria for related episodes documented? [Gap, Spec Β§FR-005]
+- [ ] CHK005 - Are loading state requirements defined for asynchronous episode data? [Gap]
+- [ ] CHK006 - Can "visual hierarchy" requirements be objectively measured? [Measurability, Spec Β§FR-001]
+```
+
+**Key Differences:**
+- Wrong: Tests if the system works correctly
+- Correct: Tests if the requirements are written correctly
+- Wrong: Verification of behavior
+- Correct: Validation of requirement quality
+- Wrong: "Does it do X?"
+- Correct: "Is X clearly specified?"
diff --git a/templates/commands/clarify.md b/templates/commands/clarify.md
index e3f4a79d..9d84a3c4 100644
--- a/templates/commands/clarify.md
+++ b/templates/commands/clarify.md
@@ -5,15 +5,19 @@ scripts:
ps: scripts/powershell/check-prerequisites.ps1 -Json -PathsOnly
---
-The user input to you can be provided directly by the agent or as a command argument - you **MUST** consider it before proceeding with the prompt (if not empty).
-
-User input:
+## User Input
+```text
$ARGUMENTS
+```
+
+You **MUST** consider the user input before proceeding (if not empty).
+
+## Outline
Goal: Detect and reduce ambiguity or missing decision points in the active feature specification and record the clarifications directly in the spec file.
-Note: This clarification workflow is expected to run (and be completed) BEFORE invoking `/plan`. If the user explicitly states they are skipping clarification (e.g., exploratory spike), you may proceed, but must warn that downstream rework risk increases.
+Note: This clarification workflow is expected to run (and be completed) BEFORE invoking `/speckit.plan`. If the user explicitly states they are skipping clarification (e.g., exploratory spike), you may proceed, but must warn that downstream rework risk increases.
Execution steps:
@@ -21,7 +25,7 @@ Execution steps:
- `FEATURE_DIR`
- `FEATURE_SPEC`
- (Optionally capture `IMPL_PLAN`, `TASKS` for future chained flows.)
- - If JSON parsing fails, abort and instruct user to re-run `/specify` or verify feature branch environment.
+ - If JSON parsing fails, abort and instruct user to re-run `/speckit.specify` or verify feature branch environment.
2. Load the current spec file. Perform a structured ambiguity & coverage scan using this taxonomy. For each category, mark status: Clear / Partial / Missing. Produce an internal coverage map used for prioritization (do not output raw map unless no questions will be asked).
@@ -80,7 +84,7 @@ Execution steps:
- Information is better deferred to planning phase (note internally)
3. Generate (internally) a prioritized queue of candidate clarification questions (maximum 5). Do NOT output them all at once. Apply these constraints:
- - Maximum of 5 total questions across the whole session.
+ - Maximum of 10 total questions across the whole session.
- Each question must be answerable with EITHER:
* A short multipleβchoice selection (2β5 distinct, mutually exclusive options), OR
* A one-word / shortβphrase answer (explicitly constrain: "Answer in <=5 words").
@@ -146,12 +150,12 @@ Execution steps:
- Path to updated spec.
- Sections touched (list names).
- Coverage summary table listing each taxonomy category with Status: Resolved (was Partial/Missing and addressed), Deferred (exceeds question quota or better suited for planning), Clear (already sufficient), Outstanding (still Partial/Missing but low impact).
- - If any Outstanding or Deferred remain, recommend whether to proceed to `/plan` or run `/clarify` again later post-plan.
+ - If any Outstanding or Deferred remain, recommend whether to proceed to `/speckit.plan` or run `/speckit.clarify` again later post-plan.
- Suggested next command.
Behavior rules:
- If no meaningful ambiguities found (or all potential questions would be low-impact), respond: "No critical ambiguities detected worth formal clarification." and suggest proceeding.
-- If spec file missing, instruct user to run `/specify` first (do not create a new spec here).
+- If spec file missing, instruct user to run `/speckit.specify` first (do not create a new spec here).
- Never exceed 5 total asked questions (clarification retries for a single question do not count as new questions).
- Avoid speculative tech stack questions unless the absence blocks functional clarity.
- Respect user early termination signals ("stop", "done", "proceed").
diff --git a/templates/commands/constitution.md b/templates/commands/constitution.md
index 605e9363..f6f8b243 100644
--- a/templates/commands/constitution.md
+++ b/templates/commands/constitution.md
@@ -2,11 +2,15 @@
description: Create or update the project constitution from interactive or provided principle inputs, ensuring all dependent templates stay in sync.
---
-The user input to you can be provided directly by the agent or as a command argument - you **MUST** consider it before proceeding with the prompt (if not empty).
-
-User input:
+## User Input
+```text
$ARGUMENTS
+```
+
+You **MUST** consider the user input before proceeding (if not empty).
+
+## Outline
You are updating the project constitution at `/memory/constitution.md`. This file is a TEMPLATE containing placeholder tokens in square brackets (e.g. `[PROJECT_NAME]`, `[PRINCIPLE_1_NAME]`). Your job is to (a) collect/derive concrete values, (b) fill the template precisely, and (c) propagate any amendments across dependent artifacts.
diff --git a/templates/commands/implement.md b/templates/commands/implement.md
index ff2f1b69..6478e9e7 100644
--- a/templates/commands/implement.md
+++ b/templates/commands/implement.md
@@ -5,15 +5,48 @@ scripts:
ps: scripts/powershell/check-prerequisites.ps1 -Json -RequireTasks -IncludeTasks
---
-The user input can be provided directly by the agent or as a command argument - you **MUST** consider it before proceeding with the prompt (if not empty).
-
-User input:
+## User Input
+```text
$ARGUMENTS
+```
+
+You **MUST** consider the user input before proceeding (if not empty).
+
+## Outline
1. Run `{SCRIPT}` from repo root and parse FEATURE_DIR and AVAILABLE_DOCS list. All paths must be absolute.
-2. Load and analyze the implementation context:
+2. **Check checklists status** (if FEATURE_DIR/checklists/ exists):
+ - Scan all checklist files in the checklists/ directory
+ - For each checklist, count:
+ * Total items: All lines matching `- [ ]` or `- [X]` or `- [x]`
+ * Completed items: Lines matching `- [X]` or `- [x]`
+ * Incomplete items: Lines matching `- [ ]`
+ - Create a status table:
+ ```
+ | Checklist | Total | Completed | Incomplete | Status |
+ |-----------|-------|-----------|------------|--------|
+ | ux.md | 12 | 12 | 0 | β PASS |
+ | test.md | 8 | 5 | 3 | β FAIL |
+ | security.md | 6 | 6 | 0 | β PASS |
+ ```
+ - Calculate overall status:
+ * **PASS**: All checklists have 0 incomplete items
+ * **FAIL**: One or more checklists have incomplete items
+
+ - **If any checklist is incomplete**:
+ * Display the table with incomplete item counts
+ * **STOP** and ask: "Some checklists are incomplete. Do you want to proceed with implementation anyway? (yes/no)"
+ * Wait for user response before continuing
+ * If user says "no" or "wait" or "stop", halt execution
+ * If user says "yes" or "proceed" or "continue", proceed to step 3
+
+ - **If all checklists are complete**:
+ * Display the table showing all checklists passed
+ * Automatically proceed to step 3
+
+3. Load and analyze the implementation context:
- **REQUIRED**: Read tasks.md for the complete task list and execution plan
- **REQUIRED**: Read plan.md for tech stack, architecture, and file structure
- **IF EXISTS**: Read data-model.md for entities and relationships
@@ -21,27 +54,27 @@ $ARGUMENTS
- **IF EXISTS**: Read research.md for technical decisions and constraints
- **IF EXISTS**: Read quickstart.md for integration scenarios
-3. Parse tasks.md structure and extract:
+4. Parse tasks.md structure and extract:
- **Task phases**: Setup, Tests, Core, Integration, Polish
- **Task dependencies**: Sequential vs parallel execution rules
- **Task details**: ID, description, file paths, parallel markers [P]
- **Execution flow**: Order and dependency requirements
-4. Execute implementation following the task plan:
+5. Execute implementation following the task plan:
- **Phase-by-phase execution**: Complete each phase before moving to the next
- **Respect dependencies**: Run sequential tasks in order, parallel tasks [P] can run together
- **Follow TDD approach**: Execute test tasks before their corresponding implementation tasks
- **File-based coordination**: Tasks affecting the same files must run sequentially
- **Validation checkpoints**: Verify each phase completion before proceeding
-5. Implementation execution rules:
+6. Implementation execution rules:
- **Setup first**: Initialize project structure, dependencies, configuration
- **Tests before code**: If you need to write tests for contracts, entities, and integration scenarios
- **Core development**: Implement models, services, CLI commands, endpoints
- **Integration work**: Database connections, middleware, logging, external services
- **Polish and validation**: Unit tests, performance optimization, documentation
-6. Progress tracking and error handling:
+7. Progress tracking and error handling:
- Report progress after each completed task
- Halt execution if any non-parallel task fails
- For parallel tasks [P], continue with successful tasks, report failed ones
@@ -49,7 +82,7 @@ $ARGUMENTS
- Suggest next steps if implementation cannot proceed
- **IMPORTANT** For completed tasks, make sure to mark the task off as [X] in the tasks file.
-7. Completion validation:
+8. Completion validation:
- Verify all required tasks are completed
- Check that implemented features match the original specification
- Validate that tests pass and coverage meets requirements
diff --git a/templates/commands/plan.md b/templates/commands/plan.md
index 32522c23..7c378fd4 100644
--- a/templates/commands/plan.md
+++ b/templates/commands/plan.md
@@ -3,44 +3,84 @@ description: Execute the implementation planning workflow using the plan templat
scripts:
sh: scripts/bash/setup-plan.sh --json
ps: scripts/powershell/setup-plan.ps1 -Json
+agent_scripts:
+ sh: scripts/bash/update-agent-context.sh __AGENT__
+ ps: scripts/powershell/update-agent-context.ps1 -AgentType __AGENT__
---
-The user input to you can be provided directly by the agent or as a command argument - you **MUST** consider it before proceeding with the prompt (if not empty).
-
-User input:
+## User Input
+```text
$ARGUMENTS
+```
-Given the implementation details provided as an argument, do this:
+You **MUST** consider the user input before proceeding (if not empty).
-1. Run `{SCRIPT}` from the repo root and parse JSON for FEATURE_SPEC, IMPL_PLAN, SPECS_DIR, BRANCH. All future file paths must be absolute.
- - BEFORE proceeding, inspect FEATURE_SPEC for a `## Clarifications` section with at least one `Session` subheading. If missing or clearly ambiguous areas remain (vague adjectives, unresolved critical choices), PAUSE and instruct the user to run `/clarify` first to reduce rework. Only continue if: (a) Clarifications exist OR (b) an explicit user override is provided (e.g., "proceed without clarification"). Do not attempt to fabricate clarifications yourself.
-2. Read and analyze the feature specification to understand:
- - The feature requirements and user stories
- - Functional and non-functional requirements
- - Success criteria and acceptance criteria
- - Any technical constraints or dependencies mentioned
+## Outline
-3. Read the constitution at `/memory/constitution.md` to understand constitutional requirements.
+1. **Setup**: Run `{SCRIPT}` from repo root and parse JSON for FEATURE_SPEC, IMPL_PLAN, SPECS_DIR, BRANCH.
-4. Execute the implementation plan template:
- - Load `/templates/plan-template.md` (already copied to IMPL_PLAN path)
- - Set Input path to FEATURE_SPEC
- - Run the Execution Flow (main) function steps 1-9
- - The template is self-contained and executable
- - Follow error handling and gate checks as specified
- - Let the template guide artifact generation in $SPECS_DIR:
- * Phase 0 generates research.md
- * Phase 1 generates data-model.md, contracts/, quickstart.md
- * Phase 2 generates tasks.md
- - Incorporate user-provided details from arguments into Technical Context: {ARGS}
- - Update Progress Tracking as you complete each phase
+2. **Load context**: Read FEATURE_SPEC and `.specify/memory/constitution.md`. Load IMPL_PLAN template (already copied).
-5. Verify execution completed:
- - Check Progress Tracking shows all phases complete
- - Ensure all required artifacts were generated
- - Confirm no ERROR states in execution
+3. **Execute plan workflow**: Follow the structure in IMPL_PLAN template to:
+ - Fill Technical Context (mark unknowns as "NEEDS CLARIFICATION")
+ - Fill Constitution Check section from constitution
+ - Evaluate gates (ERROR if violations unjustified)
+ - Phase 0: Generate research.md (resolve all NEEDS CLARIFICATION)
+ - Phase 1: Generate data-model.md, contracts/, quickstart.md
+ - Phase 1: Update agent context by running the agent script
+ - Re-evaluate Constitution Check post-design
-6. Report results with branch name, file paths, and generated artifacts.
+4. **Stop and report**: Command ends after Phase 2 planning. Report branch, IMPL_PLAN path, and generated artifacts.
-Use absolute paths with the repository root for all file operations to avoid path issues.
+## Phases
+
+### Phase 0: Outline & Research
+
+1. **Extract unknowns from Technical Context** above:
+ - For each NEEDS CLARIFICATION β research task
+ - For each dependency β best practices task
+ - For each integration β patterns task
+
+2. **Generate and dispatch research agents**:
+ ```
+ For each unknown in Technical Context:
+ Task: "Research {unknown} for {feature context}"
+ For each technology choice:
+ Task: "Find best practices for {tech} in {domain}"
+ ```
+
+3. **Consolidate findings** in `research.md` using format:
+ - Decision: [what was chosen]
+ - Rationale: [why chosen]
+ - Alternatives considered: [what else evaluated]
+
+**Output**: research.md with all NEEDS CLARIFICATION resolved
+
+### Phase 1: Design & Contracts
+
+**Prerequisites:** `research.md` complete
+
+1. **Extract entities from feature spec** β `data-model.md`:
+ - Entity name, fields, relationships
+ - Validation rules from requirements
+ - State transitions if applicable
+
+2. **Generate API contracts** from functional requirements:
+ - For each user action β endpoint
+ - Use standard REST/GraphQL patterns
+ - Output OpenAPI/GraphQL schema to `/contracts/`
+
+3. **Agent context update**:
+ - Run `{AGENT_SCRIPT}`
+ - These scripts detect which AI agent is in use
+ - Update the appropriate agent-specific context file
+ - Add only new technology from current plan
+ - Preserve manual additions between markers
+
+**Output**: data-model.md, /contracts/*, quickstart.md, agent-specific file
+
+## Key rules
+
+- Use absolute paths
+- ERROR on gate failures or unresolved clarifications
diff --git a/templates/commands/specify.md b/templates/commands/specify.md
index 652c86a2..3edce410 100644
--- a/templates/commands/specify.md
+++ b/templates/commands/specify.md
@@ -5,20 +5,207 @@ scripts:
ps: scripts/powershell/create-new-feature.ps1 -Json "{ARGS}"
---
-The user input to you can be provided directly by the agent or as a command argument - you **MUST** consider it before proceeding with the prompt (if not empty).
-
-User input:
+## User Input
+```text
$ARGUMENTS
+```
-The text the user typed after `/specify` in the triggering message **is** the feature description. Assume you always have it available in this conversation even if `{ARGS}` appears literally below. Do not ask the user to repeat it unless they provided an empty command.
+You **MUST** consider the user input before proceeding (if not empty).
+
+## Outline
+
+The text the user typed after `/speckit.specify` in the triggering message **is** the feature description. Assume you always have it available in this conversation even if `{ARGS}` appears literally below. Do not ask the user to repeat it unless they provided an empty command.
Given that feature description, do this:
1. Run the script `{SCRIPT}` from repo root and parse its JSON output for BRANCH_NAME and SPEC_FILE. All file paths must be absolute.
**IMPORTANT** You must only ever run this script once. The JSON is provided in the terminal as output - always refer to it to get the actual content you're looking for.
2. Load `templates/spec-template.md` to understand required sections.
-3. Write the specification to SPEC_FILE using the template structure, replacing placeholders with concrete details derived from the feature description (arguments) while preserving section order and headings.
-4. Report completion with branch name, spec file path, and readiness for the next phase.
-Note: The script creates and checks out the new branch and initializes the spec file before writing.
+3. Follow this execution flow:
+
+ 1. Parse user description from Input
+ If empty: ERROR "No feature description provided"
+ 2. Extract key concepts from description
+ Identify: actors, actions, data, constraints
+ 3. For unclear aspects:
+ - Make informed guesses based on context and industry standards
+ - Only mark with [NEEDS CLARIFICATION: specific question] if:
+ - The choice significantly impacts feature scope or user experience
+ - Multiple reasonable interpretations exist with different implications
+ - No reasonable default exists
+ - **LIMIT: Maximum 3 [NEEDS CLARIFICATION] markers total**
+ - Prioritize clarifications by impact: scope > security/privacy > user experience > technical details
+ 4. Fill User Scenarios & Testing section
+ If no clear user flow: ERROR "Cannot determine user scenarios"
+ 5. Generate Functional Requirements
+ Each requirement must be testable
+ Use reasonable defaults for unspecified details (document assumptions in Assumptions section)
+ 6. Define Success Criteria
+ Create measurable, technology-agnostic outcomes
+ Include both quantitative metrics (time, performance, volume) and qualitative measures (user satisfaction, task completion)
+ Each criterion must be verifiable without implementation details
+ 7. Identify Key Entities (if data involved)
+ 8. Return: SUCCESS (spec ready for planning)
+
+4. Write the specification to SPEC_FILE using the template structure, replacing placeholders with concrete details derived from the feature description (arguments) while preserving section order and headings.
+
+5. **Specification Quality Validation**: After writing the initial spec, validate it against quality criteria:
+
+ a. **Create Spec Quality Checklist**: Generate a checklist file at `FEATURE_DIR/checklists/requirements.md` using the checklist template structure with these validation items:
+
+ ```markdown
+ # Specification Quality Checklist: [FEATURE NAME]
+
+ **Purpose**: Validate specification completeness and quality before proceeding to planning
+ **Created**: [DATE]
+ **Feature**: [Link to spec.md]
+
+ ## Content Quality
+
+ - [ ] No implementation details (languages, frameworks, APIs)
+ - [ ] Focused on user value and business needs
+ - [ ] Written for non-technical stakeholders
+ - [ ] All mandatory sections completed
+
+ ## Requirement Completeness
+
+ - [ ] No [NEEDS CLARIFICATION] markers remain
+ - [ ] Requirements are testable and unambiguous
+ - [ ] Success criteria are measurable
+ - [ ] Success criteria are technology-agnostic (no implementation details)
+ - [ ] All acceptance scenarios are defined
+ - [ ] Edge cases are identified
+ - [ ] Scope is clearly bounded
+ - [ ] Dependencies and assumptions identified
+
+ ## Feature Readiness
+
+ - [ ] All functional requirements have clear acceptance criteria
+ - [ ] User scenarios cover primary flows
+ - [ ] Feature meets measurable outcomes defined in Success Criteria
+ - [ ] No implementation details leak into specification
+
+ ## Notes
+
+ - Items marked incomplete require spec updates before `/speckit.clarify` or `/speckit.plan`
+ ```
+
+ b. **Run Validation Check**: Review the spec against each checklist item:
+ - For each item, determine if it passes or fails
+ - Document specific issues found (quote relevant spec sections)
+
+ c. **Handle Validation Results**:
+
+ - **If all items pass**: Mark checklist complete and proceed to step 6
+
+ - **If items fail (excluding [NEEDS CLARIFICATION])**:
+ 1. List the failing items and specific issues
+ 2. Update the spec to address each issue
+ 3. Re-run validation until all items pass (max 3 iterations)
+ 4. If still failing after 3 iterations, document remaining issues in checklist notes and warn user
+
+ - **If [NEEDS CLARIFICATION] markers remain**:
+ 1. Extract all [NEEDS CLARIFICATION: ...] markers from the spec
+ 2. **LIMIT CHECK**: If more than 3 markers exist, keep only the 3 most critical (by scope/security/UX impact) and make informed guesses for the rest
+ 3. For each clarification needed (max 3), present options to user in this format:
+
+ ```markdown
+ ## Question [N]: [Topic]
+
+ **Context**: [Quote relevant spec section]
+
+ **What we need to know**: [Specific question from NEEDS CLARIFICATION marker]
+
+ **Suggested Answers**:
+
+ | Option | Answer | Implications |
+ |--------|--------|--------------|
+ | A | [First suggested answer] | [What this means for the feature] |
+ | B | [Second suggested answer] | [What this means for the feature] |
+ | C | [Third suggested answer] | [What this means for the feature] |
+ | Custom | Provide your own answer | [Explain how to provide custom input] |
+
+ **Your choice**: _[Wait for user response]_
+ ```
+
+ 4. **CRITICAL - Table Formatting**: Ensure markdown tables are properly formatted:
+ - Use consistent spacing with pipes aligned
+ - Each cell should have spaces around content: `| Content |` not `|Content|`
+ - Header separator must have at least 3 dashes: `|--------|`
+ - Test that the table renders correctly in markdown preview
+ 5. Number questions sequentially (Q1, Q2, Q3 - max 3 total)
+ 6. Present all questions together before waiting for responses
+ 7. Wait for user to respond with their choices for all questions (e.g., "Q1: A, Q2: Custom - [details], Q3: B")
+ 8. Update the spec by replacing each [NEEDS CLARIFICATION] marker with the user's selected or provided answer
+ 9. Re-run validation after all clarifications are resolved
+
+ d. **Update Checklist**: After each validation iteration, update the checklist file with current pass/fail status
+
+6. Report completion with branch name, spec file path, checklist results, and readiness for the next phase (`/speckit.clarify` or `/speckit.plan`).
+
+**NOTE:** The script creates and checks out the new branch and initializes the spec file before writing.
+
+## General Guidelines
+
+## Quick Guidelines
+
+- Focus on **WHAT** users need and **WHY**.
+- Avoid HOW to implement (no tech stack, APIs, code structure).
+- Written for business stakeholders, not developers.
+- DO NOT create any checklists that are embedded in the spec. That will be a separate command.
+
+### Section Requirements
+
+- **Mandatory sections**: Must be completed for every feature
+- **Optional sections**: Include only when relevant to the feature
+- When a section doesn't apply, remove it entirely (don't leave as "N/A")
+
+### For AI Generation
+
+When creating this spec from a user prompt:
+
+1. **Make informed guesses**: Use context, industry standards, and common patterns to fill gaps
+2. **Document assumptions**: Record reasonable defaults in the Assumptions section
+3. **Limit clarifications**: Maximum 3 [NEEDS CLARIFICATION] markers - use only for critical decisions that:
+ - Significantly impact feature scope or user experience
+ - Have multiple reasonable interpretations with different implications
+ - Lack any reasonable default
+4. **Prioritize clarifications**: scope > security/privacy > user experience > technical details
+5. **Think like a tester**: Every vague requirement should fail the "testable and unambiguous" checklist item
+6. **Common areas needing clarification** (only if no reasonable default exists):
+ - Feature scope and boundaries (include/exclude specific use cases)
+ - User types and permissions (if multiple conflicting interpretations possible)
+ - Security/compliance requirements (when legally/financially significant)
+
+**Examples of reasonable defaults** (don't ask about these):
+
+- Data retention: Industry-standard practices for the domain
+- Performance targets: Standard web/mobile app expectations unless specified
+- Error handling: User-friendly messages with appropriate fallbacks
+- Authentication method: Standard session-based or OAuth2 for web apps
+- Integration patterns: RESTful APIs unless specified otherwise
+
+### Success Criteria Guidelines
+
+Success criteria must be:
+
+1. **Measurable**: Include specific metrics (time, percentage, count, rate)
+2. **Technology-agnostic**: No mention of frameworks, languages, databases, or tools
+3. **User-focused**: Describe outcomes from user/business perspective, not system internals
+4. **Verifiable**: Can be tested/validated without knowing implementation details
+
+**Good examples**:
+
+- "Users can complete checkout in under 3 minutes"
+- "System supports 10,000 concurrent users"
+- "95% of searches return results in under 1 second"
+- "Task completion rate improves by 40%"
+
+**Bad examples** (implementation-focused):
+
+- "API response time is under 200ms" (too technical, use "Users see results instantly")
+- "Database can handle 1000 TPS" (implementation detail, use user-facing metric)
+- "React components render efficiently" (framework-specific)
+- "Redis cache hit rate above 80%" (technology-specific)
diff --git a/templates/commands/tasks.md b/templates/commands/tasks.md
index eb0ef2b6..f2bafadc 100644
--- a/templates/commands/tasks.md
+++ b/templates/commands/tasks.md
@@ -5,61 +5,111 @@ scripts:
ps: scripts/powershell/check-prerequisites.ps1 -Json
---
-The user input to you can be provided directly by the agent or as a command argument - you **MUST** consider it before proceeding with the prompt (if not empty).
-
-User input:
+## User Input
+```text
$ARGUMENTS
+```
-1. Run `{SCRIPT}` from repo root and parse FEATURE_DIR and AVAILABLE_DOCS list. All paths must be absolute.
-2. Load and analyze available design documents:
- - Always read plan.md for tech stack and libraries
- - IF EXISTS: Read data-model.md for entities
- - IF EXISTS: Read contracts/ for API endpoints
- - IF EXISTS: Read research.md for technical decisions
- - IF EXISTS: Read quickstart.md for test scenarios
+You **MUST** consider the user input before proceeding (if not empty).
- Note: Not all projects have all documents. For example:
- - CLI tools might not have contracts/
- - Simple libraries might not need data-model.md
- - Generate tasks based on what's available
+## Outline
-3. Generate tasks following the template:
- - Use `/templates/tasks-template.md` as the base
- - Replace example tasks with actual tasks based on:
- * **Setup tasks**: Project init, dependencies, linting
- * **Test tasks [P]**: One per contract, one per integration scenario
- * **Core tasks**: One per entity, service, CLI command, endpoint
- * **Integration tasks**: DB connections, middleware, logging
- * **Polish tasks [P]**: Unit tests, performance, docs
+1. **Setup**: Run `{SCRIPT}` from repo root and parse FEATURE_DIR and AVAILABLE_DOCS list. All paths must be absolute.
-4. Task generation rules:
- - Each contract file β contract test task marked [P]
- - Each entity in data-model β model creation task marked [P]
- - Each endpoint β implementation task (not parallel if shared files)
- - Each user story β integration test marked [P]
- - Different files = can be parallel [P]
- - Same file = sequential (no [P])
+2. **Load design documents**: Read from FEATURE_DIR:
+ - **Required**: plan.md (tech stack, libraries, structure), spec.md (user stories with priorities)
+ - **Optional**: data-model.md (entities), contracts/ (API endpoints), research.md (decisions), quickstart.md (test scenarios)
+ - Note: Not all projects have all documents. Generate tasks based on what's available.
-5. Order tasks by dependencies:
- - Setup before everything
- - Tests before implementation (TDD)
- - Models before services
- - Services before endpoints
- - Core before integration
- - Everything before polish
+3. **Execute task generation workflow** (follow the template structure):
+ - Load plan.md and extract tech stack, libraries, project structure
+ - **Load spec.md and extract user stories with their priorities (P1, P2, P3, etc.)**
+ - If data-model.md exists: Extract entities β map to user stories
+ - If contracts/ exists: Each file β map endpoints to user stories
+ - If research.md exists: Extract decisions β generate setup tasks
+ - **Generate tasks ORGANIZED BY USER STORY**:
+ - Setup tasks (shared infrastructure needed by all stories)
+ - **Foundational tasks (prerequisites that must complete before ANY user story can start)**
+ - For each user story (in priority order P1, P2, P3...):
+ - Group all tasks needed to complete JUST that story
+ - Include models, services, endpoints, UI components specific to that story
+ - Mark which tasks are [P] parallelizable
+ - If tests requested: Include tests specific to that story
+ - Polish/Integration tasks (cross-cutting concerns)
+ - **Tests are OPTIONAL**: Only generate test tasks if explicitly requested in the feature spec or user asks for TDD approach
+ - Apply task rules:
+ - Different files = mark [P] for parallel
+ - Same file = sequential (no [P])
+ - If tests requested: Tests before implementation (TDD order)
+ - Number tasks sequentially (T001, T002...)
+ - Generate dependency graph showing user story completion order
+ - Create parallel execution examples per user story
+ - Validate task completeness (each user story has all needed tasks, independently testable)
-6. Include parallel execution examples:
- - Group [P] tasks that can run together
- - Show actual Task agent commands
-
-7. Create FEATURE_DIR/tasks.md with:
- - Correct feature name from implementation plan
- - Numbered tasks (T001, T002, etc.)
+4. **Generate tasks.md**: Use `.specify/templates/tasks-template.md` as structure, fill with:
+ - Correct feature name from plan.md
+ - Phase 1: Setup tasks (project initialization)
+ - Phase 2: Foundational tasks (blocking prerequisites for all user stories)
+ - Phase 3+: One phase per user story (in priority order from spec.md)
+ - Each phase includes: story goal, independent test criteria, tests (if requested), implementation tasks
+ - Clear [Story] labels (US1, US2, US3...) for each task
+ - [P] markers for parallelizable tasks within each story
+ - Checkpoint markers after each story phase
+ - Final Phase: Polish & cross-cutting concerns
+ - Numbered tasks (T001, T002...) in execution order
- Clear file paths for each task
- - Dependency notes
- - Parallel execution guidance
+ - Dependencies section showing story completion order
+ - Parallel execution examples per story
+ - Implementation strategy section (MVP first, incremental delivery)
+
+5. **Report**: Output path to generated tasks.md and summary:
+ - Total task count
+ - Task count per user story
+ - Parallel opportunities identified
+ - Independent test criteria for each story
+ - Suggested MVP scope (typically just User Story 1)
Context for task generation: {ARGS}
The tasks.md should be immediately executable - each task must be specific enough that an LLM can complete it without additional context.
+
+## Task Generation Rules
+
+**IMPORTANT**: Tests are optional. Only generate test tasks if the user explicitly requested testing or TDD approach in the feature specification.
+
+**CRITICAL**: Tasks MUST be organized by user story to enable independent implementation and testing.
+
+1. **From User Stories (spec.md)** - PRIMARY ORGANIZATION:
+ - Each user story (P1, P2, P3...) gets its own phase
+ - Map all related components to their story:
+ - Models needed for that story
+ - Services needed for that story
+ - Endpoints/UI needed for that story
+ - If tests requested: Tests specific to that story
+ - Mark story dependencies (most stories should be independent)
+
+2. **From Contracts**:
+ - Map each contract/endpoint β to the user story it serves
+ - If tests requested: Each contract β contract test task [P] before implementation in that story's phase
+
+3. **From Data Model**:
+ - Map each entity β to the user story(ies) that need it
+ - If entity serves multiple stories: Put in earliest story or Setup phase
+ - Relationships β service layer tasks in appropriate story phase
+
+4. **From Setup/Infrastructure**:
+ - Shared infrastructure β Setup phase (Phase 1)
+ - Foundational/blocking tasks β Foundational phase (Phase 2)
+ - Examples: Database schema setup, authentication framework, core libraries, base configurations
+ - These MUST complete before any user story can be implemented
+ - Story-specific setup β within that story's phase
+
+5. **Ordering**:
+ - Phase 1: Setup (project initialization)
+ - Phase 2: Foundational (blocking prerequisites - must complete before user stories)
+ - Phase 3+: User Stories in priority order (P1, P2, P3...)
+ - Within each story: Tests (if requested) β Models β Services β Endpoints β Integration
+ - Final Phase: Polish & Cross-Cutting Concerns
+ - Each user story phase should be a complete, independently testable increment
+
diff --git a/templates/plan-template.md b/templates/plan-template.md
index 5e28b50e..70fa8f97 100644
--- a/templates/plan-template.md
+++ b/templates/plan-template.md
@@ -1,45 +1,22 @@
----
-description: "Implementation plan template for feature development"
-scripts:
- sh: scripts/bash/update-agent-context.sh __AGENT__
- ps: scripts/powershell/update-agent-context.ps1 -AgentType __AGENT__
----
-
# Implementation Plan: [FEATURE]
**Branch**: `[###-feature-name]` | **Date**: [DATE] | **Spec**: [link]
**Input**: Feature specification from `/specs/[###-feature-name]/spec.md`
-## Execution Flow (/plan command scope)
-```
-1. Load feature spec from Input path
- β If not found: ERROR "No feature spec at {path}"
-2. Fill Technical Context (scan for NEEDS CLARIFICATION)
- β Detect Project Type from file system structure or context (web=frontend+backend, mobile=app+api)
- β Set Structure Decision based on project type
-3. Fill the Constitution Check section based on the content of the constitution document.
-4. Evaluate Constitution Check section below
- β If violations exist: Document in Complexity Tracking
- β If no justification possible: ERROR "Simplify approach first"
- β Update Progress Tracking: Initial Constitution Check
-5. Execute Phase 0 β research.md
- β If NEEDS CLARIFICATION remain: ERROR "Resolve unknowns"
-6. Execute Phase 1 β contracts, data-model.md, quickstart.md, agent-specific template file (e.g., `CLAUDE.md` for Claude Code, `.github/copilot-instructions.md` for GitHub Copilot, `GEMINI.md` for Gemini CLI, `QWEN.md` for Qwen Code, or `AGENTS.md` for all other agents).
-7. Re-evaluate Constitution Check section
- β If new violations: Refactor design, return to Phase 1
- β Update Progress Tracking: Post-Design Constitution Check
-8. Plan Phase 2 β Describe task generation approach (DO NOT create tasks.md)
-9. STOP - Ready for /tasks command
-```
-
-**IMPORTANT**: The /plan command STOPS at step 7. Phases 2-4 are executed by other commands:
-- Phase 2: /tasks command creates tasks.md
-- Phase 3-4: Implementation execution (manual or via tools)
+**Note**: This template is filled in by the `/speckit.plan` command. See `.specify/templates/commands/plan.md` for the execution workflow.
## Summary
+
[Extract from feature spec: primary requirement + technical approach from research]
## Technical Context
+
+
+
**Language/Version**: [e.g., Python 3.11, Swift 5.9, Rust 1.75 or NEEDS CLARIFICATION]
**Primary Dependencies**: [e.g., FastAPI, UIKit, LLVM or NEEDS CLARIFICATION]
**Storage**: [if applicable, e.g., PostgreSQL, CoreData, files or N/A]
@@ -51,6 +28,7 @@ scripts:
**Scale/Scope**: [domain-specific, e.g., 10k users, 1M LOC, 50 screens or NEEDS CLARIFICATION]
## Constitution Check
+
*GATE: Must pass before Phase 0 research. Re-check after Phase 1 design.*
[Gates determined based on constitution file]
@@ -58,14 +36,15 @@ scripts:
## Project Structure
### Documentation (this feature)
+
```
specs/[###-feature]/
-βββ plan.md # This file (/plan command output)
-βββ research.md # Phase 0 output (/plan command)
-βββ data-model.md # Phase 1 output (/plan command)
-βββ quickstart.md # Phase 1 output (/plan command)
-βββ contracts/ # Phase 1 output (/plan command)
-βββ tasks.md # Phase 2 output (/tasks command - NOT created by /plan)
+βββ plan.md # This file (/speckit.plan command output)
+βββ research.md # Phase 0 output (/speckit.plan command)
+βββ data-model.md # Phase 1 output (/speckit.plan command)
+βββ quickstart.md # Phase 1 output (/speckit.plan command)
+βββ contracts/ # Phase 1 output (/speckit.plan command)
+βββ tasks.md # Phase 2 output (/speckit.tasks command - NOT created by /speckit.plan)
```
### Source Code (repository root)
@@ -75,6 +54,7 @@ specs/[###-feature]/
real paths (e.g., apps/admin, packages/something). The delivered plan must
not include Option labels.
-->
+
```
# [REMOVE IF UNUSED] Option 1: Single project (DEFAULT)
src/
@@ -114,112 +94,11 @@ ios/ or android/
**Structure Decision**: [Document the selected structure and reference the real
directories captured above]
-## Phase 0: Outline & Research
-1. **Extract unknowns from Technical Context** above:
- - For each NEEDS CLARIFICATION β research task
- - For each dependency β best practices task
- - For each integration β patterns task
-
-2. **Generate and dispatch research agents**:
- ```
- For each unknown in Technical Context:
- Task: "Research {unknown} for {feature context}"
- For each technology choice:
- Task: "Find best practices for {tech} in {domain}"
- ```
-
-3. **Consolidate findings** in `research.md` using format:
- - Decision: [what was chosen]
- - Rationale: [why chosen]
- - Alternatives considered: [what else evaluated]
-
-**Output**: research.md with all NEEDS CLARIFICATION resolved
-
-## Phase 1: Design & Contracts
-*Prerequisites: research.md complete*
-
-1. **Extract entities from feature spec** β `data-model.md`:
- - Entity name, fields, relationships
- - Validation rules from requirements
- - State transitions if applicable
-
-2. **Generate API contracts** from functional requirements:
- - For each user action β endpoint
- - Use standard REST/GraphQL patterns
- - Output OpenAPI/GraphQL schema to `/contracts/`
-
-3. **Generate contract tests** from contracts:
- - One test file per endpoint
- - Assert request/response schemas
- - Tests must fail (no implementation yet)
-
-4. **Extract test scenarios** from user stories:
- - Each story β integration test scenario
- - Quickstart test = story validation steps
-
-5. **Update agent file incrementally** (O(1) operation):
- - Run `{SCRIPT}`
- **IMPORTANT**: Execute it exactly as specified above. Do not add or remove any arguments.
- - If exists: Add only NEW tech from current plan
- - Preserve manual additions between markers
- - Update recent changes (keep last 3)
- - Keep under 150 lines for token efficiency
- - Output to repository root
-
-**Output**: data-model.md, /contracts/*, failing tests, quickstart.md, agent-specific file
-
-## Phase 2: Task Planning Approach
-*This section describes what the /tasks command will do - DO NOT execute during /plan*
-
-**Task Generation Strategy**:
-- Load `.specify/templates/tasks-template.md` as base
-- Generate tasks from Phase 1 design docs (contracts, data model, quickstart)
-- Each contract β contract test task [P]
-- Each entity β model creation task [P]
-- Each user story β integration test task
-- Implementation tasks to make tests pass
-
-**Ordering Strategy**:
-- TDD order: Tests before implementation
-- Dependency order: Models before services before UI
-- Mark [P] for parallel execution (independent files)
-
-**Estimated Output**: 25-30 numbered, ordered tasks in tasks.md
-
-**IMPORTANT**: This phase is executed by the /tasks command, NOT by /plan
-
-## Phase 3+: Future Implementation
-*These phases are beyond the scope of the /plan command*
-
-**Phase 3**: Task execution (/tasks command creates tasks.md)
-**Phase 4**: Implementation (execute tasks.md following constitutional principles)
-**Phase 5**: Validation (run tests, execute quickstart.md, performance validation)
-
## Complexity Tracking
+
*Fill ONLY if Constitution Check has violations that must be justified*
| Violation | Why Needed | Simpler Alternative Rejected Because |
|-----------|------------|-------------------------------------|
| [e.g., 4th project] | [current need] | [why 3 projects insufficient] |
| [e.g., Repository pattern] | [specific problem] | [why direct DB access insufficient] |
-
-
-## Progress Tracking
-*This checklist is updated during execution flow*
-
-**Phase Status**:
-- [ ] Phase 0: Research complete (/plan command)
-- [ ] Phase 1: Design complete (/plan command)
-- [ ] Phase 2: Task planning complete (/plan command - describe approach only)
-- [ ] Phase 3: Tasks generated (/tasks command)
-- [ ] Phase 4: Implementation complete
-- [ ] Phase 5: Validation passed
-
-**Gate Status**:
-- [ ] Initial Constitution Check: PASS
-- [ ] Post-Design Constitution Check: PASS
-- [ ] All NEEDS CLARIFICATION resolved
-- [ ] Complexity deviations documented
-
----
-*Based on Constitution v2.1.1 - See `/memory/constitution.md`*
diff --git a/templates/spec-template.md b/templates/spec-template.md
index 7915e7dd..c67d9149 100644
--- a/templates/spec-template.md
+++ b/templates/spec-template.md
@@ -5,69 +5,85 @@
**Status**: Draft
**Input**: User description: "$ARGUMENTS"
-## Execution Flow (main)
-```
-1. Parse user description from Input
- β If empty: ERROR "No feature description provided"
-2. Extract key concepts from description
- β Identify: actors, actions, data, constraints
-3. For each unclear aspect:
- β Mark with [NEEDS CLARIFICATION: specific question]
-4. Fill User Scenarios & Testing section
- β If no clear user flow: ERROR "Cannot determine user scenarios"
-5. Generate Functional Requirements
- β Each requirement must be testable
- β Mark ambiguous requirements
-6. Identify Key Entities (if data involved)
-7. Run Review Checklist
- β If any [NEEDS CLARIFICATION]: WARN "Spec has uncertainties"
- β If implementation details found: ERROR "Remove tech details"
-8. Return: SUCCESS (spec ready for planning)
-```
-
----
-
-## β‘ Quick Guidelines
-- β
Focus on WHAT users need and WHY
-- β Avoid HOW to implement (no tech stack, APIs, code structure)
-- π₯ Written for business stakeholders, not developers
-
-### Section Requirements
-- **Mandatory sections**: Must be completed for every feature
-- **Optional sections**: Include only when relevant to the feature
-- When a section doesn't apply, remove it entirely (don't leave as "N/A")
-
-### For AI Generation
-When creating this spec from a user prompt:
-1. **Mark all ambiguities**: Use [NEEDS CLARIFICATION: specific question] for any assumption you'd need to make
-2. **Don't guess**: If the prompt doesn't specify something (e.g., "login system" without auth method), mark it
-3. **Think like a tester**: Every vague requirement should fail the "testable and unambiguous" checklist item
-4. **Common underspecified areas**:
- - User types and permissions
- - Data retention/deletion policies
- - Performance targets and scale
- - Error handling behaviors
- - Integration requirements
- - Security/compliance needs
-
----
-
## User Scenarios & Testing *(mandatory)*
-### Primary User Story
-[Describe the main user journey in plain language]
+
+
+### User Story 1 - [Brief Title] (Priority: P1)
+
+[Describe this user journey in plain language]
+
+**Why this priority**: [Explain the value and why it has this priority level]
+
+**Independent Test**: [Describe how this can be tested independently - e.g., "Can be fully tested by [specific action] and delivers [specific value]"]
+
+**Acceptance Scenarios**:
-### Acceptance Scenarios
1. **Given** [initial state], **When** [action], **Then** [expected outcome]
2. **Given** [initial state], **When** [action], **Then** [expected outcome]
+---
+
+### User Story 2 - [Brief Title] (Priority: P2)
+
+[Describe this user journey in plain language]
+
+**Why this priority**: [Explain the value and why it has this priority level]
+
+**Independent Test**: [Describe how this can be tested independently]
+
+**Acceptance Scenarios**:
+
+1. **Given** [initial state], **When** [action], **Then** [expected outcome]
+
+---
+
+### User Story 3 - [Brief Title] (Priority: P3)
+
+[Describe this user journey in plain language]
+
+**Why this priority**: [Explain the value and why it has this priority level]
+
+**Independent Test**: [Describe how this can be tested independently]
+
+**Acceptance Scenarios**:
+
+1. **Given** [initial state], **When** [action], **Then** [expected outcome]
+
+---
+
+[Add more user stories as needed, each with an assigned priority]
+
### Edge Cases
+
+
+
- What happens when [boundary condition]?
- How does system handle [error scenario]?
## Requirements *(mandatory)*
+
+
### Functional Requirements
+
- **FR-001**: System MUST [specific capability, e.g., "allow users to create accounts"]
- **FR-002**: System MUST [specific capability, e.g., "validate email addresses"]
- **FR-003**: Users MUST be able to [key interaction, e.g., "reset their password"]
@@ -75,42 +91,25 @@ When creating this spec from a user prompt:
- **FR-005**: System MUST [behavior, e.g., "log all security events"]
*Example of marking unclear requirements:*
+
- **FR-006**: System MUST authenticate users via [NEEDS CLARIFICATION: auth method not specified - email/password, SSO, OAuth?]
- **FR-007**: System MUST retain user data for [NEEDS CLARIFICATION: retention period not specified]
### Key Entities *(include if feature involves data)*
+
- **[Entity 1]**: [What it represents, key attributes without implementation]
- **[Entity 2]**: [What it represents, relationships to other entities]
----
+## Success Criteria *(mandatory)*
-## Review & Acceptance Checklist
-*GATE: Automated checks run during main() execution*
+
-### Content Quality
-- [ ] No implementation details (languages, frameworks, APIs)
-- [ ] Focused on user value and business needs
-- [ ] Written for non-technical stakeholders
-- [ ] All mandatory sections completed
+### Measurable Outcomes
-### Requirement Completeness
-- [ ] No [NEEDS CLARIFICATION] markers remain
-- [ ] Requirements are testable and unambiguous
-- [ ] Success criteria are measurable
-- [ ] Scope is clearly bounded
-- [ ] Dependencies and assumptions identified
-
----
-
-## Execution Status
-*Updated by main() during processing*
-
-- [ ] User description parsed
-- [ ] Key concepts extracted
-- [ ] Ambiguities marked
-- [ ] User scenarios defined
-- [ ] Requirements generated
-- [ ] Entities identified
-- [ ] Review checklist passed
-
----
+- **SC-001**: [Measurable metric, e.g., "Users can complete account creation in under 2 minutes"]
+- **SC-002**: [Measurable metric, e.g., "System handles 1000 concurrent users without degradation"]
+- **SC-003**: [User satisfaction metric, e.g., "90% of users successfully complete primary task on first attempt"]
+- **SC-004**: [Business metric, e.g., "Reduce support tickets related to [X] by 50%"]
diff --git a/templates/tasks-template.md b/templates/tasks-template.md
index b8a28faf..66fdd810 100644
--- a/templates/tasks-template.md
+++ b/templates/tasks-template.md
@@ -1,39 +1,19 @@
+---
+description: "Task list template for feature implementation"
+---
+
# Tasks: [FEATURE NAME]
**Input**: Design documents from `/specs/[###-feature-name]/`
-**Prerequisites**: plan.md (required), research.md, data-model.md, contracts/
+**Prerequisites**: plan.md (required), spec.md (required for user stories), research.md, data-model.md, contracts/
-## Execution Flow (main)
-```
-1. Load plan.md from feature directory
- β If not found: ERROR "No implementation plan found"
- β Extract: tech stack, libraries, structure
-2. Load optional design documents:
- β data-model.md: Extract entities β model tasks
- β contracts/: Each file β contract test task
- β research.md: Extract decisions β setup tasks
-3. Generate tasks by category:
- β Setup: project init, dependencies, linting
- β Tests: contract tests, integration tests
- β Core: models, services, CLI commands
- β Integration: DB, middleware, logging
- β Polish: unit tests, performance, docs
-4. Apply task rules:
- β Different files = mark [P] for parallel
- β Same file = sequential (no [P])
- β Tests before implementation (TDD)
-5. Number tasks sequentially (T001, T002...)
-6. Generate dependency graph
-7. Create parallel execution examples
-8. Validate task completeness:
- β All contracts have tests?
- β All entities have models?
- β All endpoints implemented?
-9. Return: SUCCESS (tasks ready for execution)
-```
+**Tests**: The examples below include test tasks. Tests are OPTIONAL - only include them if explicitly requested in the feature specification.
-## Format: `[ID] [P?] Description`
+**Organization**: Tasks are grouped by user story to enable independent implementation and testing of each story.
+
+## Format: `[ID] [P?] [Story] Description`
- **[P]**: Can run in parallel (different files, no dependencies)
+- **[Story]**: Which user story this task belongs to (e.g., US1, US2, US3)
- Include exact file paths in descriptions
## Path Conventions
@@ -42,86 +22,229 @@
- **Mobile**: `api/src/`, `ios/src/` or `android/src/`
- Paths shown below assume single project - adjust based on plan.md structure
-## Phase 3.1: Setup
+
+
+## Phase 1: Setup (Shared Infrastructure)
+
+**Purpose**: Project initialization and basic structure
+
- [ ] T001 Create project structure per implementation plan
- [ ] T002 Initialize [language] project with [framework] dependencies
- [ ] T003 [P] Configure linting and formatting tools
-## Phase 3.2: Tests First (TDD) β οΈ MUST COMPLETE BEFORE 3.3
-**CRITICAL: These tests MUST be written and MUST FAIL before ANY implementation**
-- [ ] T004 [P] Contract test POST /api/users in tests/contract/test_users_post.py
-- [ ] T005 [P] Contract test GET /api/users/{id} in tests/contract/test_users_get.py
-- [ ] T006 [P] Integration test user registration in tests/integration/test_registration.py
-- [ ] T007 [P] Integration test auth flow in tests/integration/test_auth.py
+---
-## Phase 3.3: Core Implementation (ONLY after tests are failing)
-- [ ] T008 [P] User model in src/models/user.py
-- [ ] T009 [P] UserService CRUD in src/services/user_service.py
-- [ ] T010 [P] CLI --create-user in src/cli/user_commands.py
-- [ ] T011 POST /api/users endpoint
-- [ ] T012 GET /api/users/{id} endpoint
-- [ ] T013 Input validation
-- [ ] T014 Error handling and logging
+## Phase 2: Foundational (Blocking Prerequisites)
-## Phase 3.4: Integration
-- [ ] T015 Connect UserService to DB
-- [ ] T016 Auth middleware
-- [ ] T017 Request/response logging
-- [ ] T018 CORS and security headers
+**Purpose**: Core infrastructure that MUST be complete before ANY user story can be implemented
-## Phase 3.5: Polish
-- [ ] T019 [P] Unit tests for validation in tests/unit/test_validation.py
-- [ ] T020 Performance tests (<200ms)
-- [ ] T021 [P] Update docs/api.md
-- [ ] T022 Remove duplication
-- [ ] T023 Run manual-testing.md
+**β οΈ CRITICAL**: No user story work can begin until this phase is complete
-## Dependencies
-- Tests (T004-T007) before implementation (T008-T014)
-- T008 blocks T009, T015
-- T016 blocks T018
-- Implementation before polish (T019-T023)
+Examples of foundational tasks (adjust based on your project):
-## Parallel Example
-```
-# Launch T004-T007 together:
-Task: "Contract test POST /api/users in tests/contract/test_users_post.py"
-Task: "Contract test GET /api/users/{id} in tests/contract/test_users_get.py"
-Task: "Integration test registration in tests/integration/test_registration.py"
-Task: "Integration test auth in tests/integration/test_auth.py"
+- [ ] T004 Setup database schema and migrations framework
+- [ ] T005 [P] Implement authentication/authorization framework
+- [ ] T006 [P] Setup API routing and middleware structure
+- [ ] T007 Create base models/entities that all stories depend on
+- [ ] T008 Configure error handling and logging infrastructure
+- [ ] T009 Setup environment configuration management
+
+**Checkpoint**: Foundation ready - user story implementation can now begin in parallel
+
+---
+
+## Phase 3: User Story 1 - [Title] (Priority: P1) π― MVP
+
+**Goal**: [Brief description of what this story delivers]
+
+**Independent Test**: [How to verify this story works on its own]
+
+### Tests for User Story 1 (OPTIONAL - only if tests requested) β οΈ
+
+**NOTE: Write these tests FIRST, ensure they FAIL before implementation**
+
+- [ ] T010 [P] [US1] Contract test for [endpoint] in tests/contract/test_[name].py
+- [ ] T011 [P] [US1] Integration test for [user journey] in tests/integration/test_[name].py
+
+### Implementation for User Story 1
+
+- [ ] T012 [P] [US1] Create [Entity1] model in src/models/[entity1].py
+- [ ] T013 [P] [US1] Create [Entity2] model in src/models/[entity2].py
+- [ ] T014 [US1] Implement [Service] in src/services/[service].py (depends on T012, T013)
+- [ ] T015 [US1] Implement [endpoint/feature] in src/[location]/[file].py
+- [ ] T016 [US1] Add validation and error handling
+- [ ] T017 [US1] Add logging for user story 1 operations
+
+**Checkpoint**: At this point, User Story 1 should be fully functional and testable independently
+
+---
+
+## Phase 4: User Story 2 - [Title] (Priority: P2)
+
+**Goal**: [Brief description of what this story delivers]
+
+**Independent Test**: [How to verify this story works on its own]
+
+### Tests for User Story 2 (OPTIONAL - only if tests requested) β οΈ
+
+- [ ] T018 [P] [US2] Contract test for [endpoint] in tests/contract/test_[name].py
+- [ ] T019 [P] [US2] Integration test for [user journey] in tests/integration/test_[name].py
+
+### Implementation for User Story 2
+
+- [ ] T020 [P] [US2] Create [Entity] model in src/models/[entity].py
+- [ ] T021 [US2] Implement [Service] in src/services/[service].py
+- [ ] T022 [US2] Implement [endpoint/feature] in src/[location]/[file].py
+- [ ] T023 [US2] Integrate with User Story 1 components (if needed)
+
+**Checkpoint**: At this point, User Stories 1 AND 2 should both work independently
+
+---
+
+## Phase 5: User Story 3 - [Title] (Priority: P3)
+
+**Goal**: [Brief description of what this story delivers]
+
+**Independent Test**: [How to verify this story works on its own]
+
+### Tests for User Story 3 (OPTIONAL - only if tests requested) β οΈ
+
+- [ ] T024 [P] [US3] Contract test for [endpoint] in tests/contract/test_[name].py
+- [ ] T025 [P] [US3] Integration test for [user journey] in tests/integration/test_[name].py
+
+### Implementation for User Story 3
+
+- [ ] T026 [P] [US3] Create [Entity] model in src/models/[entity].py
+- [ ] T027 [US3] Implement [Service] in src/services/[service].py
+- [ ] T028 [US3] Implement [endpoint/feature] in src/[location]/[file].py
+
+**Checkpoint**: All user stories should now be independently functional
+
+---
+
+[Add more user story phases as needed, following the same pattern]
+
+---
+
+## Phase N: Polish & Cross-Cutting Concerns
+
+**Purpose**: Improvements that affect multiple user stories
+
+- [ ] TXXX [P] Documentation updates in docs/
+- [ ] TXXX Code cleanup and refactoring
+- [ ] TXXX Performance optimization across all stories
+- [ ] TXXX [P] Additional unit tests (if requested) in tests/unit/
+- [ ] TXXX Security hardening
+- [ ] TXXX Run quickstart.md validation
+
+---
+
+## Dependencies & Execution Order
+
+### Phase Dependencies
+
+- **Setup (Phase 1)**: No dependencies - can start immediately
+- **Foundational (Phase 2)**: Depends on Setup completion - BLOCKS all user stories
+- **User Stories (Phase 3+)**: All depend on Foundational phase completion
+ - User stories can then proceed in parallel (if staffed)
+ - Or sequentially in priority order (P1 β P2 β P3)
+- **Polish (Final Phase)**: Depends on all desired user stories being complete
+
+### User Story Dependencies
+
+- **User Story 1 (P1)**: Can start after Foundational (Phase 2) - No dependencies on other stories
+- **User Story 2 (P2)**: Can start after Foundational (Phase 2) - May integrate with US1 but should be independently testable
+- **User Story 3 (P3)**: Can start after Foundational (Phase 2) - May integrate with US1/US2 but should be independently testable
+
+### Within Each User Story
+
+- Tests (if included) MUST be written and FAIL before implementation
+- Models before services
+- Services before endpoints
+- Core implementation before integration
+- Story complete before moving to next priority
+
+### Parallel Opportunities
+
+- All Setup tasks marked [P] can run in parallel
+- All Foundational tasks marked [P] can run in parallel (within Phase 2)
+- Once Foundational phase completes, all user stories can start in parallel (if team capacity allows)
+- All tests for a user story marked [P] can run in parallel
+- Models within a story marked [P] can run in parallel
+- Different user stories can be worked on in parallel by different team members
+
+---
+
+## Parallel Example: User Story 1
+
+```bash
+# Launch all tests for User Story 1 together (if tests requested):
+Task: "Contract test for [endpoint] in tests/contract/test_[name].py"
+Task: "Integration test for [user journey] in tests/integration/test_[name].py"
+
+# Launch all models for User Story 1 together:
+Task: "Create [Entity1] model in src/models/[entity1].py"
+Task: "Create [Entity2] model in src/models/[entity2].py"
```
+---
+
+## Implementation Strategy
+
+### MVP First (User Story 1 Only)
+
+1. Complete Phase 1: Setup
+2. Complete Phase 2: Foundational (CRITICAL - blocks all stories)
+3. Complete Phase 3: User Story 1
+4. **STOP and VALIDATE**: Test User Story 1 independently
+5. Deploy/demo if ready
+
+### Incremental Delivery
+
+1. Complete Setup + Foundational β Foundation ready
+2. Add User Story 1 β Test independently β Deploy/Demo (MVP!)
+3. Add User Story 2 β Test independently β Deploy/Demo
+4. Add User Story 3 β Test independently β Deploy/Demo
+5. Each story adds value without breaking previous stories
+
+### Parallel Team Strategy
+
+With multiple developers:
+
+1. Team completes Setup + Foundational together
+2. Once Foundational is done:
+ - Developer A: User Story 1
+ - Developer B: User Story 2
+ - Developer C: User Story 3
+3. Stories complete and integrate independently
+
+---
+
## Notes
+
- [P] tasks = different files, no dependencies
+- [Story] label maps task to specific user story for traceability
+- Each user story should be independently completable and testable
- Verify tests fail before implementing
-- Commit after each task
-- Avoid: vague tasks, same file conflicts
+- Commit after each task or logical group
+- Stop at any checkpoint to validate story independently
+- Avoid: vague tasks, same file conflicts, cross-story dependencies that break independence
-## Task Generation Rules
-*Applied during main() execution*
-1. **From Contracts**:
- - Each contract file β contract test task [P]
- - Each endpoint β implementation task
-
-2. **From Data Model**:
- - Each entity β model creation task [P]
- - Relationships β service layer tasks
-
-3. **From User Stories**:
- - Each story β integration test [P]
- - Quickstart scenarios β validation tasks
-
-4. **Ordering**:
- - Setup β Tests β Models β Services β Endpoints β Polish
- - Dependencies block parallel execution
-
-## Validation Checklist
-*GATE: Checked by main() before returning*
-
-- [ ] All contracts have corresponding tests
-- [ ] All entities have model tasks
-- [ ] All tests come before implementation
-- [ ] Parallel tasks truly independent
-- [ ] Each task specifies exact file path
-- [ ] No task modifies same file as another [P] task
\ No newline at end of file
diff --git a/templates/vscode-settings.json b/templates/vscode-settings.json
new file mode 100644
index 00000000..3d6be004
--- /dev/null
+++ b/templates/vscode-settings.json
@@ -0,0 +1,13 @@
+{
+ "chat.promptFilesRecommendations": {
+ "speckit.constitution": true,
+ "speckit.specify": true,
+ "speckit.plan": true,
+ "speckit.tasks": true,
+ "speckit.implement": true
+ },
+ "chat.tools.terminal.autoApprove": {
+ ".specify/scripts/bash/": true,
+ ".specify/scripts/ps/": true
+ }
+}