teamspec 3.2.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 (45) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +252 -0
  3. package/bin/teamspec-init.js +10 -0
  4. package/extensions/teamspec-0.1.0.vsix +0 -0
  5. package/lib/cli.js +1174 -0
  6. package/lib/extension-installer.js +236 -0
  7. package/lib/linter.js +1184 -0
  8. package/lib/prompt-generator.js +409 -0
  9. package/package.json +51 -0
  10. package/teamspec-core/agents/AGENT_BA.md +486 -0
  11. package/teamspec-core/agents/AGENT_BOOTSTRAP.md +447 -0
  12. package/teamspec-core/agents/AGENT_DES.md +623 -0
  13. package/teamspec-core/agents/AGENT_DEV.md +611 -0
  14. package/teamspec-core/agents/AGENT_FA.md +736 -0
  15. package/teamspec-core/agents/AGENT_FEEDBACK.md +202 -0
  16. package/teamspec-core/agents/AGENT_FIX.md +380 -0
  17. package/teamspec-core/agents/AGENT_QA.md +756 -0
  18. package/teamspec-core/agents/AGENT_SA.md +581 -0
  19. package/teamspec-core/agents/AGENT_SM.md +771 -0
  20. package/teamspec-core/agents/README.md +383 -0
  21. package/teamspec-core/context/_schema.yml +222 -0
  22. package/teamspec-core/copilot-instructions.md +356 -0
  23. package/teamspec-core/definitions/definition-of-done.md +129 -0
  24. package/teamspec-core/definitions/definition-of-ready.md +104 -0
  25. package/teamspec-core/profiles/enterprise.yml +127 -0
  26. package/teamspec-core/profiles/platform-team.yml +104 -0
  27. package/teamspec-core/profiles/regulated.yml +97 -0
  28. package/teamspec-core/profiles/startup.yml +85 -0
  29. package/teamspec-core/teamspec.yml +69 -0
  30. package/teamspec-core/templates/README.md +211 -0
  31. package/teamspec-core/templates/active-sprint-template.md +98 -0
  32. package/teamspec-core/templates/adr-template.md +194 -0
  33. package/teamspec-core/templates/bug-report-template.md +188 -0
  34. package/teamspec-core/templates/business-analysis-template.md +164 -0
  35. package/teamspec-core/templates/decision-log-template.md +216 -0
  36. package/teamspec-core/templates/feature-template.md +269 -0
  37. package/teamspec-core/templates/functional-spec-template.md +161 -0
  38. package/teamspec-core/templates/refinement-notes-template.md +133 -0
  39. package/teamspec-core/templates/sprint-goal-template.md +129 -0
  40. package/teamspec-core/templates/sprint-template.md +175 -0
  41. package/teamspec-core/templates/sprints-index-template.md +67 -0
  42. package/teamspec-core/templates/story-template.md +244 -0
  43. package/teamspec-core/templates/storymap-template.md +204 -0
  44. package/teamspec-core/templates/testcases-template.md +147 -0
  45. package/teamspec-core/templates/uat-pack-template.md +161 -0
