sdd-agent-pack 1.0.0

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.
Files changed (56) hide show
  1. package/README.md +128 -0
  2. package/assets/config/agent.config.json +20 -0
  3. package/assets/docs/workflow.md +48 -0
  4. package/assets/hooks/README.md +50 -0
  5. package/assets/hooks/hooks.json +10 -0
  6. package/assets/hooks/pre-implementation.sh +60 -0
  7. package/assets/hooks/stop-hook.sh +52 -0
  8. package/assets/prompts/epic-prompt.md +12 -0
  9. package/assets/skills/sdd-completion/SKILL.md +29 -0
  10. package/assets/skills/sdd-context/SKILL.md +32 -0
  11. package/assets/skills/sdd-epic-workflow/SKILL.md +34 -0
  12. package/assets/skills/sdd-implementation/SKILL.md +30 -0
  13. package/assets/skills/sdd-testing/SKILL.md +36 -0
  14. package/assets/templates/constitution.md +16 -0
  15. package/assets/templates/tasks.md +24 -0
  16. package/dist/commands/doctor.d.ts +6 -0
  17. package/dist/commands/doctor.d.ts.map +1 -0
  18. package/dist/commands/doctor.js +54 -0
  19. package/dist/commands/doctor.js.map +1 -0
  20. package/dist/commands/help.d.ts +6 -0
  21. package/dist/commands/help.d.ts.map +1 -0
  22. package/dist/commands/help.js +41 -0
  23. package/dist/commands/help.js.map +1 -0
  24. package/dist/commands/init.d.ts +6 -0
  25. package/dist/commands/init.d.ts.map +1 -0
  26. package/dist/commands/init.js +70 -0
  27. package/dist/commands/init.js.map +1 -0
  28. package/dist/commands/status.d.ts +6 -0
  29. package/dist/commands/status.d.ts.map +1 -0
  30. package/dist/commands/status.js +51 -0
  31. package/dist/commands/status.js.map +1 -0
  32. package/dist/commands/uninstall.d.ts +6 -0
  33. package/dist/commands/uninstall.d.ts.map +1 -0
  34. package/dist/commands/uninstall.js +49 -0
  35. package/dist/commands/uninstall.js.map +1 -0
  36. package/dist/commands/update.d.ts +6 -0
  37. package/dist/commands/update.d.ts.map +1 -0
  38. package/dist/commands/update.js +45 -0
  39. package/dist/commands/update.js.map +1 -0
  40. package/dist/index.d.ts +9 -0
  41. package/dist/index.d.ts.map +1 -0
  42. package/dist/index.js +28 -0
  43. package/dist/index.js.map +1 -0
  44. package/dist/utils/console.d.ts +12 -0
  45. package/dist/utils/console.d.ts.map +1 -0
  46. package/dist/utils/console.js +13 -0
  47. package/dist/utils/console.js.map +1 -0
  48. package/dist/utils/installer.d.ts +27 -0
  49. package/dist/utils/installer.d.ts.map +1 -0
  50. package/dist/utils/installer.js +190 -0
  51. package/dist/utils/installer.js.map +1 -0
  52. package/dist/utils/repo.d.ts +10 -0
  53. package/dist/utils/repo.d.ts.map +1 -0
  54. package/dist/utils/repo.js +31 -0
  55. package/dist/utils/repo.js.map +1 -0
  56. package/package.json +40 -0
