create-agentic-starter 0.1.10 → 0.1.11
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/dist/index.js +8 -864
- package/dist/templates/commands/architecture.md +28 -0
- package/dist/templates/commands/create-brd.md +30 -0
- package/dist/templates/commands/create-estimate.md +32 -0
- package/dist/templates/commands/create-frd.md +30 -0
- package/dist/templates/commands/create-plan.md +38 -0
- package/dist/templates/commands/create-proposal.md +29 -0
- package/dist/templates/commands/create-tasks.md +35 -0
- package/dist/templates/commands/project-requirements.md +34 -0
- package/dist/templates/core/context.md +96 -0
- package/dist/templates/core/init.md +70 -0
- package/dist/templates/meta/agents.md +77 -0
- package/dist/templates/scripts/README.md +58 -0
- package/dist/templates/scripts/_shared.js +114 -0
- package/dist/templates/scripts/generate_brd.js +48 -0
- package/dist/templates/scripts/generate_estimate.js +28 -0
- package/dist/templates/scripts/generate_frd.js +39 -0
- package/dist/templates/scripts/generate_plan.js +62 -0
- package/dist/templates/scripts/generate_proposal.js +75 -0
- package/dist/templates/scripts/generate_tasks.js +28 -0
- package/package.json +2 -2
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
const fs = require("node:fs");
|
|
4
|
+
const path = require("node:path");
|
|
5
|
+
|
|
6
|
+
function parseArgs(argv) {
|
|
7
|
+
const args = {};
|
|
8
|
+
|
|
9
|
+
for (let index = 0; index < argv.length; index += 1) {
|
|
10
|
+
const token = argv[index];
|
|
11
|
+
|
|
12
|
+
if (!token.startsWith("--")) {
|
|
13
|
+
continue;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
const key = token.slice(2);
|
|
17
|
+
const next = argv[index + 1];
|
|
18
|
+
|
|
19
|
+
if (!next || next.startsWith("--")) {
|
|
20
|
+
args[key] = true;
|
|
21
|
+
continue;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
args[key] = next;
|
|
25
|
+
index += 1;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
return args;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
function resolveFromRoot(targetPath) {
|
|
32
|
+
return path.resolve(process.cwd(), targetPath);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
function ensureParentDir(filePath) {
|
|
36
|
+
fs.mkdirSync(path.dirname(filePath), { recursive: true });
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
function readJsonFile(relativePath) {
|
|
40
|
+
const absolutePath = resolveFromRoot(relativePath);
|
|
41
|
+
|
|
42
|
+
if (!fs.existsSync(absolutePath)) {
|
|
43
|
+
throw new Error(
|
|
44
|
+
"Input file not found: " +
|
|
45
|
+
relativePath +
|
|
46
|
+
"\nCreate it first under .agentic/workspace/documents/ or pass --input."
|
|
47
|
+
);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
return JSON.parse(fs.readFileSync(absolutePath, "utf8"));
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
function loadPackage(packageName) {
|
|
54
|
+
try {
|
|
55
|
+
return require(packageName);
|
|
56
|
+
} catch (error) {
|
|
57
|
+
console.error("Missing dependency:", packageName);
|
|
58
|
+
console.error(
|
|
59
|
+
"Install it in the target project's chosen Node environment before running this script."
|
|
60
|
+
);
|
|
61
|
+
console.error("Current working directory:", process.cwd());
|
|
62
|
+
process.exit(1);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
function writeBuffer(relativePath, buffer) {
|
|
67
|
+
const absolutePath = resolveFromRoot(relativePath);
|
|
68
|
+
ensureParentDir(absolutePath);
|
|
69
|
+
fs.writeFileSync(absolutePath, buffer);
|
|
70
|
+
return absolutePath;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
function writeSuccess(label, absolutePath) {
|
|
74
|
+
console.log(label + " written to " + absolutePath);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
function toParagraphs(docx, lines, options = {}) {
|
|
78
|
+
if (!Array.isArray(lines) || lines.length === 0) {
|
|
79
|
+
return [];
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
return lines.map((line) =>
|
|
83
|
+
new docx.Paragraph({
|
|
84
|
+
text: String(line),
|
|
85
|
+
bullet: options.bullet ? { level: 0 } : undefined,
|
|
86
|
+
spacing: { after: options.bullet ? 80 : 160 },
|
|
87
|
+
})
|
|
88
|
+
);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
function deriveColumns(rows) {
|
|
92
|
+
const firstRow = Array.isArray(rows) && rows.length > 0 ? rows[0] : null;
|
|
93
|
+
|
|
94
|
+
if (!firstRow || Array.isArray(firstRow)) {
|
|
95
|
+
return [];
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
return Object.keys(firstRow).map((key) => ({
|
|
99
|
+
header: key,
|
|
100
|
+
key,
|
|
101
|
+
width: Math.max(String(key).length + 4, 18),
|
|
102
|
+
}));
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
module.exports = {
|
|
106
|
+
parseArgs,
|
|
107
|
+
resolveFromRoot,
|
|
108
|
+
readJsonFile,
|
|
109
|
+
loadPackage,
|
|
110
|
+
writeBuffer,
|
|
111
|
+
writeSuccess,
|
|
112
|
+
toParagraphs,
|
|
113
|
+
deriveColumns,
|
|
114
|
+
};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
const shared = require("./_shared.js");
|
|
4
|
+
const docx = shared.loadPackage("docx");
|
|
5
|
+
|
|
6
|
+
const args = shared.parseArgs(process.argv.slice(2));
|
|
7
|
+
const inputPath = args.input || ".agentic/workspace/documents/brd.json";
|
|
8
|
+
const outputPath = args.output || ".docs/brd/brd.docx";
|
|
9
|
+
const data = shared.readJsonFile(inputPath);
|
|
10
|
+
|
|
11
|
+
const children = [
|
|
12
|
+
new docx.Paragraph({
|
|
13
|
+
text: data.title || "Business Requirements Document",
|
|
14
|
+
heading: docx.HeadingLevel.TITLE,
|
|
15
|
+
}),
|
|
16
|
+
];
|
|
17
|
+
|
|
18
|
+
if (data.subtitle) {
|
|
19
|
+
children.push(
|
|
20
|
+
new docx.Paragraph({
|
|
21
|
+
text: String(data.subtitle),
|
|
22
|
+
spacing: { after: 240 },
|
|
23
|
+
})
|
|
24
|
+
);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
for (const section of data.sections || []) {
|
|
28
|
+
if (section.heading) {
|
|
29
|
+
children.push(
|
|
30
|
+
new docx.Paragraph({
|
|
31
|
+
text: String(section.heading),
|
|
32
|
+
heading: docx.HeadingLevel.HEADING_1,
|
|
33
|
+
})
|
|
34
|
+
);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
children.push(...shared.toParagraphs(docx, section.paragraphs));
|
|
38
|
+
children.push(...shared.toParagraphs(docx, section.bullets, { bullet: true }));
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
const document = new docx.Document({
|
|
42
|
+
sections: [{ children }],
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
docx.Packer.toBuffer(document).then((buffer) => {
|
|
46
|
+
const absolutePath = shared.writeBuffer(outputPath, buffer);
|
|
47
|
+
shared.writeSuccess("BRD", absolutePath);
|
|
48
|
+
});
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
const shared = require("./_shared.js");
|
|
4
|
+
const ExcelJS = shared.loadPackage("exceljs");
|
|
5
|
+
|
|
6
|
+
const args = shared.parseArgs(process.argv.slice(2));
|
|
7
|
+
const inputPath = args.input || ".agentic/workspace/documents/estimate.json";
|
|
8
|
+
const outputPath = args.output || ".docs/estimate/estimate.xlsx";
|
|
9
|
+
const data = shared.readJsonFile(inputPath);
|
|
10
|
+
|
|
11
|
+
const workbook = new ExcelJS.Workbook();
|
|
12
|
+
const worksheet = workbook.addWorksheet(data.sheetName || "Estimate");
|
|
13
|
+
const rows = Array.isArray(data.rows) ? data.rows : [];
|
|
14
|
+
|
|
15
|
+
worksheet.columns = Array.isArray(data.columns) && data.columns.length > 0
|
|
16
|
+
? data.columns
|
|
17
|
+
: shared.deriveColumns(rows);
|
|
18
|
+
|
|
19
|
+
for (const row of rows) {
|
|
20
|
+
worksheet.addRow(row);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
worksheet.views = [{ state: "frozen", ySplit: 1 }];
|
|
24
|
+
|
|
25
|
+
workbook.xlsx.writeBuffer().then((buffer) => {
|
|
26
|
+
const absolutePath = shared.writeBuffer(outputPath, buffer);
|
|
27
|
+
shared.writeSuccess("Estimate", absolutePath);
|
|
28
|
+
});
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
const shared = require("./_shared.js");
|
|
4
|
+
const docx = shared.loadPackage("docx");
|
|
5
|
+
|
|
6
|
+
const args = shared.parseArgs(process.argv.slice(2));
|
|
7
|
+
const inputPath = args.input || ".agentic/workspace/documents/frd.json";
|
|
8
|
+
const outputPath = args.output || ".docs/frd/frd.docx";
|
|
9
|
+
const data = shared.readJsonFile(inputPath);
|
|
10
|
+
|
|
11
|
+
const children = [
|
|
12
|
+
new docx.Paragraph({
|
|
13
|
+
text: data.title || "Functional Requirements Document",
|
|
14
|
+
heading: docx.HeadingLevel.TITLE,
|
|
15
|
+
}),
|
|
16
|
+
];
|
|
17
|
+
|
|
18
|
+
for (const moduleItem of data.modules || []) {
|
|
19
|
+
children.push(
|
|
20
|
+
new docx.Paragraph({
|
|
21
|
+
text: String(moduleItem.name || "Module"),
|
|
22
|
+
heading: docx.HeadingLevel.HEADING_1,
|
|
23
|
+
})
|
|
24
|
+
);
|
|
25
|
+
|
|
26
|
+
children.push(...shared.toParagraphs(docx, moduleItem.summary ? [moduleItem.summary] : []));
|
|
27
|
+
children.push(...shared.toParagraphs(docx, moduleItem.features, { bullet: true }));
|
|
28
|
+
children.push(...shared.toParagraphs(docx, moduleItem.validations, { bullet: true }));
|
|
29
|
+
children.push(...shared.toParagraphs(docx, moduleItem.edgeCases, { bullet: true }));
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
const document = new docx.Document({
|
|
33
|
+
sections: [{ children }],
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
docx.Packer.toBuffer(document).then((buffer) => {
|
|
37
|
+
const absolutePath = shared.writeBuffer(outputPath, buffer);
|
|
38
|
+
shared.writeSuccess("FRD", absolutePath);
|
|
39
|
+
});
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
const shared = require("./_shared.js");
|
|
4
|
+
|
|
5
|
+
const args = shared.parseArgs(process.argv.slice(2));
|
|
6
|
+
const inputPath = args.input || ".agentic/workspace/documents/plan.json";
|
|
7
|
+
const data = shared.readJsonFile(inputPath);
|
|
8
|
+
const format = args.format || data.format || "docx";
|
|
9
|
+
|
|
10
|
+
if (format === "xlsx") {
|
|
11
|
+
const ExcelJS = shared.loadPackage("exceljs");
|
|
12
|
+
const outputPath = args.output || ".docs/plan/plan.xlsx";
|
|
13
|
+
const workbook = new ExcelJS.Workbook();
|
|
14
|
+
const worksheet = workbook.addWorksheet(data.sheetName || "Plan");
|
|
15
|
+
const rows = Array.isArray(data.rows) ? data.rows : [];
|
|
16
|
+
|
|
17
|
+
worksheet.columns = Array.isArray(data.columns) && data.columns.length > 0
|
|
18
|
+
? data.columns
|
|
19
|
+
: shared.deriveColumns(rows);
|
|
20
|
+
|
|
21
|
+
for (const row of rows) {
|
|
22
|
+
worksheet.addRow(row);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
worksheet.views = [{ state: "frozen", ySplit: 1 }];
|
|
26
|
+
|
|
27
|
+
workbook.xlsx.writeBuffer().then((buffer) => {
|
|
28
|
+
const absolutePath = shared.writeBuffer(outputPath, buffer);
|
|
29
|
+
shared.writeSuccess("Plan", absolutePath);
|
|
30
|
+
});
|
|
31
|
+
} else {
|
|
32
|
+
const docx = shared.loadPackage("docx");
|
|
33
|
+
const outputPath = args.output || ".docs/plan/plan.docx";
|
|
34
|
+
const children = [
|
|
35
|
+
new docx.Paragraph({
|
|
36
|
+
text: data.title || "Project Plan",
|
|
37
|
+
heading: docx.HeadingLevel.TITLE,
|
|
38
|
+
}),
|
|
39
|
+
];
|
|
40
|
+
|
|
41
|
+
for (const phase of data.phases || []) {
|
|
42
|
+
children.push(
|
|
43
|
+
new docx.Paragraph({
|
|
44
|
+
text: String(phase.name || "Phase"),
|
|
45
|
+
heading: docx.HeadingLevel.HEADING_1,
|
|
46
|
+
})
|
|
47
|
+
);
|
|
48
|
+
|
|
49
|
+
children.push(...shared.toParagraphs(docx, phase.summary ? [phase.summary] : []));
|
|
50
|
+
children.push(...shared.toParagraphs(docx, phase.tasks, { bullet: true }));
|
|
51
|
+
children.push(...shared.toParagraphs(docx, phase.risks, { bullet: true }));
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
const document = new docx.Document({
|
|
55
|
+
sections: [{ children }],
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
docx.Packer.toBuffer(document).then((buffer) => {
|
|
59
|
+
const absolutePath = shared.writeBuffer(outputPath, buffer);
|
|
60
|
+
shared.writeSuccess("Plan", absolutePath);
|
|
61
|
+
});
|
|
62
|
+
}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
const shared = require("./_shared.js");
|
|
4
|
+
const PptxGenJS = shared.loadPackage("pptxgenjs");
|
|
5
|
+
|
|
6
|
+
const args = shared.parseArgs(process.argv.slice(2));
|
|
7
|
+
const inputPath = args.input || ".agentic/workspace/documents/proposal.json";
|
|
8
|
+
const outputPath = args.output || ".docs/proposal/proposal.pptx";
|
|
9
|
+
const data = shared.readJsonFile(inputPath);
|
|
10
|
+
|
|
11
|
+
const pptx = new PptxGenJS();
|
|
12
|
+
pptx.layout = "LAYOUT_WIDE";
|
|
13
|
+
pptx.author = "create-agentic-starter";
|
|
14
|
+
|
|
15
|
+
const titleSlide = pptx.addSlide();
|
|
16
|
+
titleSlide.addText(data.title || "Project Proposal", {
|
|
17
|
+
x: 0.7,
|
|
18
|
+
y: 1.0,
|
|
19
|
+
w: 11.0,
|
|
20
|
+
h: 0.8,
|
|
21
|
+
fontSize: 24,
|
|
22
|
+
bold: true,
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
if (data.subtitle) {
|
|
26
|
+
titleSlide.addText(String(data.subtitle), {
|
|
27
|
+
x: 0.7,
|
|
28
|
+
y: 2.0,
|
|
29
|
+
w: 10.5,
|
|
30
|
+
h: 0.5,
|
|
31
|
+
fontSize: 14,
|
|
32
|
+
color: "666666",
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
for (const slideData of data.slides || []) {
|
|
37
|
+
const slide = pptx.addSlide();
|
|
38
|
+
|
|
39
|
+
slide.addText(String(slideData.title || "Slide"), {
|
|
40
|
+
x: 0.7,
|
|
41
|
+
y: 0.5,
|
|
42
|
+
w: 11,
|
|
43
|
+
h: 0.6,
|
|
44
|
+
fontSize: 20,
|
|
45
|
+
bold: true,
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
const bullets = Array.isArray(slideData.bullets)
|
|
49
|
+
? slideData.bullets.map((item) => ({ text: String(item), options: { bullet: { indent: 18 } } }))
|
|
50
|
+
: [];
|
|
51
|
+
|
|
52
|
+
if (bullets.length > 0) {
|
|
53
|
+
slide.addText(bullets, {
|
|
54
|
+
x: 0.9,
|
|
55
|
+
y: 1.5,
|
|
56
|
+
w: 10.6,
|
|
57
|
+
h: 4.5,
|
|
58
|
+
fontSize: 16,
|
|
59
|
+
breakLine: true,
|
|
60
|
+
});
|
|
61
|
+
} else if (slideData.body) {
|
|
62
|
+
slide.addText(String(slideData.body), {
|
|
63
|
+
x: 0.9,
|
|
64
|
+
y: 1.5,
|
|
65
|
+
w: 10.6,
|
|
66
|
+
h: 4.5,
|
|
67
|
+
fontSize: 16,
|
|
68
|
+
breakLine: true,
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
pptx.writeFile({ fileName: shared.resolveFromRoot(outputPath) }).then(() => {
|
|
74
|
+
shared.writeSuccess("Proposal", shared.resolveFromRoot(outputPath));
|
|
75
|
+
});
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
const shared = require("./_shared.js");
|
|
4
|
+
const ExcelJS = shared.loadPackage("exceljs");
|
|
5
|
+
|
|
6
|
+
const args = shared.parseArgs(process.argv.slice(2));
|
|
7
|
+
const inputPath = args.input || ".agentic/workspace/documents/tasks.json";
|
|
8
|
+
const outputPath = args.output || ".docs/tasks/tasks.xlsx";
|
|
9
|
+
const data = shared.readJsonFile(inputPath);
|
|
10
|
+
|
|
11
|
+
const workbook = new ExcelJS.Workbook();
|
|
12
|
+
const worksheet = workbook.addWorksheet(data.sheetName || "Tasks");
|
|
13
|
+
const rows = Array.isArray(data.rows) ? data.rows : [];
|
|
14
|
+
|
|
15
|
+
worksheet.columns = Array.isArray(data.columns) && data.columns.length > 0
|
|
16
|
+
? data.columns
|
|
17
|
+
: shared.deriveColumns(rows);
|
|
18
|
+
|
|
19
|
+
for (const row of rows) {
|
|
20
|
+
worksheet.addRow(row);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
worksheet.views = [{ state: "frozen", ySplit: 1 }];
|
|
24
|
+
|
|
25
|
+
workbook.xlsx.writeBuffer().then((buffer) => {
|
|
26
|
+
const absolutePath = shared.writeBuffer(outputPath, buffer);
|
|
27
|
+
shared.writeSuccess("Tasks", absolutePath);
|
|
28
|
+
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-agentic-starter",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.11",
|
|
4
4
|
"description": "Scaffold a minimal AI-powered project delivery workflow inside the current folder.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"access": "public"
|
|
15
15
|
},
|
|
16
16
|
"scripts": {
|
|
17
|
-
"build": "tsup",
|
|
17
|
+
"build": "tsup && node scripts/copy-templates.mjs",
|
|
18
18
|
"dev": "tsup --watch",
|
|
19
19
|
"prepublishOnly": "npm run typecheck && npm run build",
|
|
20
20
|
"typecheck": "tsc --noEmit"
|