trinity-method-sdk 2.1.0 → 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 (96) hide show
  1. package/CHANGELOG.md +702 -467
  2. package/README.md +550 -539
  3. package/dist/cli/commands/deploy/ci-cd.d.ts +4 -3
  4. package/dist/cli/commands/deploy/ci-cd.js +10 -9
  5. package/dist/cli/commands/deploy/configuration.js +10 -11
  6. package/dist/cli/commands/deploy/directories.js +13 -14
  7. package/dist/cli/commands/deploy/gitignore.js +3 -5
  8. package/dist/cli/commands/deploy/index.d.ts +1 -1
  9. package/dist/cli/commands/deploy/index.js +6 -2
  10. package/dist/cli/commands/deploy/knowledge-base.js +2 -2
  11. package/dist/cli/commands/deploy/pre-flight.js +1 -1
  12. package/dist/cli/commands/deploy/root-files.js +2 -17
  13. package/dist/cli/commands/deploy/summary.js +3 -3
  14. package/dist/cli/commands/deploy/templates.js +5 -5
  15. package/dist/cli/commands/update/backup.js +6 -12
  16. package/dist/cli/commands/update/knowledge-base.js +1 -1
  17. package/dist/cli/commands/update/pre-flight.js +11 -11
  18. package/dist/cli/commands/update/summary.js +5 -5
  19. package/dist/cli/commands/update/templates.js +1 -1
  20. package/dist/cli/commands/update/verification.js +5 -5
  21. package/dist/cli/commands/update/version.js +1 -1
  22. package/dist/cli/utils/deploy-ci.d.ts +3 -2
  23. package/dist/cli/utils/deploy-ci.js +24 -24
  24. package/dist/cli/utils/deploy-linting.js +100 -5
  25. package/dist/cli/utils/error-classes.d.ts +2 -2
  26. package/dist/cli/utils/linting-tools.js +14 -6
  27. package/dist/cli/utils/template-processor.js +1 -3
  28. package/dist/templates/.claude/EMPLOYEE-DIRECTORY.md.template +16 -22
  29. package/dist/templates/.claude/agents/aj-team/apo-documentation-specialist.md.template +7 -7
  30. package/dist/templates/.claude/agents/aj-team/bas-quality-gate.md.template +8 -8
  31. package/dist/templates/.claude/agents/aj-team/dra-code-reviewer.md.template +3 -3
  32. package/dist/templates/.claude/agents/aj-team/kil-task-executor.md.template +6 -6
  33. package/dist/templates/.claude/agents/audit/juno-auditor.md.template +39 -40
  34. package/dist/templates/.claude/agents/deployment/ein-cicd.md.template +56 -159
  35. package/dist/templates/.claude/agents/deployment/ino-context.md.template +21 -21
  36. package/dist/templates/.claude/agents/deployment/tan-structure.md.template +28 -29
  37. package/dist/templates/.claude/agents/deployment/zen-knowledge.md.template +22 -23
  38. package/dist/templates/.claude/agents/leadership/aj-maestro.md.template +6 -6
  39. package/dist/templates/.claude/agents/leadership/aly-cto.md.template +17 -18
  40. package/dist/templates/.claude/agents/planning/eus-decomposer.md.template +4 -4
  41. package/dist/templates/.claude/agents/planning/mon-requirements.md.template +4 -4
  42. package/dist/templates/.claude/agents/planning/ror-design.md.template +4 -4
  43. package/dist/templates/.claude/agents/planning/tra-planner.md.template +4 -4
  44. package/dist/templates/.claude/commands/execution/trinity-audit.md.template +9 -9
  45. package/dist/templates/.claude/commands/execution/trinity-breakdown.md.template +535 -0
  46. package/dist/templates/.claude/commands/execution/trinity-orchestrate.md.template +43 -43
  47. package/dist/templates/.claude/commands/infrastructure/trinity-init.md.template +20 -43
  48. package/dist/templates/.claude/commands/investigation/trinity-create-investigation.md.template +5 -5
  49. package/dist/templates/.claude/commands/investigation/trinity-investigate-templates.md.template +10 -10
  50. package/dist/templates/.claude/commands/investigation/trinity-plan-investigation.md.template +1 -1
  51. package/dist/templates/.claude/commands/maintenance/trinity-changelog.md.template +4 -4
  52. package/dist/templates/.claude/commands/maintenance/trinity-docs-update.md.template +10 -10
  53. package/dist/templates/.claude/commands/maintenance/trinity-docs.md.template +62 -62
  54. package/dist/templates/.claude/commands/maintenance/trinity-readme.md.template +16 -16
  55. package/dist/templates/.claude/commands/session/trinity-continue.md.template +22 -22
  56. package/dist/templates/.claude/commands/session/trinity-end.md.template +22 -22
  57. package/dist/templates/.claude/commands/session/trinity-start.md.template +1 -2
  58. package/dist/templates/.claude/commands/utility/trinity-agents.md.template +3 -6
  59. package/dist/templates/.claude/commands/utility/trinity-verify.md.template +48 -54
  60. package/dist/templates/.claude/commands/utility/trinity-workorder.md.template +5 -5
  61. package/dist/templates/ci/ci.yml.template +2 -2
  62. package/dist/templates/root/CLAUDE.md.template +9 -9
  63. package/dist/templates/root/linting/nodejs/.husky-pre-commit.template +5 -0
  64. package/dist/templates/source/base-CLAUDE.md.template +310 -310
  65. package/dist/templates/source/flutter-CLAUDE.md.template +593 -593
  66. package/dist/templates/source/nodejs-CLAUDE.md.template +531 -531
  67. package/dist/templates/source/python-CLAUDE.md.template +510 -510
  68. package/dist/templates/source/react-CLAUDE.md.template +513 -513
  69. package/dist/templates/source/rust-CLAUDE.md.template +653 -653
  70. package/dist/templates/trinity/CLAUDE.md.template +14 -14
  71. package/dist/templates/trinity/knowledge-base/ARCHITECTURE.md.template +4 -4
  72. package/dist/templates/trinity/knowledge-base/ISSUES.md.template +8 -8
  73. package/dist/templates/trinity/knowledge-base/Technical-Debt.md.template +1 -3
  74. package/dist/templates/trinity/knowledge-base/To-do.md.template +1 -1
  75. package/dist/templates/trinity/knowledge-base/Trinity.md.template +5 -5
  76. package/dist/templates/trinity/templates/documentation/configuration/env-example-generator.md.template +1 -1
  77. package/dist/templates/trinity/templates/documentation/processes/error-handling-protocol.md.template +2 -2
  78. package/dist/templates/trinity/templates/documentation/reports/apo-docs-update-checklist.md.template +7 -7
  79. package/dist/templates/trinity/templates/documentation/reports/juno-docs-update-checklist.md.template +4 -4
  80. package/dist/templates/trinity/templates/documentation/reports/juno-internal-report.md.template +10 -10
  81. package/dist/templates/trinity/templates/investigations/bug.md.template +14 -14
  82. package/dist/templates/trinity/templates/investigations/feature.md.template +14 -14
  83. package/dist/templates/trinity/templates/investigations/performance.md.template +14 -14
  84. package/dist/templates/trinity/templates/investigations/security.md.template +14 -14
  85. package/dist/templates/trinity/templates/investigations/technical.md.template +14 -14
  86. package/dist/templates/trinity/templates/work-orders/ANALYSIS-TEMPLATE.md.template +10 -10
  87. package/dist/templates/trinity/templates/work-orders/AUDIT-TEMPLATE.md.template +10 -10
  88. package/dist/templates/trinity/templates/work-orders/IMPLEMENTATION-TEMPLATE.md.template +10 -10
  89. package/dist/templates/trinity/templates/work-orders/INVESTIGATION-TEMPLATE.md.template +10 -10
  90. package/dist/templates/trinity/templates/work-orders/PATTERN-TEMPLATE.md.template +10 -10
  91. package/dist/templates/trinity/templates/work-orders/VERIFICATION-TEMPLATE.md.template +10 -10
  92. package/package.json +99 -94
  93. package/dist/templates/.claude/agents/leadership/aj-cc.md.template +0 -467
  94. package/dist/templates/ci/cd.yml.template +0 -175
  95. package/dist/templates/ci/github-actions.yml +0 -86
  96. package/dist/templates/root/TRINITY.md.template +0 -52
