@sniper.ai/core 2.0.0 → 3.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.
Files changed (208) hide show
  1. package/README.md +88 -98
  2. package/agents/analyst.md +30 -0
  3. package/agents/architect.md +36 -0
  4. package/agents/backend-dev.md +43 -0
  5. package/agents/code-reviewer.md +72 -0
  6. package/agents/frontend-dev.md +43 -0
  7. package/agents/fullstack-dev.md +44 -0
  8. package/agents/gate-reviewer.md +62 -0
  9. package/agents/lead-orchestrator.md +51 -0
  10. package/agents/product-manager.md +38 -0
  11. package/agents/qa-engineer.md +37 -0
  12. package/agents/retro-analyst.md +98 -0
  13. package/checklists/discover.yaml +23 -0
  14. package/checklists/implement.yaml +28 -0
  15. package/checklists/ingest-document.yaml +18 -0
  16. package/checklists/ingest-extract.yaml +13 -0
  17. package/checklists/ingest-scan.yaml +18 -0
  18. package/checklists/multi-faceted-review.yaml +56 -0
  19. package/checklists/plan.yaml +36 -0
  20. package/checklists/refactor-analyze.yaml +18 -0
  21. package/checklists/review.yaml +28 -0
  22. package/claude-md.template +42 -0
  23. package/config.template.yaml +156 -0
  24. package/hooks/settings-hooks.json +31 -0
  25. package/hooks/signal-hooks.json +11 -0
  26. package/package.json +23 -5
  27. package/personas/cognitive/devils-advocate.md +24 -0
  28. package/personas/cognitive/performance-focused.md +23 -0
  29. package/personas/cognitive/security-first.md +24 -0
  30. package/protocols/explore.yaml +18 -0
  31. package/protocols/feature.yaml +45 -0
  32. package/protocols/full.yaml +63 -0
  33. package/protocols/hotfix.yaml +19 -0
  34. package/protocols/ingest.yaml +39 -0
  35. package/protocols/patch.yaml +30 -0
  36. package/protocols/refactor.yaml +41 -0
  37. package/schemas/checkpoint.schema.yaml +133 -0
  38. package/schemas/cost.schema.yaml +97 -0
  39. package/schemas/dependency-graph.schema.yaml +37 -0
  40. package/schemas/gate-result.schema.yaml +101 -0
  41. package/schemas/knowledge-manifest.schema.yaml +39 -0
  42. package/schemas/live-status.schema.yaml +122 -0
  43. package/schemas/protocol.schema.yaml +100 -0
  44. package/schemas/retro.schema.yaml +95 -0
  45. package/schemas/revert-plan.schema.yaml +40 -0
  46. package/schemas/signal.schema.yaml +39 -0
  47. package/schemas/velocity.schema.yaml +52 -0
  48. package/schemas/workspace-lock.schema.yaml +34 -0
  49. package/schemas/workspace.schema.yaml +82 -0
  50. package/skills/sniper-flow/SKILL.md +243 -0
  51. package/skills/sniper-flow-headless/SKILL.md +105 -0
  52. package/skills/sniper-init/SKILL.md +103 -0
  53. package/skills/sniper-review/SKILL.md +49 -0
  54. package/skills/sniper-status/SKILL.md +79 -0
  55. package/templates/architecture.md +23 -0
  56. package/templates/checkpoint.yaml +27 -0
  57. package/templates/codebase-overview.md +19 -0
  58. package/templates/cost.yaml +23 -0
  59. package/templates/custom-protocol.yaml +98 -0
  60. package/templates/knowledge-manifest.yaml +32 -0
  61. package/templates/live-status.yaml +26 -0
  62. package/templates/multi-faceted-review-report.md +28 -0
  63. package/templates/review-report.md +25 -0
  64. package/templates/signal-record.yaml +37 -0
  65. package/templates/spec.md +28 -0
  66. package/templates/story.md +19 -0
  67. package/templates/velocity.yaml +9 -0
  68. package/templates/workspace-config.yaml +44 -0
  69. package/framework/checklists/code-review.md +0 -33
  70. package/framework/checklists/debug-review.md +0 -34
  71. package/framework/checklists/discover-review.md +0 -33
  72. package/framework/checklists/doc-review.md +0 -39
  73. package/framework/checklists/feature-review.md +0 -42
  74. package/framework/checklists/ingest-review.md +0 -42
  75. package/framework/checklists/memory-review.md +0 -30
  76. package/framework/checklists/perf-review.md +0 -33
  77. package/framework/checklists/plan-review.md +0 -52
  78. package/framework/checklists/refactor-review.md +0 -33
  79. package/framework/checklists/security-review.md +0 -34
  80. package/framework/checklists/sprint-review.md +0 -41
  81. package/framework/checklists/story-review.md +0 -30
  82. package/framework/checklists/test-review.md +0 -32
  83. package/framework/checklists/workspace-review.md +0 -34
  84. package/framework/claude-md.template +0 -37
  85. package/framework/commands/sniper-audit.md +0 -1549
  86. package/framework/commands/sniper-compose.md +0 -323
  87. package/framework/commands/sniper-debug.md +0 -337
  88. package/framework/commands/sniper-discover.md +0 -423
  89. package/framework/commands/sniper-doc.md +0 -441
  90. package/framework/commands/sniper-feature.md +0 -515
  91. package/framework/commands/sniper-ingest.md +0 -506
  92. package/framework/commands/sniper-init.md +0 -388
  93. package/framework/commands/sniper-memory.md +0 -219
  94. package/framework/commands/sniper-plan.md +0 -630
  95. package/framework/commands/sniper-review.md +0 -369
  96. package/framework/commands/sniper-solve.md +0 -408
  97. package/framework/commands/sniper-sprint.md +0 -716
  98. package/framework/commands/sniper-status.md +0 -481
  99. package/framework/commands/sniper-workspace-feature.md +0 -267
  100. package/framework/commands/sniper-workspace-init.md +0 -252
  101. package/framework/commands/sniper-workspace-status.md +0 -112
  102. package/framework/commands/sniper-workspace-validate.md +0 -138
  103. package/framework/config.template.yaml +0 -196
  104. package/framework/personas/cognitive/devils-advocate.md +0 -30
  105. package/framework/personas/cognitive/mentor-explainer.md +0 -29
  106. package/framework/personas/cognitive/performance-focused.md +0 -30
  107. package/framework/personas/cognitive/security-first.md +0 -29
  108. package/framework/personas/cognitive/systems-thinker.md +0 -29
  109. package/framework/personas/cognitive/user-empathetic.md +0 -29
  110. package/framework/personas/domain/.gitkeep +0 -0
  111. package/framework/personas/process/analyst.md +0 -29
  112. package/framework/personas/process/architect.md +0 -30
  113. package/framework/personas/process/architecture-cartographer.md +0 -25
  114. package/framework/personas/process/code-archaeologist.md +0 -22
  115. package/framework/personas/process/code-investigator.md +0 -29
  116. package/framework/personas/process/code-reviewer.md +0 -26
  117. package/framework/personas/process/contract-designer.md +0 -31
  118. package/framework/personas/process/convention-miner.md +0 -27
  119. package/framework/personas/process/coverage-analyst.md +0 -24
  120. package/framework/personas/process/developer.md +0 -32
  121. package/framework/personas/process/doc-analyst.md +0 -63
  122. package/framework/personas/process/doc-reviewer.md +0 -62
  123. package/framework/personas/process/doc-writer.md +0 -42
  124. package/framework/personas/process/flake-hunter.md +0 -30
  125. package/framework/personas/process/impact-analyst.md +0 -23
  126. package/framework/personas/process/integration-validator.md +0 -29
  127. package/framework/personas/process/log-analyst.md +0 -22
  128. package/framework/personas/process/migration-architect.md +0 -24
  129. package/framework/personas/process/perf-profiler.md +0 -27
  130. package/framework/personas/process/product-manager.md +0 -32
  131. package/framework/personas/process/qa-engineer.md +0 -31
  132. package/framework/personas/process/release-manager.md +0 -23
  133. package/framework/personas/process/retro-analyst.md +0 -30
  134. package/framework/personas/process/scrum-master.md +0 -31
  135. package/framework/personas/process/threat-modeler.md +0 -30
  136. package/framework/personas/process/triage-lead.md +0 -23
  137. package/framework/personas/process/ux-designer.md +0 -31
  138. package/framework/personas/process/vuln-scanner.md +0 -27
  139. package/framework/personas/process/workspace-orchestrator.md +0 -30
  140. package/framework/personas/technical/ai-ml.md +0 -33
  141. package/framework/personas/technical/api-design.md +0 -32
  142. package/framework/personas/technical/backend.md +0 -32
  143. package/framework/personas/technical/database.md +0 -32
  144. package/framework/personas/technical/frontend.md +0 -33
  145. package/framework/personas/technical/infrastructure.md +0 -32
  146. package/framework/personas/technical/security.md +0 -34
  147. package/framework/settings.template.json +0 -6
  148. package/framework/spawn-prompts/_template.md +0 -25
  149. package/framework/teams/debug.yaml +0 -56
  150. package/framework/teams/discover.yaml +0 -57
  151. package/framework/teams/doc.yaml +0 -76
  152. package/framework/teams/feature-plan.yaml +0 -61
  153. package/framework/teams/ingest.yaml +0 -85
  154. package/framework/teams/perf.yaml +0 -33
  155. package/framework/teams/plan.yaml +0 -86
  156. package/framework/teams/refactor.yaml +0 -34
  157. package/framework/teams/retro.yaml +0 -30
  158. package/framework/teams/review-pr.yaml +0 -73
  159. package/framework/teams/review-release.yaml +0 -70
  160. package/framework/teams/security.yaml +0 -59
  161. package/framework/teams/solve.yaml +0 -48
  162. package/framework/teams/sprint.yaml +0 -68
  163. package/framework/teams/test.yaml +0 -59
  164. package/framework/teams/workspace-feature.yaml +0 -69
  165. package/framework/teams/workspace-validation.yaml +0 -27
  166. package/framework/templates/arch-delta.md +0 -74
  167. package/framework/templates/architecture.md +0 -95
  168. package/framework/templates/brief.md +0 -73
  169. package/framework/templates/bug-report.md +0 -55
  170. package/framework/templates/contract-validation-report.md +0 -68
  171. package/framework/templates/contract.yaml +0 -60
  172. package/framework/templates/conventions.md +0 -59
  173. package/framework/templates/coverage-report.md +0 -67
  174. package/framework/templates/doc-api.md +0 -53
  175. package/framework/templates/doc-guide.md +0 -35
  176. package/framework/templates/doc-readme.md +0 -49
  177. package/framework/templates/epic.md +0 -47
  178. package/framework/templates/feature-brief.md +0 -54
  179. package/framework/templates/feature-spec.md +0 -53
  180. package/framework/templates/flaky-report.md +0 -64
  181. package/framework/templates/investigation.md +0 -49
  182. package/framework/templates/memory-anti-pattern.yaml +0 -16
  183. package/framework/templates/memory-convention.yaml +0 -17
  184. package/framework/templates/memory-decision.yaml +0 -16
  185. package/framework/templates/migration-plan.md +0 -47
  186. package/framework/templates/optimization-plan.md +0 -59
  187. package/framework/templates/performance-profile.md +0 -64
  188. package/framework/templates/personas.md +0 -118
  189. package/framework/templates/postmortem.md +0 -69
  190. package/framework/templates/pr-review.md +0 -50
  191. package/framework/templates/prd.md +0 -92
  192. package/framework/templates/refactor-scope.md +0 -52
  193. package/framework/templates/release-readiness.md +0 -66
  194. package/framework/templates/retro.yaml +0 -44
  195. package/framework/templates/risks.md +0 -64
  196. package/framework/templates/security.md +0 -111
  197. package/framework/templates/sprint-review.md +0 -32
  198. package/framework/templates/story.md +0 -53
  199. package/framework/templates/threat-model.md +0 -71
  200. package/framework/templates/ux-spec.md +0 -71
  201. package/framework/templates/vulnerability-report.md +0 -56
  202. package/framework/templates/workspace-brief.md +0 -52
  203. package/framework/templates/workspace-plan.md +0 -50
  204. package/framework/workflows/discover-only.md +0 -39
  205. package/framework/workflows/full-lifecycle.md +0 -56
  206. package/framework/workflows/quick-feature.md +0 -44
  207. package/framework/workflows/sprint-cycle.md +0 -47
  208. package/framework/workflows/workspace-feature.md +0 -71
@@ -1,267 +0,0 @@
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
@@ -1,252 +0,0 @@
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
@@ -1,112 +0,0 @@
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)