@@ -0,0 +1,41 @@
1
+ /**
2
+ * help command — Show all commands with descriptions.
3
+ */
4
+ import { Command } from 'commander';
5
+ import { term } from '../utils/console.js';
6
+ export const helpCommand = new Command('help')
7
+ .description('Show all SDD Agent Pack commands and usage')
8
+ .action(() => {
9
+ term.log('');
10
+ term.log('━━━ SDD Agent Pack ━━━');
11
+ term.log('Lightweight installer for SDD workflow assets.\n');
12
+ term.log('Commands:\n');
13
+ term.log(' init Initialize SDD Agent Pack in the current repository');
14
+ term.log(' Creates .sdd-agent-pack/ with skills, hooks, prompts,');
15
+ term.log(' templates, docs, and config. Updates AGENTS.md.');
16
+ term.log('');
17
+ term.log(' update Update SDD Agent Pack assets in an installed repository');
18
+ term.log(' Backs up existing files, installs new assets, preserves');
19
+ term.log(' user changes where possible.');
20
+ term.log('');
21
+ term.log(' uninstall Remove SDD Agent Pack from the current repository');
22
+ term.log(' Removes .sdd-agent-pack/ and cleans AGENTS.md. Optionally');
23
+ term.log(' restores from backup (--keep-backups).');
24
+ term.log('');
25
+ term.log(' doctor Validate installation and environment');
26
+ term.log(' Checks Git repo, installation status, and file structure.');
27
+ term.log('');
28
+ term.log(' status Show installation status');
29
+ term.log(' Displays which components are installed and their state.');
30
+ term.log('');
31
+ term.log(' help Show this help message\n');
32
+ term.log('Usage:\n');
33
+ term.log(' npx sdd-agent-pack init');
34
+ term.log(' npx sdd-agent-pack update');
35
+ term.log(' npx sdd-agent-pack uninstall');
36
+ term.log(' npx sdd-agent-pack doctor');
37
+ term.log(' npx sdd-agent-pack status');
38
+ term.log(' npx sdd-agent-pack help\n');
39
+ term.log('Documentation: .sdd-agent-pack/docs/workflow.md (after init)\n');
40
+ });
41
+ //# sourceMappingURL=help.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"help.js","sourceRoot":"","sources":["../../src/commands/help.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AAE3C,MAAM,CAAC,MAAM,WAAW,GAAG,IAAI,OAAO,CAAC,MAAM,CAAC;KAC3C,WAAW,CAAC,4CAA4C,CAAC;KACzD,MAAM,CAAC,GAAG,EAAE;IACX,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IACb,IAAI,CAAC,GAAG,CAAC,wBAAwB,CAAC,CAAC;IACnC,IAAI,CAAC,GAAG,CAAC,kDAAkD,CAAC,CAAC;IAC7D,IAAI,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;IACxB,IAAI,CAAC,GAAG,CAAC,mEAAmE,CAAC,CAAC;IAC9E,IAAI,CAAC,GAAG,CAAC,sEAAsE,CAAC,CAAC;IACjF,IAAI,CAAC,GAAG,CAAC,gEAAgE,CAAC,CAAC;IAC3E,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IACb,IAAI,CAAC,GAAG,CAAC,uEAAuE,CAAC,CAAC;IAClF,IAAI,CAAC,GAAG,CAAC,wEAAwE,CAAC,CAAC;IACnF,IAAI,CAAC,GAAG,CAAC,6CAA6C,CAAC,CAAC;IACxD,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IACb,IAAI,CAAC,GAAG,CAAC,iEAAiE,CAAC,CAAC;IAC5E,IAAI,CAAC,GAAG,CAAC,0EAA0E,CAAC,CAAC;IACrF,IAAI,CAAC,GAAG,CAAC,uDAAuD,CAAC,CAAC;IAClE,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IACb,IAAI,CAAC,GAAG,CAAC,qDAAqD,CAAC,CAAC;IAChE,IAAI,CAAC,GAAG,CAAC,0EAA0E,CAAC,CAAC;IACrF,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IACb,IAAI,CAAC,GAAG,CAAC,wCAAwC,CAAC,CAAC;IACnD,IAAI,CAAC,GAAG,CAAC,yEAAyE,CAAC,CAAC;IACpF,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IACb,IAAI,CAAC,GAAG,CAAC,wCAAwC,CAAC,CAAC;IACnD,IAAI,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;IACrB,IAAI,CAAC,GAAG,CAAC,2BAA2B,CAAC,CAAC;IACtC,IAAI,CAAC,GAAG,CAAC,6BAA6B,CAAC,CAAC;IACxC,IAAI,CAAC,GAAG,CAAC,gCAAgC,CAAC,CAAC;IAC3C,IAAI,CAAC,GAAG,CAAC,6BAA6B,CAAC,CAAC;IACxC,IAAI,CAAC,GAAG,CAAC,6BAA6B,CAAC,CAAC;IACxC,IAAI,CAAC,GAAG,CAAC,6BAA6B,CAAC,CAAC;IACxC,IAAI,CAAC,GAAG,CAAC,gEAAgE,CAAC,CAAC;AAC7E,CAAC,CAAC,CAAC"}
@@ -0,0 +1,6 @@
1
+ /**
2
+ * init command — Install SDD Agent Pack into a target application repository.
3
+ */
4
+ import { Command } from 'commander';
5
+ export declare const initCommand: Command;
6
+ //# sourceMappingURL=init.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../src/commands/init.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAKpC,eAAO,MAAM,WAAW,SAuEpB,CAAC"}
@@ -0,0 +1,70 @@
1
+ /**
2
+ * init command — Install SDD Agent Pack into a target application repository.
3
+ */
4
+ import { Command } from 'commander';
5
+ import { detectRepoRoot, isGitRepository, detectExistingInstallation } from '../utils/repo.js';
6
+ import { backupFiles, createDirectories, installAssets, updateAgentsMd, updateGitignore, validateInstallation } from '../utils/installer.js';
7
+ import { term } from '../utils/console.js';
8
+ export const initCommand = new Command('init')
9
+ .description('Initialize SDD Agent Pack in the current repository')
10
+ .option('-f, --force', 'Force installation even if already installed')
11
+ .action(async (options) => {
12
+ term.log('\n━━━ SDD Agent Pack Init ━━━\n');
13
+ // 1. Detect repo root
14
+ const repoRoot = detectRepoRoot();
15
+ if (!repoRoot) {
16
+ term.error('✗ Not in a Git repository');
17
+ process.exit(1);
18
+ }
19
+ term.info(`Repository root: ${repoRoot}`);
20
+ // 2. Verify Git
21
+ if (!isGitRepository(repoRoot)) {
22
+ term.error('✗ Not a valid Git repository');
23
+ process.exit(1);
24
+ }
25
+ term.success('✓ Valid Git repository');
26
+ // 3. Detect existing
27
+ const existing = detectExistingInstallation(repoRoot);
28
+ if (existing && !options.force) {
29
+ term.warn('⚠ SDD Agent Pack already installed');
30
+ term.log(' Use --force to reinstall or "sdd-agent-pack update" to update');
31
+ return;
32
+ }
33
+ // 4. Backup
34
+ await backupFiles(repoRoot);
35
+ term.success('✓ Backup created');
36
+ // 5. Create directories
37
+ await createDirectories(repoRoot);
38
+ term.success('✓ Directories created');
39
+ // 6. Install assets
40
+ await installAssets(repoRoot);
41
+ term.success('✓ Assets installed');
42
+ // 7. Update AGENTS.md
43
+ await updateAgentsMd(repoRoot);
44
+ term.success('✓ AGENTS.md updated');
45
+ // 8. Update .gitignore
46
+ await updateGitignore(repoRoot);
47
+ term.success('✓ .gitignore updated');
48
+ // 9. Validate
49
+ const valid = await validateInstallation(repoRoot);
50
+ if (!valid) {
51
+ term.error('✗ Installation validation failed');
52
+ process.exit(1);
53
+ }
54
+ term.success('✓ Installation validated');
55
+ // 10. Summary
56
+ term.log('\n━━━ SDD Agent Pack installed successfully! ━━━\n');
57
+ term.log('Installed:');
58
+ term.log(' .sdd-agent-pack/skills/ — OpenHands microagents');
59
+ term.log(' .sdd-agent-pack/prompts/ — Workflow prompts');
60
+ term.log(' .sdd-agent-pack/hooks/ — Quality enforcement hooks');
61
+ term.log(' .sdd-agent-pack/docs/ — Workflow documentation');
62
+ term.log(' .sdd-agent-pack/templates/— SDD document templates');
63
+ term.log(' .sdd-agent-pack/config/ — Agent configuration');
64
+ term.log('\nNext steps:');
65
+ term.log(' 1. Review .sdd-agent-pack/docs/ for workflow docs');
66
+ term.log(' 2. Create or update tasks.md with your epics');
67
+ term.log(' 3. Ask your AI agent to implement epics following the SDD workflow');
68
+ term.log('');
69
+ });
70
+ //# sourceMappingURL=init.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"init.js","sourceRoot":"","sources":["../../src/commands/init.ts"],"names":[],"mappings":"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"}
@@ -0,0 +1,6 @@
1
+ /**
2
+ * status command — Show SDD Agent Pack installation status.
3
+ */
4
+ import { Command } from 'commander';
5
+ export declare const statusCommand: Command;
6
+ //# sourceMappingURL=status.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"status.d.ts","sourceRoot":"","sources":["../../src/commands/status.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAKpC,eAAO,MAAM,aAAa,SAgDtB,CAAC"}
@@ -0,0 +1,51 @@
1
+ /**
2
+ * status command — Show SDD Agent Pack installation status.
3
+ */
4
+ import { Command } from 'commander';
5
+ import { detectRepoRoot, isGitRepository, detectExistingInstallation } from '../utils/repo.js';
6
+ import { validateInstallation } from '../utils/installer.js';
7
+ import { term } from '../utils/console.js';
8
+ export const statusCommand = new Command('status')
9
+ .description('Show SDD Agent Pack installation status')
10
+ .action(async () => {
11
+ term.log('\n━━━ SDD Agent Pack Status ━━━\n');
12
+ const repoRoot = detectRepoRoot();
13
+ if (!repoRoot) {
14
+ term.error('✗ Not inside a Git repository');
15
+ process.exit(1);
16
+ }
17
+ term.info(`Repository: ${repoRoot}`);
18
+ if (!isGitRepository(repoRoot)) {
19
+ term.error('✗ Not a valid Git repository');
20
+ process.exit(1);
21
+ }
22
+ term.success('✓ Valid Git repository');
23
+ const installed = detectExistingInstallation(repoRoot);
24
+ if (!installed) {
25
+ term.warn('⚠ SDD Agent Pack not installed');
26
+ term.log(' Run "sdd-agent-pack init" to install');
27
+ process.exit(0);
28
+ }
29
+ term.success('✓ SDD Agent Pack installed');
30
+ const valid = await validateInstallation(repoRoot);
31
+ if (valid) {
32
+ term.success('✓ Installation is valid');
33
+ }
34
+ else {
35
+ term.error('✗ Installation is incomplete — re-run "sdd-agent-pack init"');
36
+ }
37
+ // Show component status
38
+ term.log('\nComponents:');
39
+ const componentStatus = (name, ok) => {
40
+ term.log(` ${ok ? '✓' : '✗'} ${name}`);
41
+ };
42
+ componentStatus('Skills (.sdd-agent-pack/skills/)', valid);
43
+ componentStatus('Prompts (.sdd-agent-pack/prompts/)', valid);
44
+ componentStatus('Hooks (.sdd-agent-pack/hooks/)', valid);
45
+ componentStatus('Docs (.sdd-agent-pack/docs/)', valid);
46
+ componentStatus('Templates (.sdd-agent-pack/templates/)', valid);
47
+ componentStatus('Config (.sdd-agent-pack/config/)', valid);
48
+ componentStatus('AGENTS.md integration', valid);
49
+ term.log('');
50
+ });
51
+ //# sourceMappingURL=status.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"status.js","sourceRoot":"","sources":["../../src/commands/status.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,0BAA0B,EAAE,MAAM,kBAAkB,CAAC;AAC/F,OAAO,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAC7D,OAAO,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AAE3C,MAAM,CAAC,MAAM,aAAa,GAAG,IAAI,OAAO,CAAC,QAAQ,CAAC;KAC/C,WAAW,CAAC,yCAAyC,CAAC;KACtD,MAAM,CAAC,KAAK,IAAI,EAAE;IACjB,IAAI,CAAC,GAAG,CAAC,mCAAmC,CAAC,CAAC;IAE9C,MAAM,QAAQ,GAAG,cAAc,EAAE,CAAC;IAClC,IAAI,CAAC,QAAQ,EAAE,CAAC;QACd,IAAI,CAAC,KAAK,CAAC,+BAA+B,CAAC,CAAC;QAC5C,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;IAED,IAAI,CAAC,IAAI,CAAC,eAAe,QAAQ,EAAE,CAAC,CAAC;IAErC,IAAI,CAAC,eAAe,CAAC,QAAQ,CAAC,EAAE,CAAC;QAC/B,IAAI,CAAC,KAAK,CAAC,8BAA8B,CAAC,CAAC;QAC3C,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;IACD,IAAI,CAAC,OAAO,CAAC,wBAAwB,CAAC,CAAC;IAEvC,MAAM,SAAS,GAAG,0BAA0B,CAAC,QAAQ,CAAC,CAAC;IACvD,IAAI,CAAC,SAAS,EAAE,CAAC;QACf,IAAI,CAAC,IAAI,CAAC,gCAAgC,CAAC,CAAC;QAC5C,IAAI,CAAC,GAAG,CAAC,wCAAwC,CAAC,CAAC;QACnD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;IACD,IAAI,CAAC,OAAO,CAAC,4BAA4B,CAAC,CAAC;IAE3C,MAAM,KAAK,GAAG,MAAM,oBAAoB,CAAC,QAAQ,CAAC,CAAC;IACnD,IAAI,KAAK,EAAE,CAAC;QACV,IAAI,CAAC,OAAO,CAAC,yBAAyB,CAAC,CAAC;IAC1C,CAAC;SAAM,CAAC;QACN,IAAI,CAAC,KAAK,CAAC,6DAA6D,CAAC,CAAC;IAC5E,CAAC;IAED,wBAAwB;IACxB,IAAI,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC;IAC1B,MAAM,eAAe,GAAG,CAAC,IAAY,EAAE,EAAW,EAAE,EAAE;QACpD,IAAI,CAAC,GAAG,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,IAAI,IAAI,EAAE,CAAC,CAAC;IAC1C,CAAC,CAAC;IACF,eAAe,CAAC,kCAAkC,EAAE,KAAK,CAAC,CAAC;IAC3D,eAAe,CAAC,oCAAoC,EAAE,KAAK,CAAC,CAAC;IAC7D,eAAe,CAAC,gCAAgC,EAAE,KAAK,CAAC,CAAC;IACzD,eAAe,CAAC,8BAA8B,EAAE,KAAK,CAAC,CAAC;IACvD,eAAe,CAAC,wCAAwC,EAAE,KAAK,CAAC,CAAC;IACjE,eAAe,CAAC,kCAAkC,EAAE,KAAK,CAAC,CAAC;IAC3D,eAAe,CAAC,uBAAuB,EAAE,KAAK,CAAC,CAAC;IAEhD,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;AACf,CAAC,CAAC,CAAC"}
@@ -0,0 +1,6 @@
1
+ /**
2
+ * uninstall command — Remove SDD Agent Pack assets from a repository.
3
+ */
4
+ import { Command } from 'commander';
5
+ export declare const uninstallCommand: Command;
6
+ //# sourceMappingURL=uninstall.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"uninstall.d.ts","sourceRoot":"","sources":["../../src/commands/uninstall.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAKpC,eAAO,MAAM,gBAAgB,SA+CzB,CAAC"}
@@ -0,0 +1,49 @@
1
+ /**
2
+ * uninstall command — Remove SDD Agent Pack assets from a repository.
3
+ */
4
+ import { Command } from 'commander';
5
+ import { detectRepoRoot, isGitRepository, detectExistingInstallation } from '../utils/repo.js';
6
+ import { removeAssets, cleanAgentsMd, cleanGitignore } from '../utils/installer.js';
7
+ import { term } from '../utils/console.js';
8
+ export const uninstallCommand = new Command('uninstall')
9
+ .description('Remove SDD Agent Pack from the current repository')
10
+ .option('-b, --keep-backups', 'Keep backup files after uninstallation')
11
+ .action(async (options) => {
12
+ term.log('\n━━━ SDD Agent Pack Uninstall ━━━\n');
13
+ const repoRoot = detectRepoRoot();
14
+ if (!repoRoot) {
15
+ term.error('✗ Not in a Git repository');
16
+ process.exit(1);
17
+ }
18
+ if (!isGitRepository(repoRoot)) {
19
+ term.error('✗ Not a valid Git repository');
20
+ process.exit(1);
21
+ }
22
+ const existing = detectExistingInstallation(repoRoot);
23
+ if (!existing) {
24
+ term.warn('⚠ SDD Agent Pack not installed — nothing to uninstall');
25
+ return;
26
+ }
27
+ // Remove assets
28
+ await removeAssets(repoRoot);
29
+ term.success('✓ Assets removed');
30
+ // Clean AGENTS.md
31
+ await cleanAgentsMd(repoRoot);
32
+ term.success('✓ AGENTS.md cleaned');
33
+ // Clean .gitignore
34
+ await cleanGitignore(repoRoot);
35
+ term.success('✓ .gitignore cleaned');
36
+ // Handle backups
37
+ if (options.keepBackups) {
38
+ term.log(' Backups preserved at .sdd-agent-pack-backup/');
39
+ }
40
+ else {
41
+ // Clean up backup directory too
42
+ const { rm } = await import('fs/promises');
43
+ const { join } = await import('path');
44
+ await rm(join(repoRoot, '.sdd-agent-pack-backup'), { recursive: true, force: true });
45
+ term.success('✓ Backups cleaned');
46
+ }
47
+ term.log('\n━━━ SDD Agent Pack uninstalled successfully! ━━━\n');
48
+ });
49
+ //# sourceMappingURL=uninstall.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"uninstall.js","sourceRoot":"","sources":["../../src/commands/uninstall.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,0BAA0B,EAAE,MAAM,kBAAkB,CAAC;AAC/F,OAAO,EAAkB,YAAY,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACpG,OAAO,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AAE3C,MAAM,CAAC,MAAM,gBAAgB,GAAG,IAAI,OAAO,CAAC,WAAW,CAAC;KACrD,WAAW,CAAC,mDAAmD,CAAC;KAChE,MAAM,CAAC,oBAAoB,EAAE,wCAAwC,CAAC;KACtE,MAAM,CAAC,KAAK,EAAE,OAAkC,EAAE,EAAE;IACnD,IAAI,CAAC,GAAG,CAAC,sCAAsC,CAAC,CAAC;IAEjD,MAAM,QAAQ,GAAG,cAAc,EAAE,CAAC;IAClC,IAAI,CAAC,QAAQ,EAAE,CAAC;QACd,IAAI,CAAC,KAAK,CAAC,2BAA2B,CAAC,CAAC;QACxC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;IAED,IAAI,CAAC,eAAe,CAAC,QAAQ,CAAC,EAAE,CAAC;QAC/B,IAAI,CAAC,KAAK,CAAC,8BAA8B,CAAC,CAAC;QAC3C,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;IAED,MAAM,QAAQ,GAAG,0BAA0B,CAAC,QAAQ,CAAC,CAAC;IACtD,IAAI,CAAC,QAAQ,EAAE,CAAC;QACd,IAAI,CAAC,IAAI,CAAC,uDAAuD,CAAC,CAAC;QACnE,OAAO;IACT,CAAC;IAED,gBAAgB;IAChB,MAAM,YAAY,CAAC,QAAQ,CAAC,CAAC;IAC7B,IAAI,CAAC,OAAO,CAAC,kBAAkB,CAAC,CAAC;IAEjC,kBAAkB;IAClB,MAAM,aAAa,CAAC,QAAQ,CAAC,CAAC;IAC9B,IAAI,CAAC,OAAO,CAAC,qBAAqB,CAAC,CAAC;IAEpC,mBAAmB;IACnB,MAAM,cAAc,CAAC,QAAQ,CAAC,CAAC;IAC/B,IAAI,CAAC,OAAO,CAAC,sBAAsB,CAAC,CAAC;IAErC,iBAAiB;IACjB,IAAI,OAAO,CAAC,WAAW,EAAE,CAAC;QACxB,IAAI,CAAC,GAAG,CAAC,gDAAgD,CAAC,CAAC;IAC7D,CAAC;SAAM,CAAC;QACN,gCAAgC;QAChC,MAAM,EAAE,EAAE,EAAE,GAAG,MAAM,MAAM,CAAC,aAAa,CAAC,CAAC;QAC3C,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,MAAM,CAAC,MAAM,CAAC,CAAC;QACtC,MAAM,EAAE,CAAC,IAAI,CAAC,QAAQ,EAAE,wBAAwB,CAAC,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;QACrF,IAAI,CAAC,OAAO,CAAC,mBAAmB,CAAC,CAAC;IACpC,CAAC;IAED,IAAI,CAAC,GAAG,CAAC,sDAAsD,CAAC,CAAC;AACnE,CAAC,CAAC,CAAC"}
@@ -0,0 +1,6 @@
1
+ /**
2
+ * update command — Update SDD Agent Pack assets in an installed repository.
3
+ */
4
+ import { Command } from 'commander';
5
+ export declare const updateCommand: Command;
6
+ //# sourceMappingURL=update.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"update.d.ts","sourceRoot":"","sources":["../../src/commands/update.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAKpC,eAAO,MAAM,aAAa,SA6CtB,CAAC"}
@@ -0,0 +1,45 @@
1
+ /**
2
+ * update command — Update SDD Agent Pack assets in an installed repository.
3
+ */
4
+ import { Command } from 'commander';
5
+ import { detectRepoRoot, isGitRepository, detectExistingInstallation } from '../utils/repo.js';
6
+ import { backupFiles, createDirectories, installAssets, updateAgentsMd, updateGitignore, validateInstallation } from '../utils/installer.js';
7
+ import { term } from '../utils/console.js';
8
+ export const updateCommand = new Command('update')
9
+ .description('Update SDD Agent Pack assets in the current repository')
10
+ .option('-f, --force', 'Force update even if no changes detected')
11
+ .action(async () => {
12
+ term.log('\n━━━ SDD Agent Pack Update ━━━\n');
13
+ const repoRoot = detectRepoRoot();
14
+ if (!repoRoot) {
15
+ term.error('✗ Not in a Git repository');
16
+ process.exit(1);
17
+ }
18
+ if (!isGitRepository(repoRoot)) {
19
+ term.error('✗ Not a valid Git repository');
20
+ process.exit(1);
21
+ }
22
+ term.success('✓ Valid Git repository');
23
+ const existing = detectExistingInstallation(repoRoot);
24
+ if (!existing) {
25
+ term.warn('⚠ SDD Agent Pack not installed');
26
+ term.log(' Run "sdd-agent-pack init" first');
27
+ process.exit(1);
28
+ }
29
+ await backupFiles(repoRoot);
30
+ term.success('✓ Backup created');
31
+ await createDirectories(repoRoot);
32
+ await installAssets(repoRoot);
33
+ term.success('✓ Assets updated');
34
+ await updateAgentsMd(repoRoot);
35
+ term.success('✓ AGENTS.md updated');
36
+ await updateGitignore(repoRoot);
37
+ term.success('✓ .gitignore updated');
38
+ const valid = await validateInstallation(repoRoot);
39
+ if (!valid) {
40
+ term.error('✗ Validation failed after update');
41
+ process.exit(1);
42
+ }
43
+ term.log('\n━━━ SDD Agent Pack updated successfully! ━━━\n');
44
+ });
45
+ //# sourceMappingURL=update.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"update.js","sourceRoot":"","sources":["../../src/commands/update.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,0BAA0B,EAAE,MAAM,kBAAkB,CAAC;AAC/F,OAAO,EAAE,WAAW,EAAE,iBAAiB,EAAE,aAAa,EAAE,cAAc,EAAE,eAAe,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAC7I,OAAO,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AAE3C,MAAM,CAAC,MAAM,aAAa,GAAG,IAAI,OAAO,CAAC,QAAQ,CAAC;KAC/C,WAAW,CAAC,wDAAwD,CAAC;KACrE,MAAM,CAAC,aAAa,EAAE,0CAA0C,CAAC;KACjE,MAAM,CAAC,KAAK,IAAI,EAAE;IACjB,IAAI,CAAC,GAAG,CAAC,mCAAmC,CAAC,CAAC;IAE9C,MAAM,QAAQ,GAAG,cAAc,EAAE,CAAC;IAClC,IAAI,CAAC,QAAQ,EAAE,CAAC;QACd,IAAI,CAAC,KAAK,CAAC,2BAA2B,CAAC,CAAC;QACxC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;IAED,IAAI,CAAC,eAAe,CAAC,QAAQ,CAAC,EAAE,CAAC;QAC/B,IAAI,CAAC,KAAK,CAAC,8BAA8B,CAAC,CAAC;QAC3C,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;IACD,IAAI,CAAC,OAAO,CAAC,wBAAwB,CAAC,CAAC;IAEvC,MAAM,QAAQ,GAAG,0BAA0B,CAAC,QAAQ,CAAC,CAAC;IACtD,IAAI,CAAC,QAAQ,EAAE,CAAC;QACd,IAAI,CAAC,IAAI,CAAC,gCAAgC,CAAC,CAAC;QAC5C,IAAI,CAAC,GAAG,CAAC,mCAAmC,CAAC,CAAC;QAC9C,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;IAED,MAAM,WAAW,CAAC,QAAQ,CAAC,CAAC;IAC5B,IAAI,CAAC,OAAO,CAAC,kBAAkB,CAAC,CAAC;IAEjC,MAAM,iBAAiB,CAAC,QAAQ,CAAC,CAAC;IAClC,MAAM,aAAa,CAAC,QAAQ,CAAC,CAAC;IAC9B,IAAI,CAAC,OAAO,CAAC,kBAAkB,CAAC,CAAC;IAEjC,MAAM,cAAc,CAAC,QAAQ,CAAC,CAAC;IAC/B,IAAI,CAAC,OAAO,CAAC,qBAAqB,CAAC,CAAC;IAEpC,MAAM,eAAe,CAAC,QAAQ,CAAC,CAAC;IAChC,IAAI,CAAC,OAAO,CAAC,sBAAsB,CAAC,CAAC;IAErC,MAAM,KAAK,GAAG,MAAM,oBAAoB,CAAC,QAAQ,CAAC,CAAC;IACnD,IAAI,CAAC,KAAK,EAAE,CAAC;QACX,IAAI,CAAC,KAAK,CAAC,kCAAkC,CAAC,CAAC;QAC/C,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;IAED,IAAI,CAAC,GAAG,CAAC,kDAAkD,CAAC,CAAC;AAC/D,CAAC,CAAC,CAAC"}
@@ -0,0 +1,9 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * SDD Agent Pack CLI
4
+ *
5
+ * Lightweight installer for SDD workflow assets into application repositories.
6
+ * This is the main entry point for the `sdd-agent-pack` CLI tool.
7
+ */
8
+ export {};
9
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAEA;;;;;GAKG"}
package/dist/index.js ADDED
@@ -0,0 +1,28 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * SDD Agent Pack CLI
4
+ *
5
+ * Lightweight installer for SDD workflow assets into application repositories.
6
+ * This is the main entry point for the `sdd-agent-pack` CLI tool.
7
+ */
8
+ import { Command } from 'commander';
9
+ import { initCommand } from './commands/init.js';
10
+ import { updateCommand } from './commands/update.js';
11
+ import { uninstallCommand } from './commands/uninstall.js';
12
+ import { doctorCommand } from './commands/doctor.js';
13
+ import { statusCommand } from './commands/status.js';
14
+ import { helpCommand } from './commands/help.js';
15
+ const pkg = { version: '1.0.0', description: 'Lightweight installer for SDD workflow assets into application repositories' };
16
+ const program = new Command();
17
+ program
18
+ .name('sdd-agent-pack')
19
+ .description(pkg.description)
20
+ .version(pkg.version)
21
+ .addCommand(initCommand)
22
+ .addCommand(updateCommand)
23
+ .addCommand(uninstallCommand)
24
+ .addCommand(doctorCommand)
25
+ .addCommand(statusCommand)
26
+ .addCommand(helpCommand);
27
+ program.parse();
28
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAEA;;;;;GAKG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAEjD,MAAM,GAAG,GAA6C,EAAE,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,6EAA6E,EAAE,CAAC;AAEvK,MAAM,OAAO,GAAG,IAAI,OAAO,EAAE,CAAC;AAE9B,OAAO;KACJ,IAAI,CAAC,gBAAgB,CAAC;KACtB,WAAW,CAAC,GAAG,CAAC,WAAW,CAAC;KAC5B,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC;KACpB,UAAU,CAAC,WAAW,CAAC;KACvB,UAAU,CAAC,aAAa,CAAC;KACzB,UAAU,CAAC,gBAAgB,CAAC;KAC5B,UAAU,CAAC,aAAa,CAAC;KACzB,UAAU,CAAC,aAAa,CAAC;KACzB,UAAU,CAAC,WAAW,CAAC,CAAC;AAE3B,OAAO,CAAC,KAAK,EAAE,CAAC"}
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Colored console output utilities.
3
+ * Uses a safe name to avoid shadowing the global `console`.
4
+ */
5
+ export declare const term: {
6
+ log: (...args: unknown[]) => void;
7
+ error: (...args: unknown[]) => void;
8
+ warn: (...args: unknown[]) => void;
9
+ info: (...args: unknown[]) => void;
10
+ success: (...args: unknown[]) => void;
11
+ };
12
+ //# sourceMappingURL=console.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"console.d.ts","sourceRoot":"","sources":["../../src/utils/console.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,eAAO,MAAM,IAAI;mBACA,OAAO,EAAE;qBACP,OAAO,EAAE;oBACV,OAAO,EAAE;oBACT,OAAO,EAAE;uBACN,OAAO,EAAE;CAC7B,CAAC"}
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Colored console output utilities.
3
+ * Uses a safe name to avoid shadowing the global `console`.
4
+ */
5
+ import chalk from 'chalk';
6
+ export const term = {
7
+ log: (...args) => console.log(...args),
8
+ error: (...args) => console.error(chalk.red(...args)),
9
+ warn: (...args) => console.warn(chalk.yellow(...args)),
10
+ info: (...args) => console.log(chalk.blue(...args)),
11
+ success: (...args) => console.log(chalk.green(...args)),
12
+ };
13
+ //# sourceMappingURL=console.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"console.js","sourceRoot":"","sources":["../../src/utils/console.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,MAAM,CAAC,MAAM,IAAI,GAAG;IAClB,GAAG,EAAE,CAAC,GAAG,IAAe,EAAE,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC;IACjD,KAAK,EAAE,CAAC,GAAG,IAAe,EAAE,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,CAAC;IAChE,IAAI,EAAE,CAAC,GAAG,IAAe,EAAE,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC,CAAC;IACjE,IAAI,EAAE,CAAC,GAAG,IAAe,EAAE,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,CAAC;IAC9D,OAAO,EAAE,CAAC,GAAG,IAAe,EAAE,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC,CAAC;CACnE,CAAC"}
@@ -0,0 +1,27 @@
1
+ /**
2
+ * Installer utility functions for SDD Agent Pack.
3
+ *
4
+ * These functions handle installing SDD workflow assets into a target
5
+ * application repository (NOT the SDD Agent Pack source repo itself).
6
+ */
7
+ /** Backup existing .sdd-agent-pack directory before modification */
8
+ export declare function backupFiles(repoRoot: string): Promise<void>;
9
+ /** Create required subdirectories inside .sdd-agent-pack */
10
+ export declare function createDirectories(repoRoot: string): Promise<void>;
11
+ /** Install SDD Agent Pack asset files into the target repository */
12
+ export declare function installAssets(repoRoot: string): Promise<void>;
13
+ /** Update AGENTS.md with a managed SDD Agent Pack section */
14
+ export declare function updateAgentsMd(repoRoot: string): Promise<void>;
15
+ /** Add .sdd-agent-pack-backup to .gitignore */
16
+ export declare function updateGitignore(repoRoot: string): Promise<void>;
17
+ /** Validate the installation in the target repository */
18
+ export declare function validateInstallation(repoRoot: string): Promise<boolean>;
19
+ /** Restore backup of .sdd-agent-pack */
20
+ export declare function restoreBackups(repoRoot: string): Promise<void>;
21
+ /** Remove .sdd-agent-pack directory */
22
+ export declare function removeAssets(repoRoot: string): Promise<void>;
23
+ /** Remove the SDD Agent Pack section from AGENTS.md */
24
+ export declare function cleanAgentsMd(repoRoot: string): Promise<void>;
25
+ /** Remove .sdd-agent-pack-backup from .gitignore */
26
+ export declare function cleanGitignore(repoRoot: string): Promise<void>;
27
+ //# sourceMappingURL=installer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"installer.d.ts","sourceRoot":"","sources":["../../src/utils/installer.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AA0DH,oEAAoE;AACpE,wBAAsB,WAAW,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAQjE;AAED,4DAA4D;AAC5D,wBAAsB,iBAAiB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAKvE;AAED,oEAAoE;AACpE,wBAAsB,aAAa,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAYnE;AAED,6DAA6D;AAC7D,wBAAsB,cAAc,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAsBpE;AAED,+CAA+C;AAC/C,wBAAsB,eAAe,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAmBrE;AAED,yDAAyD;AACzD,wBAAsB,oBAAoB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAqB7E;AAED,wCAAwC;AACxC,wBAAsB,cAAc,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAUpE;AAED,uCAAuC;AACvC,wBAAsB,YAAY,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAElE;AAED,uDAAuD;AACvD,wBAAsB,aAAa,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAYnE;AAED,oDAAoD;AACpD,wBAAsB,cAAc,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CASpE"}
@@ -0,0 +1,190 @@
1
+ /**
2
+ * Installer utility functions for SDD Agent Pack.
3
+ *
4
+ * These functions handle installing SDD workflow assets into a target
5
+ * application repository (NOT the SDD Agent Pack source repo itself).
6
+ */
7
+ import pkg from 'fs-extra';
8
+ const { copy, ensureDir, readFile, remove, writeFile } = pkg;
9
+ import { join, dirname } from 'path';
10
+ import { fileURLToPath } from 'url';
11
+ import { existsSync } from 'fs';
12
+ const __filename = fileURLToPath(import.meta.url);
13
+ const __dirname = dirname(__filename);
14
+ /** Resolve the path to bundled assets directory (two levels up from utils/) */
15
+ function assetsDir() {
16
+ return join(__dirname, '..', '..', 'assets');
17
+ }
18
+ /**
19
+ * The markdown section that gets injected into AGENTS.md.
20
+ * Wrapped in markers so it can be safely added/updated/removed.
21
+ */
22
+ function agentsMdSection() {
23
+ return `
24
+ <!-- BEGIN SDD AGENT PACK -->
25
+
26
+ ## SDD Agent Pack Integration
27
+
28
+ ### Overview
29
+ This repository uses SDD Agent Pack — a lightweight framework for integrating AI coding agents with the Software Driven Development (SDD) workflow.
30
+
31
+ ### Agent Instructions
32
+ When working in this repository, follow these instructions:
33
+
34
+ 1. **SDD documents are authoritative** — Always read and follow them.
35
+ 2. **Read AGENTS.md** — This file contains critical workflow instructions.
36
+ 3. **Read constitution.md** — Core principles and governance rules.
37
+ 4. **Read plan.md** — Current implementation plan and milestones.
38
+ 5. **Read tasks.md** — Epic and task tracking with completion state.
39
+ 6. **Search specs/** — Find primary brainstorming and design documents. The filename is not consistent, so inspect all files in specs/.
40
+ 7. **Follow deep references** — SDD documents cross-reference each other. Follow those links for full context.
41
+ 8. **Maintain tasks.md** — Update epic status and completion notes as you work.
42
+ 9. **Run tests** — Verify changes before marking anything complete.
43
+ 10. **Add completion notes** — Every completed epic must include what was built, what files changed, and architectural decisions.
44
+
45
+ ### Workflow Integration
46
+ - SDD documents define what to build and why
47
+ - The AI agent implements epics from tasks.md
48
+ - Tests verify correctness before completion
49
+ - Completion notes provide context for future epics
50
+
51
+ ### Documentation
52
+ - Repository customization: https://docs.openhands.dev/openhands/usage/customization/repository
53
+ - Hooks: https://docs.openhands.dev/openhands/usage/customization/hooks
54
+ - Skills/microagents: https://docs.openhands.dev/usage/prompting/microagents-overview
55
+
56
+ <!-- END SDD AGENT PACK -->
57
+ `;
58
+ }
59
+ /** Backup existing .sdd-agent-pack directory before modification */
60
+ export async function backupFiles(repoRoot) {
61
+ const packPath = join(repoRoot, '.sdd-agent-pack');
62
+ const backupPath = join(repoRoot, '.sdd-agent-pack-backup');
63
+ if (existsSync(packPath)) {
64
+ await remove(backupPath);
65
+ await copy(packPath, backupPath, { overwrite: true, errorOnExist: false });
66
+ }
67
+ }
68
+ /** Create required subdirectories inside .sdd-agent-pack */
69
+ export async function createDirectories(repoRoot) {
70
+ const dirs = ['skills', 'prompts', 'hooks', 'docs', 'templates', 'config'];
71
+ for (const dir of dirs) {
72
+ await ensureDir(join(repoRoot, '.sdd-agent-pack', dir));
73
+ }
74
+ }
75
+ /** Install SDD Agent Pack asset files into the target repository */
76
+ export async function installAssets(repoRoot) {
77
+ const assetRoot = assetsDir();
78
+ const packPath = join(repoRoot, '.sdd-agent-pack');
79
+ const assetDirs = ['skills', 'prompts', 'hooks', 'docs', 'templates', 'config'];
80
+ for (const dir of assetDirs) {
81
+ const src = join(assetRoot, dir);
82
+ const dest = join(packPath, dir);
83
+ if (existsSync(src)) {
84
+ await copy(src, dest, { overwrite: true, errorOnExist: true });
85
+ }
86
+ }
87
+ }
88
+ /** Update AGENTS.md with a managed SDD Agent Pack section */
89
+ export async function updateAgentsMd(repoRoot) {
90
+ const agentsPath = join(repoRoot, 'AGENTS.md');
91
+ const section = agentsMdSection().trim();
92
+ try {
93
+ let content = await readFile(agentsPath, 'utf8');
94
+ // Replace existing section
95
+ content = content.replace(/<!-- BEGIN SDD AGENT PACK -->[\s\S]*?<!-- END SDD AGENT PACK -->/g, '').trim();
96
+ content += '\n\n' + section + '\n';
97
+ await writeFile(agentsPath, content, 'utf8');
98
+ }
99
+ catch (err) {
100
+ const nodeErr = err;
101
+ if (nodeErr.code === 'ENOENT') {
102
+ // AGENTS.md doesn't exist — create it
103
+ await writeFile(agentsPath, section + '\n', 'utf8');
104
+ }
105
+ else {
106
+ throw err;
107
+ }
108
+ }
109
+ }
110
+ /** Add .sdd-agent-pack-backup to .gitignore */
111
+ export async function updateGitignore(repoRoot) {
112
+ const gitignorePath = join(repoRoot, '.gitignore');
113
+ const ignoreLine = '.sdd-agent-pack-backup/';
114
+ try {
115
+ let content = await readFile(gitignorePath, 'utf8');
116
+ const lines = content.split('\n').map((l) => l.trim());
117
+ if (!lines.includes(ignoreLine)) {
118
+ lines.push(ignoreLine);
119
+ await writeFile(gitignorePath, lines.filter((l) => l.length > 0).join('\n') + '\n', 'utf8');
120
+ }
121
+ }
122
+ catch (err) {
123
+ const nodeErr = err;
124
+ if (nodeErr.code === 'ENOENT') {
125
+ await writeFile(gitignorePath, ignoreLine + '\n', 'utf8');
126
+ }
127
+ else {
128
+ throw err;
129
+ }
130
+ }
131
+ }
132
+ /** Validate the installation in the target repository */
133
+ export async function validateInstallation(repoRoot) {
134
+ const packPath = join(repoRoot, '.sdd-agent-pack');
135
+ const requiredDirs = ['skills', 'prompts', 'hooks', 'docs', 'templates', 'config'];
136
+ // Check all required directories exist
137
+ for (const dir of requiredDirs) {
138
+ if (!existsSync(join(packPath, dir))) {
139
+ return false;
140
+ }
141
+ }
142
+ // Check AGENTS.md has the managed section
143
+ const agentsPath = join(repoRoot, 'AGENTS.md');
144
+ if (existsSync(agentsPath)) {
145
+ const content = await readFile(agentsPath, 'utf8');
146
+ if (!content.includes('<!-- BEGIN SDD AGENT PACK -->') || !content.includes('<!-- END SDD AGENT PACK -->')) {
147
+ return false;
148
+ }
149
+ }
150
+ return true;
151
+ }
152
+ /** Restore backup of .sdd-agent-pack */
153
+ export async function restoreBackups(repoRoot) {
154
+ const packPath = join(repoRoot, '.sdd-agent-pack');
155
+ const backupPath = join(repoRoot, '.sdd-agent-pack-backup');
156
+ await remove(packPath);
157
+ if (existsSync(backupPath)) {
158
+ await copy(backupPath, packPath, { overwrite: true });
159
+ await remove(backupPath);
160
+ }
161
+ }
162
+ /** Remove .sdd-agent-pack directory */
163
+ export async function removeAssets(repoRoot) {
164
+ await remove(join(repoRoot, '.sdd-agent-pack'));
165
+ }
166
+ /** Remove the SDD Agent Pack section from AGENTS.md */
167
+ export async function cleanAgentsMd(repoRoot) {
168
+ const agentsPath = join(repoRoot, 'AGENTS.md');
169
+ try {
170
+ const content = await readFile(agentsPath, 'utf8');
171
+ const cleaned = content.replace(/<!-- BEGIN SDD AGENT PACK -->[\s\S]*?<!-- END SDD AGENT PACK -->/g, '').trim();
172
+ await writeFile(agentsPath, cleaned + '\n', 'utf8');
173
+ }
174
+ catch {
175
+ // Ignore if file doesn't exist
176
+ }
177
+ }
178
+ /** Remove .sdd-agent-pack-backup from .gitignore */
179
+ export async function cleanGitignore(repoRoot) {
180
+ const gitignorePath = join(repoRoot, '.gitignore');
181
+ try {
182
+ const content = await readFile(gitignorePath, 'utf8');
183
+ const lines = content.split('\n').filter((l) => l.trim() !== '.sdd-agent-pack-backup/');
184
+ await writeFile(gitignorePath, lines.join('\n') + '\n', 'utf8');
185
+ }
186
+ catch {
187
+ // Ignore if file doesn't exist
188
+ }
189
+ }
190
+ //# sourceMappingURL=installer.js.map