@applica-software-guru/sdd 0.2.0 → 1.0.1
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/commands/apply.d.ts +3 -0
- package/dist/commands/apply.d.ts.map +1 -0
- package/dist/commands/apply.js +46 -0
- package/dist/commands/apply.js.map +1 -0
- package/dist/commands/bug.d.ts +3 -0
- package/dist/commands/bug.d.ts.map +1 -0
- package/dist/commands/bug.js +76 -0
- package/dist/commands/bug.js.map +1 -0
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +109 -25
- package/dist/commands/init.js.map +1 -1
- package/dist/index.js +5 -1
- package/dist/index.js.map +1 -1
- package/dist/ui/markdown.d.ts +2 -0
- package/dist/ui/markdown.d.ts.map +1 -0
- package/dist/ui/markdown.js +10 -0
- package/dist/ui/markdown.js.map +1 -0
- package/package.json +4 -2
- package/src/commands/apply.ts +49 -0
- package/src/commands/bug.ts +84 -0
- package/src/commands/init.ts +124 -27
- package/src/index.ts +5 -1
- package/src/types/marked-terminal.d.ts +5 -0
- package/src/ui/markdown.ts +8 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"apply.d.ts","sourceRoot":"","sources":["../../src/commands/apply.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAMpC,wBAAgB,aAAa,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CA0CpD"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.registerApply = registerApply;
|
|
7
|
+
const chalk_1 = __importDefault(require("chalk"));
|
|
8
|
+
const sdd_core_1 = require("@applica-software-guru/sdd-core");
|
|
9
|
+
const format_js_1 = require("../ui/format.js");
|
|
10
|
+
const markdown_js_1 = require("../ui/markdown.js");
|
|
11
|
+
function registerApply(program) {
|
|
12
|
+
program
|
|
13
|
+
.command('apply')
|
|
14
|
+
.description('Run the full SDD workflow automatically using an external AI agent')
|
|
15
|
+
.option('--agent <name>', 'Agent to use (default: from config or "claude")')
|
|
16
|
+
.action(async (options) => {
|
|
17
|
+
const sdd = new sdd_core_1.SDD({ root: process.cwd() });
|
|
18
|
+
console.log((0, format_js_1.heading)('SDD Apply'));
|
|
19
|
+
const prompt = await sdd.applyPrompt();
|
|
20
|
+
if (!prompt) {
|
|
21
|
+
console.log((0, format_js_1.info)('Nothing to apply — no open bugs, pending CRs, or pending files.'));
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
24
|
+
// Show the prompt being sent
|
|
25
|
+
console.log(chalk_1.default.dim(' ─'.repeat(30)));
|
|
26
|
+
console.log((0, format_js_1.heading)('Agent Prompt'));
|
|
27
|
+
console.log((0, markdown_js_1.renderMarkdown)(prompt));
|
|
28
|
+
console.log(chalk_1.default.dim(' ─'.repeat(30)));
|
|
29
|
+
const config = await sdd.config();
|
|
30
|
+
const agent = options.agent ?? config.agent ?? 'claude';
|
|
31
|
+
console.log((0, format_js_1.info)(`Using agent: ${chalk_1.default.cyan(agent)}`));
|
|
32
|
+
console.log((0, format_js_1.info)('Starting agent...\n'));
|
|
33
|
+
const exitCode = await (0, sdd_core_1.runAgent)({
|
|
34
|
+
root: process.cwd(),
|
|
35
|
+
prompt,
|
|
36
|
+
agent,
|
|
37
|
+
agents: config.agents,
|
|
38
|
+
});
|
|
39
|
+
if (exitCode !== 0) {
|
|
40
|
+
console.log(chalk_1.default.red(`\n Agent exited with code ${exitCode}`));
|
|
41
|
+
process.exit(exitCode);
|
|
42
|
+
}
|
|
43
|
+
console.log(chalk_1.default.green('\n Agent completed successfully.'));
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
//# sourceMappingURL=apply.js.map
|
|
@@ -0,0 +1 @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AAC,KAAK,IAAI,QAAQ,CAAC;QAExD,OAAO,CAAC,GAAG,CAAC,IAAA,gBAAI,EAAC,gBAAgB,eAAK,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,CAAC;QACvD,OAAO,CAAC,GAAG,CAAC,IAAA,gBAAI,EAAC,qBAAqB,CAAC,CAAC,CAAC;QAEzC,MAAM,QAAQ,GAAG,MAAM,IAAA,mBAAQ,EAAC;YAC9B,IAAI,EAAE,OAAO,CAAC,GAAG,EAAE;YACnB,MAAM;YACN,KAAK;YACL,MAAM,EAAE,MAAM,CAAC,MAAM;SACtB,CAAC,CAAC;QAEH,IAAI,QAAQ,KAAK,CAAC,EAAE,CAAC;YACnB,OAAO,CAAC,GAAG,CAAC,eAAK,CAAC,GAAG,CAAC,8BAA8B,QAAQ,EAAE,CAAC,CAAC,CAAC;YACjE,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QACzB,CAAC;QAED,OAAO,CAAC,GAAG,CAAC,eAAK,CAAC,KAAK,CAAC,mCAAmC,CAAC,CAAC,CAAC;IAChE,CAAC,CAAC,CAAC;AACP,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bug.d.ts","sourceRoot":"","sources":["../../src/commands/bug.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAgBpC,wBAAgB,WAAW,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAmElD"}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.registerBug = registerBug;
|
|
7
|
+
const chalk_1 = __importDefault(require("chalk"));
|
|
8
|
+
const sdd_core_1 = require("@applica-software-guru/sdd-core");
|
|
9
|
+
const format_js_1 = require("../ui/format.js");
|
|
10
|
+
function statusLabel(status) {
|
|
11
|
+
switch (status) {
|
|
12
|
+
case 'open':
|
|
13
|
+
return chalk_1.default.yellow('open');
|
|
14
|
+
case 'resolved':
|
|
15
|
+
return chalk_1.default.green('resolved');
|
|
16
|
+
default:
|
|
17
|
+
return chalk_1.default.gray(status);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
function registerBug(program) {
|
|
21
|
+
const bug = program
|
|
22
|
+
.command('bug')
|
|
23
|
+
.description('Manage bugs');
|
|
24
|
+
bug.command('list')
|
|
25
|
+
.description('List all bugs with their status')
|
|
26
|
+
.action(async () => {
|
|
27
|
+
const sdd = new sdd_core_1.SDD({ root: process.cwd() });
|
|
28
|
+
const bugs = await sdd.bugs();
|
|
29
|
+
console.log((0, format_js_1.heading)('Bugs'));
|
|
30
|
+
if (bugs.length === 0) {
|
|
31
|
+
console.log((0, format_js_1.info)('No bugs found.\n'));
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
for (const b of bugs) {
|
|
35
|
+
const icon = b.frontmatter.status === 'resolved' ? chalk_1.default.green(' ✓') : chalk_1.default.yellow(' ●');
|
|
36
|
+
console.log(`${icon} ${chalk_1.default.white(b.relativePath)} ${chalk_1.default.dim(`[${statusLabel(b.frontmatter.status)}]`)} ${chalk_1.default.cyan(b.frontmatter.title)}`);
|
|
37
|
+
}
|
|
38
|
+
console.log('');
|
|
39
|
+
});
|
|
40
|
+
bug.command('open')
|
|
41
|
+
.description('Show open bugs for the agent to process')
|
|
42
|
+
.action(async () => {
|
|
43
|
+
const sdd = new sdd_core_1.SDD({ root: process.cwd() });
|
|
44
|
+
const open = await sdd.openBugs();
|
|
45
|
+
if (open.length === 0) {
|
|
46
|
+
console.log((0, format_js_1.heading)('Bugs'));
|
|
47
|
+
console.log((0, format_js_1.info)('No open bugs.\n'));
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
console.log((0, format_js_1.heading)(`Open Bugs (${open.length})`));
|
|
51
|
+
for (const b of open) {
|
|
52
|
+
console.log(chalk_1.default.cyan.bold(` --- ${b.relativePath} ---`));
|
|
53
|
+
console.log(chalk_1.default.cyan(` Title: ${b.frontmatter.title}`));
|
|
54
|
+
console.log('');
|
|
55
|
+
console.log(b.body.trim().split('\n').map((line) => ` ${line}`).join('\n'));
|
|
56
|
+
console.log('');
|
|
57
|
+
}
|
|
58
|
+
});
|
|
59
|
+
program
|
|
60
|
+
.command('mark-bug-resolved [files...]')
|
|
61
|
+
.description('Mark bugs as resolved')
|
|
62
|
+
.action(async (files) => {
|
|
63
|
+
const sdd = new sdd_core_1.SDD({ root: process.cwd() });
|
|
64
|
+
const marked = await sdd.markBugResolved(files.length > 0 ? files : undefined);
|
|
65
|
+
console.log((0, format_js_1.heading)('Mark Bug Resolved'));
|
|
66
|
+
if (marked.length === 0) {
|
|
67
|
+
console.log((0, format_js_1.info)('No open bugs to mark.\n'));
|
|
68
|
+
return;
|
|
69
|
+
}
|
|
70
|
+
for (const f of marked) {
|
|
71
|
+
console.log(chalk_1.default.green(` ✓ ${f}`));
|
|
72
|
+
}
|
|
73
|
+
console.log(chalk_1.default.dim(`\n ${marked.length} bug(s) marked as resolved.\n`));
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
//# sourceMappingURL=bug.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bug.js","sourceRoot":"","sources":["../../src/commands/bug.ts"],"names":[],"mappings":";;;;;AAgBA,kCAmEC;AAlFD,kDAA0B;AAC1B,8DAAsD;AACtD,+CAAgD;AAEhD,SAAS,WAAW,CAAC,MAAc;IACjC,QAAQ,MAAM,EAAE,CAAC;QACf,KAAK,MAAM;YACT,OAAO,eAAK,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;QAC9B,KAAK,UAAU;YACb,OAAO,eAAK,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;QACjC;YACE,OAAO,eAAK,CAAC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QAClB,CAAC;IACH,CAAC,CAAC,CAAC;IAEL,OAAO;SACJ,OAAO,CAAC,8BAA8B,CAAC;SACvC,WAAW,CAAC,uBAAuB,CAAC;SACpC,MAAM,CAAC,KAAK,EAAE,KAAe,EAAE,EAAE;QAChC,MAAM,GAAG,GAAG,IAAI,cAAG,CAAC,EAAE,IAAI,EAAE,OAAO,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;QAC7C,MAAM,MAAM,GAAG,MAAM,GAAG,CAAC,eAAe,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;QAE/E,OAAO,CAAC,GAAG,CAAC,IAAA,mBAAO,EAAC,mBAAmB,CAAC,CAAC,CAAC;QAE1C,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YACxB,OAAO,CAAC,GAAG,CAAC,IAAA,gBAAI,EAAC,yBAAyB,CAAC,CAAC,CAAC;YAC7C,OAAO;QACT,CAAC;QAED,KAAK,MAAM,CAAC,IAAI,MAAM,EAAE,CAAC;YACvB,OAAO,CAAC,GAAG,CAAC,eAAK,CAAC,KAAK,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,CAAC;QACvC,CAAC;QACD,OAAO,CAAC,GAAG,CAAC,eAAK,CAAC,GAAG,CAAC,OAAO,MAAM,CAAC,MAAM,+BAA+B,CAAC,CAAC,CAAC;IAC9E,CAAC,CAAC,CAAC;AACP,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../src/commands/init.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../src/commands/init.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAkDpC,wBAAgB,YAAY,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAsKnD"}
|
package/dist/commands/init.js
CHANGED
|
@@ -13,8 +13,26 @@ const ora_1 = __importDefault(require("ora"));
|
|
|
13
13
|
const sdd_core_1 = require("@applica-software-guru/sdd-core");
|
|
14
14
|
const banner_js_1 = require("../ui/banner.js");
|
|
15
15
|
const format_js_1 = require("../ui/format.js");
|
|
16
|
+
const markdown_js_1 = require("../ui/markdown.js");
|
|
16
17
|
const START_PROMPT = `Read INSTRUCTIONS.md and the documentation in product/ and system/, then run \`sdd sync\` to start working.`;
|
|
17
|
-
function buildBootstrapPrompt(description) {
|
|
18
|
+
function buildBootstrapPrompt(description, auto) {
|
|
19
|
+
if (auto) {
|
|
20
|
+
return `Read INSTRUCTIONS.md first. This is a new SDD project.
|
|
21
|
+
|
|
22
|
+
Project goal: "${description}"
|
|
23
|
+
|
|
24
|
+
Your task: generate the initial documentation for this project based on the description above. Do NOT ask questions — infer reasonable defaults and create all documentation files directly:
|
|
25
|
+
|
|
26
|
+
- product/vision.md — Product vision and goals
|
|
27
|
+
- product/users.md — User personas
|
|
28
|
+
- product/features/*.md — One file per main feature
|
|
29
|
+
- system/entities.md — Data models (use ### headings per entity)
|
|
30
|
+
- system/architecture.md — Architecture decisions
|
|
31
|
+
- system/tech-stack.md — Technologies and frameworks
|
|
32
|
+
- system/interfaces.md — API contracts
|
|
33
|
+
|
|
34
|
+
Follow the file format described in INSTRUCTIONS.md for the YAML frontmatter. Do NOT write any code, only documentation. Commit all created files when done.`;
|
|
35
|
+
}
|
|
18
36
|
return `Read INSTRUCTIONS.md first. This is a new SDD project.
|
|
19
37
|
|
|
20
38
|
Project goal: "${description}"
|
|
@@ -35,25 +53,56 @@ function registerInit(program) {
|
|
|
35
53
|
program
|
|
36
54
|
.command('init <project-name>')
|
|
37
55
|
.description('Initialize a new SDD project')
|
|
38
|
-
.
|
|
39
|
-
.action(async (projectName, options) => {
|
|
56
|
+
.action(async (projectName) => {
|
|
40
57
|
(0, banner_js_1.printBanner)();
|
|
41
58
|
const projectDir = (0, node_path_1.resolve)(process.cwd(), projectName);
|
|
42
59
|
if ((0, node_fs_1.existsSync)((0, node_path_1.resolve)(projectDir, '.sdd'))) {
|
|
43
60
|
console.log(chalk_1.default.yellow(`\n SDD project already initialized at ${projectName}/\n`));
|
|
44
61
|
return;
|
|
45
62
|
}
|
|
63
|
+
const promptTheme = {
|
|
64
|
+
prefix: chalk_1.default.cyan('?'),
|
|
65
|
+
style: { message: (text) => chalk_1.default.cyan.bold(text) },
|
|
66
|
+
};
|
|
46
67
|
const description = await (0, prompts_1.input)({
|
|
47
68
|
message: 'What should your project do?',
|
|
48
|
-
theme:
|
|
49
|
-
prefix: chalk_1.default.cyan('?'),
|
|
50
|
-
style: { message: (text) => chalk_1.default.cyan.bold(text) },
|
|
51
|
-
},
|
|
69
|
+
theme: promptTheme,
|
|
52
70
|
});
|
|
53
71
|
if (!description.trim()) {
|
|
54
72
|
console.log(chalk_1.default.yellow('\n No description provided. Aborting.\n'));
|
|
55
73
|
return;
|
|
56
74
|
}
|
|
75
|
+
const agentChoice = await (0, prompts_1.select)({
|
|
76
|
+
message: 'Which agent do you use?',
|
|
77
|
+
choices: [
|
|
78
|
+
{ value: 'claude', name: 'Claude Code' },
|
|
79
|
+
{ value: 'codex', name: 'Codex' },
|
|
80
|
+
{ value: 'opencode', name: 'OpenCode' },
|
|
81
|
+
{ value: 'other', name: 'Other' },
|
|
82
|
+
],
|
|
83
|
+
theme: promptTheme,
|
|
84
|
+
});
|
|
85
|
+
let agentName = agentChoice;
|
|
86
|
+
let customCommand;
|
|
87
|
+
if (agentChoice === 'other') {
|
|
88
|
+
agentName = await (0, prompts_1.input)({
|
|
89
|
+
message: 'Agent name:',
|
|
90
|
+
theme: promptTheme,
|
|
91
|
+
});
|
|
92
|
+
customCommand = await (0, prompts_1.input)({
|
|
93
|
+
message: 'Agent command (use $PROMPT_FILE for the prompt file path):',
|
|
94
|
+
theme: promptTheme,
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
const bootstrapMode = await (0, prompts_1.select)({
|
|
98
|
+
message: 'How do you want to start?',
|
|
99
|
+
choices: [
|
|
100
|
+
{ value: 'skip', name: 'Write docs manually' },
|
|
101
|
+
{ value: 'prompt', name: 'Generate bootstrap prompt (copy to clipboard)' },
|
|
102
|
+
{ value: 'auto', name: 'Generate and apply bootstrap automatically' },
|
|
103
|
+
],
|
|
104
|
+
theme: promptTheme,
|
|
105
|
+
});
|
|
57
106
|
if (!(0, node_fs_1.existsSync)(projectDir)) {
|
|
58
107
|
(0, node_fs_1.mkdirSync)(projectDir, { recursive: true });
|
|
59
108
|
}
|
|
@@ -63,6 +112,13 @@ function registerInit(program) {
|
|
|
63
112
|
}).start();
|
|
64
113
|
const sdd = new sdd_core_1.SDD({ root: projectDir });
|
|
65
114
|
const files = await sdd.init({ description: description.trim() });
|
|
115
|
+
// Save agent config
|
|
116
|
+
const config = await sdd.config();
|
|
117
|
+
config.agent = agentName;
|
|
118
|
+
if (customCommand) {
|
|
119
|
+
config.agents = { [agentName]: customCommand };
|
|
120
|
+
}
|
|
121
|
+
await (0, sdd_core_1.writeConfig)(projectDir, config);
|
|
66
122
|
spinner.stop();
|
|
67
123
|
// Project created
|
|
68
124
|
console.log(chalk_1.default.cyan.bold(`\n ${chalk_1.default.white(projectName)} is ready!\n`));
|
|
@@ -75,27 +131,55 @@ function registerInit(program) {
|
|
|
75
131
|
console.log((0, format_js_1.success)('product/features/'));
|
|
76
132
|
console.log((0, format_js_1.success)('system/'));
|
|
77
133
|
console.log((0, format_js_1.success)('code/'));
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
134
|
+
if (bootstrapMode === 'auto') {
|
|
135
|
+
const prompt = buildBootstrapPrompt(description.trim(), true);
|
|
136
|
+
console.log(chalk_1.default.dim(' ─'.repeat(30)));
|
|
137
|
+
console.log((0, format_js_1.heading)('Agent Prompt'));
|
|
138
|
+
console.log((0, markdown_js_1.renderMarkdown)(prompt));
|
|
139
|
+
console.log(chalk_1.default.dim(' ─'.repeat(30)));
|
|
140
|
+
console.log((0, format_js_1.info)(`Using agent: ${chalk_1.default.cyan(agentName)}`));
|
|
141
|
+
console.log((0, format_js_1.info)('Starting agent...\n'));
|
|
142
|
+
const exitCode = await (0, sdd_core_1.runAgent)({
|
|
143
|
+
root: projectDir,
|
|
144
|
+
prompt,
|
|
145
|
+
agent: agentName,
|
|
146
|
+
agents: customCommand ? { [agentName]: customCommand } : undefined,
|
|
147
|
+
});
|
|
148
|
+
if (exitCode !== 0) {
|
|
149
|
+
console.log(chalk_1.default.red(`\n Agent exited with code ${exitCode}`));
|
|
150
|
+
process.exit(exitCode);
|
|
151
|
+
}
|
|
152
|
+
console.log(chalk_1.default.green('\n Agent completed successfully.'));
|
|
153
|
+
return;
|
|
154
|
+
}
|
|
155
|
+
if (bootstrapMode === 'prompt') {
|
|
156
|
+
const prompt = buildBootstrapPrompt(description.trim(), false);
|
|
157
|
+
console.log(chalk_1.default.cyan.bold('\n Next steps:\n'));
|
|
158
|
+
console.log(` ${chalk_1.default.white('1.')} Enter the project folder:\n`);
|
|
159
|
+
console.log(` ${chalk_1.default.green(`cd ${projectName}`)}\n`);
|
|
83
160
|
console.log(` ${chalk_1.default.white('2.')} Open your AI agent and paste the prompt below.`);
|
|
84
161
|
console.log(` It will ask you a few questions and generate the initial docs.\n`);
|
|
162
|
+
console.log(chalk_1.default.dim(' ─'.repeat(30)));
|
|
163
|
+
console.log((0, format_js_1.heading)('Agent Prompt'));
|
|
164
|
+
console.log((0, markdown_js_1.renderMarkdown)(prompt));
|
|
165
|
+
try {
|
|
166
|
+
await clipboardy_1.default.write(prompt);
|
|
167
|
+
console.log((0, format_js_1.success)('Copied to clipboard — paste it into your agent.\n'));
|
|
168
|
+
}
|
|
169
|
+
catch {
|
|
170
|
+
console.log((0, format_js_1.info)('Copy the prompt above into your agent.\n'));
|
|
171
|
+
}
|
|
172
|
+
return;
|
|
85
173
|
}
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
: START_PROMPT;
|
|
96
|
-
console.log(chalk_1.default.dim(' ─'.repeat(30)));
|
|
97
|
-
console.log(chalk_1.default.cyan.bold('\n Agent prompt:\n'));
|
|
98
|
-
console.log(chalk_1.default.white(` ${prompt.split('\n').join('\n ')}\n`));
|
|
174
|
+
// skip — manual mode
|
|
175
|
+
console.log(chalk_1.default.cyan.bold('\n Next steps:\n'));
|
|
176
|
+
console.log(` ${chalk_1.default.white('1.')} Enter the project folder:\n`);
|
|
177
|
+
console.log(` ${chalk_1.default.green(`cd ${projectName}`)}\n`);
|
|
178
|
+
console.log(` ${chalk_1.default.white('2.')} Start writing your documentation in ${chalk_1.default.cyan('product/')} and ${chalk_1.default.cyan('system/')}.`);
|
|
179
|
+
console.log(` Check ${chalk_1.default.cyan('INSTRUCTIONS.md')} for the file format.\n`);
|
|
180
|
+
console.log(` ${chalk_1.default.white('3.')} When ready, let your AI agent run:\n`);
|
|
181
|
+
console.log(` ${chalk_1.default.green('sdd sync')}\n`);
|
|
182
|
+
const prompt = START_PROMPT;
|
|
99
183
|
try {
|
|
100
184
|
await clipboardy_1.default.write(prompt);
|
|
101
185
|
console.log((0, format_js_1.success)('Copied to clipboard — paste it into your agent.\n'));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"init.js","sourceRoot":"","sources":["../../src/commands/init.ts"],"names":[],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"init.js","sourceRoot":"","sources":["../../src/commands/init.ts"],"names":[],"mappings":";;;;;AAkDA,oCAsKC;AAvND,kDAA0B;AAC1B,+CAAkD;AAClD,4DAAoC;AACpC,qCAAgD;AAChD,yCAAoC;AACpC,8CAAsB;AACtB,8DAA6E;AAC7E,+CAA8C;AAC9C,+CAAyD;AACzD,mDAAmD;AAEnD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AAG,CAAC,eAAK,CAAC,IAAI,CAAC,IAAI,CAAC,mBAAmB,CAAC,CAAC,CAAC;QAClD,OAAO,CAAC,GAAG,CAAC,KAAK,eAAK,CAAC,KAAK,CAAC,IAAI,CAAC,8BAA8B,CAAC,CAAC;QAClE,OAAO,CAAC,GAAG,CAAC,QAAQ,eAAK,CAAC,KAAK,CAAC,MAAM,WAAW,EAAE,CAAC,IAAI,CAAC,CAAC;QAC1D,OAAO,CAAC,GAAG,CAAC,KAAK,eAAK,CAAC,KAAK,CAAC,IAAI,CAAC,wCAAwC,eAAK,CAAC,IAAI,CAAC,UAAU,CAAC,QAAQ,eAAK,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC;QAClI,OAAO,CAAC,GAAG,CAAC,cAAc,eAAK,CAAC,IAAI,CAAC,iBAAiB,CAAC,yBAAyB,CAAC,CAAC;QAClF,OAAO,CAAC,GAAG,CAAC,KAAK,eAAK,CAAC,KAAK,CAAC,IAAI,CAAC,uCAAuC,CAAC,CAAC;QAC3E,OAAO,CAAC,GAAG,CAAC,QAAQ,eAAK,CAAC,KAAK,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;QAEjD,MAAM,MAAM,GAAG,YAAY,CAAC;QAE5B,IAAI,CAAC;YACH,MAAM,oBAAU,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;YAC/B,OAAO,CAAC,GAAG,CAAC,IAAA,mBAAO,EAAC,mDAAmD,CAAC,CAAC,CAAC;QAC5E,CAAC;QAAC,MAAM,CAAC;YACP,OAAO,CAAC,GAAG,CAAC,IAAA,gBAAI,EAAC,0CAA0C,CAAC,CAAC,CAAC;QAChE,CAAC;IACH,CAAC,CAAC,CAAC;AACP,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -9,11 +9,13 @@ const sync_js_1 = require("./commands/sync.js");
|
|
|
9
9
|
const validate_js_1 = require("./commands/validate.js");
|
|
10
10
|
const mark_synced_js_1 = require("./commands/mark-synced.js");
|
|
11
11
|
const cr_js_1 = require("./commands/cr.js");
|
|
12
|
+
const bug_js_1 = require("./commands/bug.js");
|
|
13
|
+
const apply_js_1 = require("./commands/apply.js");
|
|
12
14
|
const program = new commander_1.Command();
|
|
13
15
|
program
|
|
14
16
|
.name('sdd')
|
|
15
17
|
.description('Story Driven Development — manage apps through structured documentation')
|
|
16
|
-
.version('0.
|
|
18
|
+
.version('1.0.1');
|
|
17
19
|
(0, init_js_1.registerInit)(program);
|
|
18
20
|
(0, status_js_1.registerStatus)(program);
|
|
19
21
|
(0, diff_js_1.registerDiff)(program);
|
|
@@ -21,6 +23,8 @@ program
|
|
|
21
23
|
(0, validate_js_1.registerValidate)(program);
|
|
22
24
|
(0, mark_synced_js_1.registerMarkSynced)(program);
|
|
23
25
|
(0, cr_js_1.registerCR)(program);
|
|
26
|
+
(0, bug_js_1.registerBug)(program);
|
|
27
|
+
(0, apply_js_1.registerApply)(program);
|
|
24
28
|
program.parseAsync().catch((err) => {
|
|
25
29
|
console.error(err.message);
|
|
26
30
|
process.exit(1);
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AACA,yCAAoC;AACpC,gDAAkD;AAClD,oDAAsD;AACtD,gDAAkD;AAClD,gDAAkD;AAClD,wDAA0D;AAC1D,8DAA+D;AAC/D,4CAA8C;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AACA,yCAAoC;AACpC,gDAAkD;AAClD,oDAAsD;AACtD,gDAAkD;AAClD,gDAAkD;AAClD,wDAA0D;AAC1D,8DAA+D;AAC/D,4CAA8C;AAC9C,8CAAgD;AAChD,kDAAoD;AAEpD,MAAM,OAAO,GAAG,IAAI,mBAAO,EAAE,CAAC;AAE9B,OAAO;KACJ,IAAI,CAAC,KAAK,CAAC;KACX,WAAW,CAAC,yEAAyE,CAAC;KACtF,OAAO,CAAC,OAAO,CAAC,CAAC;AAEpB,IAAA,sBAAY,EAAC,OAAO,CAAC,CAAC;AACtB,IAAA,0BAAc,EAAC,OAAO,CAAC,CAAC;AACxB,IAAA,sBAAY,EAAC,OAAO,CAAC,CAAC;AACtB,IAAA,sBAAY,EAAC,OAAO,CAAC,CAAC;AACtB,IAAA,8BAAgB,EAAC,OAAO,CAAC,CAAC;AAC1B,IAAA,mCAAkB,EAAC,OAAO,CAAC,CAAC;AAC5B,IAAA,kBAAU,EAAC,OAAO,CAAC,CAAC;AACpB,IAAA,oBAAW,EAAC,OAAO,CAAC,CAAC;AACrB,IAAA,wBAAa,EAAC,OAAO,CAAC,CAAC;AAEvB,OAAO,CAAC,UAAU,EAAE,CAAC,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE;IACjC,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;IAC3B,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"markdown.d.ts","sourceRoot":"","sources":["../../src/ui/markdown.ts"],"names":[],"mappings":"AAKA,wBAAgB,cAAc,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,CAEjD"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.renderMarkdown = renderMarkdown;
|
|
4
|
+
const marked_1 = require("marked");
|
|
5
|
+
const marked_terminal_1 = require("marked-terminal");
|
|
6
|
+
const marked = new marked_1.Marked((0, marked_terminal_1.markedTerminal)());
|
|
7
|
+
function renderMarkdown(md) {
|
|
8
|
+
return marked.parse(md);
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=markdown.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"markdown.js","sourceRoot":"","sources":["../../src/ui/markdown.ts"],"names":[],"mappings":";;AAKA,wCAEC;AAPD,mCAAgC;AAChC,qDAAiD;AAEjD,MAAM,MAAM,GAAG,IAAI,eAAM,CAAC,IAAA,gCAAc,GAAE,CAAC,CAAC;AAE5C,SAAgB,cAAc,CAAC,EAAU;IACvC,OAAO,MAAM,CAAC,KAAK,CAAC,EAAE,CAAW,CAAC;AACpC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@applica-software-guru/sdd",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "1.0.1",
|
|
4
4
|
"description": "CLI for Story Driven Development",
|
|
5
5
|
"author": "Bruno Fortunato <bruno.fortunato@applica.guru>",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -11,12 +11,14 @@
|
|
|
11
11
|
"build": "tsc"
|
|
12
12
|
},
|
|
13
13
|
"dependencies": {
|
|
14
|
+
"@applica-software-guru/sdd-core": "^1.0.0",
|
|
14
15
|
"@inquirer/prompts": "^7.0.0",
|
|
15
|
-
"@applica-software-guru/sdd-core": "^0.2.0",
|
|
16
16
|
"chalk": "^4.1.2",
|
|
17
17
|
"cli-table3": "^0.6.5",
|
|
18
18
|
"clipboardy": "^2.3.0",
|
|
19
19
|
"commander": "^13.0.0",
|
|
20
|
+
"marked": "^15.0.12",
|
|
21
|
+
"marked-terminal": "^7.3.0",
|
|
20
22
|
"ora": "^5.4.1"
|
|
21
23
|
}
|
|
22
24
|
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { Command } from 'commander';
|
|
2
|
+
import chalk from 'chalk';
|
|
3
|
+
import { SDD, runAgent } from '@applica-software-guru/sdd-core';
|
|
4
|
+
import { heading, info } from '../ui/format.js';
|
|
5
|
+
import { renderMarkdown } from '../ui/markdown.js';
|
|
6
|
+
|
|
7
|
+
export function registerApply(program: Command): void {
|
|
8
|
+
program
|
|
9
|
+
.command('apply')
|
|
10
|
+
.description('Run the full SDD workflow automatically using an external AI agent')
|
|
11
|
+
.option('--agent <name>', 'Agent to use (default: from config or "claude")')
|
|
12
|
+
.action(async (options) => {
|
|
13
|
+
const sdd = new SDD({ root: process.cwd() });
|
|
14
|
+
|
|
15
|
+
console.log(heading('SDD Apply'));
|
|
16
|
+
|
|
17
|
+
const prompt = await sdd.applyPrompt();
|
|
18
|
+
if (!prompt) {
|
|
19
|
+
console.log(info('Nothing to apply — no open bugs, pending CRs, or pending files.'));
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
// Show the prompt being sent
|
|
24
|
+
console.log(chalk.dim(' ─'.repeat(30)));
|
|
25
|
+
console.log(heading('Agent Prompt'));
|
|
26
|
+
console.log(renderMarkdown(prompt));
|
|
27
|
+
console.log(chalk.dim(' ─'.repeat(30)));
|
|
28
|
+
|
|
29
|
+
const config = await sdd.config();
|
|
30
|
+
const agent = options.agent ?? config.agent ?? 'claude';
|
|
31
|
+
|
|
32
|
+
console.log(info(`Using agent: ${chalk.cyan(agent)}`));
|
|
33
|
+
console.log(info('Starting agent...\n'));
|
|
34
|
+
|
|
35
|
+
const exitCode = await runAgent({
|
|
36
|
+
root: process.cwd(),
|
|
37
|
+
prompt,
|
|
38
|
+
agent,
|
|
39
|
+
agents: config.agents,
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
if (exitCode !== 0) {
|
|
43
|
+
console.log(chalk.red(`\n Agent exited with code ${exitCode}`));
|
|
44
|
+
process.exit(exitCode);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
console.log(chalk.green('\n Agent completed successfully.'));
|
|
48
|
+
});
|
|
49
|
+
}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { Command } from 'commander';
|
|
2
|
+
import chalk from 'chalk';
|
|
3
|
+
import { SDD } from '@applica-software-guru/sdd-core';
|
|
4
|
+
import { heading, info } from '../ui/format.js';
|
|
5
|
+
|
|
6
|
+
function statusLabel(status: string): string {
|
|
7
|
+
switch (status) {
|
|
8
|
+
case 'open':
|
|
9
|
+
return chalk.yellow('open');
|
|
10
|
+
case 'resolved':
|
|
11
|
+
return chalk.green('resolved');
|
|
12
|
+
default:
|
|
13
|
+
return chalk.gray(status);
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export function registerBug(program: Command): void {
|
|
18
|
+
const bug = program
|
|
19
|
+
.command('bug')
|
|
20
|
+
.description('Manage bugs');
|
|
21
|
+
|
|
22
|
+
bug.command('list')
|
|
23
|
+
.description('List all bugs with their status')
|
|
24
|
+
.action(async () => {
|
|
25
|
+
const sdd = new SDD({ root: process.cwd() });
|
|
26
|
+
const bugs = await sdd.bugs();
|
|
27
|
+
|
|
28
|
+
console.log(heading('Bugs'));
|
|
29
|
+
|
|
30
|
+
if (bugs.length === 0) {
|
|
31
|
+
console.log(info('No bugs found.\n'));
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
for (const b of bugs) {
|
|
36
|
+
const icon = b.frontmatter.status === 'resolved' ? chalk.green(' ✓') : chalk.yellow(' ●');
|
|
37
|
+
console.log(`${icon} ${chalk.white(b.relativePath)} ${chalk.dim(`[${statusLabel(b.frontmatter.status)}]`)} ${chalk.cyan(b.frontmatter.title)}`);
|
|
38
|
+
}
|
|
39
|
+
console.log('');
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
bug.command('open')
|
|
43
|
+
.description('Show open bugs for the agent to process')
|
|
44
|
+
.action(async () => {
|
|
45
|
+
const sdd = new SDD({ root: process.cwd() });
|
|
46
|
+
const open = await sdd.openBugs();
|
|
47
|
+
|
|
48
|
+
if (open.length === 0) {
|
|
49
|
+
console.log(heading('Bugs'));
|
|
50
|
+
console.log(info('No open bugs.\n'));
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
console.log(heading(`Open Bugs (${open.length})`));
|
|
55
|
+
|
|
56
|
+
for (const b of open) {
|
|
57
|
+
console.log(chalk.cyan.bold(` --- ${b.relativePath} ---`));
|
|
58
|
+
console.log(chalk.cyan(` Title: ${b.frontmatter.title}`));
|
|
59
|
+
console.log('');
|
|
60
|
+
console.log(b.body.trim().split('\n').map((line: string) => ` ${line}`).join('\n'));
|
|
61
|
+
console.log('');
|
|
62
|
+
}
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
program
|
|
66
|
+
.command('mark-bug-resolved [files...]')
|
|
67
|
+
.description('Mark bugs as resolved')
|
|
68
|
+
.action(async (files: string[]) => {
|
|
69
|
+
const sdd = new SDD({ root: process.cwd() });
|
|
70
|
+
const marked = await sdd.markBugResolved(files.length > 0 ? files : undefined);
|
|
71
|
+
|
|
72
|
+
console.log(heading('Mark Bug Resolved'));
|
|
73
|
+
|
|
74
|
+
if (marked.length === 0) {
|
|
75
|
+
console.log(info('No open bugs to mark.\n'));
|
|
76
|
+
return;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
for (const f of marked) {
|
|
80
|
+
console.log(chalk.green(` ✓ ${f}`));
|
|
81
|
+
}
|
|
82
|
+
console.log(chalk.dim(`\n ${marked.length} bug(s) marked as resolved.\n`));
|
|
83
|
+
});
|
|
84
|
+
}
|
package/src/commands/init.ts
CHANGED
|
@@ -1,17 +1,36 @@
|
|
|
1
1
|
import { Command } from 'commander';
|
|
2
2
|
import chalk from 'chalk';
|
|
3
|
-
import { input } from '@inquirer/prompts';
|
|
3
|
+
import { input, select } from '@inquirer/prompts';
|
|
4
4
|
import clipboardy from 'clipboardy';
|
|
5
5
|
import { existsSync, mkdirSync } from 'node:fs';
|
|
6
6
|
import { resolve } from 'node:path';
|
|
7
7
|
import ora from 'ora';
|
|
8
|
-
import { SDD } from '@applica-software-guru/sdd-core';
|
|
8
|
+
import { SDD, writeConfig, runAgent } from '@applica-software-guru/sdd-core';
|
|
9
9
|
import { printBanner } from '../ui/banner.js';
|
|
10
|
-
import { success, info } from '../ui/format.js';
|
|
10
|
+
import { success, info, heading } from '../ui/format.js';
|
|
11
|
+
import { renderMarkdown } from '../ui/markdown.js';
|
|
11
12
|
|
|
12
13
|
const START_PROMPT = `Read INSTRUCTIONS.md and the documentation in product/ and system/, then run \`sdd sync\` to start working.`;
|
|
13
14
|
|
|
14
|
-
function buildBootstrapPrompt(description: string): string {
|
|
15
|
+
function buildBootstrapPrompt(description: string, auto: boolean): string {
|
|
16
|
+
if (auto) {
|
|
17
|
+
return `Read INSTRUCTIONS.md first. This is a new SDD project.
|
|
18
|
+
|
|
19
|
+
Project goal: "${description}"
|
|
20
|
+
|
|
21
|
+
Your task: generate the initial documentation for this project based on the description above. Do NOT ask questions — infer reasonable defaults and create all documentation files directly:
|
|
22
|
+
|
|
23
|
+
- product/vision.md — Product vision and goals
|
|
24
|
+
- product/users.md — User personas
|
|
25
|
+
- product/features/*.md — One file per main feature
|
|
26
|
+
- system/entities.md — Data models (use ### headings per entity)
|
|
27
|
+
- system/architecture.md — Architecture decisions
|
|
28
|
+
- system/tech-stack.md — Technologies and frameworks
|
|
29
|
+
- system/interfaces.md — API contracts
|
|
30
|
+
|
|
31
|
+
Follow the file format described in INSTRUCTIONS.md for the YAML frontmatter. Do NOT write any code, only documentation. Commit all created files when done.`;
|
|
32
|
+
}
|
|
33
|
+
|
|
15
34
|
return `Read INSTRUCTIONS.md first. This is a new SDD project.
|
|
16
35
|
|
|
17
36
|
Project goal: "${description}"
|
|
@@ -33,8 +52,7 @@ export function registerInit(program: Command): void {
|
|
|
33
52
|
program
|
|
34
53
|
.command('init <project-name>')
|
|
35
54
|
.description('Initialize a new SDD project')
|
|
36
|
-
.
|
|
37
|
-
.action(async (projectName: string, options) => {
|
|
55
|
+
.action(async (projectName: string) => {
|
|
38
56
|
printBanner();
|
|
39
57
|
|
|
40
58
|
const projectDir = resolve(process.cwd(), projectName);
|
|
@@ -44,12 +62,14 @@ export function registerInit(program: Command): void {
|
|
|
44
62
|
return;
|
|
45
63
|
}
|
|
46
64
|
|
|
65
|
+
const promptTheme = {
|
|
66
|
+
prefix: chalk.cyan('?'),
|
|
67
|
+
style: { message: (text: string) => chalk.cyan.bold(text) },
|
|
68
|
+
};
|
|
69
|
+
|
|
47
70
|
const description = await input({
|
|
48
71
|
message: 'What should your project do?',
|
|
49
|
-
theme:
|
|
50
|
-
prefix: chalk.cyan('?'),
|
|
51
|
-
style: { message: (text: string) => chalk.cyan.bold(text) },
|
|
52
|
-
},
|
|
72
|
+
theme: promptTheme,
|
|
53
73
|
});
|
|
54
74
|
|
|
55
75
|
if (!description.trim()) {
|
|
@@ -57,6 +77,41 @@ export function registerInit(program: Command): void {
|
|
|
57
77
|
return;
|
|
58
78
|
}
|
|
59
79
|
|
|
80
|
+
const agentChoice = await select({
|
|
81
|
+
message: 'Which agent do you use?',
|
|
82
|
+
choices: [
|
|
83
|
+
{ value: 'claude', name: 'Claude Code' },
|
|
84
|
+
{ value: 'codex', name: 'Codex' },
|
|
85
|
+
{ value: 'opencode', name: 'OpenCode' },
|
|
86
|
+
{ value: 'other', name: 'Other' },
|
|
87
|
+
],
|
|
88
|
+
theme: promptTheme,
|
|
89
|
+
});
|
|
90
|
+
|
|
91
|
+
let agentName = agentChoice;
|
|
92
|
+
let customCommand: string | undefined;
|
|
93
|
+
|
|
94
|
+
if (agentChoice === 'other') {
|
|
95
|
+
agentName = await input({
|
|
96
|
+
message: 'Agent name:',
|
|
97
|
+
theme: promptTheme,
|
|
98
|
+
});
|
|
99
|
+
customCommand = await input({
|
|
100
|
+
message: 'Agent command (use $PROMPT_FILE for the prompt file path):',
|
|
101
|
+
theme: promptTheme,
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
const bootstrapMode = await select({
|
|
106
|
+
message: 'How do you want to start?',
|
|
107
|
+
choices: [
|
|
108
|
+
{ value: 'skip', name: 'Write docs manually' },
|
|
109
|
+
{ value: 'prompt', name: 'Generate bootstrap prompt (copy to clipboard)' },
|
|
110
|
+
{ value: 'auto', name: 'Generate and apply bootstrap automatically' },
|
|
111
|
+
],
|
|
112
|
+
theme: promptTheme,
|
|
113
|
+
});
|
|
114
|
+
|
|
60
115
|
if (!existsSync(projectDir)) {
|
|
61
116
|
mkdirSync(projectDir, { recursive: true });
|
|
62
117
|
}
|
|
@@ -69,6 +124,14 @@ export function registerInit(program: Command): void {
|
|
|
69
124
|
const sdd = new SDD({ root: projectDir });
|
|
70
125
|
const files = await sdd.init({ description: description.trim() });
|
|
71
126
|
|
|
127
|
+
// Save agent config
|
|
128
|
+
const config = await sdd.config();
|
|
129
|
+
config.agent = agentName;
|
|
130
|
+
if (customCommand) {
|
|
131
|
+
config.agents = { [agentName]: customCommand };
|
|
132
|
+
}
|
|
133
|
+
await writeConfig(projectDir, config);
|
|
134
|
+
|
|
72
135
|
spinner.stop();
|
|
73
136
|
|
|
74
137
|
// Project created
|
|
@@ -84,31 +147,65 @@ export function registerInit(program: Command): void {
|
|
|
84
147
|
console.log(success('system/'));
|
|
85
148
|
console.log(success('code/'));
|
|
86
149
|
|
|
87
|
-
|
|
88
|
-
|
|
150
|
+
if (bootstrapMode === 'auto') {
|
|
151
|
+
const prompt = buildBootstrapPrompt(description.trim(), true);
|
|
89
152
|
|
|
90
|
-
|
|
91
|
-
|
|
153
|
+
console.log(chalk.dim(' ─'.repeat(30)));
|
|
154
|
+
console.log(heading('Agent Prompt'));
|
|
155
|
+
console.log(renderMarkdown(prompt));
|
|
156
|
+
console.log(chalk.dim(' ─'.repeat(30)));
|
|
157
|
+
|
|
158
|
+
console.log(info(`Using agent: ${chalk.cyan(agentName)}`));
|
|
159
|
+
console.log(info('Starting agent...\n'));
|
|
160
|
+
|
|
161
|
+
const exitCode = await runAgent({
|
|
162
|
+
root: projectDir,
|
|
163
|
+
prompt,
|
|
164
|
+
agent: agentName,
|
|
165
|
+
agents: customCommand ? { [agentName]: customCommand } : undefined,
|
|
166
|
+
});
|
|
167
|
+
|
|
168
|
+
if (exitCode !== 0) {
|
|
169
|
+
console.log(chalk.red(`\n Agent exited with code ${exitCode}`));
|
|
170
|
+
process.exit(exitCode);
|
|
171
|
+
}
|
|
92
172
|
|
|
93
|
-
|
|
173
|
+
console.log(chalk.green('\n Agent completed successfully.'));
|
|
174
|
+
return;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
if (bootstrapMode === 'prompt') {
|
|
178
|
+
const prompt = buildBootstrapPrompt(description.trim(), false);
|
|
179
|
+
|
|
180
|
+
console.log(chalk.cyan.bold('\n Next steps:\n'));
|
|
181
|
+
console.log(` ${chalk.white('1.')} Enter the project folder:\n`);
|
|
182
|
+
console.log(` ${chalk.green(`cd ${projectName}`)}\n`);
|
|
94
183
|
console.log(` ${chalk.white('2.')} Open your AI agent and paste the prompt below.`);
|
|
95
184
|
console.log(` It will ask you a few questions and generate the initial docs.\n`);
|
|
96
|
-
} else {
|
|
97
|
-
console.log(` ${chalk.white('2.')} Start writing your documentation in ${chalk.cyan('product/')} and ${chalk.cyan('system/')}.`);
|
|
98
|
-
console.log(` Check ${chalk.cyan('INSTRUCTIONS.md')} for the file format.\n`);
|
|
99
185
|
|
|
100
|
-
console.log(
|
|
101
|
-
console.log(
|
|
186
|
+
console.log(chalk.dim(' ─'.repeat(30)));
|
|
187
|
+
console.log(heading('Agent Prompt'));
|
|
188
|
+
console.log(renderMarkdown(prompt));
|
|
189
|
+
|
|
190
|
+
try {
|
|
191
|
+
await clipboardy.write(prompt);
|
|
192
|
+
console.log(success('Copied to clipboard — paste it into your agent.\n'));
|
|
193
|
+
} catch {
|
|
194
|
+
console.log(info('Copy the prompt above into your agent.\n'));
|
|
195
|
+
}
|
|
196
|
+
return;
|
|
102
197
|
}
|
|
103
198
|
|
|
104
|
-
//
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
199
|
+
// skip — manual mode
|
|
200
|
+
console.log(chalk.cyan.bold('\n Next steps:\n'));
|
|
201
|
+
console.log(` ${chalk.white('1.')} Enter the project folder:\n`);
|
|
202
|
+
console.log(` ${chalk.green(`cd ${projectName}`)}\n`);
|
|
203
|
+
console.log(` ${chalk.white('2.')} Start writing your documentation in ${chalk.cyan('product/')} and ${chalk.cyan('system/')}.`);
|
|
204
|
+
console.log(` Check ${chalk.cyan('INSTRUCTIONS.md')} for the file format.\n`);
|
|
205
|
+
console.log(` ${chalk.white('3.')} When ready, let your AI agent run:\n`);
|
|
206
|
+
console.log(` ${chalk.green('sdd sync')}\n`);
|
|
108
207
|
|
|
109
|
-
|
|
110
|
-
console.log(chalk.cyan.bold('\n Agent prompt:\n'));
|
|
111
|
-
console.log(chalk.white(` ${prompt.split('\n').join('\n ')}\n`));
|
|
208
|
+
const prompt = START_PROMPT;
|
|
112
209
|
|
|
113
210
|
try {
|
|
114
211
|
await clipboardy.write(prompt);
|
package/src/index.ts
CHANGED
|
@@ -7,13 +7,15 @@ import { registerSync } from './commands/sync.js';
|
|
|
7
7
|
import { registerValidate } from './commands/validate.js';
|
|
8
8
|
import { registerMarkSynced } from './commands/mark-synced.js';
|
|
9
9
|
import { registerCR } from './commands/cr.js';
|
|
10
|
+
import { registerBug } from './commands/bug.js';
|
|
11
|
+
import { registerApply } from './commands/apply.js';
|
|
10
12
|
|
|
11
13
|
const program = new Command();
|
|
12
14
|
|
|
13
15
|
program
|
|
14
16
|
.name('sdd')
|
|
15
17
|
.description('Story Driven Development — manage apps through structured documentation')
|
|
16
|
-
.version('0.
|
|
18
|
+
.version('1.0.1');
|
|
17
19
|
|
|
18
20
|
registerInit(program);
|
|
19
21
|
registerStatus(program);
|
|
@@ -22,6 +24,8 @@ registerSync(program);
|
|
|
22
24
|
registerValidate(program);
|
|
23
25
|
registerMarkSynced(program);
|
|
24
26
|
registerCR(program);
|
|
27
|
+
registerBug(program);
|
|
28
|
+
registerApply(program);
|
|
25
29
|
|
|
26
30
|
program.parseAsync().catch((err) => {
|
|
27
31
|
console.error(err.message);
|