trinity-method-sdk 2.0.9 → 2.2.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 (147) hide show
  1. package/CHANGELOG.md +702 -267
  2. package/README.md +550 -540
  3. package/dist/cli/commands/deploy/agents.js +1 -1
  4. package/dist/cli/commands/deploy/ci-cd.d.ts +4 -3
  5. package/dist/cli/commands/deploy/ci-cd.js +10 -9
  6. package/dist/cli/commands/deploy/claude-setup.js +28 -35
  7. package/dist/cli/commands/deploy/configuration.js +10 -11
  8. package/dist/cli/commands/deploy/directories.js +13 -14
  9. package/dist/cli/commands/deploy/gitignore.js +3 -5
  10. package/dist/cli/commands/deploy/index.d.ts +1 -1
  11. package/dist/cli/commands/deploy/index.js +7 -3
  12. package/dist/cli/commands/deploy/knowledge-base.js +3 -3
  13. package/dist/cli/commands/deploy/pre-flight.js +1 -1
  14. package/dist/cli/commands/deploy/root-files.js +3 -18
  15. package/dist/cli/commands/deploy/sdk-install.js +1 -1
  16. package/dist/cli/commands/deploy/summary.js +3 -3
  17. package/dist/cli/commands/deploy/templates.js +33 -20
  18. package/dist/cli/commands/update/agents.js +1 -1
  19. package/dist/cli/commands/update/backup.js +6 -12
  20. package/dist/cli/commands/update/commands.d.ts +1 -0
  21. package/dist/cli/commands/update/commands.js +18 -45
  22. package/dist/cli/commands/update/knowledge-base.js +2 -2
  23. package/dist/cli/commands/update/pre-flight.js +11 -11
  24. package/dist/cli/commands/update/summary.js +5 -5
  25. package/dist/cli/commands/update/templates.js +35 -13
  26. package/dist/cli/commands/update/verification.js +5 -5
  27. package/dist/cli/commands/update/version.js +1 -1
  28. package/dist/cli/utils/deploy-ci.d.ts +3 -2
  29. package/dist/cli/utils/deploy-ci.js +24 -24
  30. package/dist/cli/utils/deploy-linting.js +101 -6
  31. package/dist/cli/utils/error-classes.d.ts +2 -2
  32. package/dist/cli/utils/linting-tools.js +14 -6
  33. package/dist/cli/utils/template-processor.js +2 -4
  34. package/dist/templates/{claude → .claude}/EMPLOYEE-DIRECTORY.md.template +16 -22
  35. package/dist/templates/{agents → .claude/agents}/aj-team/apo-documentation-specialist.md.template +10 -10
  36. package/dist/templates/{agents → .claude/agents}/aj-team/bas-quality-gate.md.template +13 -15
  37. package/dist/templates/{agents → .claude/agents}/aj-team/bon-dependency-manager.md.template +4 -4
  38. package/dist/templates/{agents → .claude/agents}/aj-team/cap-configuration-specialist.md.template +3 -3
  39. package/dist/templates/{agents → .claude/agents}/aj-team/dra-code-reviewer.md.template +8 -10
  40. package/dist/templates/{agents → .claude/agents}/aj-team/kil-task-executor.md.template +11 -13
  41. package/dist/templates/{agents → .claude/agents}/aj-team/uro-refactoring-specialist.md.template +3 -3
  42. package/dist/templates/{agents → .claude/agents}/audit/juno-auditor.md.template +46 -42
  43. package/dist/templates/{agents → .claude/agents}/deployment/ein-cicd.md.template +59 -164
  44. package/dist/templates/{agents → .claude/agents}/deployment/ino-context.md.template +25 -22
  45. package/dist/templates/{agents → .claude/agents}/deployment/tan-structure.md.template +32 -30
  46. package/dist/templates/{agents → .claude/agents}/deployment/zen-knowledge.md.template +28 -23
  47. package/dist/templates/{agents → .claude/agents}/leadership/aj-maestro.md.template +10 -6
  48. package/dist/templates/{agents → .claude/agents}/leadership/aly-cto.md.template +22 -19
  49. package/dist/templates/{agents → .claude/agents}/planning/eus-decomposer.md.template +8 -4
  50. package/dist/templates/{agents → .claude/agents}/planning/mon-requirements.md.template +8 -4
  51. package/dist/templates/{agents → .claude/agents}/planning/ror-design.md.template +8 -4
  52. package/dist/templates/{agents → .claude/agents}/planning/tra-planner.md.template +10 -4
  53. package/dist/templates/{shared/claude-commands → .claude/commands/execution}/trinity-audit.md.template +15 -15
  54. package/dist/templates/.claude/commands/execution/trinity-breakdown.md.template +535 -0
  55. package/dist/templates/{shared/claude-commands → .claude/commands/execution}/trinity-orchestrate.md.template +48 -48
  56. package/dist/templates/{shared/claude-commands → .claude/commands/infrastructure}/trinity-init.md.template +32 -54
  57. package/dist/templates/{shared/claude-commands → .claude/commands/investigation}/trinity-create-investigation.md.template +13 -7
  58. package/dist/templates/{shared/claude-commands → .claude/commands/investigation}/trinity-investigate-templates.md.template +19 -15
  59. package/dist/templates/{shared/claude-commands → .claude/commands/investigation}/trinity-plan-investigation.md.template +12 -6
  60. package/dist/templates/{shared/claude-commands → .claude/commands/maintenance}/trinity-changelog.md.template +9 -8
  61. package/dist/templates/.claude/commands/maintenance/trinity-docs-update.md.template +279 -0
  62. package/dist/templates/.claude/commands/maintenance/trinity-docs.md.template +2828 -0
  63. package/dist/templates/{shared/claude-commands → .claude/commands/maintenance}/trinity-readme.md.template +21 -20
  64. package/dist/templates/{shared/claude-commands → .claude/commands/planning}/trinity-decompose.md.template +6 -4
  65. package/dist/templates/{shared/claude-commands → .claude/commands/planning}/trinity-design.md.template +6 -4
  66. package/dist/templates/{shared/claude-commands → .claude/commands/planning}/trinity-plan.md.template +7 -5
  67. package/dist/templates/{shared/claude-commands → .claude/commands/planning}/trinity-requirements.md.template +6 -4
  68. package/dist/templates/{shared/claude-commands → .claude/commands/session}/trinity-continue.md.template +30 -24
  69. package/dist/templates/{shared/claude-commands → .claude/commands/session}/trinity-end.md.template +403 -397
  70. package/dist/templates/{shared/claude-commands → .claude/commands/session}/trinity-start.md.template +9 -4
  71. package/dist/templates/{shared/claude-commands → .claude/commands/utility}/trinity-agents.md.template +11 -8
  72. package/dist/templates/{shared/claude-commands → .claude/commands/utility}/trinity-verify.md.template +56 -57
  73. package/dist/templates/{shared/claude-commands → .claude/commands/utility}/trinity-workorder.md.template +13 -9
  74. package/dist/templates/ci/ci.yml.template +2 -2
  75. package/dist/templates/root/CLAUDE.md.template +9 -9
  76. package/dist/templates/root/linting/nodejs/.husky-pre-commit.template +5 -0
  77. package/dist/templates/source/base-CLAUDE.md.template +310 -310
  78. package/dist/templates/source/flutter-CLAUDE.md.template +593 -593
  79. package/dist/templates/source/nodejs-CLAUDE.md.template +531 -531
  80. package/dist/templates/source/python-CLAUDE.md.template +510 -510
  81. package/dist/templates/source/react-CLAUDE.md.template +513 -513
  82. package/dist/templates/source/rust-CLAUDE.md.template +653 -653
  83. package/dist/templates/trinity/CLAUDE.md.template +14 -14
  84. package/dist/templates/{knowledge-base → trinity/knowledge-base}/AI-DEVELOPMENT-GUIDE.md.template +1 -1
  85. package/dist/templates/{knowledge-base → trinity/knowledge-base}/ARCHITECTURE.md.template +5 -5
  86. package/dist/templates/{knowledge-base → trinity/knowledge-base}/CODING-PRINCIPLES.md.template +1 -1
  87. package/dist/templates/{knowledge-base → trinity/knowledge-base}/DOCUMENTATION-CRITERIA.md.template +1 -1
  88. package/dist/templates/{knowledge-base → trinity/knowledge-base}/ISSUES.md.template +9 -9
  89. package/dist/templates/{knowledge-base → trinity/knowledge-base}/TESTING-PRINCIPLES.md.template +1 -1
  90. package/dist/templates/{knowledge-base → trinity/knowledge-base}/Technical-Debt.md.template +2 -4
  91. package/dist/templates/{knowledge-base → trinity/knowledge-base}/To-do.md.template +2 -2
  92. package/dist/templates/{knowledge-base → trinity/knowledge-base}/Trinity.md.template +6 -6
  93. package/dist/templates/trinity/templates/documentation/api-docs/README.md.template +218 -0
  94. package/dist/templates/trinity/templates/documentation/configuration/documentation-structure.md.template +71 -0
  95. package/dist/templates/trinity/templates/documentation/configuration/env-example-generator.md.template +387 -0
  96. package/dist/templates/trinity/templates/documentation/discovery/api-endpoint-scanner.md.template +343 -0
  97. package/dist/templates/trinity/templates/documentation/discovery/component-discovery.md.template +254 -0
  98. package/dist/templates/trinity/templates/documentation/discovery/env-variable-extraction.md.template +316 -0
  99. package/dist/templates/trinity/templates/documentation/discovery/framework-detection.md.template +205 -0
  100. package/dist/templates/trinity/templates/documentation/guides/api-development.md.template +375 -0
  101. package/dist/templates/trinity/templates/documentation/guides/contributing.md.template +488 -0
  102. package/dist/templates/trinity/templates/documentation/guides/deployment.md.template +565 -0
  103. package/dist/templates/trinity/templates/documentation/guides/getting-started.md.template +118 -0
  104. package/dist/templates/trinity/templates/documentation/mermaid-diagrams/api-endpoint-map.md.template +56 -0
  105. package/dist/templates/trinity/templates/documentation/mermaid-diagrams/component-hierarchy.md.template +60 -0
  106. package/dist/templates/trinity/templates/documentation/mermaid-diagrams/database-er.md.template +49 -0
  107. package/dist/templates/trinity/templates/documentation/mermaid-diagrams/mvc-flow.md.template +41 -0
  108. package/dist/templates/trinity/templates/documentation/processes/error-handling-protocol.md.template +166 -0
  109. package/dist/templates/trinity/templates/documentation/processes/fallback-mechanism.md.template +88 -0
  110. package/dist/templates/trinity/templates/documentation/reports/apo-docs-update-checklist.md.template +343 -0
  111. package/dist/templates/trinity/templates/documentation/reports/juno-docs-update-checklist.md.template +1337 -0
  112. package/dist/templates/trinity/templates/documentation/reports/juno-final-report.md.template +237 -0
  113. package/dist/templates/trinity/templates/documentation/reports/juno-internal-report.md.template +461 -0
  114. package/dist/templates/trinity/templates/documentation/validation/documentation-verification-rules.md.template +379 -0
  115. package/dist/templates/trinity/templates/documentation/validation/juno-quality-gates.md.template +282 -0
  116. package/dist/templates/{investigations → trinity/templates/investigations}/bug.md.template +14 -14
  117. package/dist/templates/{investigations → trinity/templates/investigations}/feature.md.template +14 -14
  118. package/dist/templates/{investigations → trinity/templates/investigations}/performance.md.template +14 -14
  119. package/dist/templates/{investigations → trinity/templates/investigations}/security.md.template +14 -14
  120. package/dist/templates/{investigations → trinity/templates/investigations}/technical.md.template +14 -14
  121. package/dist/templates/{work-orders → trinity/templates/work-orders}/ANALYSIS-TEMPLATE.md.template +10 -13
  122. package/dist/templates/{work-orders → trinity/templates/work-orders}/AUDIT-TEMPLATE.md.template +10 -26
  123. package/dist/templates/{work-orders → trinity/templates/work-orders}/IMPLEMENTATION-TEMPLATE.md.template +10 -26
  124. package/dist/templates/{work-orders → trinity/templates/work-orders}/INVESTIGATION-TEMPLATE.md.template +10 -25
  125. package/dist/templates/{work-orders → trinity/templates/work-orders}/PATTERN-TEMPLATE.md.template +10 -26
  126. package/dist/templates/{work-orders → trinity/templates/work-orders}/VERIFICATION-TEMPLATE.md.template +10 -26
  127. package/package.json +99 -94
  128. package/dist/templates/agents/leadership/aj-cc.md.template +0 -462
  129. package/dist/templates/ci/cd.yml.template +0 -175
  130. package/dist/templates/ci/github-actions.yml +0 -86
  131. package/dist/templates/root/TRINITY.md.template +0 -52
  132. package/dist/templates/shared/claude-commands/trinity-docs.md.template +0 -2577
  133. /package/dist/templates/{linting → root/linting}/flutter/.pre-commit-config.yaml.template +0 -0
  134. /package/dist/templates/{linting → root/linting}/flutter/analysis_options.yaml.template +0 -0
  135. /package/dist/templates/{linting → root/linting}/nodejs/.eslintrc-commonjs.json.template +0 -0
  136. /package/dist/templates/{linting → root/linting}/nodejs/.eslintrc-esm.json.template +0 -0
  137. /package/dist/templates/{linting → root/linting}/nodejs/.eslintrc-typescript.json.template +0 -0
  138. /package/dist/templates/{linting → root/linting}/nodejs/.pre-commit-config.yaml.template +0 -0
  139. /package/dist/templates/{linting → root/linting}/nodejs/.prettierrc.json.template +0 -0
  140. /package/dist/templates/{linting → root/linting}/python/.flake8.template +0 -0
  141. /package/dist/templates/{linting → root/linting}/python/.pre-commit-config.yaml.template +0 -0
  142. /package/dist/templates/{linting → root/linting}/python/pyproject.toml.template +0 -0
  143. /package/dist/templates/{linting → root/linting}/rust/.pre-commit-config.yaml.template +0 -0
  144. /package/dist/templates/{linting → root/linting}/rust/clippy.toml.template +0 -0
  145. /package/dist/templates/{linting → root/linting}/rust/rustfmt.toml.template +0 -0
  146. /package/dist/templates/{documentation → trinity/templates/documentation}/ROOT-README.md.template +0 -0
  147. /package/dist/templates/{documentation → trinity/templates/documentation}/SUBDIRECTORY-README.md.template +0 -0
