sam-agents 0.1.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 (37) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +92 -0
  3. package/bin/cli.js +320 -0
  4. package/package.json +36 -0
  5. package/templates/.claude/commands/sam/core/agents/sam.md +6 -0
  6. package/templates/.claude/commands/sam/core/workflows/autonomous-tdd.md +6 -0
  7. package/templates/.claude/commands/sam/sam/agents/argus.md +6 -0
  8. package/templates/.claude/commands/sam/sam/agents/atlas.md +6 -0
  9. package/templates/.claude/commands/sam/sam/agents/dyna.md +6 -0
  10. package/templates/.claude/commands/sam/sam/agents/iris.md +6 -0
  11. package/templates/.claude/commands/sam/sam/agents/sage.md +6 -0
  12. package/templates/.claude/commands/sam/sam/agents/titan.md +6 -0
  13. package/templates/_sam/_config/agent-manifest.csv +8 -0
  14. package/templates/_sam/_config/agents/sam-architect.customize.yaml +13 -0
  15. package/templates/_sam/_config/agents/sam-dev.customize.yaml +13 -0
  16. package/templates/_sam/_config/agents/sam-reviewer.customize.yaml +13 -0
  17. package/templates/_sam/_config/agents/sam-sam.customize.yaml +13 -0
  18. package/templates/_sam/_config/agents/sam-tech-writer.customize.yaml +13 -0
  19. package/templates/_sam/_config/agents/sam-test.customize.yaml +13 -0
  20. package/templates/_sam/_config/agents/sam-ux-designer.customize.yaml +13 -0
  21. package/templates/_sam/_config/ides/claude-code.yaml +6 -0
  22. package/templates/_sam/_config/manifest.yaml +13 -0
  23. package/templates/_sam/_config/workflow-manifest.csv +2 -0
  24. package/templates/_sam/agents/architect.md +69 -0
  25. package/templates/_sam/agents/dev.md +97 -0
  26. package/templates/_sam/agents/reviewer.md +138 -0
  27. package/templates/_sam/agents/tech-writer.md +147 -0
  28. package/templates/_sam/agents/test.md +120 -0
  29. package/templates/_sam/agents/ux-designer.md +141 -0
  30. package/templates/_sam/core/agents/sam-master.md +91 -0
  31. package/templates/_sam/core/config.yaml +31 -0
  32. package/templates/_sam/core/workflows/autonomous-tdd/steps/step-01-validate-prd.md +213 -0
  33. package/templates/_sam/core/workflows/autonomous-tdd/steps/step-02-generate-stories.md +266 -0
  34. package/templates/_sam/core/workflows/autonomous-tdd/steps/step-03-tdd-loop.md +422 -0
  35. package/templates/_sam/core/workflows/autonomous-tdd/steps/step-04-complete.md +356 -0
  36. package/templates/_sam/core/workflows/autonomous-tdd/templates/pipeline-status.yaml +108 -0
  37. package/templates/_sam/core/workflows/autonomous-tdd/workflow.md +311 -0