@@ -0,0 +1,409 @@
1
+ /**
2
+ * TeamSpec Copilot Command Generator
3
+ *
4
+ * Generates GitHub Copilot prompt files for all TeamSpec commands.
5
+ * Usage: teamspec generate-prompts
6
+ */
7
+
8
+ const fs = require('fs');
9
+ const path = require('path');
10
+
11
+ // Command definitions from agent system
12
+ const COMMANDS = {
13
+ ba: {
14
+ name: 'Business Analyst',
15
+ commands: [
16
+ {
17
+ name: 'project',
18
+ description: 'Create project structure',
19
+ prompt: `Execute project creation workflow:
20
+ 1. Gather project information (name, ID, stakeholders, goals)
21
+ 2. Create project folder structure in projects/{id}/
22
+ 3. Generate project.yml with metadata
23
+ 4. Create README.md
24
+ 5. Initialize folders: features/, stories/backlog/, stories/ready-to-refine/, stories/ready-for-development/, adr/, decisions/, dev-plans/, qa/test-cases/, epics/, sprints/
25
+ 6. Create features-index.md and story-ledger.md
26
+ Wait for user confirmation before creating files.`
27
+ },
28
+ {
29
+ name: 'epic',
30
+ description: 'Define an epic',
31
+ prompt: `Execute epic creation workflow:
32
+ 1. Identify epic scope and goal
33
+ 2. Link to project
34
+ 3. Break down into candidate features
35
+ 4. Create epic file in epics/ folder
36
+ Wait for user confirmation before creating files.`
37
+ },
38
+ {
39
+ name: 'feature',
40
+ description: 'Create feature file',
41
+ prompt: `Execute feature creation workflow:
42
+ 1. Gather feature requirements (purpose, value, scope)
43
+ 2. Define personas/actors
44
+ 3. Create feature file in features/ folder using F-XXX-name.md format
45
+ 4. Update features-index.md
46
+ Ensure feature is implementation-agnostic.
47
+ Wait for user confirmation before creating files.`
48
+ },
49
+ {
50
+ name: 'decision',
51
+ description: 'Log business decision',
52
+ prompt: `Log a business decision:
53
+ 1. Capture decision context
54
+ 2. Document options considered
55
+ 3. Record rationale
56
+ 4. Link to affected features
57
+ 5. Create decision file in decisions/ folder using DECISION-XXX-name.md format`
58
+ },
59
+ {
60
+ name: 'analysis',
61
+ description: 'Create business analysis document',
62
+ prompt: `Create a business analysis document to describe business processes:
63
+
64
+ 1. **Understand the business domain** - Ask about:
65
+ - What business problem needs to be analyzed?
66
+ - Who are the stakeholders?
67
+ - What business processes are involved?
68
+
69
+ 2. **Document Current State (As-Is)**
70
+ - How do users solve the problem today?
71
+ - What are the pain points?
72
+ - What processes exist?
73
+
74
+ 3. **Define Future State (To-Be)**
75
+ - What will the improved workflow look like?
76
+ - What business rules apply?
77
+ - What are the success metrics?
78
+
79
+ 4. **Create business analysis document** using templates/business-analysis-template.md
80
+ - Place in analysis/ folder (create if needed)
81
+ - Name format: BA-XXX-description.md
82
+
83
+ 5. **Link to related artifacts**
84
+ - Identify candidate features that will come from this analysis
85
+ - Note decisions that need to be made
86
+ - Identify risks and constraints
87
+
88
+ āš ļø This is a PLANNING artifact - Feature Canon becomes Source of Truth after features are created.`
89
+ }
90
+ ]
91
+ },
92
+ fa: {
93
+ name: 'Functional Analyst',
94
+ commands: [
95
+ {
96
+ name: 'story',
97
+ description: 'Create a new story',
98
+ prompt: `Create a story as a DELTA to the Feature Canon:
99
+ 1. Identify the linked feature (REQUIRED)
100
+ 2. Document BEFORE state (reference Canon)
101
+ 3. Document AFTER state (the delta)
102
+ 4. Write testable Acceptance Criteria
103
+ 5. Mark impact type (Adds/Changes/Fixes/Removes)
104
+ 6. Create story in stories/backlog/ using S-XXX-name.md format
105
+ NEVER create a story without a feature link.`
106
+ },
107
+ {
108
+ name: 'slice',
109
+ description: 'Slice feature into stories',
110
+ prompt: `Slice a feature into implementable stories:
111
+ 1. Read the Feature Canon entry
112
+ 2. Identify discrete behavior changes
113
+ 3. Create story deltas for each change
114
+ 4. Ensure each story is independently deliverable
115
+ 5. Link all stories to the feature
116
+ Create files in stories/backlog/`
117
+ },
118
+ {
119
+ name: 'refine',
120
+ description: 'Move story to ready-to-refine',
121
+ prompt: `Refine a story for development:
122
+ 1. Verify feature link exists
123
+ 2. Check Before/After delta is clear
124
+ 3. Validate ACs are testable
125
+ 4. Move file from stories/backlog/ to stories/ready-to-refine/`
126
+ },
127
+ {
128
+ name: 'sync',
129
+ description: 'Update Feature Canon after story completion',
130
+ prompt: `CRITICAL: Canon sync workflow:
131
+ 1. Identify completed story
132
+ 2. Check impact type (Adds/Changes Behavior?)
133
+ 3. Update Feature Canon sections in features/
134
+ 4. Add Change Log entry with story reference
135
+ 5. Update story-ledger.md
136
+ 6. Verify DoD checkbox is checked
137
+ A story CANNOT be Done until Canon is synchronized.`
138
+ }
139
+ ]
140
+ },
141
+ arch: {
142
+ name: 'Solution Architect',
143
+ commands: [
144
+ {
145
+ name: 'adr',
146
+ description: 'Create Architecture Decision Record',
147
+ prompt: `Create an ADR:
148
+ 1. Identify technical decision
149
+ 2. Document context and options
150
+ 3. Record decision and rationale
151
+ 4. Link to affected features
152
+ 5. Create ADR file in adr/ folder using ADR-XXX-name.md format`
153
+ }
154
+ ]
155
+ },
156
+ dev: {
157
+ name: 'Developer',
158
+ commands: [
159
+ {
160
+ name: 'plan',
161
+ description: 'Create development plan',
162
+ prompt: `Create a development plan:
163
+ 1. Read the story and linked feature
164
+ 2. Break down into implementation tasks
165
+ 3. Estimate effort for each task
166
+ 4. Identify dependencies and risks
167
+ 5. Create dev plan in dev-plans/ using story-XXX-tasks.md format`
168
+ },
169
+ {
170
+ name: 'implement',
171
+ description: 'Execute implementation',
172
+ prompt: `Execute implementation:
173
+ 1. Load dev plan
174
+ 2. Work through tasks sequentially
175
+ 3. Update task completion status
176
+ 4. Create/modify code files
177
+ 5. Track actual vs estimated effort`
178
+ },
179
+ {
180
+ name: 'ready',
181
+ description: 'Move story to ready-for-development',
182
+ prompt: `Move story to ready-for-development:
183
+ 1. Verify dev plan exists
184
+ 2. Check DoR criteria
185
+ 3. Move file from stories/ready-to-refine/ to stories/ready-for-development/`
186
+ }
187
+ ]
188
+ },
189
+ qa: {
190
+ name: 'QA Engineer',
191
+ commands: [
192
+ {
193
+ name: 'test',
194
+ description: 'Design test cases',
195
+ prompt: `Design test cases:
196
+ 1. Read feature specification
197
+ 2. Identify test scenarios
198
+ 3. Write test cases with steps and expected results
199
+ 4. Create test file in qa/test-cases/ using F-XXX-test-cases.md format`
200
+ },
201
+ {
202
+ name: 'bug',
203
+ description: 'File bug report',
204
+ prompt: `File a bug report:
205
+ 1. Capture bug details
206
+ 2. Document reproduction steps
207
+ 3. Classify severity
208
+ 4. Link to affected feature
209
+ 5. Create bug file in bugs/ folder`
210
+ },
211
+ {
212
+ name: 'dor-check',
213
+ description: 'Validate Definition of Ready',
214
+ prompt: `Check Definition of Ready:
215
+ 1. Verify feature link exists
216
+ 2. Check Before/After delta is clear
217
+ 3. Validate ACs are testable
218
+ 4. Confirm no TBD/placeholder content
219
+ 5. Check estimate is assigned
220
+ Report any gaps.`
221
+ }
222
+ ]
223
+ },
224
+ sm: {
225
+ name: 'Scrum Master',
226
+ commands: [
227
+ {
228
+ name: 'sprint-create',
229
+ description: 'Create new sprint',
230
+ prompt: `Create new sprint:
231
+ 1. Determine sprint number
232
+ 2. Create sprint folder: sprints/sprint-N/
233
+ 3. Create sprint-goal.md
234
+ 4. Update active-sprint.md`
235
+ },
236
+ {
237
+ name: 'sprint-plan',
238
+ description: 'Plan sprint backlog',
239
+ prompt: `Plan sprint backlog:
240
+ 1. Review ready-for-development stories
241
+ 2. Calculate team capacity
242
+ 3. Select stories for sprint
243
+ 4. Move story files to sprints/sprint-N/
244
+ 5. Update sprint-goal.md`
245
+ },
246
+ {
247
+ name: 'sprint-status',
248
+ description: 'Sprint status report',
249
+ prompt: `Generate sprint status:
250
+ 1. Count stories by status
251
+ 2. Calculate burndown
252
+ 3. Identify blockers
253
+ 4. Report health metrics`
254
+ }
255
+ ]
256
+ },
257
+ utility: {
258
+ name: 'Utility',
259
+ commands: [
260
+ {
261
+ name: 'fix',
262
+ description: 'Auto-fix linter errors',
263
+ prompt: `Auto-fix TeamSpec linter errors:
264
+ 1. Run \`teamspec lint\` to identify errors
265
+ 2. Review the linter output
266
+ 3. Apply fixes for each error category
267
+ 4. Re-run linter to verify fixes
268
+
269
+ Supports: TS-PROJ, TS-FEAT, TS-STORY, TS-ADR, TS-DEVPLAN, TS-DOD, TS-NAMING rules.`
270
+ }
271
+ ]
272
+ }
273
+ };
274
+
275
+ /**
276
+ * Map role codes to agent file names
277
+ */
278
+ const ROLE_TO_AGENT = {
279
+ ba: 'AGENT_BA',
280
+ fa: 'AGENT_FA',
281
+ arch: 'AGENT_SA', // Solution Architect
282
+ dev: 'AGENT_DEV',
283
+ qa: 'AGENT_QA',
284
+ sm: 'AGENT_SM',
285
+ utility: 'AGENT_FIX'
286
+ };
287
+
288
+ /**
289
+ * Generate GitHub Copilot prompt file in VS Code format
290
+ * Creates minimal prompts that link to the full agent files
291
+ * VS Code automatically includes linked Markdown files as context
292
+ */
293
+ function generatePromptFile(role, command, outputDir) {
294
+ // Utility commands use just the command name (e.g., fix.prompt.md, ts:fix)
295
+ // Other roles use role-command pattern (e.g., ba-project.prompt.md, ts:ba-project)
296
+ const isUtility = role === 'utility';
297
+ const filename = isUtility ? `${command.name}.prompt.md` : `${role}-${command.name}.prompt.md`;
298
+ const filepath = path.join(outputDir, filename);
299
+ const commandName = isUtility ? `ts:${command.name}` : `ts:${role}-${command.name}`;
300
+ const agentFile = ROLE_TO_AGENT[role] || `AGENT_${role.toUpperCase()}`;
301
+
302
+ // Create minimal prompt that links to the agent file
303
+ // VS Code will include the linked file as context automatically
304
+ const content = `---
305
+ name: "${commandName}"
306
+ description: "TeamSpec ${COMMANDS[role].name}: ${command.description}"
307
+ agent: "agent"
308
+ ---
309
+
310
+ # ${command.description}
311
+
312
+ Execute the **${command.name}** workflow as a **${COMMANDS[role].name}**.
313
+
314
+ See full role instructions: [${agentFile}.md](../../.teamspec/agents/${agentFile}.md)
315
+
316
+ ## Quick Reference
317
+
318
+ ${command.prompt}
319
+ `;
320
+
321
+ fs.writeFileSync(filepath, content, 'utf-8');
322
+ return filename;
323
+ }
324
+
325
+ /**
326
+ * Generate all prompt files
327
+ */
328
+ function generateAllPrompts(targetDir = process.cwd()) {
329
+ const outputDir = path.join(targetDir, '.github', 'prompts');
330
+
331
+ // Create output directory
332
+ if (!fs.existsSync(outputDir)) {
333
+ fs.mkdirSync(outputDir, { recursive: true });
334
+ }
335
+
336
+ console.log('šŸš€ Generating GitHub Copilot prompt files...\n');
337
+
338
+ const generated = [];
339
+
340
+ // Generate prompts for each role and command
341
+ for (const [role, config] of Object.entries(COMMANDS)) {
342
+ console.log(`šŸ“‹ ${config.name}:`);
343
+ for (const command of config.commands) {
344
+ const filename = generatePromptFile(role, command, outputDir);
345
+ generated.push(filename);
346
+ console.log(` āœ“ ${filename}`);
347
+ }
348
+ }
349
+
350
+ // Generate index file
351
+ const indexContent = `# TeamSpec Copilot Prompts
352
+
353
+ These prompt files provide structured guidance for TeamSpec commands in GitHub Copilot Chat.
354
+
355
+ ## Usage
356
+
357
+ In VS Code, type \`/\` in Copilot Chat to see available prompts. Look for prompts starting with \`ts:\`.
358
+
359
+ Alternatively, run any prompt directly:
360
+ - Press \`Ctrl+Shift+P\` (or \`Cmd+Shift+P\` on Mac)
361
+ - Type "Chat: Run Prompt"
362
+ - Select a TeamSpec prompt
363
+
364
+ ## Available Commands
365
+
366
+ ${Object.entries(COMMANDS).map(([role, config]) => {
367
+ const isUtility = role === 'utility';
368
+ return `
369
+ ### ${config.name}
370
+
371
+ ${config.commands.map(cmd => {
372
+ const cmdName = isUtility ? `ts:${cmd.name}` : `ts:${role}-${cmd.name}`;
373
+ return `- \`/${cmdName}\` - ${cmd.description}`;
374
+ }).join('\n')}
375
+ `;
376
+ }).join('\n')}
377
+
378
+ ## How It Works
379
+
380
+ 1. Type \`/\` in Copilot Chat to see prompts
381
+ 2. Select a \`ts:\` prefixed prompt
382
+ 3. Copilot provides role-specific guidance
383
+ 4. Follow the workflow to create artifacts
384
+
385
+ ---
386
+
387
+ *Generated by TeamSpec CLI v${require('../package.json').version}*
388
+ `;
389
+
390
+ fs.writeFileSync(path.join(outputDir, 'README.md'), indexContent, 'utf-8');
391
+ generated.push('README.md');
392
+
393
+ console.log(`\nāœ… Generated ${generated.length} files in ${outputDir}`);
394
+ console.log('\nšŸ“– See .github/prompts/README.md for usage instructions');
395
+ console.log('šŸ’” In Copilot Chat, type "/" to see available prompts');
396
+
397
+ return generated;
398
+ }
399
+
400
+ module.exports = {
401
+ generateAllPrompts,
402
+ COMMANDS
403
+ };
404
+
405
+ // CLI execution
406
+ if (require.main === module) {
407
+ const targetDir = process.argv[2] || process.cwd();
408
+ generateAllPrompts(targetDir);
409
+ }
package/package.json ADDED
@@ -0,0 +1,51 @@
1
+ {
2
+ "name": "teamspec",
3
+ "version": "3.2.0",
4
+ "description": "CLI tool to bootstrap TeamSpec 2.0 Feature Canon operating model in any repository",
5
+ "main": "lib/cli.js",
6
+ "bin": {
7
+ "teamspec": "./bin/teamspec-init.js"
8
+ },
9
+ "scripts": {
10
+ "test": "node --test test/**/*.test.js",
11
+ "lint": "eslint lib/**/*.js",
12
+ "prepublishOnly": "npm test"
13
+ },
14
+ "keywords": [
15
+ "teamspec",
16
+ "agile",
17
+ "specifications",
18
+ "feature-canon",
19
+ "copilot",
20
+ "cursor",
21
+ "claude",
22
+ "ai-coding",
23
+ "documentation",
24
+ "templates",
25
+ "scrum",
26
+ "kanban",
27
+ "software-development"
28
+ ],
29
+ "author": "TeamSpec Contributors",
30
+ "license": "MIT",
31
+ "repository": {
32
+ "type": "git",
33
+ "url": "git+https://github.com/teamspec/teamspec.git"
34
+ },
35
+ "bugs": {
36
+ "url": "https://github.com/teamspec/teamspec/issues"
37
+ },
38
+ "homepage": "https://github.com/teamspec/teamspec#readme",
39
+ "engines": {
40
+ "node": ">=14.0.0"
41
+ },
42
+ "files": [
43
+ "bin/",
44
+ "lib/",
45
+ "teamspec-core/",
46
+ "extensions/",
47
+ "README.md",
48
+ "LICENSE"
49
+ ],
50
+ "preferGlobal": true
51
+ }