@@ -42,7 +42,7 @@ export async function deployAgents(templatesPath, variables, spinner) {
42
42
  ];
43
43
  for (const { dir, agents } of agentDirs) {
44
44
  for (const agent of agents) {
45
- const templatePath = path.join(templatesPath, 'agents', dir, `${agent}.template`);
45
+ const templatePath = path.join(templatesPath, '.claude/agents', dir, `${agent}.template`);
46
46
  if (await fs.pathExists(templatePath)) {
47
47
  const content = await fs.readFile(templatePath, 'utf8');
48
48
  const processed = processTemplate(content, variables);
@@ -1,13 +1,14 @@
1
1
  /**
2
- * CI/CD workflow deployment
2
+ * CI workflow deployment
3
3
  */
4
4
  import type { DeployOptions, Spinner } from './types.js';
5
5
  /**
6
- * Deploy CI/CD workflow templates
6
+ * Deploy CI workflow templates
7
7
  *
8
8
  * @param options - Deploy command options
9
9
  * @param spinner - Spinner instance for status updates
10
+ * @param variables - Template variables for processing
10
11
  * @returns Number of files deployed
11
12
  */
12
- export declare function deployCICD(options: DeployOptions, spinner: Spinner): Promise<number>;
13
+ export declare function deployCICD(options: DeployOptions, spinner: Spinner, variables?: Record<string, string>): Promise<number>;
13
14
  //# sourceMappingURL=ci-cd.d.ts.map
@@ -1,30 +1,31 @@
1
1
  /**
2
- * CI/CD workflow deployment
2
+ * CI workflow deployment
3
3
  */
4
4
  import chalk from 'chalk';
5
5
  import { deployCITemplates } from '../../utils/deploy-ci.js';
6
6
  /**
7
- * Deploy CI/CD workflow templates
7
+ * Deploy CI workflow templates
8
8
  *
9
9
  * @param options - Deploy command options
10
10
  * @param spinner - Spinner instance for status updates
11
+ * @param variables - Template variables for processing
11
12
  * @returns Number of files deployed
12
13
  */
13
- export async function deployCICD(options, spinner) {
14
+ export async function deployCICD(options, spinner, variables = {}) {
14
15
  if (!options.ciDeploy) {
15
16
  return 0;
16
17
  }
17
- spinner.start('Deploying CI/CD workflow templates...');
18
+ spinner.start('Deploying CI workflow templates...');
18
19
  try {
19
- const ciStats = await deployCITemplates(options);
20
+ const ciStats = await deployCITemplates(options, variables);
20
21
  if (ciStats.deployed.length > 0) {
21
- spinner.succeed(`CI/CD templates deployed (${ciStats.deployed.length} files)`);
22
+ spinner.succeed(`CI templates deployed (${ciStats.deployed.length} files)`);
22
23
  ciStats.deployed.forEach((file) => {
23
24
  console.log(chalk.white(` ✓ ${file}`));
24
25
  });
25
26
  }
26
27
  else {
27
- spinner.info('No CI/CD templates deployed');
28
+ spinner.info('No CI templates deployed');
28
29
  }
29
30
  if (ciStats.skipped.length > 0) {
30
31
  console.log(chalk.yellow(' Skipped:'));
@@ -33,7 +34,7 @@ export async function deployCICD(options, spinner) {
33
34
  });
34
35
  }
35
36
  if (ciStats.errors.length > 0) {
36
- spinner.warn('Some CI/CD templates failed to deploy');
37
+ spinner.warn('Some CI templates failed to deploy');
37
38
  ciStats.errors.forEach((err) => {
38
39
  console.log(chalk.red(` ✗ ${err.file || 'Error'}: ${err.error}`));
39
40
  });
@@ -41,7 +42,7 @@ export async function deployCICD(options, spinner) {
41
42
  return ciStats.deployed.length;
42
43
  }
43
44
  catch (error) {
44
- spinner.fail('CI/CD template deployment failed');
45
+ spinner.fail('CI template deployment failed');
45
46
  const { displayWarning, getErrorMessage } = await import('../../utils/errors.js');
46
47
  displayWarning(getErrorMessage(error));
47
48
  return 0;
@@ -26,7 +26,7 @@ export async function deployClaudeSetup(templatesPath, variables, spinner) {
26
26
  spinner.succeed('Claude Code settings created (empty - customize as needed)');
27
27
  // Deploy Employee Directory
28
28
  spinner.start('Deploying Employee Directory...');
29
- const employeeDirectoryTemplate = path.join(templatesPath, 'claude', 'EMPLOYEE-DIRECTORY.md.template');
29
+ const employeeDirectoryTemplate = path.join(templatesPath, '.claude', 'EMPLOYEE-DIRECTORY.md.template');
30
30
  if (await fs.pathExists(employeeDirectoryTemplate)) {
31
31
  const content = await fs.readFile(employeeDirectoryTemplate, 'utf8');
32
32
  const processed = processTemplate(content, variables);
@@ -48,41 +48,34 @@ export async function deployClaudeSetup(templatesPath, variables, spinner) {
48
48
  await fs.ensureDir(`${commandsDir}/execution`);
49
49
  await fs.ensureDir(`${commandsDir}/investigation`);
50
50
  await fs.ensureDir(`${commandsDir}/infrastructure`);
51
+ await fs.ensureDir(`${commandsDir}/maintenance`);
51
52
  await fs.ensureDir(`${commandsDir}/utility`);
52
- // Command categorization map
53
- const commandCategories = {
54
- 'trinity-start.md.template': 'session',
55
- 'trinity-continue.md.template': 'session',
56
- 'trinity-end.md.template': 'session',
57
- 'trinity-requirements.md.template': 'planning',
58
- 'trinity-design.md.template': 'planning',
59
- 'trinity-decompose.md.template': 'planning',
60
- 'trinity-plan.md.template': 'planning',
61
- 'trinity-orchestrate.md.template': 'execution',
62
- 'trinity-audit.md.template': 'execution',
63
- 'trinity-readme.md.template': 'execution',
64
- 'trinity-docs.md.template': 'execution',
65
- 'trinity-changelog.md.template': 'execution',
66
- 'trinity-create-investigation.md.template': 'investigation',
67
- 'trinity-plan-investigation.md.template': 'investigation',
68
- 'trinity-investigate-templates.md.template': 'investigation',
69
- 'trinity-init.md.template': 'infrastructure',
70
- 'trinity-agents.md.template': 'utility',
71
- 'trinity-verify.md.template': 'utility',
72
- 'trinity-workorder.md.template': 'utility',
73
- };
74
- const commandsTemplatePath = path.join(templatesPath, 'shared/claude-commands');
75
- const commandFiles = await fs.readdir(commandsTemplatePath);
76
- for (const file of commandFiles) {
77
- if (file.endsWith('.md.template') && commandCategories[file]) {
78
- const sourcePath = path.join(commandsTemplatePath, file);
79
- const category = commandCategories[file];
80
- // Remove .template extension for deployed files
81
- const deployedName = file.replace('.template', '');
82
- const destPath = path.join(commandsDir, category, deployedName);
83
- await fs.copy(sourcePath, destPath);
84
- commandsDeployed++;
85
- filesDeployed++;
53
+ // Commands are now organized by category in source templates
54
+ const commandsTemplatePath = path.join(templatesPath, '.claude/commands');
55
+ const categories = [
56
+ 'session',
57
+ 'planning',
58
+ 'execution',
59
+ 'investigation',
60
+ 'infrastructure',
61
+ 'maintenance',
62
+ 'utility',
63
+ ];
64
+ for (const category of categories) {
65
+ const categoryPath = path.join(commandsTemplatePath, category);
66
+ if (await fs.pathExists(categoryPath)) {
67
+ const commandFiles = await fs.readdir(categoryPath);
68
+ for (const file of commandFiles) {
69
+ if (file.endsWith('.md.template')) {
70
+ const sourcePath = path.join(categoryPath, file);
71
+ // Remove .template extension for deployed files
72
+ const deployedName = file.replace('.template', '');
73
+ const destPath = path.join(commandsDir, category, deployedName);
74
+ await fs.copy(sourcePath, destPath);
75
+ commandsDeployed++;
76
+ filesDeployed++;
77
+ }
78
+ }
86
79
  }
87
80
  }
88
81
  spinner.succeed(`Deployed ${commandsDeployed} Trinity slash commands (6 categories)`);
@@ -66,7 +66,7 @@ async function promptLintingChoice(stack) {
66
66
  {
67
67
  type: 'confirm',
68
68
  name: 'setupLinting',
69
- message: 'Setup linting configuration? (y/n)',
69
+ message: 'Setup linting configuration?',
70
70
  default: true,
71
71
  },
72
72
  ]);
@@ -82,7 +82,6 @@ async function promptLintingChoice(stack) {
82
82
  */
83
83
  async function configureRecommendedLinting(stack) {
84
84
  const tools = getRecommendedTools(stack.framework, stack.language);
85
- console.log(chalk.green('\n✔ Setup linting configuration?'), 'Recommended\n');
86
85
  const dependencies = getDependenciesForTools(tools);
87
86
  const scripts = getScriptsForTools(tools);
88
87
  displayLintingConfig(tools, dependencies, scripts);
@@ -111,35 +110,35 @@ async function detectGitPlatform() {
111
110
  * Display CI/CD configuration summary
112
111
  */
113
112
  function displayCICDConfig(platform) {
114
- console.log(chalk.green('\n✔ Deploy CI/CD workflow templates?'), 'Yes');
113
+ console.log(chalk.green('\n✔ Deploy CI workflow templates?'), 'yes');
115
114
  if (platform !== 'unknown') {
116
115
  console.log(chalk.cyan(`📦 Detected platform: ${platform}\n`));
117
116
  console.log(chalk.white(' Will configure:'));
118
117
  if (platform === 'GitHub Actions') {
119
- console.log(chalk.white(' ✓ .github/workflows/trinity-ci.yml'));
118
+ console.log(chalk.white(' ✓ .github/workflows/ci.yml'));
120
119
  }
121
120
  else if (platform === 'GitLab CI') {
122
121
  console.log(chalk.white(' ✓ .gitlab-ci.yml'));
123
122
  }
124
- console.log(chalk.white(' ✓ trinity/templates/ci/generic-ci.yml (reference)'));
123
+ console.log(chalk.white(' ✓ .claude/trinity/templates/ci/generic-ci.yml (reference)'));
125
124
  }
126
125
  else {
127
126
  console.log(chalk.cyan('\n📦 Will configure:\n'));
128
- console.log(chalk.white(' ✓ .github/workflows/trinity-ci.yml (GitHub Actions)'));
129
- console.log(chalk.white(' ✓ trinity/templates/ci/generic-ci.yml (reference)'));
127
+ console.log(chalk.white(' ✓ .github/workflows/ci.yml (GitHub Actions)'));
128
+ console.log(chalk.white(' ✓ .claude/trinity/templates/ci/generic-ci.yml (reference)'));
130
129
  }
131
130
  }
132
131
  /**
133
132
  * Prompt for CI/CD setup
134
133
  */
135
134
  async function promptCICDSetup() {
136
- console.log(chalk.cyan('\n⚙️ Optional: CI/CD Automation\n'));
137
- console.log(chalk.white('Trinity can setup automated testing workflows for your CI/CD platform.\n'));
135
+ console.log(chalk.cyan('\n⚙️ Optional: CI Automation\n'));
136
+ console.log(chalk.white('Trinity can setup automated testing workflows for your CI platform.\n'));
138
137
  const ciChoice = await inquirer.prompt([
139
138
  {
140
139
  type: 'confirm',
141
140
  name: 'setupCI',
142
- message: 'Deploy CI/CD workflow templates?',
141
+ message: 'Deploy CI workflow templates?',
143
142
  default: true,
144
143
  },
145
144
  ]);
@@ -149,7 +148,7 @@ async function promptCICDSetup() {
149
148
  return true;
150
149
  }
151
150
  else {
152
- console.log(chalk.gray('\n✔ Deploy CI/CD workflow templates?'), 'Skip\n');
151
+ console.log(chalk.gray('\n✔ Deploy CI workflow templates?'), 'Skip\n');
153
152
  return false;
154
153
  }
155
154
  }
@@ -11,20 +11,19 @@ import fs from 'fs-extra';
11
11
  export async function createDirectories(spinner) {
12
12
  spinner.start('Creating Trinity Method structure...');
13
13
  let directoriesCreated = 0;
14
- // Trinity core directories
15
- await fs.ensureDir('trinity/knowledge-base');
16
- await fs.ensureDir('trinity/sessions');
17
- await fs.ensureDir('trinity/investigations');
18
- await fs.ensureDir('trinity/patterns');
19
- await fs.ensureDir('trinity/work-orders');
20
- await fs.ensureDir('trinity/templates');
21
- await fs.ensureDir('trinity/reports');
22
- await fs.ensureDir('trinity/investigations/plans');
23
- await fs.ensureDir('trinity/archive/work-orders');
24
- await fs.ensureDir('trinity/archive/investigations');
25
- await fs.ensureDir('trinity/archive/reports');
26
- await fs.ensureDir('trinity/archive/sessions');
27
- directoriesCreated += 12;
14
+ // Trinity core directories (inside .claude/)
15
+ await fs.ensureDir('.claude/trinity/knowledge-base');
16
+ await fs.ensureDir('.claude/trinity/sessions');
17
+ await fs.ensureDir('.claude/trinity/investigations');
18
+ await fs.ensureDir('.claude/trinity/work-orders');
19
+ await fs.ensureDir('.claude/trinity/templates');
20
+ await fs.ensureDir('.claude/trinity/reports');
21
+ await fs.ensureDir('.claude/trinity/investigations/plans');
22
+ await fs.ensureDir('.claude/trinity/archive/work-orders');
23
+ await fs.ensureDir('.claude/trinity/archive/investigations');
24
+ await fs.ensureDir('.claude/trinity/archive/reports');
25
+ await fs.ensureDir('.claude/trinity/archive/sessions');
26
+ directoriesCreated += 11;
28
27
  // Claude Code directories
29
28
  await fs.ensureDir('.claude/agents/leadership');
30
29
  await fs.ensureDir('.claude/agents/deployment');
@@ -18,14 +18,12 @@ export async function updateGitignore(spinner) {
18
18
  if (await fs.pathExists(gitignorePath)) {
19
19
  gitignoreContent = await fs.readFile(gitignorePath, 'utf8');
20
20
  }
21
- // Trinity files to ignore
21
+ // Trinity files to ignore (archive and templates are ephemeral/generated)
22
22
  const trinityIgnores = [
23
23
  '',
24
24
  '# Trinity Method SDK',
25
- '.claude/',
26
- 'trinity/',
27
- '*CLAUDE.md',
28
- 'TRINITY.md',
25
+ '.claude/trinity/archive/',
26
+ '.claude/trinity/templates/',
29
27
  ];
30
28
  // Check if Trinity section already exists
31
29
  if (!gitignoreContent.includes('# Trinity Method SDK')) {
@@ -13,7 +13,7 @@
13
13
  * Manual setup is error-prone and inconsistent. Developers forget folders, skip quality tools, or
14
14
  * misconfigure agents. This command orchestrates TAN (structure), ZEN (documentation), INO (context),
15
15
  * and EIN (CI/CD) to deploy battle-tested Trinity infrastructure in minutes. Every project gets same
16
- * high-quality foundation: 19 agents, 20 commands, quality gates, and documentation architecture.
16
+ * high-quality foundation: 18 agents, 20 commands, quality gates, and documentation architecture.
17
17
  *
18
18
  * @example
19
19
  * ```bash
@@ -13,7 +13,7 @@
13
13
  * Manual setup is error-prone and inconsistent. Developers forget folders, skip quality tools, or
14
14
  * misconfigure agents. This command orchestrates TAN (structure), ZEN (documentation), INO (context),
15
15
  * and EIN (CI/CD) to deploy battle-tested Trinity infrastructure in minutes. Every project gets same
16
- * high-quality foundation: 19 agents, 20 commands, quality gates, and documentation architecture.
16
+ * high-quality foundation: 18 agents, 20 commands, quality gates, and documentation architecture.
17
17
  *
18
18
  * @example
19
19
  * ```bash
@@ -75,6 +75,10 @@ export async function deploy(options) {
75
75
  spinner.succeed(`Detected: ${stack.framework} (${stack.language}) - Source: ${stack.sourceDir}`);
76
76
  // STEP 3: Interactive configuration (or use defaults with --yes)
77
77
  const config = await promptConfiguration(options, stack);
78
+ // Bridge interactive CI/CD selection to deployment flag
79
+ if (config.enableCICD) {
80
+ options.ciDeploy = true;
81
+ }
78
82
  // STEP 3.5: Collect codebase metrics
79
83
  let metrics;
80
84
  if (!options.skipAudit) {
@@ -98,7 +102,7 @@ export async function deploy(options) {
98
102
  PACKAGE_MANAGER: stack.packageManager || 'npm',
99
103
  BACKEND_FRAMEWORK: stack.framework,
100
104
  CURRENT_DATE: new Date().toISOString(),
101
- TRINITY_VERSION: pkg.version || '2.0.9',
105
+ TRINITY_VERSION: pkg.version || '2.1.0',
102
106
  };
103
107
  // STEP 4: Create directory structure
104
108
  const directoriesCreated = await createDirectories(spinner);
@@ -126,7 +130,7 @@ export async function deploy(options) {
126
130
  const templatesDeployed = await deployTemplates(templatesPath, variables, spinner);
127
131
  progress.templatesDeployed = templatesDeployed;
128
132
  // STEP 11: Deploy CI/CD workflow templates (if enabled)
129
- const cicdFiles = await deployCICD(options, spinner);
133
+ const cicdFiles = await deployCICD(options, spinner, variables);
130
134
  progress.rootFilesDeployed += cicdFiles;
131
135
  // STEP 11.5: Update .gitignore
132
136
  const gitignoreUpdated = await updateGitignore(spinner);
@@ -30,12 +30,12 @@ export async function deployKnowledgeBase(templatesPath, variables, stack, metri
30
30
  'DOCUMENTATION-CRITERIA.md',
31
31
  ];
32
32
  for (const template of kbTemplates) {
33
- const templatePath = path.join(templatesPath, 'knowledge-base', `${template}.template`);
33
+ const templatePath = path.join(templatesPath, 'trinity/knowledge-base', `${template}.template`);
34
34
  if (await fs.pathExists(templatePath)) {
35
35
  const content = await fs.readFile(templatePath, 'utf8');
36
36
  const processed = processTemplate(content, variables);
37
37
  // Validate destination path for security
38
- const destPath = validatePath(`trinity/knowledge-base/${template}`);
38
+ const destPath = validatePath(`.claude/trinity/knowledge-base/${template}`);
39
39
  await fs.writeFile(destPath, processed);
40
40
  filesDeployed++;
41
41
  }
@@ -44,7 +44,7 @@ export async function deployKnowledgeBase(templatesPath, variables, stack, metri
44
44
  // Enrich knowledge base with project metrics
45
45
  try {
46
46
  spinner.start('Enriching knowledge base with project metrics...');
47
- const archPath = 'trinity/knowledge-base/ARCHITECTURE.md';
47
+ const archPath = '.claude/trinity/knowledge-base/ARCHITECTURE.md';
48
48
  if (await fs.pathExists(archPath)) {
49
49
  let archContent = await fs.readFile(archPath, 'utf8');
50
50
  // Replace common placeholders with actual data
@@ -13,7 +13,7 @@ import chalk from 'chalk';
13
13
  export async function checkPreFlight(options, spinner) {
14
14
  spinner.start('Running pre-flight checks...');
15
15
  // Check if Trinity is already deployed
16
- const trinityExists = await fs.pathExists('trinity');
16
+ const trinityExists = await fs.pathExists('.claude/trinity');
17
17
  if (trinityExists && !options.force) {
18
18
  spinner.fail();
19
19
  console.log(chalk.yellow('\nTrinity Method is already deployed in this project.'));
@@ -6,20 +6,6 @@ import path from 'path';
6
6
  import chalk from 'chalk';
7
7
  import { processTemplate } from '../../utils/template-processor.js';
8
8
  import { validatePath } from '../../utils/validate-path.js';
9
- /**
10
- * Deploy TRINITY.md root file
11
- */
12
- async function deployTrinityMarkdown(templatesPath, variables) {
13
- const trinityRootTemplate = path.join(templatesPath, 'root', 'TRINITY.md.template');
14
- if (await fs.pathExists(trinityRootTemplate)) {
15
- const content = await fs.readFile(trinityRootTemplate, 'utf8');
16
- const processed = processTemplate(content, variables);
17
- const destPath = validatePath('TRINITY.md');
18
- await fs.writeFile(destPath, processed);
19
- return 1;
20
- }
21
- return 0;
22
- }
23
9
  /**
24
10
  * Deploy root CLAUDE.md file
25
11
  */
@@ -38,8 +24,8 @@ async function deployRootClaudeMarkdown(templatesPath, variables) {
38
24
  * Deploy VERSION file
39
25
  */
40
26
  async function deployVersionFile(pkgVersion) {
41
- const versionPath = validatePath('trinity/VERSION');
42
- await fs.writeFile(versionPath, pkgVersion || '2.0.9');
27
+ const versionPath = validatePath('.claude/trinity/VERSION');
28
+ await fs.writeFile(versionPath, pkgVersion || '2.1.0');
43
29
  return 1;
44
30
  }
45
31
  /**
@@ -51,7 +37,7 @@ async function deployTrinityClaudeMarkdown(templatesPath, variables, spinner) {
51
37
  if (await fs.pathExists(trinityCLAUDETemplate)) {
52
38
  const content = await fs.readFile(trinityCLAUDETemplate, 'utf8');
53
39
  const processed = processTemplate(content, variables);
54
- const destPath = validatePath('trinity/CLAUDE.md');
40
+ const destPath = validatePath('.claude/trinity/CLAUDE.md');
55
41
  await fs.writeFile(destPath, processed);
56
42
  spinner.succeed('Trinity CLAUDE.md deployed');
57
43
  return 1;
@@ -163,7 +149,6 @@ export async function deployRootFiles(templatesPath, variables, stack, pkgVersio
163
149
  let filesDeployed = 0;
164
150
  // Deploy root files
165
151
  spinner.start('Creating root files...');
166
- filesDeployed += await deployTrinityMarkdown(templatesPath, variables);
167
152
  filesDeployed += await deployRootClaudeMarkdown(templatesPath, variables);
168
153
  filesDeployed += await deployVersionFile(pkgVersion);
169
154
  spinner.succeed('Root files created');
@@ -24,7 +24,7 @@ export async function installSDK(spinner) {
24
24
  if (!packageJson.dependencies) {
25
25
  packageJson.dependencies = {};
26
26
  }
27
- packageJson.dependencies['trinity-method-sdk'] = '^2.0.9';
27
+ packageJson.dependencies['trinity-method-sdk'] = '^2.1.0';
28
28
  await fs.writeJson(packageJsonPath, packageJson, { spaces: 2 });
29
29
  spinner.text = 'Installing Trinity Method SDK (this may take a moment)...';
30
30
  // Install dependencies
@@ -6,7 +6,7 @@ import chalk from 'chalk';
6
6
  /**
7
7
  * Display deployment statistics section
8
8
  */
9
- function displayStatistics(stats, stack, claudeMdCount, claudeMdSummary) {
9
+ function displayStatistics(stats, _stack, claudeMdCount, claudeMdSummary) {
10
10
  console.log(chalk.cyan('📊 Deployment Statistics (v2.0):\n'));
11
11
  console.log(chalk.white(` Directories Created: ${stats.directories || 17}`));
12
12
  console.log(chalk.white(` Agents Deployed: ${stats.agentsDeployed} (v2.0: 2 leadership + 4 planning + 7 execution + 4 deployment + 1 audit)`));
@@ -88,8 +88,8 @@ function displayNextSteps(options, stack) {
88
88
  step++;
89
89
  }
90
90
  // Standard next steps
91
- console.log(chalk.white(` ${step}. Review trinity/knowledge-base/ARCHITECTURE.md`));
92
- console.log(chalk.white(` ${step + 1}. Update trinity/knowledge-base/To-do.md`));
91
+ console.log(chalk.white(` ${step}. Review .claude/trinity/knowledge-base/ARCHITECTURE.md`));
92
+ console.log(chalk.white(` ${step + 1}. Update .claude/trinity/knowledge-base/To-do.md`));
93
93
  console.log(chalk.white(` ${step + 2}. Open Claude Code and start your first Trinity session`));
94
94
  console.log(chalk.white(` ${step + 3}. Agents will be automatically invoked as needed\n`));
95
95
  // Test linting command (if applicable)
@@ -25,15 +25,15 @@ export async function deployTemplates(templatesPath, variables, spinner) {
25
25
  'PATTERN-TEMPLATE.md.template',
26
26
  'VERIFICATION-TEMPLATE.md.template',
27
27
  ];
28
- await fs.ensureDir('trinity/templates/work-orders');
28
+ await fs.ensureDir('.claude/trinity/templates/work-orders');
29
29
  for (const template of woTemplates) {
30
- const templatePath = path.join(templatesPath, 'work-orders', template);
30
+ const templatePath = path.join(templatesPath, 'trinity/templates/work-orders', template);
31
31
  if (await fs.pathExists(templatePath)) {
32
32
  const content = await fs.readFile(templatePath, 'utf8');
33
33
  const processed = processTemplate(content, variables);
34
34
  const deployedName = template.replace('.template', '');
35
35
  // Validate destination path for security
36
- const destPath = validatePath(`trinity/templates/work-orders/${deployedName}`);
36
+ const destPath = validatePath(`.claude/trinity/templates/work-orders/${deployedName}`);
37
37
  await fs.writeFile(destPath, processed);
38
38
  templatesDeployed++;
39
39
  }
@@ -48,37 +48,50 @@ export async function deployTemplates(templatesPath, variables, spinner) {
48
48
  'security.md.template',
49
49
  'technical.md.template',
50
50
  ];
51
- await fs.ensureDir('trinity/templates/investigations');
51
+ await fs.ensureDir('.claude/trinity/templates/investigations');
52
52
  for (const template of investigationTemplates) {
53
- const templatePath = path.join(templatesPath, 'investigations', template);
53
+ const templatePath = path.join(templatesPath, 'trinity/templates/investigations', template);
54
54
  if (await fs.pathExists(templatePath)) {
55
55
  const content = await fs.readFile(templatePath, 'utf8');
56
56
  const processed = processTemplate(content, variables);
57
57
  const deployedName = template.replace('.template', '');
58
58
  // Validate destination path for security
59
- const destPath = validatePath(`trinity/templates/investigations/${deployedName}`);
59
+ const destPath = validatePath(`.claude/trinity/templates/investigations/${deployedName}`);
60
60
  await fs.writeFile(destPath, processed);
61
61
  templatesDeployed++;
62
62
  }
63
63
  }
64
64
  spinner.succeed(`Investigation templates deployed (${investigationTemplates.length} templates)`);
65
- // Deploy documentation templates
65
+ // Deploy documentation templates (all 28 templates including subdirectories)
66
66
  spinner.start('Deploying documentation templates...');
67
- const documentationTemplates = ['ROOT-README.md.template', 'SUBDIRECTORY-README.md.template'];
68
- await fs.ensureDir('trinity/templates/documentation');
69
- for (const template of documentationTemplates) {
70
- const templatePath = path.join(templatesPath, 'documentation', template);
71
- if (await fs.pathExists(templatePath)) {
72
- const content = await fs.readFile(templatePath, 'utf8');
73
- const processed = processTemplate(content, variables);
74
- const deployedName = template.replace('.template', '');
75
- // Validate destination path for security
76
- const destPath = validatePath(`trinity/templates/documentation/${deployedName}`);
77
- await fs.writeFile(destPath, processed);
78
- templatesDeployed++;
67
+ const docSourcePath = path.join(templatesPath, 'trinity/templates/documentation');
68
+ const docDestPath = '.claude/trinity/templates/documentation';
69
+ await fs.ensureDir(docDestPath);
70
+ // Recursively copy all documentation templates, removing .template extension
71
+ async function copyDocTemplates(sourcePath, destPath) {
72
+ const items = await fs.readdir(sourcePath);
73
+ for (const item of items) {
74
+ const sourceItemPath = path.join(sourcePath, item);
75
+ const stat = await fs.stat(sourceItemPath);
76
+ if (stat.isDirectory()) {
77
+ // Create subdirectory and recurse
78
+ const destSubDir = path.join(destPath, item);
79
+ await fs.ensureDir(destSubDir);
80
+ await copyDocTemplates(sourceItemPath, destSubDir);
81
+ }
82
+ else if (item.endsWith('.md.template')) {
83
+ // Process template file and remove .template extension
84
+ const content = await fs.readFile(sourceItemPath, 'utf8');
85
+ const processed = processTemplate(content, variables);
86
+ const deployedName = item.replace('.template', '');
87
+ const destFilePath = validatePath(path.join(destPath, deployedName));
88
+ await fs.writeFile(destFilePath, processed);
89
+ templatesDeployed++;
90
+ }
79
91
  }
80
92
  }
81
- spinner.succeed(`Documentation templates deployed (${documentationTemplates.length} templates)`);
93
+ await copyDocTemplates(docSourcePath, docDestPath);
94
+ spinner.succeed(`Documentation templates deployed (${templatesDeployed - 11} templates)`);
82
95
  return templatesDeployed;
83
96
  }
84
97
  //# sourceMappingURL=templates.js.map
@@ -16,7 +16,7 @@ const AGENT_DIRS = ['leadership', 'planning', 'aj-team', 'deployment', 'audit'];
16
16
  export async function updateAgents(spinner, stats) {
17
17
  spinner.start('Updating agents...');
18
18
  const sdkPath = await getSDKPath();
19
- const agentsTemplatePath = path.join(sdkPath, 'dist/templates/agents');
19
+ const agentsTemplatePath = path.join(sdkPath, 'dist/templates/.claude/agents');
20
20
  for (const agentDir of AGENT_DIRS) {
21
21
  const sourcePath = path.join(agentsTemplatePath, agentDir);
22
22
  const targetPath = path.join('.claude/agents', agentDir);
@@ -7,10 +7,10 @@ import fs from 'fs-extra';
7
7
  import path from 'path';
8
8
  /** User-managed files that need backup */
9
9
  const USER_FILES = [
10
- 'trinity/knowledge-base/ARCHITECTURE.md',
11
- 'trinity/knowledge-base/To-do.md',
12
- 'trinity/knowledge-base/ISSUES.md',
13
- 'trinity/knowledge-base/Technical-Debt.md',
10
+ '.claude/trinity/knowledge-base/ARCHITECTURE.md',
11
+ '.claude/trinity/knowledge-base/To-do.md',
12
+ '.claude/trinity/knowledge-base/ISSUES.md',
13
+ '.claude/trinity/knowledge-base/Technical-Debt.md',
14
14
  ];
15
15
  /**
16
16
  * Create backup of Trinity Method files before update
@@ -28,8 +28,7 @@ export async function createUpdateBackup(spinner) {
28
28
  await fs.copy(file, backupPath);
29
29
  }
30
30
  }
31
- // Backup entire trinity and .claude dirs for rollback safety
32
- await fs.copy('trinity', path.join(backupDir, 'trinity'));
31
+ // Backup entire .claude dir for rollback safety (includes .claude/trinity/)
33
32
  await fs.copy('.claude', path.join(backupDir, '.claude'));
34
33
  spinner.succeed('Backup created');
35
34
  return backupDir;
@@ -60,12 +59,7 @@ export async function rollbackFromBackup(backupDir) {
60
59
  }
61
60
  const rollbackSpinner = await import('ora').then((m) => m.default('Restoring from backup...').start());
62
61
  try {
63
- // Restore trinity directory
64
- if (await fs.pathExists(path.join(backupDir, 'trinity'))) {
65
- await fs.remove('trinity');
66
- await fs.copy(path.join(backupDir, 'trinity'), 'trinity');
67
- }
68
- // Restore .claude directory
62
+ // Restore .claude directory (includes .claude/trinity/)
69
63
  if (await fs.pathExists(path.join(backupDir, '.claude'))) {
70
64
  await fs.remove('.claude');
71
65
  await fs.copy(path.join(backupDir, '.claude'), '.claude');
@@ -7,6 +7,7 @@ import { Ora } from 'ora';
7
7
  import { UpdateStats } from './types.js';
8
8
  /**
9
9
  * Update slash command files from SDK to .claude/commands/
10
+ * Commands are now organized by category in source templates
10
11
  * @param spinner - ora spinner instance for status display
11
12
  * @param stats - update statistics to track progress
12
13
  */