@applica-software-guru/sdd 1.8.1 → 1.8.3
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/bug.d.ts.map +1 -1
- package/dist/commands/bug.js +1 -13
- package/dist/commands/bug.js.map +1 -1
- package/dist/commands/cr.d.ts.map +1 -1
- package/dist/commands/cr.js +1 -13
- package/dist/commands/cr.js.map +1 -1
- package/dist/commands/drafts.d.ts +3 -0
- package/dist/commands/drafts.d.ts.map +1 -0
- package/dist/commands/drafts.js +56 -0
- package/dist/commands/drafts.js.map +1 -0
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +9 -6
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/remote.d.ts.map +1 -1
- package/dist/commands/remote.js +46 -0
- package/dist/commands/remote.js.map +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/ui/format.d.ts +2 -0
- package/dist/ui/format.d.ts.map +1 -1
- package/dist/ui/format.js +26 -0
- package/dist/ui/format.js.map +1 -1
- package/package.json +3 -3
- package/skills/sdd/SKILL.md +8 -0
- package/skills/sdd-remote/SKILL.md +128 -0
- package/src/commands/bug.ts +2 -15
- package/src/commands/cr.ts +2 -15
- package/src/commands/drafts.ts +57 -0
- package/src/commands/init.ts +9 -6
- package/src/commands/remote.ts +51 -1
- package/src/index.ts +2 -2
- package/src/ui/format.ts +26 -0
- package/dist/commands/apply.d.ts +0 -3
- package/dist/commands/apply.d.ts.map +0 -1
- package/dist/commands/apply.js +0 -46
- package/dist/commands/apply.js.map +0 -1
- package/src/commands/apply.ts +0 -49
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bug.d.ts","sourceRoot":"","sources":["../../src/commands/bug.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"bug.d.ts","sourceRoot":"","sources":["../../src/commands/bug.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAKpC,wBAAgB,WAAW,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAmElD"}
|
package/dist/commands/bug.js
CHANGED
|
@@ -7,18 +7,6 @@ exports.registerBug = registerBug;
|
|
|
7
7
|
const chalk_1 = __importDefault(require("chalk"));
|
|
8
8
|
const sdd_core_1 = require("@applica-software-guru/sdd-core");
|
|
9
9
|
const format_js_1 = require("../ui/format.js");
|
|
10
|
-
function statusLabel(status) {
|
|
11
|
-
switch (status) {
|
|
12
|
-
case 'draft':
|
|
13
|
-
return chalk_1.default.magenta('draft');
|
|
14
|
-
case 'open':
|
|
15
|
-
return chalk_1.default.yellow('open');
|
|
16
|
-
case 'resolved':
|
|
17
|
-
return chalk_1.default.green('resolved');
|
|
18
|
-
default:
|
|
19
|
-
return chalk_1.default.gray(status);
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
10
|
function registerBug(program) {
|
|
23
11
|
const bug = program
|
|
24
12
|
.command('bug')
|
|
@@ -35,7 +23,7 @@ function registerBug(program) {
|
|
|
35
23
|
}
|
|
36
24
|
for (const b of bugs) {
|
|
37
25
|
const icon = b.frontmatter.status === 'resolved' ? chalk_1.default.green(' ✓') : b.frontmatter.status === 'draft' ? chalk_1.default.magenta(' ◇') : chalk_1.default.yellow(' ●');
|
|
38
|
-
console.log(`${icon} ${chalk_1.default.white(b.relativePath)} ${chalk_1.default.dim(`[${
|
|
26
|
+
console.log(`${icon} ${chalk_1.default.white(b.relativePath)} ${chalk_1.default.dim(`[${(0, format_js_1.bugStatusLabel)(b.frontmatter.status)}]`)} ${chalk_1.default.cyan(b.frontmatter.title)}`);
|
|
39
27
|
}
|
|
40
28
|
console.log('');
|
|
41
29
|
});
|
package/dist/commands/bug.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bug.js","sourceRoot":"","sources":["../../src/commands/bug.ts"],"names":[],"mappings":";;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"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"cr.d.ts","sourceRoot":"","sources":["../../src/commands/cr.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAKpC,wBAAgB,UAAU,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAmEjD"}
|
package/dist/commands/cr.js
CHANGED
|
@@ -7,18 +7,6 @@ exports.registerCR = registerCR;
|
|
|
7
7
|
const chalk_1 = __importDefault(require("chalk"));
|
|
8
8
|
const sdd_core_1 = require("@applica-software-guru/sdd-core");
|
|
9
9
|
const format_js_1 = require("../ui/format.js");
|
|
10
|
-
function statusLabel(status) {
|
|
11
|
-
switch (status) {
|
|
12
|
-
case 'draft':
|
|
13
|
-
return chalk_1.default.magenta('draft');
|
|
14
|
-
case 'pending':
|
|
15
|
-
return chalk_1.default.yellow('pending');
|
|
16
|
-
case 'applied':
|
|
17
|
-
return chalk_1.default.green('applied');
|
|
18
|
-
default:
|
|
19
|
-
return chalk_1.default.gray(status);
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
10
|
function registerCR(program) {
|
|
23
11
|
const cr = program
|
|
24
12
|
.command('cr')
|
|
@@ -35,7 +23,7 @@ function registerCR(program) {
|
|
|
35
23
|
}
|
|
36
24
|
for (const cr of crs) {
|
|
37
25
|
const icon = cr.frontmatter.status === 'applied' ? chalk_1.default.green(' ✓') : cr.frontmatter.status === 'draft' ? chalk_1.default.magenta(' ◇') : chalk_1.default.yellow(' ●');
|
|
38
|
-
console.log(`${icon} ${chalk_1.default.white(cr.relativePath)} ${chalk_1.default.dim(`[${
|
|
26
|
+
console.log(`${icon} ${chalk_1.default.white(cr.relativePath)} ${chalk_1.default.dim(`[${(0, format_js_1.crStatusLabel)(cr.frontmatter.status)}]`)} ${chalk_1.default.cyan(cr.frontmatter.title)}`);
|
|
39
27
|
}
|
|
40
28
|
console.log('');
|
|
41
29
|
});
|
package/dist/commands/cr.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cr.js","sourceRoot":"","sources":["../../src/commands/cr.ts"],"names":[],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"cr.js","sourceRoot":"","sources":["../../src/commands/cr.ts"],"names":[],"mappings":";;;;;AAKA,gCAmEC;AAvED,kDAA0B;AAC1B,8DAAsD;AACtD,+CAA+D;AAE/D,SAAgB,UAAU,CAAC,OAAgB;IACzC,MAAM,EAAE,GAAG,OAAO;SACf,OAAO,CAAC,IAAI,CAAC;SACb,WAAW,CAAC,wBAAwB,CAAC,CAAC;IAEzC,EAAE,CAAC,OAAO,CAAC,MAAM,CAAC;SACf,WAAW,CAAC,4CAA4C,CAAC;SACzD,MAAM,CAAC,KAAK,IAAI,EAAE;QACjB,MAAM,GAAG,GAAG,IAAI,cAAG,CAAC,EAAE,IAAI,EAAE,OAAO,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;QAC7C,MAAM,GAAG,GAAG,MAAM,GAAG,CAAC,cAAc,EAAE,CAAC;QAEvC,OAAO,CAAC,GAAG,CAAC,IAAA,mBAAO,EAAC,iBAAiB,CAAC,CAAC,CAAC;QAExC,IAAI,GAAG,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YACrB,OAAO,CAAC,GAAG,CAAC,IAAA,gBAAI,EAAC,6BAA6B,CAAC,CAAC,CAAC;YACjD,OAAO;QACT,CAAC;QAED,KAAK,MAAM,EAAE,IAAI,GAAG,EAAE,CAAC;YACrB,MAAM,IAAI,GAAG,EAAE,CAAC,WAAW,CAAC,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,eAAK,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,WAAW,CAAC,MAAM,KAAK,OAAO,CAAC,CAAC,CAAC,eAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,eAAK,CAAC,MAAM,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,CAAC,CAAC;IACxF,CAAC,CAAC,CAAC;AACP,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"drafts.d.ts","sourceRoot":"","sources":["../../src/commands/drafts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAMpC,wBAAgB,cAAc,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAkDrD"}
|
|
@@ -0,0 +1,56 @@
|
|
|
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.registerDrafts = registerDrafts;
|
|
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 registerDrafts(program) {
|
|
12
|
+
program
|
|
13
|
+
.command('drafts')
|
|
14
|
+
.description('List draft docs/CRs/bugs and print a TODO prompt for the agent')
|
|
15
|
+
.action(async () => {
|
|
16
|
+
const sdd = new sdd_core_1.SDD({ root: process.cwd() });
|
|
17
|
+
console.log((0, format_js_1.heading)('Drafts'));
|
|
18
|
+
const drafts = await sdd.drafts();
|
|
19
|
+
const total = drafts.docs.length + drafts.crs.length + drafts.bugs.length;
|
|
20
|
+
if (total === 0) {
|
|
21
|
+
console.log((0, format_js_1.info)('No draft elements found.'));
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
24
|
+
console.log((0, format_js_1.info)(`Found ${total} draft element(s):`));
|
|
25
|
+
if (drafts.docs.length > 0) {
|
|
26
|
+
console.log(chalk_1.default.dim(` Documents (${drafts.docs.length})`));
|
|
27
|
+
for (const f of drafts.docs) {
|
|
28
|
+
console.log(chalk_1.default.magenta(` ◇ ${f.relativePath}`));
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
if (drafts.crs.length > 0) {
|
|
32
|
+
console.log(chalk_1.default.dim(` Change Requests (${drafts.crs.length})`));
|
|
33
|
+
for (const cr of drafts.crs) {
|
|
34
|
+
console.log(chalk_1.default.magenta(` ◇ ${cr.relativePath}`));
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
if (drafts.bugs.length > 0) {
|
|
38
|
+
console.log(chalk_1.default.dim(` Bugs (${drafts.bugs.length})`));
|
|
39
|
+
for (const bug of drafts.bugs) {
|
|
40
|
+
console.log(chalk_1.default.magenta(` ◇ ${bug.relativePath}`));
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
console.log('');
|
|
44
|
+
const prompt = await sdd.draftEnrichmentPrompt();
|
|
45
|
+
if (!prompt) {
|
|
46
|
+
console.log((0, format_js_1.info)('Drafts are present but no enrichment prompt could be generated.'));
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
49
|
+
console.log(chalk_1.default.dim(' ─'.repeat(30)));
|
|
50
|
+
console.log((0, format_js_1.heading)('Draft TODO'));
|
|
51
|
+
console.log((0, markdown_js_1.renderMarkdown)(prompt));
|
|
52
|
+
console.log(chalk_1.default.dim(' ─'.repeat(30)));
|
|
53
|
+
console.log((0, format_js_1.info)('After enrichment, run `sdd mark-drafts-enriched` when drafts are ready.'));
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
//# sourceMappingURL=drafts.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"drafts.js","sourceRoot":"","sources":["../../src/commands/drafts.ts"],"names":[],"mappings":";;;;;AAMA,wCAkDC;AAvDD,kDAA0B;AAC1B,8DAAsD;AACtD,+CAAgD;AAChD,mDAAmD;AAEnD,SAAgB,cAAc,CAAC,OAAgB;IAC7C,OAAO;SACJ,OAAO,CAAC,QAAQ,CAAC;SACjB,WAAW,CAAC,gEAAgE,CAAC;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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;AAqDpC,wBAAgB,YAAY,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CA2InD"}
|
package/dist/commands/init.js
CHANGED
|
@@ -14,10 +14,10 @@ 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
16
|
const markdown_js_1 = require("../ui/markdown.js");
|
|
17
|
-
const START_PROMPT = `
|
|
17
|
+
const START_PROMPT = `Use the \`sdd\` skill and the documentation in product/ and system/, then run \`sdd sync\` to start working.`;
|
|
18
18
|
function buildBootstrapPrompt(description, auto) {
|
|
19
19
|
if (auto) {
|
|
20
|
-
return `
|
|
20
|
+
return `Use the \`sdd\` skill. This is a new SDD project.
|
|
21
21
|
|
|
22
22
|
Project goal: "${description}"
|
|
23
23
|
|
|
@@ -31,9 +31,12 @@ Your task: generate the initial documentation for this project based on the desc
|
|
|
31
31
|
- system/tech-stack.md — Technologies and frameworks
|
|
32
32
|
- system/interfaces.md — API contracts
|
|
33
33
|
|
|
34
|
-
|
|
34
|
+
Set status: new on every file. Do NOT write any code, only documentation.
|
|
35
|
+
|
|
36
|
+
When done, commit with: git add -A && git commit -m "bootstrap: initial documentation"
|
|
37
|
+
Do NOT run \`sdd mark-synced\` — files must stay status: new so they can be implemented later.`;
|
|
35
38
|
}
|
|
36
|
-
return `
|
|
39
|
+
return `Use the \`sdd\` skill. This is a new SDD project.
|
|
37
40
|
|
|
38
41
|
Project goal: "${description}"
|
|
39
42
|
|
|
@@ -47,7 +50,7 @@ Your task: generate the initial documentation for this project. Ask me a few que
|
|
|
47
50
|
- system/tech-stack.md — Technologies and frameworks
|
|
48
51
|
- system/interfaces.md — API contracts
|
|
49
52
|
|
|
50
|
-
|
|
53
|
+
Set status: new on every file. Do NOT write any code, only documentation. Do NOT run \`sdd mark-synced\` — files must stay status: new so they can be implemented later.`;
|
|
51
54
|
}
|
|
52
55
|
function registerInit(program) {
|
|
53
56
|
program
|
|
@@ -151,7 +154,7 @@ function registerInit(program) {
|
|
|
151
154
|
console.log(` ${chalk_1.default.white("1.")} Enter the project folder:\n`);
|
|
152
155
|
console.log(` ${chalk_1.default.green(`cd ${projectName}`)}\n`);
|
|
153
156
|
console.log(` ${chalk_1.default.white("2.")} Start writing your documentation in ${chalk_1.default.cyan("product/")} and ${chalk_1.default.cyan("system/")}.`);
|
|
154
|
-
console.log(`
|
|
157
|
+
console.log(` Your agent will use the ${chalk_1.default.cyan("sdd")} skill automatically.\n`);
|
|
155
158
|
console.log(` ${chalk_1.default.white("3.")} When ready, let your AI agent run:\n`);
|
|
156
159
|
console.log(` ${chalk_1.default.green("sdd sync")}\n`);
|
|
157
160
|
const prompt = START_PROMPT;
|
|
@@ -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":";;;;;AAqDA,oCA2IC;AA/LD,kDAA0B;AAC1B,+CAAkD;AAClD,4DAAoC;AACpC,qCAAgD;AAChD,yCAAoC;AACpC,8CAAsB;AACtB,8DAAgE;AAChE,+CAA8C;AAC9C,+CAAyD;AACzD,mDAAmD;AAEnD,MAAM,YAAY,GAAG,8GAA8G,CAAC;AAEpI,SAAS,oBAAoB,CAAC,WAAmB,EAAE,IAAa;IAC9D,IAAI,IAAI,EAAE,CAAC;QACT,OAAO;;iBAEM,WAAW;;;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],"mappings":"
|
|
1
|
+
{"version":3,"file":"remote.d.ts","sourceRoot":"","sources":["../../src/commands/remote.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAOpC,wBAAgB,cAAc,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAsKrD"}
|
package/dist/commands/remote.js
CHANGED
|
@@ -4,10 +4,12 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.registerRemote = registerRemote;
|
|
7
|
+
const node_os_1 = require("node:os");
|
|
7
8
|
const chalk_1 = __importDefault(require("chalk"));
|
|
8
9
|
const prompts_1 = require("@inquirer/prompts");
|
|
9
10
|
const sdd_core_1 = require("@applica-software-guru/sdd-core");
|
|
10
11
|
const format_js_1 = require("../ui/format.js");
|
|
12
|
+
const markdown_js_1 = require("../ui/markdown.js");
|
|
11
13
|
function registerRemote(program) {
|
|
12
14
|
const remote = program
|
|
13
15
|
.command('remote')
|
|
@@ -109,5 +111,49 @@ function registerRemote(program) {
|
|
|
109
111
|
}
|
|
110
112
|
console.log('');
|
|
111
113
|
});
|
|
114
|
+
remote
|
|
115
|
+
.command('worker')
|
|
116
|
+
.description('Start a persistent worker that receives and executes jobs from SDD Flow')
|
|
117
|
+
.option('--name <name>', 'Worker name (default: hostname)')
|
|
118
|
+
.option('--agent <agent>', 'Agent to use for executing jobs (default: from config or "claude")')
|
|
119
|
+
.option('--timeout <seconds>', 'Remote request timeout in seconds (default: 300)', parseInt)
|
|
120
|
+
.action(async (options) => {
|
|
121
|
+
const root = process.cwd();
|
|
122
|
+
const config = await (0, sdd_core_1.readConfig)(root);
|
|
123
|
+
console.log((0, format_js_1.heading)('SDD Remote Worker'));
|
|
124
|
+
try {
|
|
125
|
+
const apiConfig = (0, sdd_core_1.buildApiConfig)(config, options.timeout);
|
|
126
|
+
const agentName = options.agent ?? config.agent ?? 'claude';
|
|
127
|
+
console.log((0, format_js_1.info)(`Starting worker "${options.name ?? (0, node_os_1.hostname)()}" with agent "${agentName}"...`));
|
|
128
|
+
console.log((0, format_js_1.info)(`Connected to ${apiConfig.baseUrl}`));
|
|
129
|
+
console.log('');
|
|
130
|
+
await (0, sdd_core_1.startWorkerDaemon)({
|
|
131
|
+
root,
|
|
132
|
+
name: options.name,
|
|
133
|
+
agent: agentName,
|
|
134
|
+
agents: config.agents,
|
|
135
|
+
apiConfig,
|
|
136
|
+
onLog: (msg) => {
|
|
137
|
+
const timestamp = new Date().toISOString().slice(11, 19);
|
|
138
|
+
const isError = /error|warning/i.test(msg);
|
|
139
|
+
const isJob = msg.startsWith('┌') || msg.startsWith('│') || msg.startsWith('└');
|
|
140
|
+
const isJobDone = msg.includes('done —');
|
|
141
|
+
const formatted = isError
|
|
142
|
+
? chalk_1.default.yellow(msg)
|
|
143
|
+
: isJobDone
|
|
144
|
+
? chalk_1.default.green(msg)
|
|
145
|
+
: isJob
|
|
146
|
+
? chalk_1.default.cyan(msg)
|
|
147
|
+
: msg;
|
|
148
|
+
console.log(`${chalk_1.default.dim(timestamp)} ${formatted}`);
|
|
149
|
+
},
|
|
150
|
+
renderPrompt: markdown_js_1.renderMarkdown,
|
|
151
|
+
});
|
|
152
|
+
}
|
|
153
|
+
catch (err) {
|
|
154
|
+
console.log((0, format_js_1.error)(err.message));
|
|
155
|
+
process.exit(1);
|
|
156
|
+
}
|
|
157
|
+
});
|
|
112
158
|
}
|
|
113
159
|
//# sourceMappingURL=remote.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"remote.js","sourceRoot":"","sources":["../../src/commands/remote.ts"],"names":[],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"remote.js","sourceRoot":"","sources":["../../src/commands/remote.ts"],"names":[],"mappings":";;;;;AAQA,wCAsKC;AA9KD,qCAAmC;AAEnC,kDAA0B;AAC1B,+CAAoD;AACpD,8DAAkH;AAClH,+CAAq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,EAAE,4BAAc;aAC7B,CAAC,CAAC;QACL,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,OAAO,CAAC,GAAG,CAAC,IAAA,iBAAQ,EAAE,GAAa,CAAC,OAAO,CAAC,CAAC,CAAC;YAC9C,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAClB,CAAC;IACH,CAAC,CAAC,CAAC;AACP,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -11,13 +11,13 @@ const validate_js_1 = require("./commands/validate.js");
|
|
|
11
11
|
const mark_synced_js_1 = require("./commands/mark-synced.js");
|
|
12
12
|
const cr_js_1 = require("./commands/cr.js");
|
|
13
13
|
const bug_js_1 = require("./commands/bug.js");
|
|
14
|
-
const apply_js_1 = require("./commands/apply.js");
|
|
15
14
|
const adapters_js_1 = require("./commands/adapters.js");
|
|
16
15
|
const ui_js_1 = require("./commands/ui.js");
|
|
17
16
|
const upgrade_js_1 = require("./commands/upgrade.js");
|
|
18
17
|
const remote_js_1 = require("./commands/remote.js");
|
|
19
18
|
const pull_js_1 = require("./commands/pull.js");
|
|
20
19
|
const push_js_1 = require("./commands/push.js");
|
|
20
|
+
const drafts_js_1 = require("./commands/drafts.js");
|
|
21
21
|
const mark_drafts_enriched_js_1 = require("./commands/mark-drafts-enriched.js");
|
|
22
22
|
const packageRequire = (0, node_module_1.createRequire)(__filename);
|
|
23
23
|
const packageJson = packageRequire("../package.json");
|
|
@@ -34,13 +34,13 @@ program
|
|
|
34
34
|
(0, mark_synced_js_1.registerMarkSynced)(program);
|
|
35
35
|
(0, cr_js_1.registerCR)(program);
|
|
36
36
|
(0, bug_js_1.registerBug)(program);
|
|
37
|
-
(0, apply_js_1.registerApply)(program);
|
|
38
37
|
(0, adapters_js_1.registerAdapters)(program);
|
|
39
38
|
(0, ui_js_1.registerUI)(program);
|
|
40
39
|
(0, upgrade_js_1.registerUpgrade)(program);
|
|
41
40
|
(0, remote_js_1.registerRemote)(program);
|
|
42
41
|
(0, pull_js_1.registerPull)(program);
|
|
43
42
|
(0, push_js_1.registerPush)(program);
|
|
43
|
+
(0, drafts_js_1.registerDrafts)(program);
|
|
44
44
|
(0, mark_drafts_enriched_js_1.registerMarkDraftsEnriched)(program);
|
|
45
45
|
program.parseAsync().catch((err) => {
|
|
46
46
|
console.error(err.message);
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AACA,yCAAoC;AACpC,6CAA4C;AAC5C,gDAAkD;AAClD,oDAAsD;AACtD,gDAAkD;AAClD,gDAAkD;AAClD,wDAA0D;AAC1D,8DAA+D;AAC/D,4CAA8C;AAC9C,8CAAgD;AAChD,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AACA,yCAAoC;AACpC,6CAA4C;AAC5C,gDAAkD;AAClD,oDAAsD;AACtD,gDAAkD;AAClD,gDAAkD;AAClD,wDAA0D;AAC1D,8DAA+D;AAC/D,4CAA8C;AAC9C,8CAAgD;AAChD,wDAA0D;AAC1D,4CAA8C;AAC9C,sDAAwD;AACxD,oDAAsD;AACtD,gDAAkD;AAClD,gDAAkD;AAClD,oDAAsD;AACtD,gFAAgF;AAEhF,MAAM,cAAc,GAAG,IAAA,2BAAa,EAAC,UAAU,CAAC,CAAC;AACjD,MAAM,WAAW,GAAG,cAAc,CAAC,iBAAiB,CAAwB,CAAC;AAE7E,MAAM,OAAO,GAAG,IAAI,mBAAO,EAAE,CAAC;AAE9B,OAAO;KACJ,IAAI,CAAC,KAAK,CAAC;KACX,WAAW,CAAC,yEAAyE,CAAC;KACtF,OAAO,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;AAEhC,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,8BAAgB,EAAC,OAAO,CAAC,CAAC;AAC1B,IAAA,kBAAU,EAAC,OAAO,CAAC,CAAC;AACpB,IAAA,4BAAe,EAAC,OAAO,CAAC,CAAC;AACzB,IAAA,0BAAc,EAAC,OAAO,CAAC,CAAC;AACxB,IAAA,sBAAY,EAAC,OAAO,CAAC,CAAC;AACtB,IAAA,sBAAY,EAAC,OAAO,CAAC,CAAC;AACtB,IAAA,0BAAc,EAAC,OAAO,CAAC,CAAC;AACxB,IAAA,oDAA0B,EAAC,OAAO,CAAC,CAAC;AAEpC,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"}
|
package/dist/ui/format.d.ts
CHANGED
|
@@ -11,4 +11,6 @@ export declare function success(text: string): string;
|
|
|
11
11
|
export declare function warning(text: string): string;
|
|
12
12
|
export declare function error(text: string): string;
|
|
13
13
|
export declare function info(text: string): string;
|
|
14
|
+
export declare function crStatusLabel(status: string): string;
|
|
15
|
+
export declare function bugStatusLabel(status: string): string;
|
|
14
16
|
//# sourceMappingURL=format.d.ts.map
|
package/dist/ui/format.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"format.d.ts","sourceRoot":"","sources":["../../src/ui/format.ts"],"names":[],"mappings":"AAGA,wBAAgB,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAejD;AAED,wB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AAM,CAE1C;AAED,wBAAgB,IAAI,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAEzC;AAED,wBAAgB,aAAa,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAWpD;AAED,wBAAgB,cAAc,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAWrD"}
|
package/dist/ui/format.js
CHANGED
|
@@ -11,6 +11,8 @@ exports.success = success;
|
|
|
11
11
|
exports.warning = warning;
|
|
12
12
|
exports.error = error;
|
|
13
13
|
exports.info = info;
|
|
14
|
+
exports.crStatusLabel = crStatusLabel;
|
|
15
|
+
exports.bugStatusLabel = bugStatusLabel;
|
|
14
16
|
const chalk_1 = __importDefault(require("chalk"));
|
|
15
17
|
const cli_table3_1 = __importDefault(require("cli-table3"));
|
|
16
18
|
function statusIcon(status) {
|
|
@@ -91,4 +93,28 @@ function error(text) {
|
|
|
91
93
|
function info(text) {
|
|
92
94
|
return chalk_1.default.dim(` ${text}`);
|
|
93
95
|
}
|
|
96
|
+
function crStatusLabel(status) {
|
|
97
|
+
switch (status) {
|
|
98
|
+
case 'draft':
|
|
99
|
+
return chalk_1.default.magenta('draft');
|
|
100
|
+
case 'pending':
|
|
101
|
+
return chalk_1.default.yellow('pending');
|
|
102
|
+
case 'applied':
|
|
103
|
+
return chalk_1.default.green('applied');
|
|
104
|
+
default:
|
|
105
|
+
return chalk_1.default.gray(status);
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
function bugStatusLabel(status) {
|
|
109
|
+
switch (status) {
|
|
110
|
+
case 'draft':
|
|
111
|
+
return chalk_1.default.magenta('draft');
|
|
112
|
+
case 'open':
|
|
113
|
+
return chalk_1.default.yellow('open');
|
|
114
|
+
case 'resolved':
|
|
115
|
+
return chalk_1.default.green('resolved');
|
|
116
|
+
default:
|
|
117
|
+
return chalk_1.default.gray(status);
|
|
118
|
+
}
|
|
119
|
+
}
|
|
94
120
|
//# sourceMappingURL=format.js.map
|
package/dist/ui/format.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"format.js","sourceRoot":"","sources":["../../src/ui/format.ts"],"names":[],"mappings":";;;;;AAGA,gCAeC;AAED,kCAeC;AAED,8CAkCC;AAED,0BAEC;AAED,0BAEC;AAED,0BAEC;AAED,sBAEC;AAED,oBAEC;
|
|
1
|
+
{"version":3,"file":"format.js","sourceRoot":"","sources":["../../src/ui/format.ts"],"names":[],"mappings":";;;;;AAGA,gCAeC;AAED,kCAeC;AAED,8CAkCC;AAED,0BAEC;AAED,0BAEC;AAED,0BAEC;AAED,sBAEC;AAED,oBAEC;AAED,sCAWC;AAED,wCAWC;AArHD,kDAA0B;AAC1B,4DAA+B;AAE/B,SAAgB,UAAU,CAAC,MAAc;IACvC,QAAQ,MAAM,EAAE,CAAC;QACf,KAAK,OAAO;YACV,OAAO,eAAK,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;QAC5B,KAAK,QAAQ;YACX,OAAO,eAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QAC1B,KAAK,KAAK;YACR,OAAO,eAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QACzB,KAAK,SAAS;YACZ,OAAO,eAAK,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;QAC3B,KAAK,SAAS;YACZ,OAAO,eAAK,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QACxB;YACE,OAAO,eAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAC3B,CAAC;AACH,CAAC;AAED,SAAgB,WAAW,CAAC,MAAc;IACxC,QAAQ,MAAM,EAAE,CAAC;QACf,KAAK,OAAO;YACV,OAAO,eAAK,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;QAChC,KAAK,QAAQ;YACX,OAAO,eAAK,CAAC,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QACpC,KAAK,KAAK;YACR,OAAO,eAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QAC3B,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AAC;QAChC,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,IAAI,CAAC,MAAM,CAAC,CAAC;IAC9B,CAAC;AACH,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@applica-software-guru/sdd",
|
|
3
|
-
"version": "1.8.
|
|
3
|
+
"version": "1.8.3",
|
|
4
4
|
"description": "CLI for Story Driven Development",
|
|
5
5
|
"author": "Bruno Fortunato <bruno.fortunato@applica.guru>",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -8,11 +8,11 @@
|
|
|
8
8
|
"sdd": "./dist/index.js"
|
|
9
9
|
},
|
|
10
10
|
"scripts": {
|
|
11
|
-
"prebuild": "node -e \"require('fs').cpSync('../skill', 'skills', {recursive:
|
|
11
|
+
"prebuild": "node -e \"const fs=require('fs'); fs.cpSync('../skill', 'skills', {recursive:true, force:true}); fs.cpSync('../skill', '../claude-plugin/skills', {recursive:true, force:true})\"",
|
|
12
12
|
"build": "tsc"
|
|
13
13
|
},
|
|
14
14
|
"dependencies": {
|
|
15
|
-
"@applica-software-guru/sdd-core": "^1.8.
|
|
15
|
+
"@applica-software-guru/sdd-core": "^1.8.2",
|
|
16
16
|
"@inquirer/prompts": "^7.0.0",
|
|
17
17
|
"chalk": "^4.1.2",
|
|
18
18
|
"cli-table3": "^0.6.5",
|
package/skills/sdd/SKILL.md
CHANGED
|
@@ -49,6 +49,12 @@ git add -A && git commit -m "sdd sync: <brief description of what was implemente
|
|
|
49
49
|
|
|
50
50
|
Do NOT skip this step. Every mark-synced must be followed by a git commit.
|
|
51
51
|
|
|
52
|
+
10. If remote sync is configured (remote section in `.sdd/config.yaml` and API key available), remind the user they can publish updates with:
|
|
53
|
+
|
|
54
|
+
```
|
|
55
|
+
sdd push
|
|
56
|
+
```
|
|
57
|
+
|
|
52
58
|
### Removing a feature
|
|
53
59
|
|
|
54
60
|
If a documentation file has `status: deleted`, it means that feature should be removed.
|
|
@@ -77,6 +83,7 @@ Delete the related code in `code/`, then run `sdd mark-synced <file>` (the doc f
|
|
|
77
83
|
5. All generated code goes inside `code/`
|
|
78
84
|
6. Respect all constraints in `## Agent Notes` sections (if present)
|
|
79
85
|
7. Do not edit files inside `.sdd/` manually
|
|
86
|
+
8. If remote is configured, suggest `sdd push` after successful local sync + commit
|
|
80
87
|
|
|
81
88
|
## Project structure
|
|
82
89
|
|
|
@@ -94,4 +101,5 @@ For detailed information on specific topics, see:
|
|
|
94
101
|
- [File format and status lifecycle](references/file-format.md)
|
|
95
102
|
- [Change Requests workflow](references/change-requests.md)
|
|
96
103
|
- [Bug workflow](references/bugs.md)
|
|
104
|
+
- [Remote pull/enrich/push workflow](../sdd-remote/SKILL.md)
|
|
97
105
|
- [UI Component workflow](../sdd-ui/SKILL.md)
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: sdd-remote
|
|
3
|
+
description: >
|
|
4
|
+
Remote sync workflow for Story Driven Development. Use when the user asks
|
|
5
|
+
to update local state from remote changes, process remote drafts, and push
|
|
6
|
+
enriched items back. Also applies when running a remote worker job (enrich
|
|
7
|
+
or sync).
|
|
8
|
+
license: MIT
|
|
9
|
+
compatibility: Requires sdd CLI (npm i -g @applica-software-guru/sdd)
|
|
10
|
+
allowed-tools: Bash(sdd:*) Read Glob Grep
|
|
11
|
+
metadata:
|
|
12
|
+
author: applica-software-guru
|
|
13
|
+
version: "1.1"
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
# SDD Remote - Pull, Enrich, Push
|
|
17
|
+
|
|
18
|
+
## Purpose
|
|
19
|
+
|
|
20
|
+
Use this skill to synchronize local SDD docs with remote updates, enrich draft content,
|
|
21
|
+
and publish the enriched result to remote in active states.
|
|
22
|
+
|
|
23
|
+
This skill also applies when a **remote worker job** is dispatched from SDD Flow, as the
|
|
24
|
+
worker runs these same workflows on behalf of the user.
|
|
25
|
+
|
|
26
|
+
## Detection
|
|
27
|
+
|
|
28
|
+
This workflow applies when:
|
|
29
|
+
|
|
30
|
+
- `.sdd/config.yaml` exists in the project root
|
|
31
|
+
- The user asks to update local state from remote, pull pending CRs/bugs/docs,
|
|
32
|
+
enrich drafts, or push pending remote updates
|
|
33
|
+
- A remote worker job prompt instructs you to follow this workflow
|
|
34
|
+
|
|
35
|
+
## Workflows
|
|
36
|
+
|
|
37
|
+
### Enrich Workflow (CR)
|
|
38
|
+
|
|
39
|
+
Follow this sequence to enrich a draft Change Request:
|
|
40
|
+
|
|
41
|
+
1. Pull remote updates:
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
sdd pull --crs-only
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
3. Generate draft TODO list:
|
|
48
|
+
|
|
49
|
+
```bash
|
|
50
|
+
sdd drafts
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
4. Enrich the draft with technical details, acceptance criteria, edge cases, and
|
|
54
|
+
any relevant information from the project documentation and comments.
|
|
55
|
+
|
|
56
|
+
5. Transition the enriched CR to pending:
|
|
57
|
+
|
|
58
|
+
```bash
|
|
59
|
+
sdd mark-drafts-enriched
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
This performs: `draft → pending`
|
|
63
|
+
|
|
64
|
+
6. Push the enriched content:
|
|
65
|
+
|
|
66
|
+
```bash
|
|
67
|
+
sdd push
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
### Enrich Workflow (Document)
|
|
71
|
+
|
|
72
|
+
Follow this sequence to enrich a document:
|
|
73
|
+
|
|
74
|
+
1. Pull remote updates:
|
|
75
|
+
|
|
76
|
+
```bash
|
|
77
|
+
sdd pull --docs-only
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
3. Locate the document file in `product/` or `system/` and update its content
|
|
81
|
+
with the enriched version.
|
|
82
|
+
|
|
83
|
+
4. Push the enriched content:
|
|
84
|
+
|
|
85
|
+
```bash
|
|
86
|
+
sdd push
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
If the document was in `draft` status, it will transition to `new` on the server.
|
|
90
|
+
|
|
91
|
+
### Sync Workflow (Project-level)
|
|
92
|
+
|
|
93
|
+
Follow this sequence for a full project sync (all pending items):
|
|
94
|
+
|
|
95
|
+
1. Pull the latest specs:
|
|
96
|
+
|
|
97
|
+
```bash
|
|
98
|
+
sdd pull
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
3. Run the `sdd` skill — it handles the full loop: open bugs, pending CRs,
|
|
102
|
+
documentation sync, code implementation, mark-synced, and commit.
|
|
103
|
+
|
|
104
|
+
4. Push:
|
|
105
|
+
|
|
106
|
+
```bash
|
|
107
|
+
sdd push
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
## Rules
|
|
111
|
+
|
|
112
|
+
1. Always check remote configuration before pull/push (`sdd remote status`)
|
|
113
|
+
3. Do not use `sdd push --all` unless the user explicitly asks for a full reseed
|
|
114
|
+
4. If pull reports conflicts, do not overwrite local files blindly; report conflicts and ask how to proceed
|
|
115
|
+
5. Do not edit files inside `.sdd/` manually
|
|
116
|
+
6. Keep status transitions explicit: enrich first, then `sdd mark-drafts-enriched`, then push
|
|
117
|
+
7. **Always commit before pushing** when the sync workflow makes code changes
|
|
118
|
+
|
|
119
|
+
## Related commands
|
|
120
|
+
|
|
121
|
+
- `sdd remote init`
|
|
122
|
+
- `sdd remote status`
|
|
123
|
+
- `sdd pull`
|
|
124
|
+
- `sdd drafts`
|
|
125
|
+
- `sdd mark-drafts-enriched`
|
|
126
|
+
- `sdd sync`
|
|
127
|
+
- `sdd mark-synced`
|
|
128
|
+
- `sdd push`
|
package/src/commands/bug.ts
CHANGED
|
@@ -1,20 +1,7 @@
|
|
|
1
1
|
import { Command } from 'commander';
|
|
2
2
|
import chalk from 'chalk';
|
|
3
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 'draft':
|
|
9
|
-
return chalk.magenta('draft');
|
|
10
|
-
case 'open':
|
|
11
|
-
return chalk.yellow('open');
|
|
12
|
-
case 'resolved':
|
|
13
|
-
return chalk.green('resolved');
|
|
14
|
-
default:
|
|
15
|
-
return chalk.gray(status);
|
|
16
|
-
}
|
|
17
|
-
}
|
|
4
|
+
import { heading, info, bugStatusLabel } from '../ui/format.js';
|
|
18
5
|
|
|
19
6
|
export function registerBug(program: Command): void {
|
|
20
7
|
const bug = program
|
|
@@ -36,7 +23,7 @@ export function registerBug(program: Command): void {
|
|
|
36
23
|
|
|
37
24
|
for (const b of bugs) {
|
|
38
25
|
const icon = b.frontmatter.status === 'resolved' ? chalk.green(' ✓') : b.frontmatter.status === 'draft' ? chalk.magenta(' ◇') : chalk.yellow(' ●');
|
|
39
|
-
console.log(`${icon} ${chalk.white(b.relativePath)} ${chalk.dim(`[${
|
|
26
|
+
console.log(`${icon} ${chalk.white(b.relativePath)} ${chalk.dim(`[${bugStatusLabel(b.frontmatter.status)}]`)} ${chalk.cyan(b.frontmatter.title)}`);
|
|
40
27
|
}
|
|
41
28
|
console.log('');
|
|
42
29
|
});
|
package/src/commands/cr.ts
CHANGED
|
@@ -1,20 +1,7 @@
|
|
|
1
1
|
import { Command } from 'commander';
|
|
2
2
|
import chalk from 'chalk';
|
|
3
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 'draft':
|
|
9
|
-
return chalk.magenta('draft');
|
|
10
|
-
case 'pending':
|
|
11
|
-
return chalk.yellow('pending');
|
|
12
|
-
case 'applied':
|
|
13
|
-
return chalk.green('applied');
|
|
14
|
-
default:
|
|
15
|
-
return chalk.gray(status);
|
|
16
|
-
}
|
|
17
|
-
}
|
|
4
|
+
import { heading, info, crStatusLabel } from '../ui/format.js';
|
|
18
5
|
|
|
19
6
|
export function registerCR(program: Command): void {
|
|
20
7
|
const cr = program
|
|
@@ -36,7 +23,7 @@ export function registerCR(program: Command): void {
|
|
|
36
23
|
|
|
37
24
|
for (const cr of crs) {
|
|
38
25
|
const icon = cr.frontmatter.status === 'applied' ? chalk.green(' ✓') : cr.frontmatter.status === 'draft' ? chalk.magenta(' ◇') : chalk.yellow(' ●');
|
|
39
|
-
console.log(`${icon} ${chalk.white(cr.relativePath)} ${chalk.dim(`[${
|
|
26
|
+
console.log(`${icon} ${chalk.white(cr.relativePath)} ${chalk.dim(`[${crStatusLabel(cr.frontmatter.status)}]`)} ${chalk.cyan(cr.frontmatter.title)}`);
|
|
40
27
|
}
|
|
41
28
|
console.log('');
|
|
42
29
|
});
|
|
@@ -0,0 +1,57 @@
|
|
|
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
|
+
import { renderMarkdown } from '../ui/markdown.js';
|
|
6
|
+
|
|
7
|
+
export function registerDrafts(program: Command): void {
|
|
8
|
+
program
|
|
9
|
+
.command('drafts')
|
|
10
|
+
.description('List draft docs/CRs/bugs and print a TODO prompt for the agent')
|
|
11
|
+
.action(async () => {
|
|
12
|
+
const sdd = new SDD({ root: process.cwd() });
|
|
13
|
+
|
|
14
|
+
console.log(heading('Drafts'));
|
|
15
|
+
|
|
16
|
+
const drafts = await sdd.drafts();
|
|
17
|
+
const total = drafts.docs.length + drafts.crs.length + drafts.bugs.length;
|
|
18
|
+
|
|
19
|
+
if (total === 0) {
|
|
20
|
+
console.log(info('No draft elements found.'));
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
console.log(info(`Found ${total} draft element(s):`));
|
|
25
|
+
if (drafts.docs.length > 0) {
|
|
26
|
+
console.log(chalk.dim(` Documents (${drafts.docs.length})`));
|
|
27
|
+
for (const f of drafts.docs) {
|
|
28
|
+
console.log(chalk.magenta(` ◇ ${f.relativePath}`));
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
if (drafts.crs.length > 0) {
|
|
32
|
+
console.log(chalk.dim(` Change Requests (${drafts.crs.length})`));
|
|
33
|
+
for (const cr of drafts.crs) {
|
|
34
|
+
console.log(chalk.magenta(` ◇ ${cr.relativePath}`));
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
if (drafts.bugs.length > 0) {
|
|
38
|
+
console.log(chalk.dim(` Bugs (${drafts.bugs.length})`));
|
|
39
|
+
for (const bug of drafts.bugs) {
|
|
40
|
+
console.log(chalk.magenta(` ◇ ${bug.relativePath}`));
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
console.log('');
|
|
44
|
+
|
|
45
|
+
const prompt = await sdd.draftEnrichmentPrompt();
|
|
46
|
+
if (!prompt) {
|
|
47
|
+
console.log(info('Drafts are present but no enrichment prompt could be generated.'));
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
console.log(chalk.dim(' ─'.repeat(30)));
|
|
52
|
+
console.log(heading('Draft TODO'));
|
|
53
|
+
console.log(renderMarkdown(prompt));
|
|
54
|
+
console.log(chalk.dim(' ─'.repeat(30)));
|
|
55
|
+
console.log(info('After enrichment, run `sdd mark-drafts-enriched` when drafts are ready.'));
|
|
56
|
+
});
|
|
57
|
+
}
|
package/src/commands/init.ts
CHANGED
|
@@ -10,11 +10,11 @@ import { printBanner } from "../ui/banner.js";
|
|
|
10
10
|
import { success, info, heading } from "../ui/format.js";
|
|
11
11
|
import { renderMarkdown } from "../ui/markdown.js";
|
|
12
12
|
|
|
13
|
-
const START_PROMPT = `
|
|
13
|
+
const START_PROMPT = `Use the \`sdd\` skill and the documentation in product/ and system/, then run \`sdd sync\` to start working.`;
|
|
14
14
|
|
|
15
15
|
function buildBootstrapPrompt(description: string, auto: boolean): string {
|
|
16
16
|
if (auto) {
|
|
17
|
-
return `
|
|
17
|
+
return `Use the \`sdd\` skill. This is a new SDD project.
|
|
18
18
|
|
|
19
19
|
Project goal: "${description}"
|
|
20
20
|
|
|
@@ -28,10 +28,13 @@ Your task: generate the initial documentation for this project based on the desc
|
|
|
28
28
|
- system/tech-stack.md — Technologies and frameworks
|
|
29
29
|
- system/interfaces.md — API contracts
|
|
30
30
|
|
|
31
|
-
|
|
31
|
+
Set status: new on every file. Do NOT write any code, only documentation.
|
|
32
|
+
|
|
33
|
+
When done, commit with: git add -A && git commit -m "bootstrap: initial documentation"
|
|
34
|
+
Do NOT run \`sdd mark-synced\` — files must stay status: new so they can be implemented later.`;
|
|
32
35
|
}
|
|
33
36
|
|
|
34
|
-
return `
|
|
37
|
+
return `Use the \`sdd\` skill. This is a new SDD project.
|
|
35
38
|
|
|
36
39
|
Project goal: "${description}"
|
|
37
40
|
|
|
@@ -45,7 +48,7 @@ Your task: generate the initial documentation for this project. Ask me a few que
|
|
|
45
48
|
- system/tech-stack.md — Technologies and frameworks
|
|
46
49
|
- system/interfaces.md — API contracts
|
|
47
50
|
|
|
48
|
-
|
|
51
|
+
Set status: new on every file. Do NOT write any code, only documentation. Do NOT run \`sdd mark-synced\` — files must stay status: new so they can be implemented later.`;
|
|
49
52
|
}
|
|
50
53
|
|
|
51
54
|
export function registerInit(program: Command): void {
|
|
@@ -174,7 +177,7 @@ export function registerInit(program: Command): void {
|
|
|
174
177
|
console.log(
|
|
175
178
|
` ${chalk.white("2.")} Start writing your documentation in ${chalk.cyan("product/")} and ${chalk.cyan("system/")}.`,
|
|
176
179
|
);
|
|
177
|
-
console.log(`
|
|
180
|
+
console.log(` Your agent will use the ${chalk.cyan("sdd")} skill automatically.\n`);
|
|
178
181
|
console.log(` ${chalk.white("3.")} When ready, let your AI agent run:\n`);
|
|
179
182
|
console.log(` ${chalk.green("sdd sync")}\n`);
|
|
180
183
|
|
package/src/commands/remote.ts
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
|
+
import { hostname } from 'node:os';
|
|
1
2
|
import { Command } from 'commander';
|
|
2
3
|
import chalk from 'chalk';
|
|
3
4
|
import { input, password } from '@inquirer/prompts';
|
|
4
|
-
import { SDD, readConfig, writeConfig } from '@applica-software-guru/sdd-core';
|
|
5
|
+
import { SDD, readConfig, writeConfig, buildApiConfig, startWorkerDaemon } from '@applica-software-guru/sdd-core';
|
|
5
6
|
import { heading, success, info, warning, error as errorFmt } from '../ui/format.js';
|
|
7
|
+
import { renderMarkdown } from '../ui/markdown.js';
|
|
6
8
|
|
|
7
9
|
export function registerRemote(program: Command): void {
|
|
8
10
|
const remote = program
|
|
@@ -122,4 +124,52 @@ export function registerRemote(program: Command): void {
|
|
|
122
124
|
}
|
|
123
125
|
console.log('');
|
|
124
126
|
});
|
|
127
|
+
|
|
128
|
+
remote
|
|
129
|
+
.command('worker')
|
|
130
|
+
.description('Start a persistent worker that receives and executes jobs from SDD Flow')
|
|
131
|
+
.option('--name <name>', 'Worker name (default: hostname)')
|
|
132
|
+
.option('--agent <agent>', 'Agent to use for executing jobs (default: from config or "claude")')
|
|
133
|
+
.option('--timeout <seconds>', 'Remote request timeout in seconds (default: 300)', parseInt)
|
|
134
|
+
.action(async (options: { name?: string; agent?: string; timeout?: number }) => {
|
|
135
|
+
const root = process.cwd();
|
|
136
|
+
const config = await readConfig(root);
|
|
137
|
+
|
|
138
|
+
console.log(heading('SDD Remote Worker'));
|
|
139
|
+
|
|
140
|
+
try {
|
|
141
|
+
const apiConfig = buildApiConfig(config, options.timeout);
|
|
142
|
+
const agentName = options.agent ?? config.agent ?? 'claude';
|
|
143
|
+
|
|
144
|
+
console.log(info(`Starting worker "${options.name ?? hostname()}" with agent "${agentName}"...`));
|
|
145
|
+
console.log(info(`Connected to ${apiConfig.baseUrl}`));
|
|
146
|
+
console.log('');
|
|
147
|
+
|
|
148
|
+
await startWorkerDaemon({
|
|
149
|
+
root,
|
|
150
|
+
name: options.name,
|
|
151
|
+
agent: agentName,
|
|
152
|
+
agents: config.agents,
|
|
153
|
+
apiConfig,
|
|
154
|
+
onLog: (msg: string) => {
|
|
155
|
+
const timestamp = new Date().toISOString().slice(11, 19);
|
|
156
|
+
const isError = /error|warning/i.test(msg);
|
|
157
|
+
const isJob = msg.startsWith('┌') || msg.startsWith('│') || msg.startsWith('└');
|
|
158
|
+
const isJobDone = msg.includes('done —');
|
|
159
|
+
const formatted = isError
|
|
160
|
+
? chalk.yellow(msg)
|
|
161
|
+
: isJobDone
|
|
162
|
+
? chalk.green(msg)
|
|
163
|
+
: isJob
|
|
164
|
+
? chalk.cyan(msg)
|
|
165
|
+
: msg;
|
|
166
|
+
console.log(`${chalk.dim(timestamp)} ${formatted}`);
|
|
167
|
+
},
|
|
168
|
+
renderPrompt: renderMarkdown,
|
|
169
|
+
});
|
|
170
|
+
} catch (err) {
|
|
171
|
+
console.log(errorFmt((err as Error).message));
|
|
172
|
+
process.exit(1);
|
|
173
|
+
}
|
|
174
|
+
});
|
|
125
175
|
}
|
package/src/index.ts
CHANGED
|
@@ -9,13 +9,13 @@ import { registerValidate } from "./commands/validate.js";
|
|
|
9
9
|
import { registerMarkSynced } from "./commands/mark-synced.js";
|
|
10
10
|
import { registerCR } from "./commands/cr.js";
|
|
11
11
|
import { registerBug } from "./commands/bug.js";
|
|
12
|
-
import { registerApply } from "./commands/apply.js";
|
|
13
12
|
import { registerAdapters } from "./commands/adapters.js";
|
|
14
13
|
import { registerUI } from "./commands/ui.js";
|
|
15
14
|
import { registerUpgrade } from "./commands/upgrade.js";
|
|
16
15
|
import { registerRemote } from "./commands/remote.js";
|
|
17
16
|
import { registerPull } from "./commands/pull.js";
|
|
18
17
|
import { registerPush } from "./commands/push.js";
|
|
18
|
+
import { registerDrafts } from "./commands/drafts.js";
|
|
19
19
|
import { registerMarkDraftsEnriched } from "./commands/mark-drafts-enriched.js";
|
|
20
20
|
|
|
21
21
|
const packageRequire = createRequire(__filename);
|
|
@@ -36,13 +36,13 @@ registerValidate(program);
|
|
|
36
36
|
registerMarkSynced(program);
|
|
37
37
|
registerCR(program);
|
|
38
38
|
registerBug(program);
|
|
39
|
-
registerApply(program);
|
|
40
39
|
registerAdapters(program);
|
|
41
40
|
registerUI(program);
|
|
42
41
|
registerUpgrade(program);
|
|
43
42
|
registerRemote(program);
|
|
44
43
|
registerPull(program);
|
|
45
44
|
registerPush(program);
|
|
45
|
+
registerDrafts(program);
|
|
46
46
|
registerMarkDraftsEnriched(program);
|
|
47
47
|
|
|
48
48
|
program.parseAsync().catch((err) => {
|
package/src/ui/format.ts
CHANGED
|
@@ -90,3 +90,29 @@ export function error(text: string): string {
|
|
|
90
90
|
export function info(text: string): string {
|
|
91
91
|
return chalk.dim(` ${text}`);
|
|
92
92
|
}
|
|
93
|
+
|
|
94
|
+
export function crStatusLabel(status: string): string {
|
|
95
|
+
switch (status) {
|
|
96
|
+
case 'draft':
|
|
97
|
+
return chalk.magenta('draft');
|
|
98
|
+
case 'pending':
|
|
99
|
+
return chalk.yellow('pending');
|
|
100
|
+
case 'applied':
|
|
101
|
+
return chalk.green('applied');
|
|
102
|
+
default:
|
|
103
|
+
return chalk.gray(status);
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
export function bugStatusLabel(status: string): string {
|
|
108
|
+
switch (status) {
|
|
109
|
+
case 'draft':
|
|
110
|
+
return chalk.magenta('draft');
|
|
111
|
+
case 'open':
|
|
112
|
+
return chalk.yellow('open');
|
|
113
|
+
case 'resolved':
|
|
114
|
+
return chalk.green('resolved');
|
|
115
|
+
default:
|
|
116
|
+
return chalk.gray(status);
|
|
117
|
+
}
|
|
118
|
+
}
|
package/dist/commands/apply.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
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"}
|
package/dist/commands/apply.js
DELETED
|
@@ -1,46 +0,0 @@
|
|
|
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 drafts, 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
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"apply.js","sourceRoot":"","sources":["../../src/commands/apply.ts"],"names":[],"mappings":";;;;;AAMA,sCA0CC;AA/CD,kDAA0B;AAC1B,8DAAgE;AAChE,+CAAgD;AAChD,mDAAmD;AAEnD,SAAgB,aAAa,CAAC,OAAgB;IAC5C,OAAO;SACJ,OAAO,CAAC,OAAO,CAAC;SAChB,WAAW,CAAC,oEAAoE,CAAC;SACjF,MAAM,CAAC,gBAAgB,EAAE,iDAAiD,CAAC;SAC3E,MAAM,CAAC,KAAK,EAAE,OAAO,EAAE,EAAE;QACxB,MAAM,GAAG,GAAG,IAAI,cAAG,CAAC,EAAE,IAAI,EAAE,OAAO,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;QAE7C,OAAO,CAAC,GAAG,CAAC,IAAA,mBAAO,EAAC,WAAW,CAAC,CAAC,CAAC;QAElC,MAAM,MAAM,GAAG,MAAM,GAAG,CAAC,WAAW,EAAE,CAAC;QACvC,IAAI,CAAC,MAAM,EAAE,CAAC;YACZ,OAAO,CAAC,GAAG,CAAC,IAAA,gBAAI,EAAC,yEAAyE,CAAC,CAAC,CAAC;YAC7F,OAAO;QACT,CAAC;QAED,6BAA6B;QAC7B,OAAO,CA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|
-
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 drafts, 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
|
-
}
|