@@ -0,0 +1,356 @@
1
+ ---
2
+ step: 4
3
+ name: complete
4
+ description: Finalize implementation, generate documentation, and produce summary report
5
+ agents: [tech-writer]
6
+ ---
7
+
8
+ # Step 4: Completion
9
+
10
+ **Purpose:** Finalize the pipeline run by generating documentation, producing a summary report, and cleaning up.
11
+
12
+ ---
13
+
14
+ ## ENTRY CONDITIONS
15
+
16
+ - Phase 3 TDD loop complete
17
+ - All stories either 'done' or 'blocked'
18
+ - Pipeline status up to date
19
+
20
+ ---
21
+
22
+ ## PROCESS
23
+
24
+ ### 4.1 Gather Results
25
+
26
+ ```yaml
27
+ results_gathering:
28
+ stories_completed:
29
+ count: N
30
+ list: [story-ids...]
31
+
32
+ stories_blocked:
33
+ count: M
34
+ list: [story-ids...]
35
+ reasons: [...]
36
+
37
+ tests_written:
38
+ acceptance_tests: X
39
+ unit_tests: Y
40
+ total: X + Y
41
+
42
+ code_changes:
43
+ files_created: [...]
44
+ files_modified: [...]
45
+ lines_added: N
46
+ lines_removed: M
47
+ ```
48
+
49
+ ### 4.2 Generate Documentation (Tech Writer)
50
+
51
+ **Agent:** Paige (Technical Writer)
52
+
53
+ **Invoke only if stories completed > 0**
54
+
55
+ **Input:**
56
+ - Completed story files
57
+ - Implemented code
58
+ - Test files
59
+
60
+ **Process:**
61
+
62
+ ```yaml
63
+ documentation:
64
+ generate:
65
+ - feature_docs:
66
+ for_each: completed_story
67
+ template: "feature-documentation.md"
68
+ output_dir: "sdocs/docs/"
69
+
70
+ - api_reference:
71
+ if: "API endpoints implemented"
72
+ template: "api-reference.md"
73
+
74
+ - readme_updates:
75
+ action: "Update README with new features"
76
+ sections: ["Features", "Usage", "API"]
77
+
78
+ - changelog:
79
+ action: "Add changelog entry"
80
+ format: "Keep a Changelog"
81
+ ```
82
+
83
+ **Documentation Output:**
84
+
85
+ ```markdown
86
+ # Feature: User Authentication
87
+
88
+ ## Overview
89
+ This feature enables users to log in, log out, and reset their passwords.
90
+
91
+ ## Implemented Stories
92
+ - ✅ User can log in with email and password
93
+ - ✅ User can log out
94
+ - ✅ User can reset password
95
+ - ❌ User can enable 2FA (blocked)
96
+
97
+ ## Usage
98
+
99
+ ### Login
100
+ \`\`\`typescript
101
+ import { login } from './auth';
102
+
103
+ const result = await login({
104
+ email: 'user@example.com',
105
+ password: 'securepassword'
106
+ });
107
+
108
+ if (result.success) {
109
+ console.log('Token:', result.token);
110
+ }
111
+ \`\`\`
112
+
113
+ ### Logout
114
+ \`\`\`typescript
115
+ import { logout } from './auth';
116
+
117
+ await logout();
118
+ \`\`\`
119
+
120
+ ## API Reference
121
+
122
+ ### POST /api/auth/login
123
+ - **Body:** `{ email: string, password: string }`
124
+ - **Response:** `{ success: boolean, token?: string, error?: string }`
125
+
126
+ ### POST /api/auth/logout
127
+ - **Headers:** `Authorization: Bearer <token>`
128
+ - **Response:** `{ success: boolean }`
129
+ ```
130
+
131
+ ### 4.3 Generate Pipeline Report
132
+
133
+ **Create comprehensive execution report:**
134
+
135
+ ```markdown
136
+ # SAM Autonomous TDD Pipeline Report
137
+
138
+ ## Run Summary
139
+
140
+ | Metric | Value |
141
+ |--------|-------|
142
+ | Run ID | 2024-01-15T10:30:00Z |
143
+ | PRD | path/to/prd.md |
144
+ | Started | 2024-01-15 10:30:00 |
145
+ | Completed | 2024-01-15 14:45:00 |
146
+ | Duration | 4h 15m |
147
+
148
+ ## Results
149
+
150
+ ### Stories
151
+ | Status | Count | Percentage |
152
+ |--------|-------|------------|
153
+ | ✅ Completed | 7 | 87.5% |
154
+ | ❌ Blocked | 1 | 12.5% |
155
+ | **Total** | 8 | 100% |
156
+
157
+ ### Completed Stories
158
+ | ID | Title | Tests |
159
+ |----|-------|-------|
160
+ | epic-1-story-1 | User can log in | 12 |
161
+ | epic-1-story-2 | User can log out | 6 |
162
+ | epic-1-story-3 | User can reset password | 8 |
163
+ | epic-2-story-1 | View dashboard | 10 |
164
+ | epic-2-story-2 | Dashboard widgets | 15 |
165
+ | epic-3-story-1 | User settings page | 9 |
166
+ | epic-3-story-2 | Change password | 7 |
167
+
168
+ ### Blocked Stories
169
+ | ID | Title | Phase | Reason |
170
+ |----|-------|-------|--------|
171
+ | epic-1-story-4 | Enable 2FA | GREEN | External service integration failed |
172
+
173
+ **Recommendation for blocked stories:** Manual intervention required for 2FA integration. Consider adding mock service for testing.
174
+
175
+ ## Test Summary
176
+
177
+ | Category | Count | Passing |
178
+ |----------|-------|---------|
179
+ | Acceptance Tests | 45 | 45 ✅ |
180
+ | Unit Tests | 78 | 78 ✅ |
181
+ | **Total** | 123 | 123 ✅ |
182
+
183
+ ## Code Changes
184
+
185
+ | Metric | Count |
186
+ |--------|-------|
187
+ | Files Created | 23 |
188
+ | Files Modified | 8 |
189
+ | Lines Added | 1,847 |
190
+ | Lines Removed | 42 |
191
+
192
+ ## Phase Breakdown
193
+
194
+ ### Phase 1: Validation
195
+ - Status: ✅ Passed
196
+ - Duration: 5 minutes
197
+ - Architect: Approved
198
+ - UX: Approved
199
+
200
+ ### Phase 2: Planning
201
+ - Status: ✅ Completed
202
+ - Duration: 10 minutes
203
+ - Epics Created: 3
204
+ - Stories Created: 8
205
+
206
+ ### Phase 3: Implementation
207
+ - Status: ✅ Completed (with 1 blocked)
208
+ - Duration: 3h 45m
209
+ - TDD Cycles: 8
210
+ - Total Retries: 3
211
+
212
+ ### Phase 4: Completion
213
+ - Status: ✅ Completed
214
+ - Duration: 15 minutes
215
+ - Documentation: Generated
216
+ - Report: This document
217
+
218
+ ## Recommendations
219
+
220
+ 1. **2FA Integration:** Requires manual setup of external service or mock
221
+ 2. **Test Coverage:** Consider adding integration tests for auth flow
222
+ 3. **Performance:** Dashboard query could benefit from caching
223
+
224
+ ## Files Generated
225
+
226
+ ### Documentation
227
+ - `sdocs/docs/user-authentication.md`
228
+ - `sdocs/docs/dashboard.md`
229
+ - `sdocs/docs/api-reference.md`
230
+
231
+ ### Reports
232
+ - `sdocs/autonomous-runs/<run-id>/pipeline-report.md` (this file)
233
+ - `sdocs/autonomous-runs/<run-id>/pipeline-status.yaml`
234
+
235
+ ---
236
+
237
+ *Generated by SAM (Smart Agent Manager) v1.0.0*
238
+ *Run completed: 2024-01-15 14:45:00*
239
+ ```
240
+
241
+ ### 4.4 Update Final State
242
+
243
+ ```yaml
244
+ # Final pipeline-status.yaml update
245
+
246
+ completion:
247
+ status: "completed" # or "partial" if blocked stories
248
+ completed_at: "<timestamp>"
249
+
250
+ summary:
251
+ stories_completed: 7
252
+ stories_blocked: 1
253
+ tests_passing: 123
254
+ documentation_generated: true
255
+ report_generated: true
256
+
257
+ outputs:
258
+ documentation:
259
+ - "sdocs/docs/user-authentication.md"
260
+ - "sdocs/docs/dashboard.md"
261
+ report: "pipeline-report.md"
262
+
263
+ current_phase: "completed"
264
+ ```
265
+
266
+ ---
267
+
268
+ ## OUTPUT FILES
269
+
270
+ ```
271
+ sdocs/autonomous-runs/<run-id>/
272
+ ├── pipeline-status.yaml # Final state
273
+ ├── pipeline-report.md # Summary report
274
+ ├── stories/
275
+ │ ├── epic-1-story-1.md # Story files (updated)
276
+ │ └── ...
277
+ ├── logs/
278
+ │ └── execution.log # Full execution log
279
+ └── docs/ # Generated documentation
280
+ ├── user-authentication.md
281
+ └── api-reference.md
282
+ ```
283
+
284
+ ---
285
+
286
+ ## EXIT STATES
287
+
288
+ ### Complete Success
289
+ ```yaml
290
+ exit_state: "success"
291
+ message: "All stories implemented and tested successfully"
292
+ action: "Pipeline complete - review documentation and report"
293
+ ```
294
+
295
+ ### Partial Success
296
+ ```yaml
297
+ exit_state: "partial"
298
+ message: "7/8 stories completed, 1 blocked"
299
+ action: "Review blocked stories for manual intervention"
300
+ blocked_stories:
301
+ - id: "epic-1-story-4"
302
+ reason: "External service integration failed"
303
+ ```
304
+
305
+ ### Failure
306
+ ```yaml
307
+ exit_state: "failure"
308
+ message: "All stories blocked - pipeline could not complete"
309
+ action: "Review failure report, revise PRD or address blockers"
310
+ ```
311
+
312
+ ---
313
+
314
+ ## FINAL OUTPUT TO USER
315
+
316
+ ```
317
+ ╔═══════════════════════════════════════════════════════════════╗
318
+ ║ SAM AUTONOMOUS TDD PIPELINE COMPLETE ║
319
+ ╠═══════════════════════════════════════════════════════════════╣
320
+ ║ ║
321
+ ║ Status: ✅ COMPLETED (with 1 blocked story) ║
322
+ ║ Duration: 4h 15m ║
323
+ ║ ║
324
+ ║ Stories: 7/8 completed (87.5%) ║
325
+ ║ Tests: 123 passing ║
326
+ ║ Coverage: Acceptance + Unit tests ║
327
+ ║ ║
328
+ ║ 📄 Report: sdocs/autonomous-runs/<run-id>/pipeline-report.md║
329
+ ║ 📚 Docs: sdocs/docs/ ║
330
+ ║ ║
331
+ ║ ⚠️ Blocked: epic-1-story-4 (2FA) - manual intervention ║
332
+ ║ ║
333
+ ╚═══════════════════════════════════════════════════════════════╝
334
+ ```
335
+
336
+ ---
337
+
338
+ ## AUTONOMOUS BEHAVIOR
339
+
340
+ In autonomous mode:
341
+ - Generate all documentation without prompts
342
+ - Produce comprehensive report automatically
343
+ - Exit cleanly with status summary
344
+ - No human intervention required
345
+
346
+ ---
347
+
348
+ ## PIPELINE COMPLETE
349
+
350
+ The SAM Autonomous TDD Pipeline has finished execution.
351
+
352
+ **Next steps for user:**
353
+ 1. Review pipeline-report.md for summary
354
+ 2. Check generated documentation
355
+ 3. Address any blocked stories manually
356
+ 4. Commit implemented features to version control
@@ -0,0 +1,108 @@
1
+ # SAM Autonomous TDD Pipeline Status
2
+ # This file tracks the state of a pipeline run
3
+
4
+ # Run Identification
5
+ run_id: "<timestamp>"
6
+ prd_path: "<path-to-prd>"
7
+ started_at: "<timestamp>"
8
+ completed_at: null
9
+
10
+ # Current State
11
+ current_phase: "initialization" # initialization|validation|planning|implementation|completion
12
+ current_story: null
13
+
14
+ # Configuration (copied from config.yaml at run start)
15
+ config:
16
+ max_retry_attempts: 3
17
+ tdd_enforced: true
18
+ coverage_threshold: 80
19
+
20
+ # Phase 1: Validation
21
+ validation:
22
+ status: "pending" # pending|passed|failed
23
+ started_at: null
24
+ completed_at: null
25
+ architect_approval: null
26
+ ux_approval: null
27
+ issues: []
28
+ # Example issue:
29
+ # - type: "warning"
30
+ # agent: "architect"
31
+ # description: "Consider caching for dashboard queries"
32
+
33
+ # Phase 2: Planning
34
+ planning:
35
+ status: "pending" # pending|completed
36
+ started_at: null
37
+ completed_at: null
38
+ epics_created: 0
39
+ stories_created: 0
40
+
41
+ # Phase 3: Implementation
42
+ implementation:
43
+ status: "pending" # pending|in_progress|completed
44
+ started_at: null
45
+ completed_at: null
46
+ current_story_index: 0
47
+
48
+ # Stories (populated in Phase 2)
49
+ stories: []
50
+ # Example story entry:
51
+ # - id: "epic-1-story-1"
52
+ # title: "User can log in with email and password"
53
+ # epic: "epic-1"
54
+ # file_path: "stories/epic-1-story-1.md"
55
+ # priority: 1
56
+ # dependencies: []
57
+ # status: "pending" # pending|red|green|refactor|done|blocked
58
+ #
59
+ # red_phase:
60
+ # status: "pending" # pending|in_progress|completed
61
+ # started_at: null
62
+ # completed_at: null
63
+ # tests_written: 0
64
+ # tests_failing: 0
65
+ #
66
+ # green_phase:
67
+ # status: "pending"
68
+ # started_at: null
69
+ # completed_at: null
70
+ # retry_count: 0
71
+ # tests_passing: 0
72
+ #
73
+ # refactor_phase:
74
+ # status: "pending"
75
+ # started_at: null
76
+ # completed_at: null
77
+ # issues_found: 0
78
+ # issues_fixed: 0
79
+ # issues_remaining: 0
80
+ #
81
+ # blocked_info: null
82
+ # # If blocked:
83
+ # # blocked_info:
84
+ # # phase: "green"
85
+ # # reason: "Could not resolve external dependency"
86
+ # # attempts: 3
87
+ # # last_error: "Error message..."
88
+
89
+ # Phase 4: Completion
90
+ completion:
91
+ status: "pending" # pending|completed
92
+ started_at: null
93
+ completed_at: null
94
+ documentation_generated: false
95
+ report_generated: false
96
+ outputs:
97
+ documentation: []
98
+ report: null
99
+
100
+ # Summary (populated at completion)
101
+ summary:
102
+ total_stories: 0
103
+ stories_completed: 0
104
+ stories_blocked: 0
105
+ total_tests: 0
106
+ tests_passing: 0
107
+ total_issues_found: 0
108
+ total_issues_fixed: 0