@eskoubar95/spec 0.1.0 → 0.1.2
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/dist/commands/help.d.ts +5 -0
- package/dist/commands/help.d.ts.map +1 -0
- package/dist/commands/help.js +23 -0
- package/dist/commands/help.js.map +1 -0
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +30 -14
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/install.d.ts +5 -0
- package/dist/commands/install.d.ts.map +1 -0
- package/dist/commands/install.js +88 -0
- package/dist/commands/install.js.map +1 -0
- package/dist/commands/update.d.ts +5 -0
- package/dist/commands/update.d.ts.map +1 -0
- package/dist/commands/update.js +72 -0
- package/dist/commands/update.js.map +1 -0
- package/dist/commands/workspace.d.ts +5 -0
- package/dist/commands/workspace.d.ts.map +1 -0
- package/dist/commands/workspace.js +17 -0
- package/dist/commands/workspace.js.map +1 -0
- package/dist/index.js +42 -9
- package/dist/index.js.map +1 -1
- package/dist/lib/backup-cursor.d.ts +16 -0
- package/dist/lib/backup-cursor.d.ts.map +1 -0
- package/dist/lib/backup-cursor.js +50 -0
- package/dist/lib/backup-cursor.js.map +1 -0
- package/dist/lib/copy-template.d.ts +9 -1
- package/dist/lib/copy-template.d.ts.map +1 -1
- package/dist/lib/copy-template.js +94 -3
- package/dist/lib/copy-template.js.map +1 -1
- package/dist/lib/cursor-detection.d.ts +6 -0
- package/dist/lib/cursor-detection.d.ts.map +1 -0
- package/dist/lib/cursor-detection.js +31 -0
- package/dist/lib/cursor-detection.js.map +1 -0
- package/dist/lib/detection.d.ts +25 -0
- package/dist/lib/detection.d.ts.map +1 -0
- package/dist/lib/detection.js +186 -0
- package/dist/lib/detection.js.map +1 -0
- package/dist/lib/install-existing.d.ts +6 -0
- package/dist/lib/install-existing.d.ts.map +1 -0
- package/dist/lib/install-existing.js +63 -0
- package/dist/lib/install-existing.js.map +1 -0
- package/dist/lib/project-name.d.ts +7 -0
- package/dist/lib/project-name.d.ts.map +1 -0
- package/dist/lib/project-name.js +13 -0
- package/dist/lib/project-name.js.map +1 -0
- package/dist/lib/prompts.d.ts +6 -5
- package/dist/lib/prompts.d.ts.map +1 -1
- package/dist/lib/prompts.js +114 -0
- package/dist/lib/prompts.js.map +1 -1
- package/dist/lib/version-check.d.ts +21 -0
- package/dist/lib/version-check.d.ts.map +1 -0
- package/dist/lib/version-check.js +49 -0
- package/dist/lib/version-check.js.map +1 -0
- package/dist/lib/workspace.d.ts +7 -0
- package/dist/lib/workspace.d.ts.map +1 -0
- package/dist/lib/workspace.js +38 -0
- package/dist/lib/workspace.js.map +1 -0
- package/dist/types.d.ts +32 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +2 -0
- package/dist/types.js.map +1 -0
- package/package.json +2 -2
- package/template/.cursor/commands/_shared/activation.md +220 -0
- package/template/.cursor/commands/_shared/coderabbit-integration.md +278 -0
- package/template/.cursor/commands/_shared/command-stacks.md +124 -0
- package/template/.cursor/commands/_shared/deployment-detection.md +294 -0
- package/template/.cursor/commands/_shared/detection.md +277 -0
- package/template/.cursor/commands/_shared/documentation-lookup.md +321 -0
- package/template/.cursor/commands/_shared/git-workflow.md +288 -0
- package/template/.cursor/commands/_shared/github-helpers.md +337 -0
- package/template/.cursor/commands/_shared/github-workflows.md +351 -0
- package/template/.cursor/commands/_shared/helper-metadata.md +481 -0
- package/template/.cursor/commands/_shared/linear-automation.md +388 -0
- package/template/.cursor/commands/_shared/linear-helpers.md +254 -0
- package/template/.cursor/commands/_shared/performance-monitoring.md +369 -0
- package/template/.cursor/commands/_shared/pr-description.md +279 -0
- package/template/.cursor/commands/_shared/retrospective-spec-creation.md +977 -0
- package/template/.cursor/commands/_shared/scaling.md +264 -0
- package/template/.cursor/commands/_shared/state-assertions.md +174 -0
- package/template/.cursor/commands/_shared/test-automation.md +388 -0
- package/template/.cursor/commands/_shared/verification-checkpoints.md +145 -0
- package/template/.cursor/commands/spec/audit.md +240 -0
- package/template/.cursor/commands/spec/evolve.md +163 -0
- package/template/.cursor/commands/spec/sync.md +196 -0
- package/template/.cursor/commands/tools/refactor.md +555 -0
- package/template/.cursor/rules/10-engineering.mdc +149 -0
- package/template/.cursor/rules/11-design.mdc +129 -0
- package/template/.cursor/rules/12-business.mdc +132 -0
- package/template/.cursor/rules/20-nextjs.mdc +146 -0
- package/template/.cursor/rules/21-api-design.mdc +176 -0
- package/template/.cursor/rules/30-database.mdc +183 -0
- package/template/.cursor/rules/31-testing.mdc +191 -0
- package/template/.cursor/scripts/validate-helpers.js +254 -0
- package/template/.sdd/detection-cache.json +1 -0
- package/template/.sdd/install-info.json +1 -0
- package/template/.sdd/version +1 -0
- package/template/spec/00-root-spec.md +8 -1
- package/template/work/backlog/tasks.local.md +92 -0
|
@@ -0,0 +1,481 @@
|
|
|
1
|
+
# Helper Metadata System
|
|
2
|
+
|
|
3
|
+
This document defines metadata for all helper files to enable smart, conditional loading and reduce token consumption.
|
|
4
|
+
|
|
5
|
+
## Purpose
|
|
6
|
+
|
|
7
|
+
Enable AI to:
|
|
8
|
+
- Load helpers only when conditions are met
|
|
9
|
+
- Read only relevant sections of large helpers
|
|
10
|
+
- Understand when each helper is needed
|
|
11
|
+
- Reduce unnecessary token consumption
|
|
12
|
+
|
|
13
|
+
## Metadata Format
|
|
14
|
+
|
|
15
|
+
Each helper should have YAML frontmatter with:
|
|
16
|
+
- `helper_id`: Unique identifier
|
|
17
|
+
- `load_when`: Conditions that trigger loading
|
|
18
|
+
- `sections`: Map of section IDs to titles and line ranges
|
|
19
|
+
- `dependencies`: List of helper IDs that this helper depends on (optional)
|
|
20
|
+
- `always_load`: Whether helper should always be loaded (default: false)
|
|
21
|
+
|
|
22
|
+
## Helper Registry
|
|
23
|
+
|
|
24
|
+
### test-automation.md
|
|
25
|
+
|
|
26
|
+
```yaml
|
|
27
|
+
helper_id: test-automation
|
|
28
|
+
file: test-automation.md
|
|
29
|
+
load_when:
|
|
30
|
+
- test_framework_detected
|
|
31
|
+
- validation_step
|
|
32
|
+
- refactoring_analysis
|
|
33
|
+
sections:
|
|
34
|
+
detection:
|
|
35
|
+
title: "Test Framework Detection"
|
|
36
|
+
lines: [39, 67]
|
|
37
|
+
execution:
|
|
38
|
+
title: "Test Execution"
|
|
39
|
+
lines: [68, 154]
|
|
40
|
+
coverage:
|
|
41
|
+
title: "Test Coverage Tracking"
|
|
42
|
+
lines: [180, 207]
|
|
43
|
+
failure_detection:
|
|
44
|
+
title: "Test Failure Detection"
|
|
45
|
+
lines: [233, 247]
|
|
46
|
+
generation:
|
|
47
|
+
title: "Test Generation Assistance"
|
|
48
|
+
lines: [273, 273]
|
|
49
|
+
always_load: false
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
### performance-monitoring.md
|
|
53
|
+
|
|
54
|
+
```yaml
|
|
55
|
+
helper_id: performance-monitoring
|
|
56
|
+
file: performance-monitoring.md
|
|
57
|
+
load_when:
|
|
58
|
+
- preview_url_available
|
|
59
|
+
- performance_enabled
|
|
60
|
+
- validation_step
|
|
61
|
+
- refactoring_analysis
|
|
62
|
+
sections:
|
|
63
|
+
metrics:
|
|
64
|
+
title: "Performance Metrics Collection"
|
|
65
|
+
lines: [37, 80]
|
|
66
|
+
tools:
|
|
67
|
+
title: "Monitoring Tools Integration"
|
|
68
|
+
lines: [104, 146]
|
|
69
|
+
regression:
|
|
70
|
+
title: "Performance Regression Detection"
|
|
71
|
+
lines: [170, 180]
|
|
72
|
+
lighthouse:
|
|
73
|
+
title: "Lighthouse Integration"
|
|
74
|
+
lines: [222, 250]
|
|
75
|
+
always_load: false
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
### deployment-detection.md
|
|
79
|
+
|
|
80
|
+
```yaml
|
|
81
|
+
helper_id: deployment-detection
|
|
82
|
+
file: deployment-detection.md
|
|
83
|
+
load_when:
|
|
84
|
+
- pr_created
|
|
85
|
+
- pr_updated
|
|
86
|
+
- validation_step
|
|
87
|
+
sections:
|
|
88
|
+
detection:
|
|
89
|
+
title: "Provider Detection"
|
|
90
|
+
lines: [32, 91]
|
|
91
|
+
preview:
|
|
92
|
+
title: "Preview Deployment Logic"
|
|
93
|
+
lines: [111, 194]
|
|
94
|
+
status:
|
|
95
|
+
title: "Deployment Status Checking"
|
|
96
|
+
lines: [214, 217]
|
|
97
|
+
always_load: false
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
### linear-automation.md
|
|
101
|
+
|
|
102
|
+
```yaml
|
|
103
|
+
helper_id: linear-automation
|
|
104
|
+
file: linear-automation.md
|
|
105
|
+
load_when:
|
|
106
|
+
- linear_mode_enabled
|
|
107
|
+
- spec_init
|
|
108
|
+
- spec_refine
|
|
109
|
+
- spec_plan
|
|
110
|
+
- task_start
|
|
111
|
+
- task_validate
|
|
112
|
+
dependencies:
|
|
113
|
+
- linear-helpers
|
|
114
|
+
sections:
|
|
115
|
+
detection:
|
|
116
|
+
title: "Detection Logic"
|
|
117
|
+
lines: [9, 32]
|
|
118
|
+
documents:
|
|
119
|
+
title: "Documents"
|
|
120
|
+
lines: [35, 80]
|
|
121
|
+
issues:
|
|
122
|
+
title: "Issues"
|
|
123
|
+
lines: [82, 130]
|
|
124
|
+
projects:
|
|
125
|
+
title: "Projects"
|
|
126
|
+
lines: [132, 180]
|
|
127
|
+
labels:
|
|
128
|
+
title: "Labels"
|
|
129
|
+
lines: [182, 220]
|
|
130
|
+
statuses:
|
|
131
|
+
title: "Statuses"
|
|
132
|
+
lines: [222, 260]
|
|
133
|
+
always_load: false
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
### linear-helpers.md
|
|
137
|
+
|
|
138
|
+
```yaml
|
|
139
|
+
helper_id: linear-helpers
|
|
140
|
+
file: linear-helpers.md
|
|
141
|
+
load_when:
|
|
142
|
+
- linear_mode_enabled
|
|
143
|
+
- linear_operation_needed
|
|
144
|
+
sections:
|
|
145
|
+
status_mapping:
|
|
146
|
+
title: "Status Mapping"
|
|
147
|
+
lines: [1, 50]
|
|
148
|
+
label_detection:
|
|
149
|
+
title: "Label Detection"
|
|
150
|
+
lines: [51, 100]
|
|
151
|
+
idempotency:
|
|
152
|
+
title: "Idempotency Checks"
|
|
153
|
+
lines: [101, 150]
|
|
154
|
+
always_load: false
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
### git-workflow.md
|
|
158
|
+
|
|
159
|
+
```yaml
|
|
160
|
+
helper_id: git-workflow
|
|
161
|
+
file: git-workflow.md
|
|
162
|
+
load_when:
|
|
163
|
+
- task_start
|
|
164
|
+
- task_validate
|
|
165
|
+
- commit_needed
|
|
166
|
+
- pr_creation_needed
|
|
167
|
+
sections:
|
|
168
|
+
commit_generation:
|
|
169
|
+
title: "Commit Message Generation"
|
|
170
|
+
lines: [13, 80]
|
|
171
|
+
state_detection:
|
|
172
|
+
title: "State Detection"
|
|
173
|
+
lines: [81, 150]
|
|
174
|
+
next_steps:
|
|
175
|
+
title: "Next Step Logic"
|
|
176
|
+
lines: [151, 220]
|
|
177
|
+
always_load: false
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
### pr-description.md
|
|
181
|
+
|
|
182
|
+
```yaml
|
|
183
|
+
helper_id: pr-description
|
|
184
|
+
file: pr-description.md
|
|
185
|
+
load_when:
|
|
186
|
+
- pr_creation_needed
|
|
187
|
+
- pr_update_needed
|
|
188
|
+
sections:
|
|
189
|
+
template:
|
|
190
|
+
title: "PR Description Template"
|
|
191
|
+
lines: [1, 100]
|
|
192
|
+
generation:
|
|
193
|
+
title: "Auto-generation Logic"
|
|
194
|
+
lines: [101, 200]
|
|
195
|
+
always_load: false
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
### documentation-lookup.md
|
|
199
|
+
|
|
200
|
+
```yaml
|
|
201
|
+
helper_id: documentation-lookup
|
|
202
|
+
file: documentation-lookup.md
|
|
203
|
+
load_when:
|
|
204
|
+
- framework_detected
|
|
205
|
+
- tool_detected
|
|
206
|
+
- documentation_needed
|
|
207
|
+
- task_start
|
|
208
|
+
- task_validate
|
|
209
|
+
sections:
|
|
210
|
+
context7:
|
|
211
|
+
title: "Context7 Integration"
|
|
212
|
+
lines: [10, 80]
|
|
213
|
+
lookup_logic:
|
|
214
|
+
title: "Documentation Lookup Logic"
|
|
215
|
+
lines: [17, 150]
|
|
216
|
+
fallback:
|
|
217
|
+
title: "Fallback Strategies"
|
|
218
|
+
lines: [151, 220]
|
|
219
|
+
always_load: false
|
|
220
|
+
```
|
|
221
|
+
|
|
222
|
+
### coderabbit-integration.md
|
|
223
|
+
|
|
224
|
+
```yaml
|
|
225
|
+
helper_id: coderabbit-integration
|
|
226
|
+
file: coderabbit-integration.md
|
|
227
|
+
load_when:
|
|
228
|
+
- pr_exists
|
|
229
|
+
- code_review_needed
|
|
230
|
+
- task_validate
|
|
231
|
+
- refactoring_analysis
|
|
232
|
+
dependencies:
|
|
233
|
+
- github-helpers
|
|
234
|
+
sections:
|
|
235
|
+
detection:
|
|
236
|
+
title: "CodeRabbit Detection"
|
|
237
|
+
lines: [14, 60]
|
|
238
|
+
categorization:
|
|
239
|
+
title: "Issue Categorization"
|
|
240
|
+
lines: [61, 120]
|
|
241
|
+
resolution:
|
|
242
|
+
title: "Conversation Resolution"
|
|
243
|
+
lines: [121, 180]
|
|
244
|
+
argumentation:
|
|
245
|
+
title: "Argumentation Logging"
|
|
246
|
+
lines: [181, 234]
|
|
247
|
+
always_load: false
|
|
248
|
+
```
|
|
249
|
+
|
|
250
|
+
### github-helpers.md
|
|
251
|
+
|
|
252
|
+
```yaml
|
|
253
|
+
helper_id: github-helpers
|
|
254
|
+
file: github-helpers.md
|
|
255
|
+
load_when:
|
|
256
|
+
- pr_exists
|
|
257
|
+
- github_operation_needed
|
|
258
|
+
- coderabbit_integration
|
|
259
|
+
sections:
|
|
260
|
+
detection:
|
|
261
|
+
title: "GitHub Integration Detection"
|
|
262
|
+
lines: [1, 50]
|
|
263
|
+
pr_comments:
|
|
264
|
+
title: "Read PR Conversations"
|
|
265
|
+
lines: [51, 100]
|
|
266
|
+
resolve:
|
|
267
|
+
title: "Resolve Conversations"
|
|
268
|
+
lines: [101, 150]
|
|
269
|
+
always_load: false
|
|
270
|
+
```
|
|
271
|
+
|
|
272
|
+
### github-workflows.md
|
|
273
|
+
|
|
274
|
+
```yaml
|
|
275
|
+
helper_id: github-workflows
|
|
276
|
+
file: github-workflows.md
|
|
277
|
+
load_when:
|
|
278
|
+
- spec_plan
|
|
279
|
+
- spec_refine
|
|
280
|
+
- ci_cd_needed
|
|
281
|
+
sections:
|
|
282
|
+
detection:
|
|
283
|
+
title: "Workflow Detection"
|
|
284
|
+
lines: [1, 50]
|
|
285
|
+
generation:
|
|
286
|
+
title: "Workflow Generation"
|
|
287
|
+
lines: [51, 200]
|
|
288
|
+
templates:
|
|
289
|
+
title: "Workflow Templates"
|
|
290
|
+
lines: [201, 300]
|
|
291
|
+
always_load: false
|
|
292
|
+
```
|
|
293
|
+
|
|
294
|
+
### detection.md
|
|
295
|
+
|
|
296
|
+
```yaml
|
|
297
|
+
helper_id: detection
|
|
298
|
+
file: detection.md
|
|
299
|
+
load_when:
|
|
300
|
+
- always
|
|
301
|
+
sections:
|
|
302
|
+
project_type:
|
|
303
|
+
title: "Project Type Detection"
|
|
304
|
+
lines: [1, 50]
|
|
305
|
+
project_size:
|
|
306
|
+
title: "Project Size Detection"
|
|
307
|
+
lines: [51, 100]
|
|
308
|
+
technologies:
|
|
309
|
+
title: "Technology Detection"
|
|
310
|
+
lines: [101, 200]
|
|
311
|
+
always_load: true
|
|
312
|
+
```
|
|
313
|
+
|
|
314
|
+
### activation.md
|
|
315
|
+
|
|
316
|
+
```yaml
|
|
317
|
+
helper_id: activation
|
|
318
|
+
file: activation.md
|
|
319
|
+
load_when:
|
|
320
|
+
- always
|
|
321
|
+
sections:
|
|
322
|
+
matching:
|
|
323
|
+
title: "Match detection results"
|
|
324
|
+
lines: [1, 50]
|
|
325
|
+
dependencies:
|
|
326
|
+
title: "Check rule dependencies"
|
|
327
|
+
lines: [51, 100]
|
|
328
|
+
activation:
|
|
329
|
+
title: "Activate matching rules"
|
|
330
|
+
lines: [101, 150]
|
|
331
|
+
always_load: true
|
|
332
|
+
```
|
|
333
|
+
|
|
334
|
+
### scaling.md
|
|
335
|
+
|
|
336
|
+
```yaml
|
|
337
|
+
helper_id: scaling
|
|
338
|
+
file: scaling.md
|
|
339
|
+
load_when:
|
|
340
|
+
- task_start
|
|
341
|
+
- spec_plan
|
|
342
|
+
sections:
|
|
343
|
+
workflow_variants:
|
|
344
|
+
title: "Workflow Variants"
|
|
345
|
+
lines: [1, 100]
|
|
346
|
+
complexity:
|
|
347
|
+
title: "Complexity Assessment"
|
|
348
|
+
lines: [101, 200]
|
|
349
|
+
always_load: false
|
|
350
|
+
```
|
|
351
|
+
|
|
352
|
+
### state-assertions.md
|
|
353
|
+
|
|
354
|
+
```yaml
|
|
355
|
+
helper_id: state-assertions
|
|
356
|
+
file: state-assertions.md
|
|
357
|
+
load_when:
|
|
358
|
+
- always
|
|
359
|
+
sections:
|
|
360
|
+
mode_boundaries:
|
|
361
|
+
title: "Mode Boundaries"
|
|
362
|
+
lines: [1, 50]
|
|
363
|
+
state_checks:
|
|
364
|
+
title: "State Checks"
|
|
365
|
+
lines: [51, 100]
|
|
366
|
+
always_load: true
|
|
367
|
+
```
|
|
368
|
+
|
|
369
|
+
### verification-checkpoints.md
|
|
370
|
+
|
|
371
|
+
```yaml
|
|
372
|
+
helper_id: verification-checkpoints
|
|
373
|
+
file: verification-checkpoints.md
|
|
374
|
+
load_when:
|
|
375
|
+
- file_creation
|
|
376
|
+
- file_modification
|
|
377
|
+
- critical_operation
|
|
378
|
+
sections:
|
|
379
|
+
gates:
|
|
380
|
+
title: "Verification Gates"
|
|
381
|
+
lines: [1, 50]
|
|
382
|
+
critical_files:
|
|
383
|
+
title: "Critical Files"
|
|
384
|
+
lines: [51, 100]
|
|
385
|
+
always_load: false
|
|
386
|
+
```
|
|
387
|
+
|
|
388
|
+
### command-stacks.md
|
|
389
|
+
|
|
390
|
+
```yaml
|
|
391
|
+
helper_id: command-stacks
|
|
392
|
+
file: command-stacks.md
|
|
393
|
+
load_when:
|
|
394
|
+
- command_invocation
|
|
395
|
+
- workflow_automation
|
|
396
|
+
sections:
|
|
397
|
+
invocation:
|
|
398
|
+
title: "Command Invocation"
|
|
399
|
+
lines: [1, 50]
|
|
400
|
+
stacks:
|
|
401
|
+
title: "Command Stacks"
|
|
402
|
+
lines: [51, 100]
|
|
403
|
+
always_load: false
|
|
404
|
+
```
|
|
405
|
+
|
|
406
|
+
### retrospective-spec-creation.md
|
|
407
|
+
|
|
408
|
+
```yaml
|
|
409
|
+
helper_id: retrospective-spec-creation
|
|
410
|
+
file: retrospective-spec-creation.md
|
|
411
|
+
load_when:
|
|
412
|
+
- legacy_project_detected
|
|
413
|
+
- retrospective_mode_requested
|
|
414
|
+
- spec_audit
|
|
415
|
+
- spec_sync
|
|
416
|
+
sections:
|
|
417
|
+
overview:
|
|
418
|
+
title: "Retrospective Spec Creation Overview"
|
|
419
|
+
lines: [1, 50]
|
|
420
|
+
audit_strategy:
|
|
421
|
+
title: "Audit Strategy"
|
|
422
|
+
lines: [51, 120]
|
|
423
|
+
sync_process:
|
|
424
|
+
title: "Sync Process"
|
|
425
|
+
lines: [121, 200]
|
|
426
|
+
documentation_patterns:
|
|
427
|
+
title: "Documentation Patterns"
|
|
428
|
+
lines: [201, 300]
|
|
429
|
+
enterprise_patterns:
|
|
430
|
+
title: "Enterprise-Specific Patterns"
|
|
431
|
+
lines: [301, 400]
|
|
432
|
+
always_load: false
|
|
433
|
+
```
|
|
434
|
+
|
|
435
|
+
## Usage Instructions
|
|
436
|
+
|
|
437
|
+
### For Commands
|
|
438
|
+
|
|
439
|
+
When referencing a helper in a command:
|
|
440
|
+
|
|
441
|
+
**Instead of:**
|
|
442
|
+
```markdown
|
|
443
|
+
**Reference:** See `.cursor/commands/_shared/test-automation.md` for test framework detection.
|
|
444
|
+
```
|
|
445
|
+
|
|
446
|
+
**Use:**
|
|
447
|
+
```markdown
|
|
448
|
+
**ONLY READ IF test framework detected:**
|
|
449
|
+
- Read `.cursor/commands/_shared/test-automation.md` ONLY IF test framework detected in Step 0
|
|
450
|
+
- Read sections: "Test Framework Detection" (lines 14-67), "Test Execution" (lines 68-154)
|
|
451
|
+
- Skip if: No test framework found → skip test automation entirely
|
|
452
|
+
- Check condition: Run detection first, then read helper only if condition met
|
|
453
|
+
```
|
|
454
|
+
|
|
455
|
+
### For AI Agents
|
|
456
|
+
|
|
457
|
+
1. **Check load_when conditions** before reading any helper
|
|
458
|
+
2. **Read only specified sections** if condition is met
|
|
459
|
+
3. **Skip helper entirely** if condition is not met
|
|
460
|
+
4. **Always load** helpers marked with `always_load: true` (detection, activation, state-assertions)
|
|
461
|
+
|
|
462
|
+
### Condition Examples
|
|
463
|
+
|
|
464
|
+
- `test_framework_detected`: Test framework found in package.json or config
|
|
465
|
+
- `linear_mode_enabled`: `work/linear/sync-config.md` exists and `MODE=linear`
|
|
466
|
+
- `pr_exists`: PR exists for current branch
|
|
467
|
+
- `validation_step`: Currently in validation phase
|
|
468
|
+
- `framework_detected`: Framework detected in tech stack
|
|
469
|
+
- `always`: Always load (for core helpers)
|
|
470
|
+
|
|
471
|
+
## Cache Strategy
|
|
472
|
+
|
|
473
|
+
Helper metadata is static and can be cached. If metadata changes, invalidate cache.
|
|
474
|
+
|
|
475
|
+
## Error Handling
|
|
476
|
+
|
|
477
|
+
- **Metadata missing:** Fallback to reading entire helper (safe default)
|
|
478
|
+
- **Condition unclear:** Read helper (safe fallback)
|
|
479
|
+
- **Section not found:** Read entire helper
|
|
480
|
+
- **Never block workflow:** All optimizations are optional
|
|
481
|
+
|