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.
- package/LICENSE +21 -0
- package/README.md +92 -0
- package/bin/cli.js +320 -0
- package/package.json +36 -0
- package/templates/.claude/commands/sam/core/agents/sam.md +6 -0
- package/templates/.claude/commands/sam/core/workflows/autonomous-tdd.md +6 -0
- package/templates/.claude/commands/sam/sam/agents/argus.md +6 -0
- package/templates/.claude/commands/sam/sam/agents/atlas.md +6 -0
- package/templates/.claude/commands/sam/sam/agents/dyna.md +6 -0
- package/templates/.claude/commands/sam/sam/agents/iris.md +6 -0
- package/templates/.claude/commands/sam/sam/agents/sage.md +6 -0
- package/templates/.claude/commands/sam/sam/agents/titan.md +6 -0
- package/templates/_sam/_config/agent-manifest.csv +8 -0
- package/templates/_sam/_config/agents/sam-architect.customize.yaml +13 -0
- package/templates/_sam/_config/agents/sam-dev.customize.yaml +13 -0
- package/templates/_sam/_config/agents/sam-reviewer.customize.yaml +13 -0
- package/templates/_sam/_config/agents/sam-sam.customize.yaml +13 -0
- package/templates/_sam/_config/agents/sam-tech-writer.customize.yaml +13 -0
- package/templates/_sam/_config/agents/sam-test.customize.yaml +13 -0
- package/templates/_sam/_config/agents/sam-ux-designer.customize.yaml +13 -0
- package/templates/_sam/_config/ides/claude-code.yaml +6 -0
- package/templates/_sam/_config/manifest.yaml +13 -0
- package/templates/_sam/_config/workflow-manifest.csv +2 -0
- package/templates/_sam/agents/architect.md +69 -0
- package/templates/_sam/agents/dev.md +97 -0
- package/templates/_sam/agents/reviewer.md +138 -0
- package/templates/_sam/agents/tech-writer.md +147 -0
- package/templates/_sam/agents/test.md +120 -0
- package/templates/_sam/agents/ux-designer.md +141 -0
- package/templates/_sam/core/agents/sam-master.md +91 -0
- package/templates/_sam/core/config.yaml +31 -0
- package/templates/_sam/core/workflows/autonomous-tdd/steps/step-01-validate-prd.md +213 -0
- package/templates/_sam/core/workflows/autonomous-tdd/steps/step-02-generate-stories.md +266 -0
- package/templates/_sam/core/workflows/autonomous-tdd/steps/step-03-tdd-loop.md +422 -0
- package/templates/_sam/core/workflows/autonomous-tdd/steps/step-04-complete.md +356 -0
- package/templates/_sam/core/workflows/autonomous-tdd/templates/pipeline-status.yaml +108 -0
- package/templates/_sam/core/workflows/autonomous-tdd/workflow.md +311 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 sam-agents
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
# SAM - Smart Agent Manager
|
|
2
|
+
|
|
3
|
+
[](https://www.npmjs.com/package/@sam-agents/sam)
|
|
4
|
+
[](https://opensource.org/licenses/MIT)
|
|
5
|
+
[](https://www.npmjs.com/package/@sam-agents/sam)
|
|
6
|
+
|
|
7
|
+
**Autonomous TDD agent system for Claude Code and Cursor.**
|
|
8
|
+
|
|
9
|
+
SAM orchestrates a team of specialized AI agents that transform your PRD into working, tested code using strict Test-Driven Development (RED-GREEN-REFACTOR).
|
|
10
|
+
|
|
11
|
+
## Quick Start
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
# For Claude Code (default)
|
|
15
|
+
npx @sam-agents/sam
|
|
16
|
+
|
|
17
|
+
# For Cursor
|
|
18
|
+
npx @sam-agents/sam --platform cursor
|
|
19
|
+
|
|
20
|
+
# For all platforms
|
|
21
|
+
npx @sam-agents/sam --platform all
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## Supported Platforms
|
|
25
|
+
|
|
26
|
+
| Platform | Install Command | Skill Format |
|
|
27
|
+
|----------|-----------------|--------------|
|
|
28
|
+
| **Claude Code** | `npx @sam-agents/sam` | `/sam:` commands |
|
|
29
|
+
| **Cursor** | `npx @sam-agents/sam --platform cursor` | `@agent` mentions |
|
|
30
|
+
|
|
31
|
+
## Why SAM?
|
|
32
|
+
|
|
33
|
+
| Feature | SAM | Traditional AI Coding |
|
|
34
|
+
|---------|-----|----------------------|
|
|
35
|
+
| **TDD-First** | Tests written before code | Code first, tests maybe |
|
|
36
|
+
| **BYOA** | Use your own AI subscription | Pay per API call (5-10x cost) |
|
|
37
|
+
| **Transparency** | Watch agents work in real-time | Black box |
|
|
38
|
+
| **Autonomous** | Minimal intervention after PRD | Constant hand-holding |
|
|
39
|
+
| **Multi-Platform** | Claude Code + Cursor | Single platform lock-in |
|
|
40
|
+
|
|
41
|
+
## Available Agents
|
|
42
|
+
|
|
43
|
+
| Agent | Claude Code | Cursor | Role |
|
|
44
|
+
|-------|-------------|--------|------|
|
|
45
|
+
| **SAM** | `/sam:core:agents:sam` | `@sam` | Orchestrator |
|
|
46
|
+
| **Atlas** | `/sam:sam:agents:atlas` | `@atlas` | System Architect |
|
|
47
|
+
| **Titan** | `/sam:sam:agents:titan` | `@titan` | Test Architect (RED) |
|
|
48
|
+
| **Dyna** | `/sam:sam:agents:dyna` | `@dyna` | Developer (GREEN) |
|
|
49
|
+
| **Argus** | `/sam:sam:agents:argus` | `@argus` | Code Reviewer (REFACTOR) |
|
|
50
|
+
| **Sage** | `/sam:sam:agents:sage` | `@sage` | Technical Writer |
|
|
51
|
+
| **Iris** | `/sam:sam:agents:iris` | `@iris` | UX Designer |
|
|
52
|
+
|
|
53
|
+
## The TDD Pipeline
|
|
54
|
+
|
|
55
|
+
**Claude Code:** `/sam:core:workflows:autonomous-tdd`
|
|
56
|
+
**Cursor:** `@sam-tdd`
|
|
57
|
+
|
|
58
|
+
1. **Validate PRD** - Atlas + Iris review requirements
|
|
59
|
+
2. **Generate Stories** - Break down into epics and user stories
|
|
60
|
+
3. **TDD Loop** - For each story:
|
|
61
|
+
- **RED**: Titan writes failing tests
|
|
62
|
+
- **GREEN**: Dyna writes minimal code to pass
|
|
63
|
+
- **REFACTOR**: Argus improves code quality
|
|
64
|
+
4. **Complete** - Sage generates documentation
|
|
65
|
+
|
|
66
|
+
## What Gets Installed
|
|
67
|
+
|
|
68
|
+
```
|
|
69
|
+
your-project/
|
|
70
|
+
โโโ _sam/ # Agent definitions (shared)
|
|
71
|
+
โ โโโ agents/ # Individual agent configs
|
|
72
|
+
โ โโโ core/workflows/ # TDD pipeline workflow
|
|
73
|
+
โโโ .claude/commands/sam/ # Claude Code skills (--platform claude)
|
|
74
|
+
โโโ .cursor/rules/ # Cursor rules (--platform cursor)
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
## Requirements
|
|
78
|
+
|
|
79
|
+
- Node.js 16+
|
|
80
|
+
- [Claude Code CLI](https://docs.anthropic.com/en/docs/claude-code) or [Cursor](https://cursor.com)
|
|
81
|
+
|
|
82
|
+
## Contributing
|
|
83
|
+
|
|
84
|
+
We welcome contributions! See [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines.
|
|
85
|
+
|
|
86
|
+
## License
|
|
87
|
+
|
|
88
|
+
MIT - see [LICENSE](LICENSE) for details.
|
|
89
|
+
|
|
90
|
+
---
|
|
91
|
+
|
|
92
|
+
Built with AI. Powered by TDD.
|
package/bin/cli.js
ADDED
|
@@ -0,0 +1,320 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
const fs = require('fs');
|
|
4
|
+
const path = require('path');
|
|
5
|
+
const readline = require('readline');
|
|
6
|
+
|
|
7
|
+
const CYAN = '\x1b[36m';
|
|
8
|
+
const GREEN = '\x1b[32m';
|
|
9
|
+
const YELLOW = '\x1b[33m';
|
|
10
|
+
const RED = '\x1b[31m';
|
|
11
|
+
const RESET = '\x1b[0m';
|
|
12
|
+
const BOLD = '\x1b[1m';
|
|
13
|
+
const DIM = '\x1b[2m';
|
|
14
|
+
|
|
15
|
+
const PLATFORMS = ['claude', 'cursor', 'all'];
|
|
16
|
+
|
|
17
|
+
function log(message, color = RESET) {
|
|
18
|
+
console.log(`${color}${message}${RESET}`);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
function copyRecursive(src, dest) {
|
|
22
|
+
const stats = fs.statSync(src);
|
|
23
|
+
|
|
24
|
+
if (stats.isDirectory()) {
|
|
25
|
+
if (!fs.existsSync(dest)) {
|
|
26
|
+
fs.mkdirSync(dest, { recursive: true });
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
const files = fs.readdirSync(src);
|
|
30
|
+
for (const file of files) {
|
|
31
|
+
copyRecursive(path.join(src, file), path.join(dest, file));
|
|
32
|
+
}
|
|
33
|
+
} else {
|
|
34
|
+
const destDir = path.dirname(dest);
|
|
35
|
+
if (!fs.existsSync(destDir)) {
|
|
36
|
+
fs.mkdirSync(destDir, { recursive: true });
|
|
37
|
+
}
|
|
38
|
+
fs.copyFileSync(src, dest);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
function countFiles(dir) {
|
|
43
|
+
let count = 0;
|
|
44
|
+
const items = fs.readdirSync(dir);
|
|
45
|
+
for (const item of items) {
|
|
46
|
+
const fullPath = path.join(dir, item);
|
|
47
|
+
if (fs.statSync(fullPath).isDirectory()) {
|
|
48
|
+
count += countFiles(fullPath);
|
|
49
|
+
} else {
|
|
50
|
+
count++;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
return count;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
function showHelp() {
|
|
57
|
+
log('\n' + BOLD + ' SAM - Smart Agent Manager' + RESET);
|
|
58
|
+
log(' Autonomous TDD Agent System\n', CYAN);
|
|
59
|
+
log(' Usage: npx @sam-agents/sam [options] [target-directory]\n');
|
|
60
|
+
log(' Options:');
|
|
61
|
+
log(' --platform <name> Target platform: claude, cursor, all');
|
|
62
|
+
log(' --help, -h Show this help message');
|
|
63
|
+
log(' --version, -v Show version number\n');
|
|
64
|
+
log(' Examples:');
|
|
65
|
+
log(' npx @sam-agents/sam Interactive mode');
|
|
66
|
+
log(' npx @sam-agents/sam --platform cursor Install for Cursor');
|
|
67
|
+
log(' npx @sam-agents/sam --platform all Install for all platforms');
|
|
68
|
+
log(' npx @sam-agents/sam ./myapp Install in ./myapp directory\n');
|
|
69
|
+
log(' Supported Platforms:');
|
|
70
|
+
log(' claude - Claude Code CLI (.claude/commands/)');
|
|
71
|
+
log(' cursor - Cursor IDE (.cursor/rules/)\n');
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
function generateCursorRules(samDir, targetDir) {
|
|
75
|
+
const cursorDir = path.join(targetDir, '.cursor', 'rules');
|
|
76
|
+
|
|
77
|
+
if (!fs.existsSync(cursorDir)) {
|
|
78
|
+
fs.mkdirSync(cursorDir, { recursive: true });
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
const agents = [
|
|
82
|
+
{ name: 'sam', file: 'core/agents/sam-master.md', display: 'SAM Orchestrator' },
|
|
83
|
+
{ name: 'atlas', file: 'agents/architect.md', display: 'Atlas - System Architect' },
|
|
84
|
+
{ name: 'dyna', file: 'agents/dev.md', display: 'Dyna - Developer' },
|
|
85
|
+
{ name: 'titan', file: 'agents/test.md', display: 'Titan - Test Architect' },
|
|
86
|
+
{ name: 'argus', file: 'agents/reviewer.md', display: 'Argus - Code Reviewer' },
|
|
87
|
+
{ name: 'sage', file: 'agents/tech-writer.md', display: 'Sage - Technical Writer' },
|
|
88
|
+
{ name: 'iris', file: 'agents/ux-designer.md', display: 'Iris - UX Designer' }
|
|
89
|
+
];
|
|
90
|
+
|
|
91
|
+
let rulesCount = 0;
|
|
92
|
+
|
|
93
|
+
for (const agent of agents) {
|
|
94
|
+
const agentPath = path.join(samDir, agent.file);
|
|
95
|
+
if (fs.existsSync(agentPath)) {
|
|
96
|
+
const content = fs.readFileSync(agentPath, 'utf8');
|
|
97
|
+
|
|
98
|
+
const ruleContent = `---
|
|
99
|
+
description: ${agent.display} - SAM Agent for TDD development
|
|
100
|
+
globs: ["**/*"]
|
|
101
|
+
alwaysApply: false
|
|
102
|
+
---
|
|
103
|
+
|
|
104
|
+
# ${agent.display}
|
|
105
|
+
|
|
106
|
+
When the user mentions "@${agent.name}" or asks for ${agent.display.toLowerCase()}, adopt this persona:
|
|
107
|
+
|
|
108
|
+
${content}
|
|
109
|
+
|
|
110
|
+
## Invocation
|
|
111
|
+
To use this agent, the user should mention @${agent.name} in their message.
|
|
112
|
+
`;
|
|
113
|
+
|
|
114
|
+
fs.writeFileSync(path.join(cursorDir, `sam-${agent.name}.mdc`), ruleContent);
|
|
115
|
+
rulesCount++;
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
const workflowRule = `---
|
|
120
|
+
description: SAM Autonomous TDD Workflow - Full pipeline from PRD to tested code
|
|
121
|
+
globs: ["**/*"]
|
|
122
|
+
alwaysApply: false
|
|
123
|
+
---
|
|
124
|
+
|
|
125
|
+
# SAM Autonomous TDD Workflow
|
|
126
|
+
|
|
127
|
+
When the user mentions "@sam-tdd" or asks for the TDD workflow, execute this pipeline:
|
|
128
|
+
|
|
129
|
+
## Overview
|
|
130
|
+
SAM orchestrates a team of AI agents to transform a PRD into working, tested code using strict TDD.
|
|
131
|
+
|
|
132
|
+
## The Pipeline
|
|
133
|
+
|
|
134
|
+
### Phase 1: Validate PRD
|
|
135
|
+
- @atlas reviews technical feasibility
|
|
136
|
+
- @iris validates UX requirements
|
|
137
|
+
|
|
138
|
+
### Phase 2: Generate Stories
|
|
139
|
+
- Break PRD into epics and user stories
|
|
140
|
+
- Create detailed acceptance criteria
|
|
141
|
+
|
|
142
|
+
### Phase 3: TDD Loop (for each story)
|
|
143
|
+
1. **RED**: @titan writes failing tests based on acceptance criteria
|
|
144
|
+
2. **GREEN**: @dyna writes minimal code to make tests pass
|
|
145
|
+
3. **REFACTOR**: @argus reviews and improves code quality
|
|
146
|
+
|
|
147
|
+
### Phase 4: Complete
|
|
148
|
+
- @sage generates documentation
|
|
149
|
+
- Final review and handoff
|
|
150
|
+
|
|
151
|
+
## Usage
|
|
152
|
+
Mention @sam-tdd with a PRD or feature description to start the pipeline.
|
|
153
|
+
|
|
154
|
+
## Agent Commands
|
|
155
|
+
- @sam - Orchestrator
|
|
156
|
+
- @atlas - Architect (PRD validation, technical design)
|
|
157
|
+
- @titan - Test Architect (RED phase - write failing tests)
|
|
158
|
+
- @dyna - Developer (GREEN phase - make tests pass)
|
|
159
|
+
- @argus - Code Reviewer (REFACTOR phase)
|
|
160
|
+
- @sage - Technical Writer (documentation)
|
|
161
|
+
- @iris - UX Designer (UX validation)
|
|
162
|
+
`;
|
|
163
|
+
|
|
164
|
+
fs.writeFileSync(path.join(cursorDir, 'sam-workflow.mdc'), workflowRule);
|
|
165
|
+
rulesCount++;
|
|
166
|
+
|
|
167
|
+
return rulesCount;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
async function promptPlatform() {
|
|
171
|
+
const rl = readline.createInterface({
|
|
172
|
+
input: process.stdin,
|
|
173
|
+
output: process.stdout
|
|
174
|
+
});
|
|
175
|
+
|
|
176
|
+
return new Promise((resolve) => {
|
|
177
|
+
log('\n' + BOLD + ' SAM - Smart Agent Manager' + RESET);
|
|
178
|
+
log(' Autonomous TDD Agent System\n', CYAN);
|
|
179
|
+
log(' Select your IDE/Platform:\n');
|
|
180
|
+
log(' 1) Claude Code ' + DIM + '(.claude/commands/)' + RESET);
|
|
181
|
+
log(' 2) Cursor ' + DIM + '(.cursor/rules/)' + RESET);
|
|
182
|
+
log(' 3) Both ' + DIM + '(install for all platforms)' + RESET);
|
|
183
|
+
log('');
|
|
184
|
+
|
|
185
|
+
rl.question(' Enter choice [1-3]: ', (answer) => {
|
|
186
|
+
rl.close();
|
|
187
|
+
const choice = answer.trim();
|
|
188
|
+
|
|
189
|
+
if (choice === '1' || choice.toLowerCase() === 'claude') {
|
|
190
|
+
resolve('claude');
|
|
191
|
+
} else if (choice === '2' || choice.toLowerCase() === 'cursor') {
|
|
192
|
+
resolve('cursor');
|
|
193
|
+
} else if (choice === '3' || choice.toLowerCase() === 'both' || choice.toLowerCase() === 'all') {
|
|
194
|
+
resolve('all');
|
|
195
|
+
} else if (choice === '') {
|
|
196
|
+
// Default to claude
|
|
197
|
+
resolve('claude');
|
|
198
|
+
} else {
|
|
199
|
+
log('\n Invalid choice. Defaulting to Claude Code.\n', YELLOW);
|
|
200
|
+
resolve('claude');
|
|
201
|
+
}
|
|
202
|
+
});
|
|
203
|
+
});
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
function install(platform, targetDir) {
|
|
207
|
+
const templatesDir = path.join(__dirname, '..', 'templates');
|
|
208
|
+
|
|
209
|
+
if (!fs.existsSync(templatesDir)) {
|
|
210
|
+
log('Error: Templates directory not found.', RED);
|
|
211
|
+
process.exit(1);
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
const samDir = path.join(targetDir, '_sam');
|
|
215
|
+
|
|
216
|
+
log(`\n Platform: ${platform}`, CYAN);
|
|
217
|
+
log(` Installing to: ${targetDir}\n`, CYAN);
|
|
218
|
+
|
|
219
|
+
// Always copy _sam folder
|
|
220
|
+
const samTemplateDir = path.join(templatesDir, '_sam');
|
|
221
|
+
if (fs.existsSync(samTemplateDir)) {
|
|
222
|
+
copyRecursive(samTemplateDir, samDir);
|
|
223
|
+
const samFileCount = countFiles(samDir);
|
|
224
|
+
log(` โ Copied _sam/ (${samFileCount} files)`, GREEN);
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
// Install Claude Code integration
|
|
228
|
+
if (platform === 'claude' || platform === 'all') {
|
|
229
|
+
const claudeCommandsDir = path.join(targetDir, '.claude', 'commands', 'sam');
|
|
230
|
+
const claudeTemplateDir = path.join(templatesDir, '.claude', 'commands', 'sam');
|
|
231
|
+
if (fs.existsSync(claudeTemplateDir)) {
|
|
232
|
+
copyRecursive(claudeTemplateDir, claudeCommandsDir);
|
|
233
|
+
const claudeFileCount = countFiles(claudeCommandsDir);
|
|
234
|
+
log(` โ Copied .claude/commands/sam/ (${claudeFileCount} files)`, GREEN);
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
// Install Cursor integration
|
|
239
|
+
if (platform === 'cursor' || platform === 'all') {
|
|
240
|
+
const cursorRulesCount = generateCursorRules(samDir, targetDir);
|
|
241
|
+
log(` โ Generated .cursor/rules/ (${cursorRulesCount} files)`, GREEN);
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
log('\n' + BOLD + ' Installation complete!' + RESET + '\n');
|
|
245
|
+
|
|
246
|
+
if (platform === 'claude' || platform === 'all') {
|
|
247
|
+
log(' Claude Code Commands:', CYAN);
|
|
248
|
+
log(' /sam:core:agents:sam - SAM Orchestrator');
|
|
249
|
+
log(' /sam:sam:agents:atlas - Atlas (Architect)');
|
|
250
|
+
log(' /sam:sam:agents:dyna - Dyna (Developer)');
|
|
251
|
+
log(' /sam:sam:agents:titan - Titan (Test Architect)');
|
|
252
|
+
log(' /sam:sam:agents:argus - Argus (Code Reviewer)');
|
|
253
|
+
log(' /sam:sam:agents:sage - Sage (Tech Writer)');
|
|
254
|
+
log(' /sam:sam:agents:iris - Iris (UX Designer)');
|
|
255
|
+
log(' /sam:core:workflows:autonomous-tdd - Full TDD Pipeline\n');
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
if (platform === 'cursor' || platform === 'all') {
|
|
259
|
+
log(' Cursor Commands (use @ mentions):', CYAN);
|
|
260
|
+
log(' @sam - SAM Orchestrator');
|
|
261
|
+
log(' @atlas - Atlas (Architect)');
|
|
262
|
+
log(' @dyna - Dyna (Developer)');
|
|
263
|
+
log(' @titan - Titan (Test Architect)');
|
|
264
|
+
log(' @argus - Argus (Code Reviewer)');
|
|
265
|
+
log(' @sage - Sage (Tech Writer)');
|
|
266
|
+
log(' @iris - Iris (UX Designer)');
|
|
267
|
+
log(' @sam-tdd - Full TDD Pipeline\n');
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
if (platform === 'claude' || platform === 'all') {
|
|
271
|
+
log(' Restart Claude Code to load the new skills.', YELLOW);
|
|
272
|
+
}
|
|
273
|
+
if (platform === 'cursor' || platform === 'all') {
|
|
274
|
+
log(' Cursor will auto-detect rules in .cursor/rules/', YELLOW);
|
|
275
|
+
}
|
|
276
|
+
log('');
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
async function main() {
|
|
280
|
+
const args = process.argv.slice(2);
|
|
281
|
+
|
|
282
|
+
// Handle flags
|
|
283
|
+
if (args.includes('--help') || args.includes('-h')) {
|
|
284
|
+
showHelp();
|
|
285
|
+
return;
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
if (args.includes('--version') || args.includes('-v')) {
|
|
289
|
+
const pkg = require('../package.json');
|
|
290
|
+
log(`@sam-agents/sam v${pkg.version}`);
|
|
291
|
+
return;
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
// Check if platform is specified
|
|
295
|
+
const platformIdx = args.indexOf('--platform');
|
|
296
|
+
let platform = null;
|
|
297
|
+
|
|
298
|
+
if (platformIdx !== -1 && args[platformIdx + 1]) {
|
|
299
|
+
platform = args[platformIdx + 1].toLowerCase();
|
|
300
|
+
if (!PLATFORMS.includes(platform)) {
|
|
301
|
+
log(`\nError: Unknown platform "${platform}". Use: ${PLATFORMS.join(', ')}`, RED);
|
|
302
|
+
process.exit(1);
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
// Get target directory (skip flags)
|
|
307
|
+
const targetDir = args.find(arg => !arg.startsWith('--') && arg !== platform) || process.cwd();
|
|
308
|
+
|
|
309
|
+
// If no platform specified, prompt interactively
|
|
310
|
+
if (!platform) {
|
|
311
|
+
platform = await promptPlatform();
|
|
312
|
+
} else {
|
|
313
|
+
log('\n' + BOLD + ' SAM - Smart Agent Manager' + RESET);
|
|
314
|
+
log(' Autonomous TDD Agent System', CYAN);
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
install(platform, targetDir);
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
main();
|
package/package.json
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "sam-agents",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "SAM (Smart Agent Manager) - Autonomous TDD agent system for Claude Code and Cursor",
|
|
5
|
+
"bin": {
|
|
6
|
+
"sam-agents": "./bin/cli.js"
|
|
7
|
+
},
|
|
8
|
+
"files": [
|
|
9
|
+
"bin",
|
|
10
|
+
"templates"
|
|
11
|
+
],
|
|
12
|
+
"keywords": [
|
|
13
|
+
"claude",
|
|
14
|
+
"claude-code",
|
|
15
|
+
"cursor",
|
|
16
|
+
"ai-agents",
|
|
17
|
+
"tdd",
|
|
18
|
+
"autonomous",
|
|
19
|
+
"code-generation",
|
|
20
|
+
"testing",
|
|
21
|
+
"developer-tools"
|
|
22
|
+
],
|
|
23
|
+
"author": "SAM Agents",
|
|
24
|
+
"license": "MIT",
|
|
25
|
+
"repository": {
|
|
26
|
+
"type": "git",
|
|
27
|
+
"url": "https://github.com/sam-agents/sam.git"
|
|
28
|
+
},
|
|
29
|
+
"homepage": "https://github.com/sam-agents/sam#readme",
|
|
30
|
+
"bugs": {
|
|
31
|
+
"url": "https://github.com/sam-agents/sam/issues"
|
|
32
|
+
},
|
|
33
|
+
"engines": {
|
|
34
|
+
"node": ">=16.0.0"
|
|
35
|
+
}
|
|
36
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: 'autonomous-tdd'
|
|
3
|
+
description: 'SAM Autonomous TDD Pipeline - Transforms PRD into working, tested code using RED-GREEN-REFACTOR methodology'
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
IT IS CRITICAL THAT YOU FOLLOW THIS COMMAND: LOAD the FULL @_sam/core/workflows/autonomous-tdd/workflow.md, READ its entire contents and follow its directions exactly!
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
name,displayName,title,icon,role,identity,communicationStyle,principles,module,path
|
|
2
|
+
"sam","SAM","Smart Agent Manager - Orchestrator","๐ค","Master Orchestrator + Pipeline Controller","SAM is the master orchestrator for autonomous development pipelines. Coordinates specialized agents (Atlas, Dyna, Titan, Argus, Sage, Iris) through TDD cycles, manages state, and ensures quality gates are enforced.","Direct and systematic, focused on pipeline execution and agent coordination. Presents clear status updates and orchestrates workflows efficiently.","- Orchestrate agents through RED-GREEN-REFACTOR cycles without human intervention - Enforce quality gates: tests must fail before impl, pass after - Track state meticulously in pipeline-status.yaml - Escalate only when max retries exceeded","core","_sam/core/agents/sam-master.md"
|
|
3
|
+
"architect","Atlas","System Architect","๐๏ธ","System Architect + Technical Design Leader","Senior architect with expertise in distributed systems, cloud infrastructure, and API design. Validates PRDs for technical feasibility and designs scalable solutions.","Speaks in calm, pragmatic tones, balancing 'what could be' with 'what should be.'","- Validate PRD technical feasibility before development begins - Design simple solutions that scale when needed - Every technical decision must connect to business value - Identify risks and dependencies early","sam","_sam/agents/architect.md"
|
|
4
|
+
"dev","Dyna","Developer Agent","๐ป","Senior Software Engineer","Executes story implementation with strict TDD adherence. Writes minimum code to make failing tests pass, following RED-GREEN-REFACTOR discipline.","Ultra-succinct. Speaks in file paths and test results. No fluff, all precision.","- Never write implementation code until failing tests exist - Write minimum code to make tests pass (GREEN phase) - All existing tests must remain green - Follow project-context.md guidance when available - Mark task complete only when ALL tests pass","sam","_sam/agents/dev.md"
|
|
5
|
+
"test","Titan","Test Architect","๐งช","Master Test Architect","Test architect specializing in writing failing acceptance tests BEFORE implementation. Enforces TDD RED phase with comprehensive test coverage.","Speaks in test assertions and coverage metrics. Risk-focused, quality-obsessed.","- Write failing tests FIRST - this is non-negotiable (RED phase) - Tests must fail for the right reasons - missing implementation - Cover edge cases, error conditions, and happy paths - Acceptance tests validate story AC, unit tests validate code behavior - Never mark RED phase complete if tests pass","sam","_sam/agents/test.md"
|
|
6
|
+
"reviewer","Argus","Code Reviewer","๐","Senior Code Reviewer + Quality Guardian","Adversarial code reviewer who finds 3-10 specific issues in every review. Challenges code quality, test coverage, security, and architecture compliance.","Direct and critical. Finds problems others miss. Never says 'looks good' without thorough analysis.","- Find minimum 3 issues in every review - no free passes - Check: correctness, tests, security, performance, maintainability - Verify all tests pass after suggested fixes - Auto-fix when possible, document when not - REFACTOR phase: improve code while keeping tests green","sam","_sam/agents/reviewer.md"
|
|
7
|
+
"tech-writer","Sage","Technical Writer","๐","Technical Documentation Specialist","Creates clear, comprehensive documentation for implemented features. Transforms code and tests into accessible documentation.","Patient educator who explains complex concepts simply. Uses examples that clarify.","- Documentation is teaching - help users accomplish tasks - Generate docs AFTER implementation is complete and reviewed - Include code examples, API references, and usage guides - Keep docs in sync with actual implementation","sam","_sam/agents/tech-writer.md"
|
|
8
|
+
"ux-designer","Iris","UX Designer","๐จ","User Experience Designer","Validates UI/UX aspects of stories. Ensures implementations serve genuine user needs with intuitive experiences.","Empathetic advocate focused on user needs. Paints pictures with user stories.","- Every UI decision must serve genuine user needs - Validate against acceptance criteria for UX requirements - Flag usability concerns before implementation locks in - Balance aesthetics with accessibility","sam","_sam/agents/ux-designer.md"
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# SAM - Smart Agent Manager
|
|
2
|
+
# Skill Package Manifest for Claude Code
|
|
3
|
+
# Version: 1.0.0
|
|
4
|
+
|
|
5
|
+
installation:
|
|
6
|
+
version: 1.0.0
|
|
7
|
+
installDate: 2026-01-28T00:00:00.000Z
|
|
8
|
+
lastUpdated: 2026-01-28T00:00:00.000Z
|
|
9
|
+
modules:
|
|
10
|
+
- core
|
|
11
|
+
- sam
|
|
12
|
+
ides:
|
|
13
|
+
- claude-code
|