sdd-toolkit 1.9.2 → 2.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/definitions/sdd-coder.yaml +161 -71
- package/definitions/sdd-feature.yaml +139 -73
- package/definitions/sdd-log.yaml +70 -61
- package/definitions/sdd-project.yaml +163 -51
- package/definitions/sdd-requirements.yaml +70 -70
- package/definitions/sdd-review.yaml +106 -88
- package/definitions/sdd.yaml +12 -12
- package/package.json +1 -1
- package/src/commands/view.js +18 -18
- package/src/index.js +98 -98
- package/src/lib/dashboard.js +187 -187
- package/src/lib/docs.js +71 -69
- package/src/lib/i18n.js +65 -65
- package/src/lib/messages.js +234 -234
- package/src/lib/profiles.js +186 -186
- package/src/lib/schema.js +13 -13
- package/src/lib/transformers.js +326 -332
- package/src/scripts/archive.js +55 -56
- package/src/scripts/reset.js +19 -19
- package/src/scripts/status.js +50 -58
- package/templates/context.md +22 -0
- package/templates/guidelines.md +9 -9
- package/templates/project.md +28 -28
- package/templates/requirements.md +15 -15
- package/templates/system.md +20 -0
- package/templates/task.md +11 -11
- package/README.pt.md +0 -334
package/src/lib/docs.js
CHANGED
|
@@ -1,69 +1,71 @@
|
|
|
1
|
-
const fs = require('fs');
|
|
2
|
-
const path = require('path');
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* Generates the necessary folder structure for the agents
|
|
6
|
-
* Implements Smart Scaffolding: Only creates missing files/folders.
|
|
7
|
-
*/
|
|
8
|
-
function generateWorkflowGuide(baseDir) {
|
|
9
|
-
const docsDir = path.join(baseDir, '.sdd-toolkit');
|
|
10
|
-
|
|
11
|
-
// 1. Define folder structure based on new logging architecture
|
|
12
|
-
const folders = [
|
|
13
|
-
path.join(docsDir, 'features'),
|
|
14
|
-
path.join(docsDir, 'logs'),
|
|
15
|
-
path.join(docsDir, 'logs', 'executions'),
|
|
16
|
-
path.join(docsDir, 'logs', 'reviews'),
|
|
17
|
-
path.join(docsDir, 'logs', 'archive'),
|
|
18
|
-
];
|
|
19
|
-
|
|
20
|
-
let stats = { created: 0, verified: 0 };
|
|
21
|
-
|
|
22
|
-
// Create folders
|
|
23
|
-
folders.forEach(dir => {
|
|
24
|
-
if (!fs.existsSync(dir)) {
|
|
25
|
-
fs.mkdirSync(dir, { recursive: true });
|
|
26
|
-
stats.created++;
|
|
27
|
-
} else {
|
|
28
|
-
stats.verified++;
|
|
29
|
-
}
|
|
30
|
-
});
|
|
31
|
-
|
|
32
|
-
// 2. Define Templates Mapping
|
|
33
|
-
// Assumes templates are located in project_root/templates/
|
|
34
|
-
// __dirname is src/lib/, so templates is ../../templates
|
|
35
|
-
const templatesDir = path.join(__dirname, '..', '..', 'templates');
|
|
36
|
-
|
|
37
|
-
const templateFiles = [
|
|
38
|
-
{ src: 'guidelines.md', dest: 'guidelines.md' },
|
|
39
|
-
{ src: 'project.md', dest: 'project.md' },
|
|
40
|
-
{ src: 'requirements.md', dest: 'requirements.md' },
|
|
41
|
-
{ src: '
|
|
42
|
-
{ src: '
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
1
|
+
const fs = require('fs');
|
|
2
|
+
const path = require('path');
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Generates the necessary folder structure for the agents
|
|
6
|
+
* Implements Smart Scaffolding: Only creates missing files/folders.
|
|
7
|
+
*/
|
|
8
|
+
function generateWorkflowGuide(baseDir) {
|
|
9
|
+
const docsDir = path.join(baseDir, '.sdd-toolkit');
|
|
10
|
+
|
|
11
|
+
// 1. Define folder structure based on new logging architecture
|
|
12
|
+
const folders = [
|
|
13
|
+
path.join(docsDir, 'features'),
|
|
14
|
+
path.join(docsDir, 'logs'),
|
|
15
|
+
path.join(docsDir, 'logs', 'executions'),
|
|
16
|
+
path.join(docsDir, 'logs', 'reviews'),
|
|
17
|
+
path.join(docsDir, 'logs', 'archive'),
|
|
18
|
+
];
|
|
19
|
+
|
|
20
|
+
let stats = { created: 0, verified: 0 };
|
|
21
|
+
|
|
22
|
+
// Create folders
|
|
23
|
+
folders.forEach(dir => {
|
|
24
|
+
if (!fs.existsSync(dir)) {
|
|
25
|
+
fs.mkdirSync(dir, { recursive: true });
|
|
26
|
+
stats.created++;
|
|
27
|
+
} else {
|
|
28
|
+
stats.verified++;
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
// 2. Define Templates Mapping
|
|
33
|
+
// Assumes templates are located in project_root/templates/
|
|
34
|
+
// __dirname is src/lib/, so templates is ../../templates
|
|
35
|
+
const templatesDir = path.join(__dirname, '..', '..', 'templates');
|
|
36
|
+
|
|
37
|
+
const templateFiles = [
|
|
38
|
+
{ src: 'guidelines.md', dest: 'guidelines.md' },
|
|
39
|
+
{ src: 'project.md', dest: 'project.md' },
|
|
40
|
+
{ src: 'requirements.md', dest: 'requirements.md' },
|
|
41
|
+
{ src: 'context.md', dest: 'context.md' },
|
|
42
|
+
{ src: 'system.md', dest: 'system.md' },
|
|
43
|
+
{ src: 'milestones.md', dest: 'milestones.md' },
|
|
44
|
+
{ src: 'task.md', dest: 'task.md' }
|
|
45
|
+
];
|
|
46
|
+
|
|
47
|
+
// Create files if they don't exist
|
|
48
|
+
templateFiles.forEach(tpl => {
|
|
49
|
+
const destPath = path.join(docsDir, tpl.dest);
|
|
50
|
+
if (!fs.existsSync(destPath)) {
|
|
51
|
+
try {
|
|
52
|
+
// Ensure template exists before reading
|
|
53
|
+
const templatePath = path.join(templatesDir, tpl.src);
|
|
54
|
+
if (fs.existsSync(templatePath)) {
|
|
55
|
+
const content = fs.readFileSync(templatePath, 'utf8');
|
|
56
|
+
fs.writeFileSync(destPath, content);
|
|
57
|
+
stats.created++;
|
|
58
|
+
}
|
|
59
|
+
} catch (e) {
|
|
60
|
+
// Fail silently/warn, do not crash the installer
|
|
61
|
+
console.warn(`Warning: Could not scaffold ${tpl.dest}`);
|
|
62
|
+
}
|
|
63
|
+
} else {
|
|
64
|
+
stats.verified++;
|
|
65
|
+
}
|
|
66
|
+
});
|
|
67
|
+
|
|
68
|
+
return stats;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
module.exports = { generateWorkflowGuide };
|
package/src/lib/i18n.js
CHANGED
|
@@ -1,65 +1,65 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Internal i18n Engine
|
|
3
|
-
*/
|
|
4
|
-
const { TRANSLATIONS } = require('./messages');
|
|
5
|
-
|
|
6
|
-
let currentLocale = 'en';
|
|
7
|
-
|
|
8
|
-
function setLocale(locale) {
|
|
9
|
-
// Normalize logic (pt-br -> pt_br) if passed incorrectly, though prompts usually give controlled values
|
|
10
|
-
const normalized = locale.toLowerCase().replace('-', '_');
|
|
11
|
-
|
|
12
|
-
if (TRANSLATIONS[normalized]) {
|
|
13
|
-
currentLocale = normalized;
|
|
14
|
-
} else {
|
|
15
|
-
// Fallback to en
|
|
16
|
-
currentLocale = 'en';
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
function getLocale() {
|
|
21
|
-
return currentLocale;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
/**
|
|
25
|
-
* Retrieves a string from the dictionary based on dot notation.
|
|
26
|
-
* e.g. t('INTRO.TITLE')
|
|
27
|
-
*/
|
|
28
|
-
function t(path, ...args) {
|
|
29
|
-
const keys = path.split('.');
|
|
30
|
-
let value = TRANSLATIONS[currentLocale];
|
|
31
|
-
|
|
32
|
-
// Traverse the object for the current locale
|
|
33
|
-
for (const key of keys) {
|
|
34
|
-
if (value && value[key]) {
|
|
35
|
-
value = value[key];
|
|
36
|
-
} else {
|
|
37
|
-
value = undefined;
|
|
38
|
-
break;
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
// If not found, Try Fallback to EN
|
|
43
|
-
if (!value) {
|
|
44
|
-
let fallback = TRANSLATIONS['en'];
|
|
45
|
-
for (const k of keys) {
|
|
46
|
-
if (fallback && fallback[k]) fallback = fallback[k];
|
|
47
|
-
else {
|
|
48
|
-
fallback = undefined;
|
|
49
|
-
break;
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
value = fallback;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
// If still not found, return the path itself as a debug marker
|
|
56
|
-
if (!value) return path;
|
|
57
|
-
|
|
58
|
-
if (typeof value === 'function') {
|
|
59
|
-
return value(...args);
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
return value;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
module.exports = { t, setLocale, getLocale };
|
|
1
|
+
/**
|
|
2
|
+
* Internal i18n Engine
|
|
3
|
+
*/
|
|
4
|
+
const { TRANSLATIONS } = require('./messages');
|
|
5
|
+
|
|
6
|
+
let currentLocale = 'en';
|
|
7
|
+
|
|
8
|
+
function setLocale(locale) {
|
|
9
|
+
// Normalize logic (pt-br -> pt_br) if passed incorrectly, though prompts usually give controlled values
|
|
10
|
+
const normalized = locale.toLowerCase().replace('-', '_');
|
|
11
|
+
|
|
12
|
+
if (TRANSLATIONS[normalized]) {
|
|
13
|
+
currentLocale = normalized;
|
|
14
|
+
} else {
|
|
15
|
+
// Fallback to en
|
|
16
|
+
currentLocale = 'en';
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
function getLocale() {
|
|
21
|
+
return currentLocale;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Retrieves a string from the dictionary based on dot notation.
|
|
26
|
+
* e.g. t('INTRO.TITLE')
|
|
27
|
+
*/
|
|
28
|
+
function t(path, ...args) {
|
|
29
|
+
const keys = path.split('.');
|
|
30
|
+
let value = TRANSLATIONS[currentLocale];
|
|
31
|
+
|
|
32
|
+
// Traverse the object for the current locale
|
|
33
|
+
for (const key of keys) {
|
|
34
|
+
if (value && value[key]) {
|
|
35
|
+
value = value[key];
|
|
36
|
+
} else {
|
|
37
|
+
value = undefined;
|
|
38
|
+
break;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
// If not found, Try Fallback to EN
|
|
43
|
+
if (!value) {
|
|
44
|
+
let fallback = TRANSLATIONS['en'];
|
|
45
|
+
for (const k of keys) {
|
|
46
|
+
if (fallback && fallback[k]) fallback = fallback[k];
|
|
47
|
+
else {
|
|
48
|
+
fallback = undefined;
|
|
49
|
+
break;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
value = fallback;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
// If still not found, return the path itself as a debug marker
|
|
56
|
+
if (!value) return path;
|
|
57
|
+
|
|
58
|
+
if (typeof value === 'function') {
|
|
59
|
+
return value(...args);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
return value;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
module.exports = { t, setLocale, getLocale };
|