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.
@@ -1,56 +1,55 @@
1
- const fs = require('fs');
2
- const path = require('path');
3
- const readline = require('readline');
4
-
5
- const docsDir = path.join(process.cwd(), '.sdd-toolkit');
6
- const archiveDir = path.join(docsDir, 'archive');
7
-
8
- // Files to archive (Ephemeral context)
9
- const filesToArchive = ['project.md', 'task.md', 'audit_report.md', 'requirements.md', 'milestones.md'];
10
-
11
- // Files to keep (Long-term context)
12
- // - guidelines.md (Laws)
13
- // - context.md (Project Reality)
14
- // - work_log.md (History)
15
-
16
- const rl = readline.createInterface({
17
- input: process.stdin,
18
- output: process.stdout
19
- });
20
-
21
- console.log('šŸ“¦ SDD SESSION ARCHIVER');
22
- console.log('This will move current Spec, Plan, and Audit reports to .sdd-toolkit/archive/.');
23
- console.log('Your Work Log and Context will remain untouched.\n');
24
-
25
- // Check if there is anything to archive
26
- const existingFiles = filesToArchive.filter(f => fs.existsSync(path.join(docsDir, f)));
27
-
28
- if (existingFiles.length === 0) {
29
- console.log('āŒ No active session files found (spec.md, plan.md, etc). Nothing to archive.');
30
- process.exit(0);
31
- }
32
-
33
- rl.question('Enter a name for this feature/session (e.g., "auth-system"): ', (name) => {
34
- const safeName = (name || 'untitled').replace(/[^a-z0-9-_]/gi, '-').toLowerCase();
35
- const timestamp = new Date().toISOString().split('T')[0];
36
- const folderName = `${timestamp}_${safeName}`;
37
- const targetDir = path.join(archiveDir, folderName);
38
-
39
- if (!fs.existsSync(targetDir)) {
40
- fs.mkdirSync(targetDir, { recursive: true });
41
- }
42
-
43
- console.log(`\nMoving files to: .sdd-toolkit/archive/${folderName}/
44
- `);
45
-
46
- existingFiles.forEach(file => {
47
- const srcPath = path.join(docsDir, file);
48
- const destPath = path.join(targetDir, file);
49
- fs.renameSync(srcPath, destPath);
50
- console.log(`āœ” Archived: ${file}`);
51
- });
52
-
53
- console.log('\nāœ… Session archived successfully!');
54
- console.log('You are ready to start a new feature with /spec');
55
- rl.close();
56
- });
1
+ const fs = require('fs');
2
+ const path = require('path');
3
+ const readline = require('readline');
4
+
5
+ const docsDir = path.join(process.cwd(), '.sdd-toolkit');
6
+ const archiveDir = path.join(docsDir, 'logs', 'archive');
7
+
8
+ // Files to archive (Ephemeral context)
9
+ const filesToArchive = ['project.md', 'task.md', 'audit_report.md', 'requirements.md', 'milestones.md'];
10
+
11
+ // Files to keep (Long-term context)
12
+ // - context.md (Project Reality)
13
+ // - system.md (System State)
14
+
15
+ const rl = readline.createInterface({
16
+ input: process.stdin,
17
+ output: process.stdout
18
+ });
19
+
20
+ console.log('šŸ“¦ SDD SESSION ARCHIVER');
21
+ console.log('This will move current Spec, Plan, and Audit reports to .sdd-toolkit/logs/archive/.');
22
+ console.log('Your Context and System files will remain untouched.\n');
23
+
24
+ // Check if there is anything to archive
25
+ const existingFiles = filesToArchive.filter(f => fs.existsSync(path.join(docsDir, f)));
26
+
27
+ if (existingFiles.length === 0) {
28
+ console.log('āŒ No active session files found (spec.md, plan.md, etc). Nothing to archive.');
29
+ process.exit(0);
30
+ }
31
+
32
+ rl.question('Enter a name for this feature/session (e.g., "auth-system"): ', (name) => {
33
+ const safeName = (name || 'untitled').replace(/[^a-z0-9-_]/gi, '-').toLowerCase();
34
+ const timestamp = new Date().toISOString().split('T')[0];
35
+ const folderName = `${timestamp}_${safeName}`;
36
+ const targetDir = path.join(archiveDir, folderName);
37
+
38
+ if (!fs.existsSync(targetDir)) {
39
+ fs.mkdirSync(targetDir, { recursive: true });
40
+ }
41
+
42
+ console.log(`\nMoving files to: .sdd-toolkit/logs/archive/${folderName}/
43
+ `);
44
+
45
+ existingFiles.forEach(file => {
46
+ const srcPath = path.join(docsDir, file);
47
+ const destPath = path.join(targetDir, file);
48
+ fs.renameSync(srcPath, destPath);
49
+ console.log(`āœ” Archived: ${file}`);
50
+ });
51
+
52
+ console.log('\nāœ… Session archived successfully!');
53
+ console.log('You are ready to start a new feature with /feature');
54
+ rl.close();
55
+ });
@@ -1,19 +1,19 @@
1
- const fs = require('fs');
2
- const path = require('path');
3
-
4
- const docsDir = path.join(process.cwd(), '.sdd-toolkit');
5
-
6
- console.log('āš ļø WARNING: This will wipe all documentation (Spec, Plan, Context).');
7
- console.log('Your source code (src/) will NOT be touched.');
8
- console.log('Are you sure? (Run with --force to execute)');
9
-
10
- if (process.argv.includes('--force')) {
11
- ['project.md', 'task.md', 'requirements.md', 'milestones.md', 'guidelines.md', 'audit_report.md'].forEach(file => {
12
- const p = path.join(docsDir, file);
13
- if (fs.existsSync(p)) {
14
- fs.unlinkSync(p);
15
- console.log(`Deleted: .sdd-toolkit/${file}`);
16
- }
17
- });
18
- console.log('āœ… Wipe complete. You can start fresh with /explore');
19
- }
1
+ const fs = require('fs');
2
+ const path = require('path');
3
+
4
+ const docsDir = path.join(process.cwd(), '.sdd-toolkit');
5
+
6
+ console.log('āš ļø WARNING: This will wipe all documentation (Spec, Plan, Context, System).');
7
+ console.log('Your source code (src/) will NOT be touched.');
8
+ console.log('Are you sure? (Run with --force to execute)');
9
+
10
+ if (process.argv.includes('--force')) {
11
+ ['project.md', 'requirements.md', 'guidelines.md', 'context.md', 'system.md'].forEach(file => {
12
+ const p = path.join(docsDir, file);
13
+ if (fs.existsSync(p)) {
14
+ fs.unlinkSync(p);
15
+ console.log(`Deleted: .sdd-toolkit/${file}`);
16
+ }
17
+ });
18
+ console.log('āœ… Wipe complete. You can start fresh with /project');
19
+ }
@@ -1,58 +1,50 @@
1
- const fs = require('fs');
2
- const path = require('path');
3
-
4
- // Tenta carregar picocolors se estiver disponível no projeto do usuÔrio, senão usa fallback
5
- let pc = {
6
- green: s => s,
7
- blue: s => s,
8
- yellow: s => s,
9
- red: s => s,
10
- bold: s => s,
11
- bgBlue: s => s
12
- };
13
- try { pc = require('picocolors'); } catch (e) {}
14
-
15
- const docsDir = path.join(process.cwd(), '.sdd-toolkit');
16
-
17
- function checkFile(name) {
18
- const p = path.join(docsDir, name);
19
- if (fs.existsSync(p)) {
20
- const stats = fs.statSync(p);
21
- return { exists: true, size: stats.size, mtime: stats.mtime };
22
- }
23
- return { exists: false };
24
- }
25
-
26
- console.clear();
27
- console.log(pc.bgBlue(pc.bold(' šŸ“Š SDD PROJECT STATUS ')));
28
- console.log('');
29
-
30
- // 1. Spec Status
31
- const spec = checkFile('project.md');
32
- if (spec.exists && spec.size > 100) {
33
- console.log(`${pc.green('āœ” Spec Defined')} (Last update: ${spec.mtime.toLocaleString()})`);
34
- } else {
35
- console.log(`${pc.red('āœ– Spec Missing')} (Run /project)`);
36
- }
37
-
38
- // 2. Plan Status
39
- const plan = checkFile('task.md');
40
- if (plan.exists && plan.size > 100) {
41
- console.log(`${pc.green('āœ” Plan Active')} (Last update: ${plan.mtime.toLocaleString()})`);
42
-
43
- // Tenta ler progresso simples
44
- try {
45
- const content = fs.readFileSync(path.join(docsDir, 'task.md'), 'utf-8');
46
- const total = (content.match(/- \[ \]/g) || []).length + (content.match(/- \[x\]/g) || []).length;
47
- const done = (content.match(/- \[x\]/g) || []).length;
48
- if (total > 0) {
49
- const percent = Math.round((done / total) * 100);
50
- console.log(` Progress: [${'#'.repeat(Math.floor(percent/10))}${'-'.repeat(10 - Math.floor(percent/10))}] ${percent}% (${done}/${total} tasks)`);
51
- }
52
- } catch (e) {}
53
- } else {
54
- console.log(`${pc.yellow('⚠ Plan Missing')} (Run /tasks)`);
55
- }
56
-
57
- console.log('');
58
- console.log('Use /build to continue work.');
1
+ const fs = require('fs');
2
+ const path = require('path');
3
+
4
+ // Tenta carregar picocolors se estiver disponível no projeto do usuÔrio, senão usa fallback
5
+ let pc = {
6
+ green: s => s,
7
+ blue: s => s,
8
+ yellow: s => s,
9
+ red: s => s,
10
+ bold: s => s,
11
+ bgBlue: s => s
12
+ };
13
+ try { pc = require('picocolors'); } catch (e) {}
14
+
15
+ const docsDir = path.join(process.cwd(), '.sdd-toolkit');
16
+
17
+ function checkFile(name) {
18
+ const p = path.join(docsDir, name);
19
+ if (fs.existsSync(p)) {
20
+ const stats = fs.statSync(p);
21
+ return { exists: true, size: stats.size, mtime: stats.mtime };
22
+ }
23
+ return { exists: false };
24
+ }
25
+
26
+ console.clear();
27
+ console.log(pc.bgBlue(pc.bold(' šŸ“Š SDD PROJECT STATUS ')));
28
+ console.log('');
29
+
30
+ // 1. Spec Status
31
+ const spec = checkFile('project.md');
32
+ if (spec.exists && spec.size > 100) {
33
+ console.log(`${pc.green('āœ” Spec Defined')} (Last update: ${spec.mtime.toLocaleString()})`);
34
+ } else {
35
+ console.log(`${pc.red('āœ– Spec Missing')} (Run /project)`);
36
+ }
37
+
38
+ // 2. Plan Status - Check for new structure
39
+ const contextFile = checkFile('context.md');
40
+ const stateFiles = fs.readdirSync(path.join(docsDir, 'features')).filter(f => f.endsWith('state.md'));
41
+ const featuresCount = stateFiles.length;
42
+
43
+ if (featuresCount > 0) {
44
+ console.log(`${pc.green('āœ” Features Active')} (${featuresCount} features)`);
45
+ } else {
46
+ console.log(`${pc.yellow('⚠ No Features Found')} (Run /feature)`);
47
+ }
48
+
49
+ console.log('');
50
+ console.log('Use /coder <Task_ID> to continue work.');
@@ -0,0 +1,22 @@
1
+ # šŸ—ŗļø Project Context
2
+
3
+ ## Executive Summary
4
+ - **Architecture:** [To be defined]
5
+ - **Database:** [To be defined]
6
+ - **Auth:** [To be defined]
7
+
8
+ ## Features Matrix
9
+ | Feature | Status | Active Milestone | Progress |
10
+ |---------|--------|------------------|----------|
11
+ | None created yet | - | - | - |
12
+
13
+ ## Key Dependencies
14
+ None defined yet.
15
+
16
+ ## System State
17
+ - Database migrations: TBD
18
+ - Test coverage: TBD
19
+ - Last deployment: TBD
20
+
21
+ ## Quick Access
22
+ - [All Features](features/)
@@ -1,9 +1,9 @@
1
- # šŸ“œ Project Guidelines
2
-
3
- ## šŸ—ļø Architecture Patterns
4
-
5
- ## šŸ’» Code Conventions
6
-
7
- ## šŸ› ļø Tech Stack & Versions
8
-
9
- ## šŸ›”ļø Security & Performance
1
+ # šŸ“œ Project Guidelines
2
+
3
+ ## šŸ—ļø Architecture Patterns
4
+
5
+ ## šŸ’» Code Conventions
6
+
7
+ ## šŸ› ļø Tech Stack & Versions
8
+
9
+ ## šŸ›”ļø Security & Performance
@@ -1,28 +1,28 @@
1
- ---
2
- title:
3
- version:
4
- status:
5
- last_updated:
6
- ---
7
-
8
- #
9
-
10
- ## 1. Overview
11
-
12
- ## 2. Business Objectives
13
-
14
- ## 3. Actors and Personas
15
-
16
- ## 4. Modules and Features Structure
17
-
18
- ## 5. User Journey (Flow)
19
-
20
- ## 6. Business Rules
21
-
22
- ## 7. External Integrations
23
-
24
- ## 8. Non-Functional Requirements & Constraints
25
-
26
- ## 9. Data Definitions
27
-
28
- ## 10. Project Principles (Constitution)
1
+ ---
2
+ title:
3
+ version:
4
+ status:
5
+ last_updated:
6
+ ---
7
+
8
+ #
9
+
10
+ ## 1. Overview
11
+
12
+ ## 2. Business Objectives
13
+
14
+ ## 3. Actors and Personas
15
+
16
+ ## 4. Modules and Features Structure
17
+
18
+ ## 5. User Journey (Flow)
19
+
20
+ ## 6. Business Rules
21
+
22
+ ## 7. External Integrations
23
+
24
+ ## 8. Non-Functional Requirements & Constraints
25
+
26
+ ## 9. Data Definitions
27
+
28
+ ## 10. Project Principles (Constitution)
@@ -1,15 +1,15 @@
1
- ---
2
- title: Requirements and Architecture Specification
3
- scope:
4
- last_updated:
5
- ---
6
-
7
- # Requirements and Stack Catalog
8
-
9
- ## 1. Tech Stack and Standards (Tech Constraints)
10
-
11
- ## 2. Functional Requirements (FR)
12
-
13
- ## 3. Non-Functional Requirements (NFR)
14
-
15
- ## 4. Data Model (Schema Draft)
1
+ ---
2
+ title: Requirements and Architecture Specification
3
+ scope:
4
+ last_updated:
5
+ ---
6
+
7
+ # Requirements and Stack Catalog
8
+
9
+ ## 1. Tech Stack and Standards (Tech Constraints)
10
+
11
+ ## 2. Functional Requirements (FR)
12
+
13
+ ## 3. Non-Functional Requirements (NFR)
14
+
15
+ ## 4. Data Model (Schema Draft)
@@ -0,0 +1,20 @@
1
+ # šŸ–„ļø System State
2
+
3
+ ## Database
4
+ - Current Migration: TBD
5
+ - Pending Migrations: None
6
+ - Database Size: TBD
7
+
8
+ ## Configuration
9
+ - Environment: development
10
+ - API Version: v1
11
+ - Auth Provider: TBD
12
+
13
+ ## Integrations
14
+ None configured yet.
15
+
16
+ ## Known Issues
17
+ None reported yet.
18
+
19
+ ## Deployments
20
+ No deployments yet.
package/templates/task.md CHANGED
@@ -1,11 +1,11 @@
1
- ---
2
- title: Tasks Sprint -
3
- milestone_ref:
4
- tech_stack:
5
- ---
6
-
7
- # Execution Backlog:
8
-
9
- ## Technical Summary
10
-
11
- ## Tasks Checklist
1
+ ---
2
+ title: Tasks Sprint -
3
+ milestone_ref:
4
+ tech_stack:
5
+ ---
6
+
7
+ # Execution Backlog:
8
+
9
+ ## Technical Summary
10
+
11
+ ## Tasks Checklist