/sniper-discover -- Phase 1: Discovery & Analysis (Parallel Team)
You are executing the /sniper-discover command. Your job is to spawn a parallel discovery team that researches the project's market landscape, risks, and user needs. You are the team lead -- you coordinate, you do NOT produce artifacts yourself. Follow every step below precisely.
Arguments: $ARGUMENTS
Step 0: Pre-Flight Checks
Perform ALL of the following checks before proceeding. If any check fails, STOP and report the issue.
0a. Verify SNIPER Is Initialized
- Read
.sniper/config.yaml. - If the file does not exist or
project.nameis empty:- STOP. Print: "SNIPER is not initialized. Run
/sniper-initfirst." - Do not proceed further.
- STOP. Print: "SNIPER is not initialized. Run
0b. Config Migration Check
- Read
schema_versionfrom.sniper/config.yaml. - If
schema_versionis absent or less than 2, run the v1→v2 migration as defined in the Config Reader Protocol (seeplans/features/phase-a-config-schema.md). Write the updated config before proceeding.
0c. Verify Phase State
- Determine the current active phase: find the last entry in
state.phase_logwherecompleted_atis null. - If no active phase (all completed or empty log): Good -- proceed. Re-running discover after other phases is normal iteration.
- If active phase is
discover: The discover phase is already in progress.- Ask the user: "A discover phase is already in progress ({context}). Options: (a) Resume it (b) Start a new discover with a different context"
- If resume, STOP (they should continue in the existing session).
- If active phase is something else (plan, solve, sprint, ingest):
- Ask the user: "You have an active {phase} phase ({context}) that hasn't completed. Options: (a) Pause it and start discover (b) Complete {phase} first"
- If (b), STOP.
0d. Amendment Detection
- Check if the target artifact files already exist and are non-empty:
docs/brief.mddocs/risks.mddocs/personas.md
- If ANY exist: Enter amendment mode. Note which files exist and their current version numbers (from the version header). Agents will be instructed to amend rather than create from scratch (see Step 4 amendment instructions below).
- If NONE exist: Normal create mode. Proceed with standard behavior.
0e. Verify Framework Files
Check that these files exist (they are needed by the team):
.sniper/teams/discover.yaml.sniper/spawn-prompts/_template.md.sniper/checklists/discover-review.md.sniper/personas/process/analyst.md.sniper/personas/cognitive/systems-thinker.md.sniper/personas/cognitive/devils-advocate.md.sniper/personas/cognitive/user-empathetic.md
If any are missing, print a warning listing the missing files but continue if at least the team YAML exists.
Step 1: Update Lifecycle State
Edit .sniper/config.yaml to update the state section:
- Append to
state.phase_log:yaml- phase: discover context: "{from --context argument, or 'initial' for first run, or 'iteration-N' for re-runs}" started_at: "{current ISO timestamp}" completed_at: null approved_by: null
Step 2: Read Team Definition
- Read
.sniper/teams/discover.yamlin full. - Parse out:
team_name(should besniper-discover)- The list of
teammateswith theirname,composelayers, andtasks - The
coordinationrules (should be empty for discover -- independent research) - The
review_gatesection (checklist path and mode)
- Store these values for subsequent steps.
Step 3: Read Project Context
Gather the context that teammates will need:
- Read
.sniper/config.yamlfully -- extractproject.name,project.description,project.type,stack,domain_pack, andownershipsections. - If
domain_packis not null, check if.sniper/domain-packs/{domain_pack}/exists and read any context files within it. - Read the artifact template
.sniper/templates/brief.md-- teammates will need to follow this template.
Step 4: Compose Spawn Prompts
For each teammate in the team YAML, compose a spawn prompt by assembling persona layers. Do this by reading the actual persona files and assembling them into the template.
Teammate: analyst
Read these persona layer files:
- Process:
.sniper/personas/process/analyst.md - Technical: SKIP (null in team YAML)
- Cognitive:
.sniper/personas/cognitive/systems-thinker.md - Domain: If
domain_packis set, read.sniper/domain-packs/{domain_pack}/context/*.md. Otherwise skip.
- Process:
Read the spawn prompt template:
.sniper/spawn-prompts/_template.mdAssemble the spawn prompt by filling the template:
{name}= "analyst"{process_layer}= contents of the process persona file{technical_layer}= "No specific technical lens for this role."{cognitive_layer}= contents of the cognitive persona file{domain_layer}= domain pack context if available, otherwise "No domain pack configured."{ownership}= thedocsownership paths fromconfig.yaml
Append to the spawn prompt:
## Your Task **Task ID:** market-research **Task Name:** Market Research & Competitive Analysis **Output File:** docs/brief.md **Template:** .sniper/templates/brief.md {task description from the team YAML} ## Project Context - **Project:** {project.name} - **Type:** {project.type} - **Description:** {project.description} - **Stack:** {summary of stack section} ## Instructions (Create Mode — when docs/brief.md does NOT exist) 1. Read the template at `.sniper/templates/brief.md` to understand the expected output format. 2. If a domain pack is configured, read the domain context files for industry knowledge. 3. Research and produce the artifact at `docs/brief.md` following the template exactly. 4. Every section in the template MUST be filled -- no empty sections. 5. When complete, message the team lead that your task is done. ## Instructions (Amendment Mode — when docs/brief.md already exists) 1. Read the EXISTING artifact at `docs/brief.md` first. Note its current version number. 2. Read the template at `.sniper/templates/brief.md` to understand the expected format. 3. AMEND the existing brief: update sections that need changes, add new information, preserve content outside managed sections (<!-- sniper:managed --> markers). 4. Increment the version number in the header (e.g., v1 → v2). 5. Add a changelog entry describing what changed. 6. Set Status back to "Draft" (even if it was previously "Approved"). 7. When complete, message the team lead that your task is done.Save this composed prompt as a variable for spawning.
Teammate: risk-researcher
Read these persona layer files:
- Process:
.sniper/personas/process/analyst.md - Technical:
.sniper/personas/technical/infrastructure.md - Cognitive:
.sniper/personas/cognitive/devils-advocate.md - Domain: Same as above.
- Process:
Assemble using the same template pattern:
{name}= "risk-researcher"{technical_layer}= contents of the infrastructure technical persona{ownership}= thedocsownership paths
Append task context:
## Your Task **Task ID:** risk-assessment **Task Name:** Technical Feasibility & Risk Assessment **Output File:** docs/risks.md **Template:** .sniper/templates/risks.md {task description from the team YAML} ## Project Context {same project context as above} ## Instructions 1. Read the template at `.sniper/templates/risks.md` to understand the expected output format. 2. Assess technical feasibility, integration risks, compliance hurdles, and scalability challenges. 3. Challenge optimistic assumptions -- be the devil's advocate. 4. For each risk, provide a specific mitigation strategy. 5. Write the output to `docs/risks.md` following the template exactly. 6. When complete, message the team lead that your task is done.
Teammate: user-researcher
Read these persona layer files:
- Process:
.sniper/personas/process/analyst.md - Technical: SKIP (null)
- Cognitive:
.sniper/personas/cognitive/user-empathetic.md - Domain: Same as above.
- Process:
Assemble using the same template pattern:
{name}= "user-researcher"{technical_layer}= "No specific technical lens for this role."{ownership}= thedocsownership paths
Append task context:
## Your Task **Task ID:** user-personas **Task Name:** User Persona & Journey Mapping **Output File:** docs/personas.md **Template:** .sniper/templates/personas.md {task description from the team YAML} ## Project Context {same project context as above} ## Instructions 1. Read the template at `.sniper/templates/personas.md` to understand the expected output format. 2. Define 2-4 distinct user personas with goals, pain points, and workflows. 3. Map the primary user journey for each persona. 4. Identify key friction points and moments of delight. 5. Write the output to `docs/personas.md` following the template exactly. 6. When complete, message the team lead that your task is done.
Step 5: Create the Agent Team
Use the TeamCreate tool to create the team:
TeamCreate:
team_name: "sniper-discover"
description: "SNIPER Phase 1: Discovery & Analysis for {project.name}"Step 6: Create Tasks in the Shared Task List
Create one task per teammate using TaskCreate. Since coordination is empty (all tasks are independent), there are NO dependencies between tasks.
Task 1: Market Research
TaskCreate:
subject: "Market Research & Competitive Analysis"
description: "Research the market landscape. Identify competitors, features, pricing, and positioning. Define the project's unique value proposition. Output: docs/brief.md. Follow template at .sniper/templates/brief.md."
activeForm: "Researching market landscape and competitors"Task 2: Risk Assessment
TaskCreate:
subject: "Technical Feasibility & Risk Assessment"
description: "Assess technical feasibility, integration risks, compliance hurdles, and scalability challenges. Challenge optimistic assumptions. Output: docs/risks.md."
activeForm: "Assessing risks and technical feasibility"Task 3: User Personas
TaskCreate:
subject: "User Persona & Journey Mapping"
description: "Define 2-4 user personas with goals, pain points, and workflows. Map primary user journeys. Output: docs/personas.md."
activeForm: "Defining user personas and journeys"No dependencies between tasks -- all three run in parallel.
Step 7: Spawn Teammates
Spawn each teammate using the Task tool. Use the composed spawn prompts from Step 4.
For each teammate, spawn using:
team_name: "sniper-discover"name: the teammate name from the YAML (analyst, risk-researcher, user-researcher)- The full composed spawn prompt as the instruction
Spawn all three teammates. They will work in parallel on their independent tasks.
After spawning, assign each task to its corresponding teammate using TaskUpdate with the owner field:
- Task 1 (Market Research) -> owner: "analyst"
- Task 2 (Risk Assessment) -> owner: "risk-researcher"
- Task 3 (User Personas) -> owner: "user-researcher"
Mark each task as in_progress via TaskUpdate.
Step 8: Enter Delegate Mode
You are now the team lead. You do NOT produce artifacts.
Your responsibilities during execution:
- Monitor task progress via TaskList
- Respond to teammate messages (questions, blockers, completion notifications)
- If a teammate is stuck or asks a question about the project, provide guidance from the project context
- If a teammate finishes early, acknowledge their completion and update their task status to
completed - Track which teammates have completed their work
Do NOT:
- Write to
docs/brief.md,docs/risks.md, ordocs/personas.mdyourself - Modify teammate artifacts
- Do research yourself
Wait for all three teammates to report completion.
Step 9: Verify Artifacts Exist
Once all three teammates report completion:
Verify these files exist and are non-empty:
docs/brief.mddocs/risks.mddocs/personas.md
If any file is missing or empty, message the responsible teammate and ask them to complete it.
Do NOT proceed to Step 10 until all three files exist and contain content.
Step 10: Run Review Gate
Read the review gate configuration from the team YAML: review_gate.mode and review_gate.checklist.
- Read the review checklist at
.sniper/checklists/discover-review.md. - For each checklist item, perform a quick evaluation by reading the relevant artifact and checking if the item is addressed.
- Compile a review summary with:
- Total checklist items
- Items that PASS
- Items that NEED ATTENTION (not fully met but not blocking)
- Items that FAIL (critical gaps)
Gate Decision
The discover gate mode is flexible:
If there are no FAIL items: Auto-advance. Print the review summary and note any NEED ATTENTION items for async review.
If there are FAIL items: Present the failures to the user and ask:
"The discovery review found {N} critical issues. Would you like to:
- Have the team fix the issues (I will message the relevant teammates)
- Override and advance anyway
- Stop and review manually"
If option 1: Message the relevant teammates with specific feedback, wait for fixes, then re-run the checklist. If option 2: Proceed with a note that issues were overridden. If option 3: STOP and let the user handle it.
Step 11: Update State and Shut Down Team
Update Lifecycle State
Edit .sniper/config.yaml:
- Update artifact tracking (increment version if amendment mode):
- Set
state.artifacts.brief.status: draftand incrementstate.artifacts.brief.version - Set
state.artifacts.risks.status: draftand incrementstate.artifacts.risks.version(if risks.md was produced) - Set
state.artifacts.personas.status: draftand incrementstate.artifacts.personas.version(if personas.md was produced)
- Set
- Update the discover entry in
state.phase_logto addcompleted_at: "{current ISO timestamp}" - If auto-advanced (flexible gate passed), set
approved_by: "auto-flexible"
Shut Down Teammates
Send a shutdown request to each teammate:
- Send shutdown_request to "analyst"
- Send shutdown_request to "risk-researcher"
- Send shutdown_request to "user-researcher"
Wait for all teammates to acknowledge shutdown.
Step 12: Present Results and Next Steps
Print a formatted summary:
============================================
SNIPER Phase 1: Discovery Complete
============================================
Artifacts Produced:
- docs/brief.md [draft]
- docs/risks.md [draft]
- docs/personas.md [draft]
Review Gate: FLEXIBLE
Passed: {count}/{total} checklist items
Attention: {count} items flagged for async review
Failed: {count} critical issues
Phase Duration: {time elapsed}
============================================
Next Steps
============================================
1. Review the discovery artifacts in `docs/`
2. When ready, run `/sniper-plan` to begin Phase 2: Planning & Architecture
3. Or run `/sniper-status` to see the full lifecycle state
============================================IMPORTANT RULES
- You are the LEAD. You coordinate. You do NOT write artifact files.
- All three teammates work in PARALLEL -- do not serialize their work.
- If
$ARGUMENTScontains "dry-run", perform Steps 0-4 only (compose prompts) and print them without spawning. This lets the user review prompts before execution. - If
$ARGUMENTScontains "skip-review", skip Step 10 and go straight to Step 11. - If a teammate crashes or becomes unresponsive after 10 minutes of no messages, report the issue to the user and offer to respawn that specific teammate.
- All file paths are relative to the project root.
- Do NOT proceed to
/sniper-planautomatically -- always let the user initiate the next phase.
