claude-autopm 1.18.0 → 1.20.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/README.md +159 -0
- package/autopm/.claude/agents/core/mcp-manager.md +1 -1
- package/autopm/.claude/commands/pm/context.md +11 -0
- package/autopm/.claude/commands/pm/epic-decompose.md +25 -2
- package/autopm/.claude/commands/pm/epic-oneshot.md +13 -0
- package/autopm/.claude/commands/pm/epic-start.md +19 -0
- package/autopm/.claude/commands/pm/epic-sync-modular.md +10 -10
- package/autopm/.claude/commands/pm/epic-sync.md +14 -14
- package/autopm/.claude/commands/pm/issue-start.md +50 -5
- package/autopm/.claude/commands/pm/issue-sync.md +15 -15
- package/autopm/.claude/commands/pm/what-next.md +11 -0
- package/autopm/.claude/mcp/MCP-REGISTRY.md +1 -1
- package/autopm/.claude/scripts/azure/active-work.js +2 -2
- package/autopm/.claude/scripts/azure/blocked.js +13 -13
- package/autopm/.claude/scripts/azure/daily.js +1 -1
- package/autopm/.claude/scripts/azure/dashboard.js +1 -1
- package/autopm/.claude/scripts/azure/feature-list.js +2 -2
- package/autopm/.claude/scripts/azure/feature-status.js +1 -1
- package/autopm/.claude/scripts/azure/next-task.js +1 -1
- package/autopm/.claude/scripts/azure/search.js +1 -1
- package/autopm/.claude/scripts/azure/setup.js +15 -15
- package/autopm/.claude/scripts/azure/sprint-report.js +2 -2
- package/autopm/.claude/scripts/azure/sync.js +1 -1
- package/autopm/.claude/scripts/azure/us-list.js +1 -1
- package/autopm/.claude/scripts/azure/us-status.js +1 -1
- package/autopm/.claude/scripts/azure/validate.js +13 -13
- package/autopm/.claude/scripts/lib/frontmatter-utils.sh +42 -7
- package/autopm/.claude/scripts/lib/logging-utils.sh +20 -16
- package/autopm/.claude/scripts/lib/validation-utils.sh +1 -1
- package/autopm/.claude/scripts/pm/context.js +338 -0
- package/autopm/.claude/scripts/pm/issue-sync/format-comment.sh +3 -3
- package/autopm/.claude/scripts/pm/lib/README.md +85 -0
- package/autopm/.claude/scripts/pm/lib/logger.js +78 -0
- package/autopm/.claude/scripts/pm/next.js +25 -1
- package/autopm/.claude/scripts/pm/what-next.js +660 -0
- package/bin/autopm.js +25 -0
- package/package.json +1 -1
- package/lib/agentExecutor.js.deprecated +0 -101
- package/lib/azure/cache.js +0 -80
- package/lib/azure/client.js +0 -77
- package/lib/azure/formatter.js +0 -177
- package/lib/commandHelpers.js +0 -177
- package/lib/context/manager.js +0 -290
- package/lib/documentation/manager.js +0 -528
- package/lib/github/workflow-manager.js +0 -546
- package/lib/helpers/azure-batch-api.js +0 -133
- package/lib/helpers/azure-cache-manager.js +0 -287
- package/lib/helpers/azure-parallel-processor.js +0 -158
- package/lib/helpers/azure-work-item-create.js +0 -278
- package/lib/helpers/gh-issue-create.js +0 -250
- package/lib/helpers/interactive-prompt.js +0 -336
- package/lib/helpers/output-manager.js +0 -335
- package/lib/helpers/progress-indicator.js +0 -258
- package/lib/performance/benchmarker.js +0 -429
- package/lib/pm/epic-decomposer.js +0 -273
- package/lib/pm/epic-syncer.js +0 -221
- package/lib/prdMetadata.js +0 -270
- package/lib/providers/azure/index.js +0 -234
- package/lib/providers/factory.js +0 -87
- package/lib/providers/github/index.js +0 -204
- package/lib/providers/interface.js +0 -73
- package/lib/python/scaffold-manager.js +0 -576
- package/lib/react/scaffold-manager.js +0 -745
- package/lib/regression/analyzer.js +0 -578
- package/lib/release/manager.js +0 -324
- package/lib/tailwind/manager.js +0 -486
- package/lib/traefik/manager.js +0 -484
- package/lib/utils/colors.js +0 -126
- package/lib/utils/config.js +0 -317
- package/lib/utils/filesystem.js +0 -316
- package/lib/utils/logger.js +0 -135
- package/lib/utils/prompts.js +0 -294
- package/lib/utils/shell.js +0 -237
- package/lib/validators/email-validator.js +0 -337
- package/lib/workflow/manager.js +0 -449
package/lib/context/manager.js
DELETED
|
@@ -1,290 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Context Manager
|
|
3
|
-
* Provides utilities for managing context files
|
|
4
|
-
* TDD Phase: REFACTOR - Extracting common functionality
|
|
5
|
-
* Task: 1.1
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
const fs = require('fs').promises;
|
|
9
|
-
const path = require('path');
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* Validates context name
|
|
13
|
-
* @param {string} name - Context name to validate
|
|
14
|
-
* @returns {boolean} - True if valid
|
|
15
|
-
*/
|
|
16
|
-
function validateContextName(name) {
|
|
17
|
-
// Only alphanumeric, hyphens, and underscores allowed
|
|
18
|
-
const pattern = /^[a-zA-Z0-9_-]+$/;
|
|
19
|
-
return pattern.test(name);
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
/**
|
|
23
|
-
* Loads template file
|
|
24
|
-
* @param {string} templateName - Template name (without extension)
|
|
25
|
-
* @param {string} projectRoot - Project root directory
|
|
26
|
-
* @returns {Promise<string|null>} - Template content or null if not found
|
|
27
|
-
*/
|
|
28
|
-
async function loadTemplate(templateName, projectRoot) {
|
|
29
|
-
const templatePath = path.join(projectRoot, '.claude', 'templates', `context-${templateName}.md`);
|
|
30
|
-
|
|
31
|
-
try {
|
|
32
|
-
const content = await fs.readFile(templatePath, 'utf8');
|
|
33
|
-
return content;
|
|
34
|
-
} catch (error) {
|
|
35
|
-
if (error.code === 'ENOENT') {
|
|
36
|
-
return null;
|
|
37
|
-
}
|
|
38
|
-
throw error;
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
/**
|
|
43
|
-
* Replaces template variables
|
|
44
|
-
* @param {string} template - Template content
|
|
45
|
-
* @param {object} variables - Variables to replace
|
|
46
|
-
* @returns {string} - Processed template
|
|
47
|
-
*/
|
|
48
|
-
function processTemplate(template, variables) {
|
|
49
|
-
let processed = template;
|
|
50
|
-
|
|
51
|
-
for (const [key, value] of Object.entries(variables)) {
|
|
52
|
-
const pattern = new RegExp(`{{${key}}}`, 'g');
|
|
53
|
-
processed = processed.replace(pattern, value);
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
return processed;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
/**
|
|
60
|
-
* Gets the context directory path
|
|
61
|
-
* @param {string} projectRoot - Project root directory
|
|
62
|
-
* @returns {string} - Context directory path
|
|
63
|
-
*/
|
|
64
|
-
function getContextDir(projectRoot) {
|
|
65
|
-
return path.join(projectRoot, '.claude', 'contexts');
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
/**
|
|
69
|
-
* Gets the context file path
|
|
70
|
-
* @param {string} projectRoot - Project root directory
|
|
71
|
-
* @param {string} name - Context name
|
|
72
|
-
* @returns {string} - Context file path
|
|
73
|
-
*/
|
|
74
|
-
function getContextPath(projectRoot, name) {
|
|
75
|
-
return path.join(getContextDir(projectRoot), `${name}.md`);
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
/**
|
|
79
|
-
* Checks if context exists
|
|
80
|
-
* @param {string} projectRoot - Project root directory
|
|
81
|
-
* @param {string} name - Context name
|
|
82
|
-
* @returns {Promise<boolean>} - True if exists
|
|
83
|
-
*/
|
|
84
|
-
async function contextExists(projectRoot, name) {
|
|
85
|
-
const contextPath = getContextPath(projectRoot, name);
|
|
86
|
-
try {
|
|
87
|
-
await fs.access(contextPath);
|
|
88
|
-
return true;
|
|
89
|
-
} catch (error) {
|
|
90
|
-
return false;
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
/**
|
|
95
|
-
* Lists all contexts
|
|
96
|
-
* @param {string} projectRoot - Project root directory
|
|
97
|
-
* @returns {Promise<string[]>} - Array of context names
|
|
98
|
-
*/
|
|
99
|
-
async function listContexts(projectRoot) {
|
|
100
|
-
const contextDir = getContextDir(projectRoot);
|
|
101
|
-
|
|
102
|
-
try {
|
|
103
|
-
const files = await fs.readdir(contextDir);
|
|
104
|
-
return files
|
|
105
|
-
.filter(file => file.endsWith('.md'))
|
|
106
|
-
.map(file => file.replace('.md', ''));
|
|
107
|
-
} catch (error) {
|
|
108
|
-
if (error.code === 'ENOENT') {
|
|
109
|
-
return [];
|
|
110
|
-
}
|
|
111
|
-
throw error;
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
/**
|
|
116
|
-
* Reads context content
|
|
117
|
-
* @param {string} projectRoot - Project root directory
|
|
118
|
-
* @param {string} name - Context name
|
|
119
|
-
* @returns {Promise<string>} - Context content
|
|
120
|
-
*/
|
|
121
|
-
async function readContext(projectRoot, name) {
|
|
122
|
-
const contextPath = getContextPath(projectRoot, name);
|
|
123
|
-
return await fs.readFile(contextPath, 'utf8');
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
/**
|
|
127
|
-
* Gets default template content
|
|
128
|
-
* @returns {string} - Default template
|
|
129
|
-
*/
|
|
130
|
-
function getDefaultTemplate() {
|
|
131
|
-
return `# Context: {{name}}
|
|
132
|
-
Created: {{date}}
|
|
133
|
-
Type: {{type}}
|
|
134
|
-
|
|
135
|
-
## Description
|
|
136
|
-
{{description}}
|
|
137
|
-
|
|
138
|
-
## Content
|
|
139
|
-
<!-- Add context content here -->`;
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
/**
|
|
143
|
-
* Gets the sessions directory path
|
|
144
|
-
* @param {string} projectRoot - Project root directory
|
|
145
|
-
* @returns {string} - Sessions directory path
|
|
146
|
-
*/
|
|
147
|
-
function getSessionsDir(projectRoot) {
|
|
148
|
-
return path.join(projectRoot, '.claude', 'sessions');
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
/**
|
|
152
|
-
* Creates a session
|
|
153
|
-
* @param {string} projectRoot - Project root directory
|
|
154
|
-
* @param {object} sessionData - Session data
|
|
155
|
-
* @returns {Promise<void>}
|
|
156
|
-
*/
|
|
157
|
-
async function createSession(projectRoot, sessionData) {
|
|
158
|
-
const sessionsDir = getSessionsDir(projectRoot);
|
|
159
|
-
await fs.mkdir(sessionsDir, { recursive: true });
|
|
160
|
-
|
|
161
|
-
const currentPath = path.join(sessionsDir, 'current.json');
|
|
162
|
-
await fs.writeFile(currentPath, JSON.stringify(sessionData, null, 2));
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
/**
|
|
166
|
-
* Gets current session
|
|
167
|
-
* @param {string} projectRoot - Project root directory
|
|
168
|
-
* @returns {Promise<object|null>} - Current session or null
|
|
169
|
-
*/
|
|
170
|
-
async function getCurrentSession(projectRoot) {
|
|
171
|
-
const currentPath = path.join(getSessionsDir(projectRoot), 'current.json');
|
|
172
|
-
|
|
173
|
-
try {
|
|
174
|
-
const data = await fs.readFile(currentPath, 'utf8');
|
|
175
|
-
return JSON.parse(data);
|
|
176
|
-
} catch (error) {
|
|
177
|
-
return null;
|
|
178
|
-
}
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
/**
|
|
182
|
-
* Updates session history
|
|
183
|
-
* @param {string} projectRoot - Project root directory
|
|
184
|
-
* @param {object} session - Session to add to history
|
|
185
|
-
* @returns {Promise<void>}
|
|
186
|
-
*/
|
|
187
|
-
async function updateSessionHistory(projectRoot, session) {
|
|
188
|
-
const sessionsDir = getSessionsDir(projectRoot);
|
|
189
|
-
const historyPath = path.join(sessionsDir, 'history.json');
|
|
190
|
-
|
|
191
|
-
let history = [];
|
|
192
|
-
try {
|
|
193
|
-
const data = await fs.readFile(historyPath, 'utf8');
|
|
194
|
-
history = JSON.parse(data);
|
|
195
|
-
} catch (error) {
|
|
196
|
-
// History file doesn't exist yet
|
|
197
|
-
}
|
|
198
|
-
|
|
199
|
-
history.push(session);
|
|
200
|
-
|
|
201
|
-
// Keep only last 100 entries
|
|
202
|
-
if (history.length > 100) {
|
|
203
|
-
history = history.slice(-100);
|
|
204
|
-
}
|
|
205
|
-
|
|
206
|
-
await fs.writeFile(historyPath, JSON.stringify(history, null, 2));
|
|
207
|
-
}
|
|
208
|
-
|
|
209
|
-
/**
|
|
210
|
-
* Creates a backup of a context file
|
|
211
|
-
* @param {string} projectRoot - Project root directory
|
|
212
|
-
* @param {string} name - Context name
|
|
213
|
-
* @returns {Promise<string>} - Backup file path
|
|
214
|
-
*/
|
|
215
|
-
async function createContextBackup(projectRoot, name) {
|
|
216
|
-
const content = await readContext(projectRoot, name);
|
|
217
|
-
const backupDir = path.join(projectRoot, '.claude', 'contexts', '.backups');
|
|
218
|
-
await fs.mkdir(backupDir, { recursive: true });
|
|
219
|
-
|
|
220
|
-
const timestamp = new Date().toISOString().replace(/[:.]/g, '-');
|
|
221
|
-
const backupPath = path.join(backupDir, `${name}_${timestamp}.md`);
|
|
222
|
-
await fs.writeFile(backupPath, content);
|
|
223
|
-
|
|
224
|
-
return backupPath;
|
|
225
|
-
}
|
|
226
|
-
|
|
227
|
-
/**
|
|
228
|
-
* Updates context update history
|
|
229
|
-
* @param {string} projectRoot - Project root directory
|
|
230
|
-
* @param {string} name - Context name
|
|
231
|
-
* @param {object} updateInfo - Update information
|
|
232
|
-
* @returns {Promise<void>}
|
|
233
|
-
*/
|
|
234
|
-
async function updateContextHistory(projectRoot, name, updateInfo) {
|
|
235
|
-
const historyDir = path.join(projectRoot, '.claude', 'contexts', '.history');
|
|
236
|
-
await fs.mkdir(historyDir, { recursive: true });
|
|
237
|
-
|
|
238
|
-
const historyPath = path.join(historyDir, `${name}.json`);
|
|
239
|
-
|
|
240
|
-
let history = [];
|
|
241
|
-
try {
|
|
242
|
-
const data = await fs.readFile(historyPath, 'utf8');
|
|
243
|
-
history = JSON.parse(data);
|
|
244
|
-
} catch (error) {
|
|
245
|
-
// History doesn't exist yet
|
|
246
|
-
}
|
|
247
|
-
|
|
248
|
-
history.push({
|
|
249
|
-
timestamp: new Date().toISOString(),
|
|
250
|
-
...updateInfo
|
|
251
|
-
});
|
|
252
|
-
|
|
253
|
-
// Keep last 50 updates
|
|
254
|
-
if (history.length > 50) {
|
|
255
|
-
history = history.slice(-50);
|
|
256
|
-
}
|
|
257
|
-
|
|
258
|
-
await fs.writeFile(historyPath, JSON.stringify(history, null, 2));
|
|
259
|
-
}
|
|
260
|
-
|
|
261
|
-
/**
|
|
262
|
-
* Writes updated context content
|
|
263
|
-
* @param {string} projectRoot - Project root directory
|
|
264
|
-
* @param {string} name - Context name
|
|
265
|
-
* @param {string} content - New content
|
|
266
|
-
* @returns {Promise<void>}
|
|
267
|
-
*/
|
|
268
|
-
async function writeContext(projectRoot, name, content) {
|
|
269
|
-
const contextPath = getContextPath(projectRoot, name);
|
|
270
|
-
await fs.writeFile(contextPath, content);
|
|
271
|
-
}
|
|
272
|
-
|
|
273
|
-
module.exports = {
|
|
274
|
-
validateContextName,
|
|
275
|
-
loadTemplate,
|
|
276
|
-
processTemplate,
|
|
277
|
-
getContextDir,
|
|
278
|
-
getContextPath,
|
|
279
|
-
contextExists,
|
|
280
|
-
listContexts,
|
|
281
|
-
readContext,
|
|
282
|
-
writeContext,
|
|
283
|
-
getDefaultTemplate,
|
|
284
|
-
getSessionsDir,
|
|
285
|
-
createSession,
|
|
286
|
-
getCurrentSession,
|
|
287
|
-
updateSessionHistory,
|
|
288
|
-
createContextBackup,
|
|
289
|
-
updateContextHistory
|
|
290
|
-
};
|