@@ -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;
@@ -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) {
@@ -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);
@@ -35,7 +35,7 @@ export async function deployKnowledgeBase(templatesPath, variables, stack, metri
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,7 +24,7 @@ async function deployRootClaudeMarkdown(templatesPath, variables) {
38
24
  * Deploy VERSION file
39
25
  */
40
26
  async function deployVersionFile(pkgVersion) {
41
- const versionPath = validatePath('trinity/VERSION');
27
+ const versionPath = validatePath('.claude/trinity/VERSION');
42
28
  await fs.writeFile(versionPath, pkgVersion || '2.1.0');
43
29
  return 1;
44
30
  }
@@ -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');
@@ -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,7 +25,7 @@ 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
30
  const templatePath = path.join(templatesPath, 'trinity/templates/work-orders', template);
31
31
  if (await fs.pathExists(templatePath)) {
@@ -33,7 +33,7 @@ export async function deployTemplates(templatesPath, variables, spinner) {
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,7 +48,7 @@ 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
53
  const templatePath = path.join(templatesPath, 'trinity/templates/investigations', template);
54
54
  if (await fs.pathExists(templatePath)) {
@@ -56,7 +56,7 @@ export async function deployTemplates(templatesPath, variables, spinner) {
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
  }
@@ -65,7 +65,7 @@ export async function deployTemplates(templatesPath, variables, spinner) {
65
65
  // Deploy documentation templates (all 28 templates including subdirectories)
66
66
  spinner.start('Deploying documentation templates...');
67
67
  const docSourcePath = path.join(templatesPath, 'trinity/templates/documentation');
68
- const docDestPath = 'trinity/templates/documentation';
68
+ const docDestPath = '.claude/trinity/templates/documentation';
69
69
  await fs.ensureDir(docDestPath);
70
70
  // Recursively copy all documentation templates, removing .template extension
71
71
  async function copyDocTemplates(sourcePath, destPath) {
@@ -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');
@@ -28,7 +28,7 @@ export async function updateKnowledgeBase(spinner, stats) {
28
28
  if (await fs.pathExists(sourcePath)) {
29
29
  // Remove .template extension for target
30
30
  const targetFile = templateFile.replace('.template', '');
31
- const targetPath = path.join('trinity/knowledge-base', targetFile);
31
+ const targetPath = path.join('.claude/trinity/knowledge-base', targetFile);
32
32
  await fs.copy(sourcePath, targetPath, { overwrite: true });
33
33
  stats.knowledgeBaseUpdated++;
34
34
  }
@@ -12,26 +12,26 @@ import { UpdateError } from '../../utils/error-classes.js';
12
12
  */
13
13
  export async function runUpdatePreflightChecks(spinner) {
14
14
  spinner.start('Running pre-flight checks...');
15
- // Check trinity directory exists
16
- const trinityExists = await fs.pathExists('trinity');
17
- if (!trinityExists) {
18
- spinner.fail('Trinity Method not deployed');
19
- const { displayInfo } = await import('../../utils/errors.js');
20
- displayInfo('Use: trinity deploy to install');
21
- throw new UpdateError('Trinity Method not deployed in this project', {
22
- reason: 'trinity_directory_missing',
23
- });
24
- }
25
15
  // Check .claude directory exists
26
16
  const claudeExists = await fs.pathExists('.claude');
27
17
  if (!claudeExists) {
28
18
  spinner.fail('.claude directory not found');
29
19
  const { displayInfo } = await import('../../utils/errors.js');
30
- displayInfo('Trinity deployment appears incomplete');
20
+ displayInfo('Use: trinity deploy to install');
31
21
  throw new UpdateError('.claude directory not found', {
32
22
  reason: 'claude_directory_missing',
33
23
  });
34
24
  }
25
+ // Check .claude/trinity directory exists
26
+ const trinityExists = await fs.pathExists('.claude/trinity');
27
+ if (!trinityExists) {
28
+ spinner.fail('Trinity Method not deployed');
29
+ const { displayInfo } = await import('../../utils/errors.js');
30
+ displayInfo('Trinity deployment appears incomplete');
31
+ throw new UpdateError('Trinity Method not deployed in this project', {
32
+ reason: 'trinity_directory_missing',
33
+ });
34
+ }
35
35
  spinner.succeed('Pre-flight checks passed');
36
36
  }
37
37
  //# sourceMappingURL=pre-flight.js.map
@@ -32,15 +32,15 @@ export function displayDryRunPreview(oldVersion, newVersion) {
32
32
  console.log(chalk.white(' Would update:'));
33
33
  console.log(chalk.gray(` • 18 agent files in .claude/agents/`));
34
34
  console.log(chalk.gray(` • 16 slash commands in .claude/commands/`));
35
- console.log(chalk.gray(` • 6 work order templates in trinity/templates/`));
35
+ console.log(chalk.gray(` • 6 work order templates in .claude/trinity/templates/`));
36
36
  console.log(chalk.gray(` • Knowledge base files (Trinity.md, CODING-PRINCIPLES.md, etc.)`));
37
37
  console.log(chalk.gray(` • Version file: ${oldVersion} → ${newVersion}`));
38
38
  console.log('');
39
39
  console.log(chalk.white(' Would preserve:'));
40
- console.log(chalk.gray(` • trinity/knowledge-base/ARCHITECTURE.md`));
41
- console.log(chalk.gray(` • trinity/knowledge-base/To-do.md`));
42
- console.log(chalk.gray(` • trinity/knowledge-base/ISSUES.md`));
43
- console.log(chalk.gray(` • trinity/knowledge-base/Technical-Debt.md`));
40
+ console.log(chalk.gray(` • .claude/trinity/knowledge-base/ARCHITECTURE.md`));
41
+ console.log(chalk.gray(` • .claude/trinity/knowledge-base/To-do.md`));
42
+ console.log(chalk.gray(` • .claude/trinity/knowledge-base/ISSUES.md`));
43
+ console.log(chalk.gray(` • .claude/trinity/knowledge-base/Technical-Debt.md`));
44
44
  console.log('');
45
45
  console.log(chalk.blue('💡 Run without --dry-run to perform update\n'));
46
46
  }
@@ -51,7 +51,7 @@ export async function updateTemplates(spinner, stats) {
51
51
  const sdkTemplatesPath = path.join(sdkPath, 'dist/templates/trinity/templates');
52
52
  for (const templateDir of TEMPLATE_DIRS) {
53
53
  const sourcePath = path.join(sdkTemplatesPath, templateDir);
54
- const targetPath = path.join('trinity/templates', templateDir);
54
+ const targetPath = path.join('.claude/trinity/templates', templateDir);
55
55
  if (await fs.pathExists(sourcePath)) {
56
56
  await fs.ensureDir(targetPath);
57
57
  await copyTemplatesRecursively(sourcePath, targetPath, stats);
@@ -7,13 +7,13 @@ import fs from 'fs-extra';
7
7
  import { validatePath } from '../../utils/validate-path.js';
8
8
  /** Verification checks to run after update */
9
9
  const VERIFICATION_CHECKS = [
10
- { path: 'trinity/VERSION', desc: 'Version file' },
10
+ { path: '.claude/trinity/VERSION', desc: 'Version file' },
11
11
  { path: '.claude/agents/leadership', desc: 'Leadership agents' },
12
12
  { path: '.claude/agents/planning', desc: 'Planning agents' },
13
13
  { path: '.claude/agents/aj-team', desc: 'AJ team agents' },
14
14
  { path: '.claude/commands', desc: 'Slash commands' },
15
- { path: 'trinity/templates', desc: 'Work order templates' },
16
- { path: 'trinity/knowledge-base/Trinity.md', desc: 'Trinity knowledge base' },
15
+ { path: '.claude/trinity/templates', desc: 'Work order templates' },
16
+ { path: '.claude/trinity/knowledge-base/Trinity.md', desc: 'Trinity knowledge base' },
17
17
  ];
18
18
  /**
19
19
  * Verify update deployment is successful
@@ -31,7 +31,7 @@ export async function verifyUpdateDeployment(spinner, expectedVersion) {
31
31
  }
32
32
  }
33
33
  // Verify version was actually updated
34
- const versionPath = 'trinity/VERSION';
34
+ const versionPath = '.claude/trinity/VERSION';
35
35
  const updatedVersion = (await fs.readFile(versionPath, 'utf8')).trim();
36
36
  if (updatedVersion !== expectedVersion) {
37
37
  spinner.fail('Version file not updated correctly');
@@ -47,7 +47,7 @@ export async function verifyUpdateDeployment(spinner, expectedVersion) {
47
47
  export async function updateVersionFile(spinner, version) {
48
48
  spinner.start('Updating version file...');
49
49
  // Validate destination path for security
50
- const destPath = validatePath('trinity/VERSION');
50
+ const destPath = validatePath('.claude/trinity/VERSION');
51
51
  await fs.writeFile(destPath, version);
52
52
  spinner.succeed('Version file updated');
53
53
  }
@@ -14,7 +14,7 @@ import { getPackageJsonPath } from '../../utils/get-sdk-path.js';
14
14
  export async function detectInstalledSDKVersion(spinner) {
15
15
  spinner.start('Checking versions...');
16
16
  // Read current version from trinity/VERSION
17
- const versionPath = 'trinity/VERSION';
17
+ const versionPath = '.claude/trinity/VERSION';
18
18
  let currentVersion = '0.0.0';
19
19
  if (await fs.pathExists(versionPath)) {
20
20
  currentVersion = (await fs.readFile(versionPath, 'utf8')).trim();
@@ -12,11 +12,12 @@ interface CIDeployOptions {
12
12
  force?: boolean;
13
13
  }
14
14
  /**
15
- * Deploy CI/CD workflow templates based on detected Git platform
15
+ * Deploy CI workflow templates based on detected Git platform
16
16
  *
17
17
  * @param options - Deployment options
18
+ * @param variables - Template variables for processing
18
19
  * @returns Deployment results with statistics
19
20
  */
20
- export declare function deployCITemplates(options?: CIDeployOptions): Promise<CIDeploymentStats>;
21
+ export declare function deployCITemplates(options?: CIDeployOptions, variables?: Record<string, string>): Promise<CIDeploymentStats>;
21
22
  export {};
22
23
  //# sourceMappingURL=deploy-ci.d.ts.map