@sniper.ai/core 1.0.1 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +122 -32
- package/framework/checklists/debug-review.md +34 -0
- package/framework/checklists/feature-review.md +42 -0
- package/framework/checklists/ingest-review.md +42 -0
- package/framework/checklists/memory-review.md +30 -0
- package/framework/checklists/perf-review.md +33 -0
- package/framework/checklists/refactor-review.md +33 -0
- package/framework/checklists/security-review.md +34 -0
- package/framework/checklists/test-review.md +32 -0
- package/framework/checklists/workspace-review.md +34 -0
- package/framework/commands/sniper-audit.md +1549 -0
- package/framework/commands/sniper-compose.md +88 -2
- package/framework/commands/sniper-debug.md +337 -0
- package/framework/commands/sniper-discover.md +41 -15
- package/framework/commands/sniper-feature.md +515 -0
- package/framework/commands/sniper-ingest.md +506 -0
- package/framework/commands/sniper-init.md +21 -5
- package/framework/commands/sniper-memory.md +219 -0
- package/framework/commands/sniper-plan.md +41 -19
- package/framework/commands/sniper-review.md +106 -42
- package/framework/commands/sniper-solve.md +47 -14
- package/framework/commands/sniper-sprint.md +132 -17
- package/framework/commands/sniper-status.md +240 -35
- package/framework/commands/sniper-workspace-feature.md +267 -0
- package/framework/commands/sniper-workspace-init.md +252 -0
- package/framework/commands/sniper-workspace-status.md +112 -0
- package/framework/commands/sniper-workspace-validate.md +138 -0
- package/framework/config.template.yaml +88 -9
- package/framework/personas/process/architecture-cartographer.md +25 -0
- package/framework/personas/process/code-archaeologist.md +22 -0
- package/framework/personas/process/code-investigator.md +29 -0
- package/framework/personas/process/code-reviewer.md +26 -0
- package/framework/personas/process/contract-designer.md +31 -0
- package/framework/personas/process/convention-miner.md +27 -0
- package/framework/personas/process/coverage-analyst.md +24 -0
- package/framework/personas/process/flake-hunter.md +30 -0
- package/framework/personas/process/impact-analyst.md +23 -0
- package/framework/personas/process/integration-validator.md +29 -0
- package/framework/personas/process/log-analyst.md +22 -0
- package/framework/personas/process/migration-architect.md +24 -0
- package/framework/personas/process/perf-profiler.md +27 -0
- package/framework/personas/process/release-manager.md +23 -0
- package/framework/personas/process/retro-analyst.md +30 -0
- package/framework/personas/process/threat-modeler.md +30 -0
- package/framework/personas/process/triage-lead.md +23 -0
- package/framework/personas/process/vuln-scanner.md +27 -0
- package/framework/personas/process/workspace-orchestrator.md +30 -0
- package/framework/spawn-prompts/_template.md +3 -0
- package/framework/teams/debug.yaml +56 -0
- package/framework/teams/feature-plan.yaml +61 -0
- package/framework/teams/ingest.yaml +85 -0
- package/framework/teams/perf.yaml +33 -0
- package/framework/teams/refactor.yaml +34 -0
- package/framework/teams/retro.yaml +30 -0
- package/framework/teams/review-pr.yaml +73 -0
- package/framework/teams/review-release.yaml +70 -0
- package/framework/teams/security.yaml +59 -0
- package/framework/teams/test.yaml +59 -0
- package/framework/teams/workspace-feature.yaml +69 -0
- package/framework/teams/workspace-validation.yaml +27 -0
- package/framework/templates/arch-delta.md +74 -0
- package/framework/templates/architecture.md +24 -1
- package/framework/templates/brief.md +22 -1
- package/framework/templates/bug-report.md +55 -0
- package/framework/templates/contract-validation-report.md +68 -0
- package/framework/templates/contract.yaml +60 -0
- package/framework/templates/conventions.md +59 -0
- package/framework/templates/coverage-report.md +67 -0
- package/framework/templates/epic.md +14 -0
- package/framework/templates/feature-brief.md +54 -0
- package/framework/templates/feature-spec.md +53 -0
- package/framework/templates/flaky-report.md +64 -0
- package/framework/templates/investigation.md +49 -0
- package/framework/templates/memory-anti-pattern.yaml +16 -0
- package/framework/templates/memory-convention.yaml +17 -0
- package/framework/templates/memory-decision.yaml +16 -0
- package/framework/templates/migration-plan.md +47 -0
- package/framework/templates/optimization-plan.md +59 -0
- package/framework/templates/performance-profile.md +64 -0
- package/framework/templates/postmortem.md +69 -0
- package/framework/templates/pr-review.md +50 -0
- package/framework/templates/prd.md +24 -1
- package/framework/templates/refactor-scope.md +52 -0
- package/framework/templates/release-readiness.md +66 -0
- package/framework/templates/retro.yaml +44 -0
- package/framework/templates/security.md +22 -1
- package/framework/templates/story.md +16 -0
- package/framework/templates/threat-model.md +71 -0
- package/framework/templates/ux-spec.md +18 -1
- package/framework/templates/vulnerability-report.md +56 -0
- package/framework/templates/workspace-brief.md +52 -0
- package/framework/templates/workspace-plan.md +50 -0
- package/framework/workflows/workspace-feature.md +71 -0
- package/package.json +1 -1
|
@@ -0,0 +1,267 @@
|
|
|
1
|
+
# /sniper-workspace feature -- Plan and Execute a Cross-Repo Feature
|
|
2
|
+
|
|
3
|
+
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.
|
|
4
|
+
|
|
5
|
+
The user's arguments are provided in: $ARGUMENTS
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## Step 0: Pre-Flight Checks
|
|
10
|
+
|
|
11
|
+
1. Verify `workspace.yaml` exists in the current directory
|
|
12
|
+
- If not, print:
|
|
13
|
+
```
|
|
14
|
+
ERROR: No workspace found. Run /sniper-workspace init first.
|
|
15
|
+
```
|
|
16
|
+
Then STOP.
|
|
17
|
+
|
|
18
|
+
2. Read `workspace.yaml` and validate:
|
|
19
|
+
- All repository paths are accessible
|
|
20
|
+
- All repos have `.sniper/config.yaml`
|
|
21
|
+
- Dependency graph is a valid DAG
|
|
22
|
+
|
|
23
|
+
3. Parse `$ARGUMENTS`:
|
|
24
|
+
- First positional argument: feature description (required)
|
|
25
|
+
- `--resume WKSP-{XXXX}`: resume an existing workspace feature
|
|
26
|
+
- `--skip-to {phase}`: skip to a specific phase (contracts | stories | sprint | validate)
|
|
27
|
+
- `--wave {N}`: resume from a specific wave
|
|
28
|
+
- `--list`: list active workspace features
|
|
29
|
+
|
|
30
|
+
4. If `--list`, display active features and STOP.
|
|
31
|
+
|
|
32
|
+
5. If `--resume`, load the existing feature state and skip to the appropriate phase.
|
|
33
|
+
|
|
34
|
+
6. If new feature: assign the next `WKSP-{XXXX}` ID from `state.feature_counter`. Increment the counter.
|
|
35
|
+
|
|
36
|
+
---
|
|
37
|
+
|
|
38
|
+
## Step 1: Phase 1 — Scoping
|
|
39
|
+
|
|
40
|
+
### 1a: Read Workspace Context
|
|
41
|
+
1. Read `workspace.yaml` for repository topology and dependency graph
|
|
42
|
+
2. For each repo, read `docs/architecture.md` (or equivalent from SNPR-0003 ingestion)
|
|
43
|
+
3. Read existing contracts from `contracts/` directory
|
|
44
|
+
4. Read workspace memory from `memory/` directory
|
|
45
|
+
|
|
46
|
+
### 1b: Create Feature Directory
|
|
47
|
+
```
|
|
48
|
+
features/WKSP-{XXXX}/
|
|
49
|
+
repo-stories/
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
### 1c: Compose Orchestrator
|
|
53
|
+
Compose the workspace orchestrator spawn prompt:
|
|
54
|
+
```
|
|
55
|
+
/sniper-compose --process workspace-orchestrator --cognitive systems-thinker --name "Workspace Orchestrator"
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
### 1d: Generate Workspace Brief
|
|
59
|
+
The orchestrator agent produces the workspace feature brief:
|
|
60
|
+
- Which repos are affected and why
|
|
61
|
+
- What interfaces need to be created or modified
|
|
62
|
+
- Wave ordering based on dependency graph
|
|
63
|
+
- Written to: `features/WKSP-{XXXX}/brief.md`
|
|
64
|
+
|
|
65
|
+
### 1e: Brief Review Gate
|
|
66
|
+
Present the workspace brief to the user for approval.
|
|
67
|
+
- If approved, proceed to Step 2
|
|
68
|
+
- If rejected, revise based on feedback and re-present
|
|
69
|
+
|
|
70
|
+
---
|
|
71
|
+
|
|
72
|
+
## Step 2: Phase 2 — Contract Design
|
|
73
|
+
|
|
74
|
+
### 2a: Read Team Definition
|
|
75
|
+
Read `.sniper/teams/workspace-feature.yaml` for the team composition.
|
|
76
|
+
|
|
77
|
+
### 2b: Compose Contract Designer
|
|
78
|
+
```
|
|
79
|
+
/sniper-compose --process contract-designer --technical api-design --cognitive systems-thinker --name "Contract Designer"
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
### 2c: Generate Contracts
|
|
83
|
+
The contract designer reads the approved brief and produces:
|
|
84
|
+
- Interface contracts for all cross-repo communication
|
|
85
|
+
- Saved to: `contracts/{contract-name}.contract.yaml`
|
|
86
|
+
- Each contract includes: endpoints, shared types, events, versioning
|
|
87
|
+
|
|
88
|
+
### 2d: Contract Review Gate
|
|
89
|
+
Present the contracts to the user for approval.
|
|
90
|
+
- If approved, proceed to Step 3
|
|
91
|
+
- If rejected, revise and re-present
|
|
92
|
+
- **This is a strict gate** — contracts cannot change once approved (immutable during sprints)
|
|
93
|
+
|
|
94
|
+
---
|
|
95
|
+
|
|
96
|
+
## Step 3: Phase 3 — Per-Repo Story Generation
|
|
97
|
+
|
|
98
|
+
For each affected repository (from the workspace brief):
|
|
99
|
+
|
|
100
|
+
### 3a: Generate Repo Feature
|
|
101
|
+
1. Change working context to the repo directory
|
|
102
|
+
2. Run a scoped `/sniper-feature` with:
|
|
103
|
+
- The workspace feature brief as context
|
|
104
|
+
- The relevant contracts as interface specifications
|
|
105
|
+
- The repo's own architecture docs
|
|
106
|
+
3. This generates stories within the repo's own `.sniper/` structure
|
|
107
|
+
|
|
108
|
+
### 3b: Record Story References
|
|
109
|
+
Save story references in the workspace:
|
|
110
|
+
```yaml
|
|
111
|
+
# features/WKSP-{XXXX}/repo-stories/{repo-name}.yaml
|
|
112
|
+
repo: {repo-name}
|
|
113
|
+
feature_ref: "SNPR-{XXXX}"
|
|
114
|
+
stories:
|
|
115
|
+
- id: "STORY-XXX"
|
|
116
|
+
title: "{story title}"
|
|
117
|
+
contract_refs: [{contract-name}/{item}]
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
### 3c: Verify Coverage
|
|
121
|
+
Check that every contract item has at least one story referencing it across all repos.
|
|
122
|
+
If coverage gaps exist, flag them and ask the user whether to generate additional stories.
|
|
123
|
+
|
|
124
|
+
---
|
|
125
|
+
|
|
126
|
+
## Step 4: Phase 4 — Wave-Based Sprint Orchestration
|
|
127
|
+
|
|
128
|
+
### 4a: Compute Wave Assignment
|
|
129
|
+
From the dependency graph, assign repos to waves:
|
|
130
|
+
1. Wave 1: repos with no dependencies (leaf nodes)
|
|
131
|
+
2. Wave 2: repos that depend only on Wave 1 repos
|
|
132
|
+
3. Wave 3: repos that depend on Wave 2 repos
|
|
133
|
+
4. Continue until all repos are assigned
|
|
134
|
+
|
|
135
|
+
Repos in the same wave can sprint in parallel.
|
|
136
|
+
|
|
137
|
+
### 4b: Execute Each Wave
|
|
138
|
+
|
|
139
|
+
For each wave (starting from Wave 1):
|
|
140
|
+
|
|
141
|
+
#### Sprint Execution
|
|
142
|
+
1. For each repo in the wave:
|
|
143
|
+
- Change working context to the repo directory
|
|
144
|
+
- Run `/sniper-sprint` with the feature's stories for this repo
|
|
145
|
+
- After sprint, run the repo's review gate (`/sniper-review`)
|
|
146
|
+
2. If multiple repos in the wave, they can sprint in parallel
|
|
147
|
+
|
|
148
|
+
#### Contract Validation (between waves)
|
|
149
|
+
After all repos in the wave complete:
|
|
150
|
+
1. Compose the integration validator:
|
|
151
|
+
```
|
|
152
|
+
/sniper-compose --process integration-validator --technical backend --cognitive devils-advocate --name "Integration Validator"
|
|
153
|
+
```
|
|
154
|
+
2. Run contract validation for contracts involving repos in this wave
|
|
155
|
+
3. Write validation report to: `features/WKSP-{XXXX}/validation-wave-{N}.md`
|
|
156
|
+
|
|
157
|
+
#### Wave Gate
|
|
158
|
+
- If validation passes: proceed to next wave
|
|
159
|
+
- If validation fails:
|
|
160
|
+
1. Display the mismatches
|
|
161
|
+
2. Auto-generate fix stories in the affected repos
|
|
162
|
+
3. Run a corrective sprint for the fix stories
|
|
163
|
+
4. Re-validate
|
|
164
|
+
5. If still failing after 2 correction attempts, STOP and ask the user for guidance
|
|
165
|
+
|
|
166
|
+
### 4c: Track Wave Progress
|
|
167
|
+
Update the workspace feature state:
|
|
168
|
+
```yaml
|
|
169
|
+
state:
|
|
170
|
+
features:
|
|
171
|
+
- id: "WKSP-{XXXX}"
|
|
172
|
+
phase: sprint
|
|
173
|
+
sprint_wave: {current_wave}
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
---
|
|
177
|
+
|
|
178
|
+
## Step 5: Phase 5 — Final Integration Validation
|
|
179
|
+
|
|
180
|
+
After all waves complete:
|
|
181
|
+
|
|
182
|
+
### 5a: Full Contract Validation
|
|
183
|
+
Run contract validation across ALL contracts (not just per-wave):
|
|
184
|
+
1. Check all endpoints match between producers and consumers
|
|
185
|
+
2. Check all shared types are compatible
|
|
186
|
+
3. Check all events have matching producer/consumer schemas
|
|
187
|
+
|
|
188
|
+
### 5b: Integration Report
|
|
189
|
+
Produce a final integration validation report:
|
|
190
|
+
```
|
|
191
|
+
============================================
|
|
192
|
+
Workspace Feature Integration Validation
|
|
193
|
+
============================================
|
|
194
|
+
|
|
195
|
+
Feature: WKSP-{XXXX} — {title}
|
|
196
|
+
Waves completed: {N}
|
|
197
|
+
Repos: {list}
|
|
198
|
+
|
|
199
|
+
Contract Validation:
|
|
200
|
+
{contract-1} v{version} ✅ All {N} items passed
|
|
201
|
+
{contract-2} v{version} ✅ All {N} items passed
|
|
202
|
+
|
|
203
|
+
Overall: PASS / FAIL
|
|
204
|
+
============================================
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
### 5c: Final Gate
|
|
208
|
+
If PASS: proceed to Step 6
|
|
209
|
+
If FAIL: present mismatches, generate fix stories, run corrective sprint
|
|
210
|
+
|
|
211
|
+
---
|
|
212
|
+
|
|
213
|
+
## Step 6: Feature Complete
|
|
214
|
+
|
|
215
|
+
### 6a: Update Workspace State
|
|
216
|
+
```yaml
|
|
217
|
+
state:
|
|
218
|
+
features:
|
|
219
|
+
- id: "WKSP-{XXXX}"
|
|
220
|
+
phase: complete
|
|
221
|
+
completed_at: "{ISO 8601}"
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
### 6b: Update Contract Versions
|
|
225
|
+
Bump versions on any contracts that were modified by this feature.
|
|
226
|
+
|
|
227
|
+
### 6c: Trigger Workspace Memory Update
|
|
228
|
+
If workspace memory is enabled:
|
|
229
|
+
1. Run retros for each repo that sprinted (if not already run)
|
|
230
|
+
2. Check for cross-repo conventions (patterns consistent across 2+ repos)
|
|
231
|
+
3. Promote qualifying conventions to workspace memory
|
|
232
|
+
|
|
233
|
+
### 6d: Present Results
|
|
234
|
+
```
|
|
235
|
+
============================================
|
|
236
|
+
Workspace Feature Complete
|
|
237
|
+
============================================
|
|
238
|
+
|
|
239
|
+
Feature: WKSP-{XXXX} — {title}
|
|
240
|
+
Repos: {count} repositories
|
|
241
|
+
Waves: {count} waves
|
|
242
|
+
Stories: {count} total across all repos
|
|
243
|
+
|
|
244
|
+
Contracts Updated:
|
|
245
|
+
{contract-name} v{old} → v{new}
|
|
246
|
+
|
|
247
|
+
Memory Updates:
|
|
248
|
+
{N} workspace conventions added
|
|
249
|
+
{N} workspace anti-patterns added
|
|
250
|
+
|
|
251
|
+
All integration checks passed. Feature is complete.
|
|
252
|
+
============================================
|
|
253
|
+
```
|
|
254
|
+
|
|
255
|
+
---
|
|
256
|
+
|
|
257
|
+
## IMPORTANT RULES
|
|
258
|
+
|
|
259
|
+
- **Contracts are immutable during sprint waves** — once approved, they do not change until the wave completes
|
|
260
|
+
- **Wave ordering is mandatory** — never sprint a repo before its dependency wave completes
|
|
261
|
+
- **Contract validation runs between every wave** — do not skip validation
|
|
262
|
+
- **Each repo sprints independently** — agents in one repo do not modify files in another repo
|
|
263
|
+
- **Fix stories are scoped** — corrective sprints only address specific contract mismatches
|
|
264
|
+
- **The workspace orchestrator coordinates but does not code** — it stays in delegate mode
|
|
265
|
+
- **Parallel execution within waves is optional** — if resources are limited, repos can sprint sequentially within a wave
|
|
266
|
+
- **Always update workspace state** — the feature's phase and wave must be tracked for resume capability
|
|
267
|
+
- **Workspace memory promotion requires user confirmation** unless `auto_promote: true` in workspace config
|
|
@@ -0,0 +1,252 @@
|
|
|
1
|
+
# /sniper-workspace init -- Initialize a SNIPER Workspace
|
|
2
|
+
|
|
3
|
+
You are executing the `/sniper-workspace init` command. Your job is to create a workspace that coordinates multiple SNIPER-enabled repositories. Follow every step below precisely.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Step 0: Pre-Flight Checks
|
|
8
|
+
|
|
9
|
+
1. Check if a `workspace.yaml` file exists in the current directory.
|
|
10
|
+
- If yes, print:
|
|
11
|
+
```
|
|
12
|
+
A workspace already exists in this directory.
|
|
13
|
+
|
|
14
|
+
Workspace: {name}
|
|
15
|
+
Repositories: {count}
|
|
16
|
+
|
|
17
|
+
To add repos: /sniper-workspace add-repo <path>
|
|
18
|
+
To view status: /sniper-workspace status
|
|
19
|
+
```
|
|
20
|
+
Then STOP.
|
|
21
|
+
2. The current directory will become the workspace root. It can be:
|
|
22
|
+
- A dedicated workspace directory (recommended)
|
|
23
|
+
- An existing repo that will also serve as workspace root
|
|
24
|
+
|
|
25
|
+
---
|
|
26
|
+
|
|
27
|
+
## Step 1: Gather Workspace Information
|
|
28
|
+
|
|
29
|
+
Ask the user for:
|
|
30
|
+
1. **Workspace name** — short identifier (e.g., "my-saas-platform")
|
|
31
|
+
2. **Description** — one-line description of what the workspace coordinates
|
|
32
|
+
|
|
33
|
+
---
|
|
34
|
+
|
|
35
|
+
## Step 2: Scan for SNIPER-Enabled Repositories
|
|
36
|
+
|
|
37
|
+
1. Scan the parent directory and sibling directories for SNIPER-enabled repos:
|
|
38
|
+
- Check each directory for `.sniper/config.yaml`
|
|
39
|
+
- Also check immediate subdirectories (for monorepo-adjacent setups)
|
|
40
|
+
2. For each found repo, read its `.sniper/config.yaml` to extract:
|
|
41
|
+
- `project.name`
|
|
42
|
+
- `project.type`
|
|
43
|
+
- `stack.language`
|
|
44
|
+
3. Present the discovered repos:
|
|
45
|
+
```
|
|
46
|
+
Discovered SNIPER-enabled repositories:
|
|
47
|
+
|
|
48
|
+
✅ ../api-service (API, typescript)
|
|
49
|
+
✅ ../web-app (SaaS, typescript)
|
|
50
|
+
✅ ../shared-lib (Library, typescript)
|
|
51
|
+
⬜ ../unrelated-repo (CLI, python) — not selected
|
|
52
|
+
```
|
|
53
|
+
4. Let the user select which repos to include (default: all)
|
|
54
|
+
5. Let the user add additional repo paths manually
|
|
55
|
+
|
|
56
|
+
---
|
|
57
|
+
|
|
58
|
+
## Step 3: Auto-Detect Dependencies
|
|
59
|
+
|
|
60
|
+
For each selected repository:
|
|
61
|
+
|
|
62
|
+
### 3a: Package Dependencies
|
|
63
|
+
1. Read `package.json` (if exists) and check for cross-repo npm dependencies
|
|
64
|
+
2. If repo A's `package.json` has repo B's package name in `dependencies` or `devDependencies`, record: A depends on B
|
|
65
|
+
|
|
66
|
+
### 3b: API Specs
|
|
67
|
+
1. Check for `openapi.yaml`, `openapi.json`, `swagger.yaml`, or `swagger.json` in the repo root or `docs/` directory
|
|
68
|
+
2. If found, record it as an exposed API spec
|
|
69
|
+
|
|
70
|
+
### 3c: Type Exports
|
|
71
|
+
1. Check for shared type packages by looking at `package.json` exports or main fields
|
|
72
|
+
2. If a repo's name appears in another repo's imports, record the relationship
|
|
73
|
+
|
|
74
|
+
### 3d: Present Detected Dependencies
|
|
75
|
+
```
|
|
76
|
+
Detected dependency graph:
|
|
77
|
+
|
|
78
|
+
shared-lib
|
|
79
|
+
└── api-service
|
|
80
|
+
└── web-app
|
|
81
|
+
|
|
82
|
+
web-app depends on:
|
|
83
|
+
- api-service (REST API consumer)
|
|
84
|
+
- shared-lib (npm package: @myapp/shared-types)
|
|
85
|
+
|
|
86
|
+
api-service depends on:
|
|
87
|
+
- shared-lib (npm package: @myapp/shared-types)
|
|
88
|
+
|
|
89
|
+
shared-lib depends on:
|
|
90
|
+
- (none — leaf node)
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
Let the user confirm or modify the dependency graph.
|
|
94
|
+
|
|
95
|
+
---
|
|
96
|
+
|
|
97
|
+
## Step 4: Determine Repository Roles
|
|
98
|
+
|
|
99
|
+
For each repository, infer its role from the project type and stack:
|
|
100
|
+
|
|
101
|
+
| Project Type | Inferred Role |
|
|
102
|
+
|-------------|---------------|
|
|
103
|
+
| saas, web | frontend |
|
|
104
|
+
| api | backend |
|
|
105
|
+
| library | library |
|
|
106
|
+
| cli | service |
|
|
107
|
+
| monorepo | service |
|
|
108
|
+
| mobile | frontend |
|
|
109
|
+
|
|
110
|
+
Let the user confirm or override roles.
|
|
111
|
+
|
|
112
|
+
Also determine `exposes` and `consumes` for each repo based on the dependency analysis from Step 3.
|
|
113
|
+
|
|
114
|
+
---
|
|
115
|
+
|
|
116
|
+
## Step 5: Generate workspace.yaml
|
|
117
|
+
|
|
118
|
+
Create the workspace manifest:
|
|
119
|
+
|
|
120
|
+
```yaml
|
|
121
|
+
name: "{workspace_name}"
|
|
122
|
+
description: "{description}"
|
|
123
|
+
version: "1.0"
|
|
124
|
+
|
|
125
|
+
repositories:
|
|
126
|
+
- name: {repo_name}
|
|
127
|
+
path: {relative_path}
|
|
128
|
+
role: {role}
|
|
129
|
+
language: {language}
|
|
130
|
+
sniper_enabled: true
|
|
131
|
+
exposes:
|
|
132
|
+
# Auto-detected from Step 3
|
|
133
|
+
- type: rest_api | npm_package | event_bus | database_schema
|
|
134
|
+
spec: {path_to_spec} # optional
|
|
135
|
+
package: {package_name} # for npm_package type
|
|
136
|
+
consumes:
|
|
137
|
+
# Auto-detected from Step 3
|
|
138
|
+
- from: {repo_name}
|
|
139
|
+
type: rest_api | npm_package
|
|
140
|
+
package: {package_name} # for npm_package type
|
|
141
|
+
|
|
142
|
+
dependency_graph:
|
|
143
|
+
{repo_name}:
|
|
144
|
+
- {dependency_repo_name}
|
|
145
|
+
|
|
146
|
+
config:
|
|
147
|
+
contract_format: yaml
|
|
148
|
+
integration_validation: true
|
|
149
|
+
shared_domain_packs: []
|
|
150
|
+
memory:
|
|
151
|
+
workspace_conventions: true
|
|
152
|
+
auto_promote: false
|
|
153
|
+
|
|
154
|
+
state:
|
|
155
|
+
feature_counter: 1
|
|
156
|
+
features: []
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
Write the file to `workspace.yaml` in the current directory.
|
|
160
|
+
|
|
161
|
+
---
|
|
162
|
+
|
|
163
|
+
## Step 6: Create Workspace Directories
|
|
164
|
+
|
|
165
|
+
Create the following directory structure:
|
|
166
|
+
|
|
167
|
+
```
|
|
168
|
+
memory/
|
|
169
|
+
conventions.yaml # workspace-level: conventions: []
|
|
170
|
+
anti-patterns.yaml # workspace-level: anti_patterns: []
|
|
171
|
+
decisions.yaml # workspace-level: decisions: []
|
|
172
|
+
contracts/
|
|
173
|
+
.gitkeep
|
|
174
|
+
features/
|
|
175
|
+
.gitkeep
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
Initialize the memory YAML files with empty arrays.
|
|
179
|
+
|
|
180
|
+
---
|
|
181
|
+
|
|
182
|
+
## Step 7: Create Repository Symlinks (Optional)
|
|
183
|
+
|
|
184
|
+
If the repos are not subdirectories of the workspace:
|
|
185
|
+
|
|
186
|
+
```
|
|
187
|
+
repositories/
|
|
188
|
+
api-service -> ../api-service
|
|
189
|
+
web-app -> ../web-app
|
|
190
|
+
shared-lib -> ../shared-lib
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
Ask the user if they want symlinks created. If the repos are already subdirectories, skip this step.
|
|
194
|
+
|
|
195
|
+
---
|
|
196
|
+
|
|
197
|
+
## Step 8: Update Per-Repo Configs
|
|
198
|
+
|
|
199
|
+
For each selected repository:
|
|
200
|
+
1. Read its `.sniper/config.yaml`
|
|
201
|
+
2. Add or update the workspace section:
|
|
202
|
+
```yaml
|
|
203
|
+
workspace:
|
|
204
|
+
enabled: true
|
|
205
|
+
workspace_path: "{relative_path_to_workspace}"
|
|
206
|
+
repo_name: "{this_repo_name}"
|
|
207
|
+
```
|
|
208
|
+
3. Write the updated config
|
|
209
|
+
|
|
210
|
+
---
|
|
211
|
+
|
|
212
|
+
## Step 9: Display Workspace Summary
|
|
213
|
+
|
|
214
|
+
```
|
|
215
|
+
============================================
|
|
216
|
+
SNIPER Workspace Initialized
|
|
217
|
+
============================================
|
|
218
|
+
|
|
219
|
+
Name: {workspace_name}
|
|
220
|
+
Description: {description}
|
|
221
|
+
Location: {current_directory}
|
|
222
|
+
|
|
223
|
+
Repositories ({count}):
|
|
224
|
+
{repo_name} ({role}, {language}) {path}
|
|
225
|
+
...
|
|
226
|
+
|
|
227
|
+
Dependency Graph:
|
|
228
|
+
{visual representation}
|
|
229
|
+
|
|
230
|
+
Directories Created:
|
|
231
|
+
memory/ Workspace-level memory
|
|
232
|
+
contracts/ Interface contracts
|
|
233
|
+
features/ Cross-repo feature plans
|
|
234
|
+
|
|
235
|
+
Next Steps:
|
|
236
|
+
/sniper-workspace feature "{description}" — Plan a cross-repo feature
|
|
237
|
+
/sniper-workspace status — View workspace status
|
|
238
|
+
|
|
239
|
+
============================================
|
|
240
|
+
```
|
|
241
|
+
|
|
242
|
+
---
|
|
243
|
+
|
|
244
|
+
## IMPORTANT RULES
|
|
245
|
+
|
|
246
|
+
- The workspace root is the current directory — do NOT create a subdirectory
|
|
247
|
+
- Repository paths in workspace.yaml are always relative to the workspace root
|
|
248
|
+
- Never modify a repo's source code during init — only update .sniper/config.yaml
|
|
249
|
+
- If a repo is not SNIPER-enabled, warn the user and exclude it (they must run `sniper init` first)
|
|
250
|
+
- The dependency graph must be a DAG (directed acyclic graph) — flag circular dependencies as errors
|
|
251
|
+
- Auto-detection is best-effort — always let the user confirm and modify
|
|
252
|
+
- Memory YAML files must be initialized with empty arrays, not null
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
# /sniper-workspace status -- Show Workspace Status
|
|
2
|
+
|
|
3
|
+
You are executing the `/sniper-workspace status` command. Your job is to display the current state of the SNIPER workspace, including repository status, active features, contracts, and memory.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Step 0: Pre-Flight
|
|
8
|
+
|
|
9
|
+
1. Verify `workspace.yaml` exists in the current directory
|
|
10
|
+
- If not, print:
|
|
11
|
+
```
|
|
12
|
+
ERROR: No workspace found in the current directory.
|
|
13
|
+
Run /sniper-workspace init to create one.
|
|
14
|
+
```
|
|
15
|
+
Then STOP.
|
|
16
|
+
|
|
17
|
+
2. Read `workspace.yaml`
|
|
18
|
+
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
## Step 1: Repository Status
|
|
22
|
+
|
|
23
|
+
For each repository in the workspace:
|
|
24
|
+
1. Check if the path is accessible
|
|
25
|
+
2. Read `.sniper/config.yaml` to get current phase and sprint info
|
|
26
|
+
3. Count active features (from the repo's state)
|
|
27
|
+
|
|
28
|
+
Display:
|
|
29
|
+
```
|
|
30
|
+
Repositories:
|
|
31
|
+
{name} {role} {language} {phase or "idle"} {active_features} features {path}
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
Use status indicators:
|
|
35
|
+
- ✅ accessible and SNIPER-enabled
|
|
36
|
+
- ⚠️ path exists but not SNIPER-enabled
|
|
37
|
+
- ❌ path not accessible
|
|
38
|
+
|
|
39
|
+
---
|
|
40
|
+
|
|
41
|
+
## Step 2: Active Workspace Features
|
|
42
|
+
|
|
43
|
+
Read workspace `state.features` array.
|
|
44
|
+
|
|
45
|
+
Display:
|
|
46
|
+
```
|
|
47
|
+
Workspace Features:
|
|
48
|
+
WKSP-{XXXX} "{title}" Phase: {phase} Wave: {N}/{total} {repos affected}
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
If no active features: `No active workspace features.`
|
|
52
|
+
|
|
53
|
+
---
|
|
54
|
+
|
|
55
|
+
## Step 3: Contracts
|
|
56
|
+
|
|
57
|
+
Scan `contracts/` directory for `.contract.yaml` files.
|
|
58
|
+
|
|
59
|
+
For each contract:
|
|
60
|
+
1. Read the contract metadata (name, version, between, last_updated)
|
|
61
|
+
2. Count endpoints, shared types, and events
|
|
62
|
+
|
|
63
|
+
Display:
|
|
64
|
+
```
|
|
65
|
+
Contracts:
|
|
66
|
+
{name} v{version} {between[0]} ↔ {between[1]} {N} endpoints, {M} types, {K} events
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
If no contracts: `No contracts defined.`
|
|
70
|
+
|
|
71
|
+
---
|
|
72
|
+
|
|
73
|
+
## Step 4: Workspace Memory
|
|
74
|
+
|
|
75
|
+
If `memory/` directory exists:
|
|
76
|
+
1. Read `memory/conventions.yaml` — count entries
|
|
77
|
+
2. Read `memory/anti-patterns.yaml` — count entries
|
|
78
|
+
3. Read `memory/decisions.yaml` — count entries
|
|
79
|
+
|
|
80
|
+
Display:
|
|
81
|
+
```
|
|
82
|
+
Workspace Memory:
|
|
83
|
+
Conventions: {N}
|
|
84
|
+
Anti-Patterns: {N}
|
|
85
|
+
Decisions: {N}
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
If memory directory doesn't exist: `Workspace memory: not initialized`
|
|
89
|
+
|
|
90
|
+
---
|
|
91
|
+
|
|
92
|
+
## Step 5: Dependency Graph
|
|
93
|
+
|
|
94
|
+
Read the dependency graph from `workspace.yaml`.
|
|
95
|
+
|
|
96
|
+
Display a visual representation:
|
|
97
|
+
```
|
|
98
|
+
Dependency Graph:
|
|
99
|
+
shared-lib
|
|
100
|
+
└── api-service
|
|
101
|
+
└── web-app
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
If repos have no dependencies on each other: `All repositories are independent (no cross-dependencies).`
|
|
105
|
+
|
|
106
|
+
---
|
|
107
|
+
|
|
108
|
+
## IMPORTANT RULES
|
|
109
|
+
|
|
110
|
+
- This is a read-only command — do not modify any files
|
|
111
|
+
- If a repo path is inaccessible, show a warning but continue with other repos
|
|
112
|
+
- Always show all sections even if they're empty (use "none" or "not initialized" messages)
|