@fitlab-ai/agent-infra 0.3.1 → 0.4.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 +29 -39
- package/README.zh-CN.md +29 -39
- package/bin/cli.js +1 -1
- package/lib/defaults.json +3 -12
- package/lib/init.js +13 -24
- package/lib/paths.js +3 -42
- package/lib/update.js +98 -32
- package/lib/version.js +2 -1
- package/package.json +2 -1
- package/templates/.agents/QUICKSTART.md +7 -7
- package/templates/.agents/QUICKSTART.zh-CN.md +7 -7
- package/templates/.agents/README.md +16 -4
- package/templates/.agents/README.zh-CN.md +16 -4
- package/templates/.agents/skills/analyze-task/SKILL.md +106 -105
- package/templates/.agents/skills/analyze-task/SKILL.zh-CN.md +6 -6
- package/templates/.agents/skills/block-task/SKILL.md +8 -8
- package/templates/.agents/skills/block-task/SKILL.zh-CN.md +8 -8
- package/templates/.agents/skills/check-task/SKILL.md +3 -3
- package/templates/.agents/skills/check-task/SKILL.zh-CN.md +3 -3
- package/templates/.agents/skills/close-codescan/SKILL.md +64 -63
- package/templates/.agents/skills/close-dependabot/SKILL.md +71 -70
- package/templates/.agents/skills/commit/SKILL.md +1 -1
- package/templates/.agents/skills/commit/SKILL.zh-CN.md +1 -1
- package/templates/.agents/skills/complete-task/SKILL.md +7 -7
- package/templates/.agents/skills/complete-task/SKILL.zh-CN.md +7 -7
- package/templates/.agents/skills/create-issue/SKILL.md +57 -12
- package/templates/.agents/skills/create-issue/SKILL.zh-CN.md +57 -12
- package/templates/.agents/skills/create-pr/SKILL.md +44 -7
- package/templates/.agents/skills/create-pr/SKILL.zh-CN.md +44 -7
- package/templates/.agents/skills/create-release-note/SKILL.md +18 -11
- package/templates/.agents/skills/create-release-note/SKILL.zh-CN.md +18 -11
- package/templates/.agents/skills/create-task/SKILL.md +80 -78
- package/templates/.agents/skills/create-task/SKILL.zh-CN.md +11 -10
- package/templates/.agents/skills/implement-task/SKILL.md +15 -18
- package/templates/.agents/skills/implement-task/SKILL.zh-CN.md +15 -18
- package/templates/.agents/skills/import-codescan/SKILL.md +54 -53
- package/templates/.agents/skills/import-codescan/SKILL.zh-CN.md +1 -1
- package/templates/.agents/skills/import-dependabot/SKILL.md +57 -56
- package/templates/.agents/skills/import-dependabot/SKILL.zh-CN.md +3 -3
- package/templates/.agents/skills/import-issue/SKILL.md +58 -58
- package/templates/.agents/skills/import-issue/SKILL.zh-CN.md +5 -5
- package/templates/.agents/skills/init-labels/SKILL.md +8 -0
- package/templates/.agents/skills/init-labels/SKILL.zh-CN.md +8 -0
- package/templates/.agents/skills/plan-task/SKILL.md +151 -149
- package/templates/.agents/skills/plan-task/SKILL.zh-CN.md +6 -6
- package/templates/.agents/skills/refine-task/SKILL.md +3 -3
- package/templates/.agents/skills/refine-task/SKILL.zh-CN.md +3 -3
- package/templates/.agents/skills/release/SKILL.md +55 -14
- package/templates/.agents/skills/release/SKILL.zh-CN.md +55 -14
- package/templates/.agents/skills/review-task/SKILL.md +9 -9
- package/templates/.agents/skills/review-task/SKILL.zh-CN.md +9 -9
- package/templates/.agents/skills/sync-issue/SKILL.md +258 -279
- package/templates/.agents/skills/sync-issue/SKILL.zh-CN.md +34 -56
- package/templates/.agents/skills/sync-pr/SKILL.md +8 -28
- package/templates/.agents/skills/sync-pr/SKILL.zh-CN.md +7 -27
- package/templates/.agents/skills/update-agent-infra/SKILL.md +6 -6
- package/templates/.agents/skills/update-agent-infra/SKILL.zh-CN.md +6 -6
- package/templates/.agents/skills/update-agent-infra/scripts/sync-templates.js +61 -116
- package/templates/.agents/templates/handoff.md +1 -1
- package/templates/.agents/templates/handoff.zh-CN.md +1 -1
- package/templates/.agents/workflows/bug-fix.yaml +71 -71
- package/templates/.agents/workflows/bug-fix.zh-CN.yaml +1 -1
- package/templates/.agents/workflows/feature-development.yaml +71 -71
- package/templates/.agents/workflows/feature-development.zh-CN.yaml +1 -1
- package/templates/.agents/workflows/refactoring.yaml +76 -76
- package/templates/.agents/workflows/refactoring.zh-CN.yaml +1 -1
- package/templates/{.agent-workspace → .agents/workspace}/README.md +1 -1
- package/templates/{.agent-workspace → .agents/workspace}/README.zh-CN.md +1 -1
- package/templates/.claude/CLAUDE.md +14 -1
- package/templates/.claude/CLAUDE.zh-CN.md +14 -1
- package/templates/.claude/hooks/check-version-format.sh +44 -0
- package/templates/.claude/settings.json +14 -0
- package/templates/.opencode/COMMAND_STYLE_GUIDE.md +6 -6
- package/templates/.opencode/COMMAND_STYLE_GUIDE.zh-CN.md +6 -6
- package/templates/AGENTS.md +14 -1
- package/templates/AGENTS.zh-CN.md +14 -1
- package/templates/.editorconfig +0 -15
- package/templates/.github/ISSUE_TEMPLATE/01_bug_report.yml +0 -149
- package/templates/.github/ISSUE_TEMPLATE/02_question.yml +0 -101
- package/templates/.github/ISSUE_TEMPLATE/03_feature_request.yml +0 -131
- package/templates/.github/ISSUE_TEMPLATE/04_documentation.yml +0 -165
- package/templates/.github/ISSUE_TEMPLATE/05_other.yml +0 -147
- package/templates/.github/ISSUE_TEMPLATE/config.yml +0 -11
- package/templates/.github/PULL_REQUEST_TEMPLATE.md +0 -123
- package/templates/.github/dependabot.yml +0 -17
- package/templates/.github/hooks/check-utf8-encoding.sh +0 -25
- package/templates/.github/release.yml +0 -27
- package/templates/.github/workflows/pr-title-check.yml +0 -42
- package/templates/.mailmap +0 -4
- package/templates/CONTRIBUTING.md +0 -126
- package/templates/CONTRIBUTING.zh-CN.md +0 -124
- package/templates/SECURITY.md +0 -131
- package/templates/SECURITY.zh-CN.md +0 -131
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
/**
|
|
3
3
|
* sync-templates.js — Deterministic template sync for managed & ejected files.
|
|
4
4
|
*
|
|
5
|
-
* Handles SKILL steps: 2 (
|
|
6
|
-
* 6 (ejected), 7 (.airc.json update).
|
|
5
|
+
* Handles SKILL steps: 2 (detect template source version), 3.0 (registry sync), 4 (managed),
|
|
6
|
+
* 6 (ejected), 7 (.agents/.airc.json update).
|
|
7
7
|
*
|
|
8
8
|
* Merged files (step 5) are NOT handled — they require AI semantic merge.
|
|
9
9
|
* The report includes `merged.pending` so the AI knows what to process.
|
|
@@ -16,39 +16,19 @@
|
|
|
16
16
|
|
|
17
17
|
import childProcess from 'node:child_process';
|
|
18
18
|
import fs from 'node:fs';
|
|
19
|
-
import os from 'node:os';
|
|
20
19
|
import path from 'node:path';
|
|
21
20
|
import { fileURLToPath } from 'node:url';
|
|
22
21
|
|
|
23
|
-
// Keep these helpers aligned with lib/paths.js for clone installs.
|
|
24
|
-
function resolveInstallDir() {
|
|
25
|
-
return path.join(os.homedir(), '.agent-infra');
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
function resolveTemplateDir() {
|
|
29
|
-
const clonePath = path.join(resolveInstallDir(), 'templates');
|
|
30
|
-
if (fs.existsSync(clonePath)) {
|
|
31
|
-
return clonePath;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
return null;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
22
|
const DEFAULTS = {
|
|
38
23
|
"files": {
|
|
39
24
|
"managed": [
|
|
40
25
|
".agents/skills/",
|
|
41
26
|
".agents/templates/",
|
|
42
27
|
".agents/workflows/",
|
|
43
|
-
".
|
|
28
|
+
".agents/workspace/README.md",
|
|
44
29
|
".claude/commands/",
|
|
45
|
-
".
|
|
30
|
+
".claude/hooks/",
|
|
46
31
|
".gemini/commands/",
|
|
47
|
-
".github/hooks/",
|
|
48
|
-
".github/ISSUE_TEMPLATE/",
|
|
49
|
-
".github/PULL_REQUEST_TEMPLATE.md",
|
|
50
|
-
".github/release.yml",
|
|
51
|
-
".github/workflows/pr-title-check.yml",
|
|
52
32
|
".opencode/commands/"
|
|
53
33
|
],
|
|
54
34
|
"merged": [
|
|
@@ -67,20 +47,16 @@ const DEFAULTS = {
|
|
|
67
47
|
".claude/settings.json",
|
|
68
48
|
".codex/README.md",
|
|
69
49
|
".gemini/settings.json",
|
|
70
|
-
".github/dependabot.yml",
|
|
71
50
|
".gitignore",
|
|
72
|
-
".mailmap",
|
|
73
51
|
".opencode/COMMAND_STYLE_GUIDE.md",
|
|
74
52
|
".opencode/README.md",
|
|
75
|
-
"AGENTS.md"
|
|
76
|
-
"CONTRIBUTING.md",
|
|
77
|
-
"SECURITY.md"
|
|
53
|
+
"AGENTS.md"
|
|
78
54
|
],
|
|
79
55
|
"ejected": []
|
|
80
56
|
}
|
|
81
57
|
};
|
|
82
58
|
|
|
83
|
-
const INSTALLER_VERSION = "
|
|
59
|
+
const INSTALLER_VERSION = "v0.4.0";
|
|
84
60
|
|
|
85
61
|
function norm(p) { return p.replace(/\\/g, '/'); }
|
|
86
62
|
|
|
@@ -139,34 +115,17 @@ function renderPathname(p, project) {
|
|
|
139
115
|
}
|
|
140
116
|
|
|
141
117
|
function resolveProjectTemplateDir(projectRoot, templateSource) {
|
|
142
|
-
|
|
118
|
+
if (!templateSource) return null;
|
|
143
119
|
|
|
144
|
-
const
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
candidates.push(templateSource);
|
|
148
|
-
} else {
|
|
149
|
-
if (fallbackRoot) {
|
|
150
|
-
candidates.push(path.resolve(path.dirname(fallbackRoot), templateSource));
|
|
151
|
-
}
|
|
152
|
-
candidates.push(path.resolve(projectRoot, templateSource));
|
|
153
|
-
}
|
|
154
|
-
}
|
|
155
|
-
if (fallbackRoot) {
|
|
156
|
-
candidates.push(fallbackRoot);
|
|
157
|
-
}
|
|
120
|
+
const candidate = path.isAbsolute(templateSource)
|
|
121
|
+
? templateSource
|
|
122
|
+
: path.resolve(projectRoot, templateSource);
|
|
158
123
|
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
}
|
|
164
|
-
} catch {
|
|
165
|
-
// Keep scanning until a valid directory is found.
|
|
166
|
-
}
|
|
124
|
+
try {
|
|
125
|
+
return fs.statSync(candidate).isDirectory() ? candidate : null;
|
|
126
|
+
} catch {
|
|
127
|
+
return null;
|
|
167
128
|
}
|
|
168
|
-
|
|
169
|
-
return null;
|
|
170
129
|
}
|
|
171
130
|
|
|
172
131
|
function isBinary(fp) {
|
|
@@ -179,15 +138,6 @@ function isBinary(fp) {
|
|
|
179
138
|
return false;
|
|
180
139
|
}
|
|
181
140
|
|
|
182
|
-
function fileModule(rel) {
|
|
183
|
-
const p = norm(rel);
|
|
184
|
-
if (p.startsWith('.github/')) return 'github';
|
|
185
|
-
if (p.startsWith('.agents/') || p.startsWith('.claude/') ||
|
|
186
|
-
p.startsWith('.gemini/') || p.startsWith('.opencode/') ||
|
|
187
|
-
p.startsWith('.codex/') || p === 'AGENTS.md') return 'ai';
|
|
188
|
-
return null;
|
|
189
|
-
}
|
|
190
|
-
|
|
191
141
|
function gitUrl(dir) {
|
|
192
142
|
try {
|
|
193
143
|
return childProcess.execSync('git remote get-url origin', {
|
|
@@ -196,9 +146,6 @@ function gitUrl(dir) {
|
|
|
196
146
|
} catch { return null; }
|
|
197
147
|
}
|
|
198
148
|
|
|
199
|
-
// Public-facing docs should keep all available language variants in sync.
|
|
200
|
-
const MULTI_LANG = new Set(['SECURITY.md']);
|
|
201
|
-
|
|
202
149
|
function langSelect(rels, lang, allSet, project) {
|
|
203
150
|
const sel = new Map();
|
|
204
151
|
|
|
@@ -227,44 +174,57 @@ function langSelect(rels, lang, allSet, project) {
|
|
|
227
174
|
}
|
|
228
175
|
|
|
229
176
|
function syncTemplates(projectRoot) {
|
|
230
|
-
const
|
|
177
|
+
const configDir = path.join(projectRoot, '.agents');
|
|
178
|
+
const cfgPath = path.join(configDir, '.airc.json');
|
|
179
|
+
const legacyCfgPaths = [
|
|
180
|
+
path.join(projectRoot, '.airc.json'),
|
|
181
|
+
path.join(projectRoot, '.agent-infra', 'config.json')
|
|
182
|
+
];
|
|
183
|
+
const workspacePath = path.join(configDir, 'workspace');
|
|
184
|
+
const legacyWorkspacePaths = [
|
|
185
|
+
path.join(projectRoot, '.agent-workspace'),
|
|
186
|
+
path.join(projectRoot, '.agent-infra', 'workspace')
|
|
187
|
+
];
|
|
188
|
+
|
|
231
189
|
if (!fs.existsSync(cfgPath)) {
|
|
232
|
-
|
|
190
|
+
for (const legacyCfgPath of legacyCfgPaths) {
|
|
191
|
+
if (!fs.existsSync(legacyCfgPath)) continue;
|
|
192
|
+
fs.mkdirSync(configDir, { recursive: true });
|
|
193
|
+
fs.renameSync(legacyCfgPath, cfgPath);
|
|
194
|
+
break;
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
if (!fs.existsSync(workspacePath)) {
|
|
198
|
+
for (const legacyWorkspacePath of legacyWorkspacePaths) {
|
|
199
|
+
if (!fs.existsSync(legacyWorkspacePath)) continue;
|
|
200
|
+
fs.mkdirSync(configDir, { recursive: true });
|
|
201
|
+
fs.renameSync(legacyWorkspacePath, workspacePath);
|
|
202
|
+
break;
|
|
203
|
+
}
|
|
233
204
|
}
|
|
234
205
|
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
206
|
+
try {
|
|
207
|
+
const legacyConfigDir = path.join(projectRoot, '.agent-infra');
|
|
208
|
+
if (fs.existsSync(legacyConfigDir) && fs.readdirSync(legacyConfigDir).length === 0) {
|
|
209
|
+
fs.rmdirSync(legacyConfigDir);
|
|
210
|
+
}
|
|
211
|
+
} catch {
|
|
212
|
+
// Ignore cleanup failures for partially migrated directories.
|
|
239
213
|
}
|
|
240
|
-
const installDir = resolveInstallDir();
|
|
241
214
|
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
try { childProcess.execSync('git fetch --tags --quiet', { cwd: installDir, stdio: 'pipe' }); } catch { /* network */ }
|
|
215
|
+
if (!fs.existsSync(cfgPath)) {
|
|
216
|
+
return { error: 'No .agents/.airc.json in project root.' };
|
|
245
217
|
}
|
|
246
218
|
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
cwd: installDir, encoding: 'utf8', stdio: ['pipe', 'pipe', 'pipe']
|
|
253
|
-
}).trim();
|
|
254
|
-
} catch {
|
|
255
|
-
return { error: 'Failed to list tags in agent-infra repository. Please check git installation.' };
|
|
256
|
-
}
|
|
257
|
-
const latestTag = tagOutput.split('\n')[0];
|
|
258
|
-
if (!latestTag) {
|
|
259
|
-
return { error: 'No tags found in agent-infra repository. This is unexpected — please reinstall.' };
|
|
260
|
-
}
|
|
261
|
-
try { childProcess.execFileSync('git', ['checkout', latestTag, '--quiet'], { cwd: installDir, stdio: 'pipe' }); } catch { /* ignore */ }
|
|
262
|
-
version = latestTag;
|
|
263
|
-
} else {
|
|
264
|
-
version = INSTALLER_VERSION || version;
|
|
219
|
+
const cfg = JSON.parse(fs.readFileSync(cfgPath, 'utf8'));
|
|
220
|
+
const configPathRel = norm(path.relative(projectRoot, cfgPath));
|
|
221
|
+
const templateRoot = resolveProjectTemplateDir(projectRoot, cfg.templateSource);
|
|
222
|
+
if (!templateRoot) {
|
|
223
|
+
return { error: 'Template source not found. Install via npm: npm install -g @fitlab-ai/agent-infra' };
|
|
265
224
|
}
|
|
225
|
+
const version = INSTALLER_VERSION;
|
|
266
226
|
|
|
267
|
-
const { project, org, language: lang = 'en'
|
|
227
|
+
const { project, org, language: lang = 'en' } = cfg;
|
|
268
228
|
const vars = { project, org };
|
|
269
229
|
|
|
270
230
|
const managed = [...(cfg.files.managed || [])];
|
|
@@ -275,7 +235,7 @@ function syncTemplates(projectRoot) {
|
|
|
275
235
|
templateVersion: version,
|
|
276
236
|
templateRoot: norm(templateRoot),
|
|
277
237
|
registryAdded: [],
|
|
278
|
-
managed: { written: [], created: [], unchanged: [], skippedMerged: [],
|
|
238
|
+
managed: { written: [], created: [], unchanged: [], skippedMerged: [], removed: [] },
|
|
279
239
|
ejected: { created: [], skipped: [] },
|
|
280
240
|
merged: { pending: [] },
|
|
281
241
|
configUpdated: false,
|
|
@@ -292,8 +252,6 @@ function syncTemplates(projectRoot) {
|
|
|
292
252
|
|
|
293
253
|
const allRels = walkDir(templateRoot).map(f => norm(path.relative(templateRoot, f)));
|
|
294
254
|
const allSet = new Set(allRels);
|
|
295
|
-
const modSet = new Set(modules);
|
|
296
|
-
|
|
297
255
|
for (const entry of managed) {
|
|
298
256
|
const isDir = entry.endsWith('/');
|
|
299
257
|
let entryRels;
|
|
@@ -313,19 +271,11 @@ function syncTemplates(projectRoot) {
|
|
|
313
271
|
if (!entryRels.length) continue;
|
|
314
272
|
}
|
|
315
273
|
|
|
316
|
-
const selected =
|
|
317
|
-
? entryRels.map(r => [norm(renderPathname(r, project)), r])
|
|
318
|
-
: langSelect(entryRels, lang, allSet, project);
|
|
274
|
+
const selected = langSelect(entryRels, lang, allSet, project);
|
|
319
275
|
|
|
320
276
|
for (const [tgt, src] of selected) {
|
|
321
277
|
if (expectedTargets) expectedTargets.add(tgt);
|
|
322
278
|
|
|
323
|
-
const mod = fileModule(tgt);
|
|
324
|
-
if (mod !== null && !modSet.has(mod)) {
|
|
325
|
-
report.managed.skippedModule.push(tgt);
|
|
326
|
-
continue;
|
|
327
|
-
}
|
|
328
|
-
|
|
329
279
|
if (matchesAny(tgt, merged) || matchesAny(tgt, ejected)) {
|
|
330
280
|
report.managed.skippedMerged.push(tgt);
|
|
331
281
|
continue;
|
|
@@ -364,11 +314,9 @@ function syncTemplates(projectRoot) {
|
|
|
364
314
|
const projFiles = walkDir(projDir).map(f => norm(path.relative(projectRoot, f)));
|
|
365
315
|
for (const projFile of projFiles) {
|
|
366
316
|
if (expectedTargets.has(projFile)) continue;
|
|
317
|
+
if (projFile === configPathRel) continue;
|
|
367
318
|
if (matchesAny(projFile, merged) || matchesAny(projFile, ejected)) continue;
|
|
368
319
|
|
|
369
|
-
const mod = fileModule(projFile);
|
|
370
|
-
if (mod !== null && !modSet.has(mod)) continue;
|
|
371
|
-
|
|
372
320
|
fs.unlinkSync(path.join(projectRoot, projFile));
|
|
373
321
|
report.managed.removed.push(projFile);
|
|
374
322
|
}
|
|
@@ -420,9 +368,7 @@ function syncTemplates(projectRoot) {
|
|
|
420
368
|
const ext = path.extname(entry), base = entry.slice(0, -ext.length);
|
|
421
369
|
const zh = norm(base + '.zh-CN' + ext);
|
|
422
370
|
if (allSet.has(zh)) rels.push(zh);
|
|
423
|
-
const selected =
|
|
424
|
-
? rels.map(r => [norm(renderPathname(r, project)), r])
|
|
425
|
-
: langSelect(rels, lang, allSet, project);
|
|
371
|
+
const selected = langSelect(rels, lang, allSet, project);
|
|
426
372
|
for (const [t, s] of selected) {
|
|
427
373
|
if (!mergedMap.has(t)) mergedMap.set(t, s);
|
|
428
374
|
}
|
|
@@ -433,8 +379,7 @@ function syncTemplates(projectRoot) {
|
|
|
433
379
|
);
|
|
434
380
|
|
|
435
381
|
const projUrl = gitUrl(projectRoot);
|
|
436
|
-
|
|
437
|
-
report.selfUpdate = !!(projUrl && instUrl && projUrl === instUrl);
|
|
382
|
+
report.selfUpdate = !!(projUrl && /fitlab-ai\/agent-infra/.test(projUrl));
|
|
438
383
|
|
|
439
384
|
const hasChanges = (
|
|
440
385
|
report.managed.written.length +
|
|
@@ -1,149 +1,149 @@
|
|
|
1
|
-
#
|
|
2
|
-
#
|
|
1
|
+
# Bug Fix Workflow
|
|
2
|
+
# Use this workflow when fixing a bug.
|
|
3
3
|
|
|
4
4
|
name: bug-fix
|
|
5
|
-
description:
|
|
5
|
+
description: Workflow for diagnosing and fixing a bug.
|
|
6
6
|
|
|
7
7
|
steps:
|
|
8
8
|
- name: analysis
|
|
9
|
-
description:
|
|
9
|
+
description: Reproduce the bug, identify the root cause, and determine the scope of the fix.
|
|
10
10
|
recommended_agents:
|
|
11
11
|
- claude
|
|
12
12
|
- gemini
|
|
13
13
|
tasks:
|
|
14
|
-
-
|
|
15
|
-
-
|
|
16
|
-
-
|
|
17
|
-
-
|
|
18
|
-
-
|
|
14
|
+
- Understand the bug report and expected behavior
|
|
15
|
+
- Reproduce the bug when possible
|
|
16
|
+
- Trace the code path to identify the root cause
|
|
17
|
+
- Determine impacted files and components
|
|
18
|
+
- Record findings in the task file
|
|
19
19
|
inputs:
|
|
20
|
-
-
|
|
21
|
-
-
|
|
22
|
-
-
|
|
20
|
+
- Bug report or issue description
|
|
21
|
+
- Reproduction steps
|
|
22
|
+
- Project codebase
|
|
23
23
|
artifact_versioning:
|
|
24
24
|
outputs:
|
|
25
25
|
- name: analysis
|
|
26
26
|
pattern: "analysis.md | analysis-r{N}.md"
|
|
27
|
-
rule: "
|
|
27
|
+
rule: "Scan existing analysis artifacts; create analysis.md for the first round, then analysis-r{N}.md for later revisions (N = current highest round + 1)"
|
|
28
28
|
outputs:
|
|
29
|
-
-
|
|
30
|
-
-
|
|
31
|
-
-
|
|
29
|
+
- Root cause analysis
|
|
30
|
+
- List of impacted files
|
|
31
|
+
- Updated task file (analysis section)
|
|
32
32
|
|
|
33
33
|
- name: design
|
|
34
|
-
description:
|
|
34
|
+
description: Plan the fix and consider edge cases.
|
|
35
35
|
recommended_agents:
|
|
36
36
|
- claude
|
|
37
37
|
tasks:
|
|
38
|
-
-
|
|
39
|
-
-
|
|
40
|
-
-
|
|
41
|
-
-
|
|
38
|
+
- Determine the best approach for fixing the bug
|
|
39
|
+
- Identify potential side effects of the fix
|
|
40
|
+
- Plan test cases to validate the fix
|
|
41
|
+
- Record the fix plan in the task file
|
|
42
42
|
inputs:
|
|
43
|
-
-
|
|
44
|
-
-
|
|
43
|
+
- Root cause analysis from the previous step
|
|
44
|
+
- Project architecture
|
|
45
45
|
artifact_versioning:
|
|
46
46
|
inputs:
|
|
47
47
|
- name: analysis
|
|
48
48
|
pattern: "analysis.md | analysis-r{N}.md"
|
|
49
|
-
rule: "
|
|
49
|
+
rule: "Read the highest-round analysis artifact as design input"
|
|
50
50
|
outputs:
|
|
51
51
|
- name: plan
|
|
52
52
|
pattern: "plan.md | plan-r{N}.md"
|
|
53
|
-
rule: "
|
|
53
|
+
rule: "Scan existing plan artifacts; create plan.md for the first round, then plan-r{N}.md for later revisions (N = current highest round + 1)"
|
|
54
54
|
outputs:
|
|
55
|
-
-
|
|
56
|
-
-
|
|
55
|
+
- Fix plan recorded in the task file
|
|
56
|
+
- List of test cases to add
|
|
57
57
|
|
|
58
58
|
- name: implementation
|
|
59
|
-
description:
|
|
59
|
+
description: Implement the bug fix and add regression tests.
|
|
60
60
|
recommended_agents:
|
|
61
61
|
- codex
|
|
62
62
|
- cursor
|
|
63
63
|
tasks:
|
|
64
|
-
-
|
|
65
|
-
-
|
|
66
|
-
-
|
|
67
|
-
-
|
|
68
|
-
-
|
|
64
|
+
- Create a bug-fix branch
|
|
65
|
+
- Implement the fix
|
|
66
|
+
- Add regression tests that would fail without the fix
|
|
67
|
+
- Verify that existing tests still pass
|
|
68
|
+
- Ensure the code follows project conventions
|
|
69
69
|
inputs:
|
|
70
|
-
-
|
|
71
|
-
-
|
|
70
|
+
- Fix plan from the previous step
|
|
71
|
+
- Project coding standards
|
|
72
72
|
artifact_versioning:
|
|
73
73
|
outputs:
|
|
74
74
|
- name: implementation
|
|
75
75
|
pattern: "implementation.md | implementation-r{N}.md"
|
|
76
|
-
rule: "
|
|
76
|
+
rule: "Scan existing implementation artifacts; create implementation.md for the first round, then implementation-r{N}.md for later re-implementations (N = current highest round + 1)"
|
|
77
77
|
outputs:
|
|
78
|
-
-
|
|
79
|
-
-
|
|
80
|
-
-
|
|
78
|
+
- Bug-fix branch with the implementation
|
|
79
|
+
- Regression test files
|
|
80
|
+
- Updated task file (implementation notes)
|
|
81
81
|
|
|
82
82
|
- name: review
|
|
83
|
-
description:
|
|
83
|
+
description: Verify that the fix is correct and complete.
|
|
84
84
|
recommended_agents:
|
|
85
85
|
- claude
|
|
86
86
|
tasks:
|
|
87
|
-
-
|
|
88
|
-
-
|
|
89
|
-
-
|
|
90
|
-
-
|
|
91
|
-
-
|
|
87
|
+
- Verify that the fix addresses the root cause
|
|
88
|
+
- Check whether regression tests are sufficient
|
|
89
|
+
- Ensure no new issues were introduced
|
|
90
|
+
- Verify that the fix does not break existing functionality
|
|
91
|
+
- Create a review report
|
|
92
92
|
inputs:
|
|
93
|
-
-
|
|
94
|
-
-
|
|
93
|
+
- Bug-fix branch
|
|
94
|
+
- Root cause analysis
|
|
95
95
|
artifact_versioning:
|
|
96
96
|
inputs:
|
|
97
97
|
- name: implementation
|
|
98
98
|
pattern: "implementation.md | implementation-r{N}.md"
|
|
99
|
-
rule: "
|
|
99
|
+
rule: "Read the highest-round implementation artifact as review input"
|
|
100
100
|
outputs:
|
|
101
101
|
- name: review
|
|
102
102
|
pattern: "review.md | review-r{N}.md"
|
|
103
|
-
rule: "
|
|
103
|
+
rule: "Scan existing review artifacts; create review.md for the first round, then review-r{N}.md for later rounds (N = current highest round + 1)"
|
|
104
104
|
outputs:
|
|
105
|
-
-
|
|
106
|
-
-
|
|
105
|
+
- Review report
|
|
106
|
+
- List of issues if any
|
|
107
107
|
|
|
108
108
|
- name: fix
|
|
109
|
-
description:
|
|
109
|
+
description: Address issues found during review.
|
|
110
110
|
recommended_agents:
|
|
111
111
|
- codex
|
|
112
112
|
- cursor
|
|
113
113
|
tasks:
|
|
114
|
-
-
|
|
115
|
-
-
|
|
116
|
-
-
|
|
114
|
+
- Fix issues identified in the review
|
|
115
|
+
- Update tests as needed
|
|
116
|
+
- Verify that all tests pass
|
|
117
117
|
inputs:
|
|
118
|
-
-
|
|
119
|
-
-
|
|
118
|
+
- Review report
|
|
119
|
+
- Bug-fix branch
|
|
120
120
|
artifact_versioning:
|
|
121
121
|
inputs:
|
|
122
122
|
- name: review
|
|
123
123
|
pattern: "review.md | review-r{N}.md"
|
|
124
|
-
rule: "
|
|
124
|
+
rule: "Read the highest-round review artifact and verify that it matches the latest Code Review entry in the task.md Activity Log"
|
|
125
125
|
outputs:
|
|
126
126
|
- name: refinement
|
|
127
127
|
pattern: "refinement.md | refinement-r{N}.md"
|
|
128
|
-
rule: "
|
|
128
|
+
rule: "Scan existing refinement artifacts; create refinement.md for the first round, then refinement-r{N}.md for later rounds (N = current highest round + 1)"
|
|
129
129
|
outputs:
|
|
130
|
-
-
|
|
131
|
-
-
|
|
130
|
+
- Updated branch with fixes
|
|
131
|
+
- Updated task file
|
|
132
132
|
|
|
133
133
|
- name: commit
|
|
134
|
-
description:
|
|
134
|
+
description: Finalize the bug fix and create a pull request.
|
|
135
135
|
recommended_agents:
|
|
136
136
|
- claude
|
|
137
137
|
- human
|
|
138
138
|
tasks:
|
|
139
|
-
-
|
|
140
|
-
-
|
|
141
|
-
-
|
|
142
|
-
-
|
|
143
|
-
-
|
|
139
|
+
- Ensure all tests pass
|
|
140
|
+
- Write a commit message that references the bug or issue
|
|
141
|
+
- Create a pull request with a bug-fix summary
|
|
142
|
+
- Link the PR to the bug report issue
|
|
143
|
+
- Move the task to completed
|
|
144
144
|
inputs:
|
|
145
|
-
-
|
|
146
|
-
-
|
|
145
|
+
- Final bug-fix branch
|
|
146
|
+
- Task file
|
|
147
147
|
outputs:
|
|
148
|
-
-
|
|
149
|
-
-
|
|
148
|
+
- Pull request
|
|
149
|
+
- Completed task file (stored in .agents/workspace/completed/)
|