/sniper-workspace feature -- Plan and Execute a Cross-Repo Feature
You are executing the /sniper-workspace feature command. Your job is to plan and orchestrate a feature that spans multiple repositories in the workspace. Follow every step below precisely.
The user's arguments are provided in: $ARGUMENTS
Step 0: Pre-Flight Checks
Verify
workspace.yamlexists in the current directory- If not, print:Then STOP.
ERROR: No workspace found. Run /sniper-workspace init first.
- If not, print:
Read
workspace.yamland validate:- All repository paths are accessible
- All repos have
.sniper/config.yaml - Dependency graph is a valid DAG
Parse
$ARGUMENTS:- First positional argument: feature description (required)
--resume WKSP-{XXXX}: resume an existing workspace feature--skip-to {phase}: skip to a specific phase (contracts | stories | sprint | validate)--wave {N}: resume from a specific wave--list: list active workspace features
If
--list, display active features and STOP.If
--resume, load the existing feature state and skip to the appropriate phase.If new feature: assign the next
WKSP-{XXXX}ID fromstate.feature_counter. Increment the counter.
Step 1: Phase 1 — Scoping
1a: Read Workspace Context
- Read
workspace.yamlfor repository topology and dependency graph - For each repo, read
docs/architecture.md(or equivalent from SNPR-0003 ingestion) - Read existing contracts from
contracts/directory - Read workspace memory from
memory/directory
1b: Create Feature Directory
features/WKSP-{XXXX}/
repo-stories/1c: Compose Orchestrator
Compose the workspace orchestrator spawn prompt:
/sniper-compose --process workspace-orchestrator --cognitive systems-thinker --name "Workspace Orchestrator"1d: Generate Workspace Brief
The orchestrator agent produces the workspace feature brief:
- Which repos are affected and why
- What interfaces need to be created or modified
- Wave ordering based on dependency graph
- Written to:
features/WKSP-{XXXX}/brief.md
1e: Brief Review Gate
Present the workspace brief to the user for approval.
- If approved, proceed to Step 2
- If rejected, revise based on feedback and re-present
Step 2: Phase 2 — Contract Design
2a: Read Team Definition
Read .sniper/teams/workspace-feature.yaml for the team composition.
2b: Compose Contract Designer
/sniper-compose --process contract-designer --technical api-design --cognitive systems-thinker --name "Contract Designer"2c: Generate Contracts
The contract designer reads the approved brief and produces:
- Interface contracts for all cross-repo communication
- Saved to:
contracts/{contract-name}.contract.yaml - Each contract includes: endpoints, shared types, events, versioning
2d: Contract Review Gate
Present the contracts to the user for approval.
- If approved, proceed to Step 3
- If rejected, revise and re-present
- This is a strict gate — contracts cannot change once approved (immutable during sprints)
Step 3: Phase 3 — Per-Repo Story Generation
For each affected repository (from the workspace brief):
3a: Generate Repo Feature
- Change working context to the repo directory
- Run a scoped
/sniper-featurewith:- The workspace feature brief as context
- The relevant contracts as interface specifications
- The repo's own architecture docs
- This generates stories within the repo's own
.sniper/structure
3b: Record Story References
Save story references in the workspace:
# features/WKSP-{XXXX}/repo-stories/{repo-name}.yaml
repo: {repo-name}
feature_ref: "SNPR-{XXXX}"
stories:
- id: "STORY-XXX"
title: "{story title}"
contract_refs: [{contract-name}/{item}]3c: Verify Coverage
Check that every contract item has at least one story referencing it across all repos. If coverage gaps exist, flag them and ask the user whether to generate additional stories.
Step 4: Phase 4 — Wave-Based Sprint Orchestration
4a: Compute Wave Assignment
From the dependency graph, assign repos to waves:
- Wave 1: repos with no dependencies (leaf nodes)
- Wave 2: repos that depend only on Wave 1 repos
- Wave 3: repos that depend on Wave 2 repos
- Continue until all repos are assigned
Repos in the same wave can sprint in parallel.
4b: Execute Each Wave
For each wave (starting from Wave 1):
Sprint Execution
- For each repo in the wave:
- Change working context to the repo directory
- Run
/sniper-sprintwith the feature's stories for this repo - After sprint, run the repo's review gate (
/sniper-review)
- If multiple repos in the wave, they can sprint in parallel
Contract Validation (between waves)
After all repos in the wave complete:
- Compose the integration validator:
/sniper-compose --process integration-validator --technical backend --cognitive devils-advocate --name "Integration Validator" - Run contract validation for contracts involving repos in this wave
- Write validation report to:
features/WKSP-{XXXX}/validation-wave-{N}.md
Wave Gate
- If validation passes: proceed to next wave
- If validation fails:
- Display the mismatches
- Auto-generate fix stories in the affected repos
- Run a corrective sprint for the fix stories
- Re-validate
- If still failing after 2 correction attempts, STOP and ask the user for guidance
4c: Track Wave Progress
Update the workspace feature state:
state:
features:
- id: "WKSP-{XXXX}"
phase: sprint
sprint_wave: {current_wave}Step 5: Phase 5 — Final Integration Validation
After all waves complete:
5a: Full Contract Validation
Run contract validation across ALL contracts (not just per-wave):
- Check all endpoints match between producers and consumers
- Check all shared types are compatible
- Check all events have matching producer/consumer schemas
5b: Integration Report
Produce a final integration validation report:
============================================
Workspace Feature Integration Validation
============================================
Feature: WKSP-{XXXX} — {title}
Waves completed: {N}
Repos: {list}
Contract Validation:
{contract-1} v{version} ✅ All {N} items passed
{contract-2} v{version} ✅ All {N} items passed
Overall: PASS / FAIL
============================================5c: Final Gate
If PASS: proceed to Step 6 If FAIL: present mismatches, generate fix stories, run corrective sprint
Step 6: Feature Complete
6a: Update Workspace State
state:
features:
- id: "WKSP-{XXXX}"
phase: complete
completed_at: "{ISO 8601}"6b: Update Contract Versions
Bump versions on any contracts that were modified by this feature.
6c: Trigger Workspace Memory Update
If workspace memory is enabled:
- Run retros for each repo that sprinted (if not already run)
- Check for cross-repo conventions (patterns consistent across 2+ repos)
- Promote qualifying conventions to workspace memory
6d: Present Results
============================================
Workspace Feature Complete
============================================
Feature: WKSP-{XXXX} — {title}
Repos: {count} repositories
Waves: {count} waves
Stories: {count} total across all repos
Contracts Updated:
{contract-name} v{old} → v{new}
Memory Updates:
{N} workspace conventions added
{N} workspace anti-patterns added
All integration checks passed. Feature is complete.
============================================IMPORTANT RULES
- Contracts are immutable during sprint waves — once approved, they do not change until the wave completes
- Wave ordering is mandatory — never sprint a repo before its dependency wave completes
- Contract validation runs between every wave — do not skip validation
- Each repo sprints independently — agents in one repo do not modify files in another repo
- Fix stories are scoped — corrective sprints only address specific contract mismatches
- The workspace orchestrator coordinates but does not code — it stays in delegate mode
- Parallel execution within waves is optional — if resources are limited, repos can sprint sequentially within a wave
- Always update workspace state — the feature's phase and wave must be tracked for resume capability
- Workspace memory promotion requires user confirmation unless
auto_promote: truein workspace config
