claude-autopm 1.31.0 ā 2.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/autopm/.claude/mcp/test-server.md +10 -0
- package/bin/autopm-poc.js +176 -44
- package/bin/autopm.js +6 -0
- package/lib/ai-providers/AbstractAIProvider.js +524 -0
- package/lib/ai-providers/ClaudeProvider.js +359 -48
- package/lib/ai-providers/TemplateProvider.js +432 -0
- package/lib/cli/commands/agent.js +206 -0
- package/lib/cli/commands/config.js +488 -0
- package/lib/cli/commands/prd.js +345 -0
- package/lib/cli/commands/task.js +206 -0
- package/lib/config/ConfigManager.js +531 -0
- package/lib/errors/AIProviderError.js +164 -0
- package/lib/services/AgentService.js +557 -0
- package/lib/services/EpicService.js +609 -0
- package/lib/services/PRDService.js +928 -103
- package/lib/services/TaskService.js +760 -0
- package/lib/services/interfaces.js +753 -0
- package/lib/utils/CircuitBreaker.js +165 -0
- package/lib/utils/Encryption.js +201 -0
- package/lib/utils/RateLimiter.js +241 -0
- package/lib/utils/ServiceFactory.js +165 -0
- package/package.json +6 -5
- package/scripts/config/get.js +108 -0
- package/scripts/config/init.js +100 -0
- package/scripts/config/list-providers.js +93 -0
- package/scripts/config/set-api-key.js +107 -0
- package/scripts/config/set-provider.js +201 -0
- package/scripts/config/set.js +139 -0
- package/scripts/config/show.js +181 -0
- package/autopm/.claude/.env +0 -158
- package/autopm/.claude/settings.local.json +0 -9
package/bin/autopm-poc.js
CHANGED
|
@@ -16,30 +16,38 @@ const fs = require('fs');
|
|
|
16
16
|
const path = require('path');
|
|
17
17
|
const ClaudeProvider = require('../lib/ai-providers/ClaudeProvider');
|
|
18
18
|
const PRDService = require('../lib/services/PRDService');
|
|
19
|
+
const EpicService = require('../lib/services/EpicService');
|
|
20
|
+
const ConfigManager = require('../lib/config/ConfigManager');
|
|
21
|
+
const ServiceFactory = require('../lib/utils/ServiceFactory');
|
|
19
22
|
|
|
20
23
|
/**
|
|
21
24
|
* Print usage information
|
|
22
25
|
*/
|
|
23
26
|
function printUsage() {
|
|
24
27
|
console.log(`
|
|
25
|
-
AutoPM POC - Claude API Integration Demo
|
|
26
|
-
|
|
28
|
+
AutoPM POC - Claude API Integration Demo (Streaming Support)
|
|
29
|
+
=============================================================
|
|
27
30
|
|
|
28
31
|
Usage:
|
|
29
|
-
autopm-poc parse <prd-file> Parse PRD with streaming
|
|
30
|
-
autopm-poc
|
|
31
|
-
autopm-poc summarize <prd-file> Get
|
|
32
|
+
autopm-poc parse <prd-file> Parse PRD with streaming AI analysis
|
|
33
|
+
autopm-poc extract-epics <prd-file> Extract epics from PRD (streaming)
|
|
34
|
+
autopm-poc summarize <prd-file> Get PRD summary (streaming)
|
|
35
|
+
autopm-poc decompose <epic-file> Decompose epic into tasks (streaming)
|
|
36
|
+
autopm-poc analyze <prd-file> Epic-level PRD analysis (streaming)
|
|
32
37
|
autopm-poc test Test API connection
|
|
33
38
|
autopm-poc help Show this help message
|
|
34
39
|
|
|
35
40
|
Environment Variables:
|
|
36
41
|
ANTHROPIC_API_KEY Required - Your Anthropic API key
|
|
42
|
+
AUTOPM_MASTER_PASSWORD Optional - For encrypted config
|
|
37
43
|
|
|
38
44
|
Examples:
|
|
39
45
|
export ANTHROPIC_API_KEY="sk-ant-..."
|
|
40
46
|
autopm-poc parse examples/sample-prd.md
|
|
47
|
+
autopm-poc extract-epics examples/sample-prd.md
|
|
41
48
|
autopm-poc summarize examples/sample-prd.md
|
|
42
|
-
autopm-poc
|
|
49
|
+
autopm-poc decompose .claude/epics/user-auth.md
|
|
50
|
+
autopm-poc analyze examples/sample-prd.md
|
|
43
51
|
`);
|
|
44
52
|
}
|
|
45
53
|
|
|
@@ -89,39 +97,97 @@ async function parsePRDStream(service, content) {
|
|
|
89
97
|
}
|
|
90
98
|
|
|
91
99
|
/**
|
|
92
|
-
*
|
|
100
|
+
* Extract epics from PRD with streaming output
|
|
93
101
|
*/
|
|
94
|
-
async function
|
|
95
|
-
console.log('š Extracting epics from PRD...\n');
|
|
102
|
+
async function extractEpicsStream(service, content) {
|
|
103
|
+
console.log('š Extracting epics from PRD with Claude AI...\n');
|
|
104
|
+
console.log('š Streaming response:\n');
|
|
105
|
+
console.log('ā'.repeat(60));
|
|
106
|
+
|
|
107
|
+
let fullResponse = '';
|
|
108
|
+
try {
|
|
109
|
+
for await (const chunk of service.extractEpicsStream(content)) {
|
|
110
|
+
process.stdout.write(chunk);
|
|
111
|
+
fullResponse += chunk;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
console.log('\n' + 'ā'.repeat(60));
|
|
115
|
+
console.log('\nā
Epic extraction complete!');
|
|
116
|
+
console.log(`š Total response length: ${fullResponse.length} characters\n`);
|
|
117
|
+
} catch (error) {
|
|
118
|
+
console.error('\nā Error during epic extraction:', error.message);
|
|
119
|
+
process.exit(1);
|
|
120
|
+
}
|
|
121
|
+
}
|
|
96
122
|
|
|
123
|
+
/**
|
|
124
|
+
* Summarize PRD with streaming output
|
|
125
|
+
*/
|
|
126
|
+
async function summarizePRDStream(service, content) {
|
|
127
|
+
console.log('š Summarizing PRD with Claude AI...\n');
|
|
128
|
+
console.log('š Streaming response:\n');
|
|
129
|
+
console.log('ā'.repeat(60));
|
|
130
|
+
|
|
131
|
+
let fullResponse = '';
|
|
97
132
|
try {
|
|
98
|
-
const
|
|
133
|
+
for await (const chunk of service.summarizeStream(content)) {
|
|
134
|
+
process.stdout.write(chunk);
|
|
135
|
+
fullResponse += chunk;
|
|
136
|
+
}
|
|
99
137
|
|
|
100
|
-
console.log('
|
|
101
|
-
console.log('
|
|
102
|
-
console.log(
|
|
103
|
-
console.log(`\nš Found ${Array.isArray(epics) ? epics.length : 0} epic(s)\n`);
|
|
138
|
+
console.log('\n' + 'ā'.repeat(60));
|
|
139
|
+
console.log('\nā
Summary complete!');
|
|
140
|
+
console.log(`š Total response length: ${fullResponse.length} characters\n`);
|
|
104
141
|
} catch (error) {
|
|
105
|
-
console.error('ā Error during
|
|
142
|
+
console.error('\nā Error during summarization:', error.message);
|
|
106
143
|
process.exit(1);
|
|
107
144
|
}
|
|
108
145
|
}
|
|
109
146
|
|
|
110
147
|
/**
|
|
111
|
-
*
|
|
148
|
+
* Decompose epic into tasks with streaming output
|
|
112
149
|
*/
|
|
113
|
-
async function
|
|
114
|
-
console.log('š
|
|
150
|
+
async function decomposeEpicStream(epicService, content) {
|
|
151
|
+
console.log('š Decomposing epic into tasks with Claude AI...\n');
|
|
152
|
+
console.log('š Streaming response:\n');
|
|
153
|
+
console.log('ā'.repeat(60));
|
|
115
154
|
|
|
155
|
+
let fullResponse = '';
|
|
116
156
|
try {
|
|
117
|
-
const
|
|
157
|
+
for await (const chunk of epicService.decomposeStream(content)) {
|
|
158
|
+
process.stdout.write(chunk);
|
|
159
|
+
fullResponse += chunk;
|
|
160
|
+
}
|
|
118
161
|
|
|
119
|
-
console.log('
|
|
120
|
-
console.log('
|
|
121
|
-
console.log(
|
|
122
|
-
console.log();
|
|
162
|
+
console.log('\n' + 'ā'.repeat(60));
|
|
163
|
+
console.log('\nā
Task decomposition complete!');
|
|
164
|
+
console.log(`š Total response length: ${fullResponse.length} characters\n`);
|
|
123
165
|
} catch (error) {
|
|
124
|
-
console.error('ā Error during
|
|
166
|
+
console.error('\nā Error during decomposition:', error.message);
|
|
167
|
+
process.exit(1);
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
/**
|
|
172
|
+
* Analyze PRD for epic breakdown with streaming output
|
|
173
|
+
*/
|
|
174
|
+
async function analyzePRDStream(epicService, content) {
|
|
175
|
+
console.log('š Analyzing PRD for epic breakdown with Claude AI...\n');
|
|
176
|
+
console.log('š Streaming response:\n');
|
|
177
|
+
console.log('ā'.repeat(60));
|
|
178
|
+
|
|
179
|
+
let fullResponse = '';
|
|
180
|
+
try {
|
|
181
|
+
for await (const chunk of epicService.analyzeStream(content)) {
|
|
182
|
+
process.stdout.write(chunk);
|
|
183
|
+
fullResponse += chunk;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
console.log('\n' + 'ā'.repeat(60));
|
|
187
|
+
console.log('\nā
PRD analysis complete!');
|
|
188
|
+
console.log(`š Total response length: ${fullResponse.length} characters\n`);
|
|
189
|
+
} catch (error) {
|
|
190
|
+
console.error('\nā Error during PRD analysis:', error.message);
|
|
125
191
|
process.exit(1);
|
|
126
192
|
}
|
|
127
193
|
}
|
|
@@ -139,18 +205,55 @@ async function main() {
|
|
|
139
205
|
process.exit(0);
|
|
140
206
|
}
|
|
141
207
|
|
|
142
|
-
//
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
208
|
+
// Try ConfigManager first, fallback to environment variable
|
|
209
|
+
let prdService;
|
|
210
|
+
let epicService;
|
|
211
|
+
let provider;
|
|
212
|
+
let configManager;
|
|
213
|
+
|
|
214
|
+
const configPath = path.join(process.cwd(), '.autopm', 'config.json');
|
|
215
|
+
if (fs.existsSync(configPath)) {
|
|
216
|
+
try {
|
|
217
|
+
configManager = new ConfigManager(configPath);
|
|
218
|
+
|
|
219
|
+
// Check for master password
|
|
220
|
+
const password = process.env.AUTOPM_MASTER_PASSWORD;
|
|
221
|
+
if (password) {
|
|
222
|
+
configManager.setMasterPassword(password);
|
|
223
|
+
|
|
224
|
+
// Use ServiceFactory to create services and provider
|
|
225
|
+
const factory = new ServiceFactory(configManager);
|
|
226
|
+
provider = factory.createProvider();
|
|
227
|
+
prdService = factory.createPRDService({ provider });
|
|
228
|
+
epicService = factory.createEpicService({ provider });
|
|
229
|
+
console.log('ā
Using configuration from .autopm/config.json\n');
|
|
230
|
+
} else {
|
|
231
|
+
console.log('ā ļø Config file found but AUTOPM_MASTER_PASSWORD not set');
|
|
232
|
+
console.log(' Falling back to ANTHROPIC_API_KEY environment variable\n');
|
|
233
|
+
}
|
|
234
|
+
} catch (error) {
|
|
235
|
+
console.log(`ā ļø Error loading config: ${error.message}`);
|
|
236
|
+
console.log(' Falling back to ANTHROPIC_API_KEY environment variable\n');
|
|
237
|
+
}
|
|
149
238
|
}
|
|
150
239
|
|
|
151
|
-
//
|
|
152
|
-
|
|
153
|
-
|
|
240
|
+
// Fallback to environment variable
|
|
241
|
+
if (!prdService) {
|
|
242
|
+
const apiKey = process.env.ANTHROPIC_API_KEY;
|
|
243
|
+
if (!apiKey) {
|
|
244
|
+
console.error('ā Error: No API key found\n');
|
|
245
|
+
console.error('Either:');
|
|
246
|
+
console.error(' 1. Run: autopm config:init (recommended)');
|
|
247
|
+
console.error(' Then: export AUTOPM_MASTER_PASSWORD="your-password"');
|
|
248
|
+
console.error(' 2. Set: export ANTHROPIC_API_KEY="sk-ant-..."\n');
|
|
249
|
+
process.exit(1);
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
provider = new ClaudeProvider(apiKey);
|
|
253
|
+
prdService = new PRDService({ provider });
|
|
254
|
+
epicService = new EpicService({ prdService, provider });
|
|
255
|
+
console.log('ā
Using ANTHROPIC_API_KEY from environment\n');
|
|
256
|
+
}
|
|
154
257
|
|
|
155
258
|
// Handle test command
|
|
156
259
|
if (command === 'test') {
|
|
@@ -158,8 +261,8 @@ async function main() {
|
|
|
158
261
|
process.exit(success ? 0 : 1);
|
|
159
262
|
}
|
|
160
263
|
|
|
161
|
-
// Handle parse
|
|
162
|
-
if (
|
|
264
|
+
// Handle PRD commands (parse, extract-epics, summarize, analyze)
|
|
265
|
+
if (['parse', 'extract-epics', 'summarize', 'analyze'].includes(command)) {
|
|
163
266
|
const file = args[1];
|
|
164
267
|
|
|
165
268
|
if (!file) {
|
|
@@ -187,20 +290,49 @@ async function main() {
|
|
|
187
290
|
|
|
188
291
|
// Execute command
|
|
189
292
|
if (command === 'parse') {
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
await parsePRDJson(service, content);
|
|
194
|
-
} else {
|
|
195
|
-
await parsePRDStream(service, content);
|
|
196
|
-
}
|
|
293
|
+
await parsePRDStream(prdService, content);
|
|
294
|
+
} else if (command === 'extract-epics') {
|
|
295
|
+
await extractEpicsStream(prdService, content);
|
|
197
296
|
} else if (command === 'summarize') {
|
|
198
|
-
await
|
|
297
|
+
await summarizePRDStream(prdService, content);
|
|
298
|
+
} else if (command === 'analyze') {
|
|
299
|
+
await analyzePRDStream(epicService, content);
|
|
199
300
|
}
|
|
200
301
|
|
|
201
302
|
process.exit(0);
|
|
202
303
|
}
|
|
203
304
|
|
|
305
|
+
// Handle decompose command (for epic files)
|
|
306
|
+
if (command === 'decompose') {
|
|
307
|
+
const file = args[1];
|
|
308
|
+
|
|
309
|
+
if (!file) {
|
|
310
|
+
console.error(`ā Error: Epic file required for 'decompose' command\n`);
|
|
311
|
+
console.error(`Usage: autopm-poc decompose <epic-file>\n`);
|
|
312
|
+
process.exit(1);
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
// Check if file exists
|
|
316
|
+
if (!fs.existsSync(file)) {
|
|
317
|
+
console.error(`ā Error: File not found: ${file}\n`);
|
|
318
|
+
process.exit(1);
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
// Read file content
|
|
322
|
+
const content = fs.readFileSync(file, 'utf8');
|
|
323
|
+
|
|
324
|
+
if (!content.trim()) {
|
|
325
|
+
console.error('ā Error: Epic file is empty\n');
|
|
326
|
+
process.exit(1);
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
console.log(`š Reading Epic from: ${file}`);
|
|
330
|
+
console.log(`š File size: ${content.length} characters\n`);
|
|
331
|
+
|
|
332
|
+
await decomposeEpicStream(epicService, content);
|
|
333
|
+
process.exit(0);
|
|
334
|
+
}
|
|
335
|
+
|
|
204
336
|
// Unknown command
|
|
205
337
|
console.error(`ā Error: Unknown command: ${command}\n`);
|
|
206
338
|
printUsage();
|
package/bin/autopm.js
CHANGED
|
@@ -182,6 +182,12 @@ function main() {
|
|
|
182
182
|
.command(require('./commands/mcp'))
|
|
183
183
|
// Epic management command
|
|
184
184
|
.command(require('./commands/epic'))
|
|
185
|
+
// PRD management command (STANDALONE)
|
|
186
|
+
.command(require('../lib/cli/commands/prd'))
|
|
187
|
+
// Task management command (STANDALONE)
|
|
188
|
+
.command(require('../lib/cli/commands/task'))
|
|
189
|
+
// Agent management command (STANDALONE)
|
|
190
|
+
.command(require('../lib/cli/commands/agent'))
|
|
185
191
|
// Validation command
|
|
186
192
|
.command('validate', 'Validate ClaudeAutoPM configuration and setup',
|
|
187
193
|
(yargs) => {
|