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
@@ -3,6 +3,7 @@ import path from 'path';
3
3
  import { fileURLToPath } from 'url';
4
4
  import { dirname } from 'path';
5
5
  import { validatePath } from './validate-path.js';
6
+ import { processTemplate } from './template-processor.js';
6
7
  const __filename = fileURLToPath(import.meta.url);
7
8
  const __dirname = dirname(__filename);
8
9
  /**
@@ -20,7 +21,7 @@ async function deployGitLabCI(templatesPath, options, stats) {
20
21
  const content = await fs.readFile(gitlabTemplate, 'utf8');
21
22
  const gitlabCIExists = await fs.pathExists('.gitlab-ci.yml');
22
23
  if (gitlabCIExists && !options.force) {
23
- stats.skipped.push('.gitlab-ci.yml (already exists)');
24
+ stats.skipped.push('.gitlab-ci.yml (already exists, use --force to overwrite)');
24
25
  return;
25
26
  }
26
27
  // Validate destination path for security
@@ -34,12 +35,13 @@ async function deployGitLabCI(templatesPath, options, stats) {
34
35
  }
35
36
  }
36
37
  /**
37
- * Deploy CI/CD workflow templates based on detected Git platform
38
+ * Deploy CI workflow templates based on detected Git platform
38
39
  *
39
40
  * @param options - Deployment options
41
+ * @param variables - Template variables for processing
40
42
  * @returns Deployment results with statistics
41
43
  */
42
- export async function deployCITemplates(options = {}) {
44
+ export async function deployCITemplates(options = {}, variables = {}) {
43
45
  const stats = {
44
46
  deployed: [],
45
47
  skipped: [],
@@ -49,33 +51,31 @@ export async function deployCITemplates(options = {}) {
49
51
  // Detect Git platform
50
52
  const platform = await detectGitPlatform();
51
53
  const templatesPath = path.join(__dirname, '../../templates/ci');
52
- // GitHub Actions - Deploy both CI and CD workflows
54
+ // GitHub Actions - Deploy CI workflow
53
55
  if (platform === 'github' || platform === 'unknown') {
54
56
  try {
55
57
  await fs.ensureDir('.github/workflows');
56
58
  // Deploy CI workflow
57
59
  const ciTemplate = path.join(templatesPath, 'ci.yml.template');
58
60
  if (await fs.pathExists(ciTemplate)) {
59
- const content = await fs.readFile(ciTemplate, 'utf8');
60
- // Validate destination path for security
61
- const destPath = validatePath('.github/workflows/ci.yml');
62
- await fs.writeFile(destPath, content);
63
- stats.deployed.push('.github/workflows/ci.yml');
64
- }
65
- // Deploy CD workflow
66
- const cdTemplate = path.join(templatesPath, 'cd.yml.template');
67
- if (await fs.pathExists(cdTemplate)) {
68
- const content = await fs.readFile(cdTemplate, 'utf8');
69
- // Validate destination path for security
70
- const destPath = validatePath('.github/workflows/cd.yml');
71
- await fs.writeFile(destPath, content);
72
- stats.deployed.push('.github/workflows/cd.yml');
61
+ const ciExists = await fs.pathExists('.github/workflows/ci.yml');
62
+ if (ciExists && !options.force) {
63
+ stats.skipped.push('.github/workflows/ci.yml (already exists, use --force to overwrite)');
64
+ }
65
+ else {
66
+ const content = await fs.readFile(ciTemplate, 'utf8');
67
+ const processed = processTemplate(content, variables);
68
+ // Validate destination path for security
69
+ const destPath = validatePath('.github/workflows/ci.yml');
70
+ await fs.writeFile(destPath, processed);
71
+ stats.deployed.push('.github/workflows/ci.yml');
72
+ }
73
73
  }
74
74
  }
75
75
  catch (error) {
76
76
  const { getErrorMessage } = await import('./errors.js');
77
77
  stats.errors.push({
78
- file: '.github/workflows/ci.yml or cd.yml',
78
+ file: '.github/workflows/ci.yml',
79
79
  error: getErrorMessage(error),
80
80
  });
81
81
  }
@@ -84,22 +84,22 @@ export async function deployCITemplates(options = {}) {
84
84
  if (platform === 'gitlab') {
85
85
  await deployGitLabCI(templatesPath, options, stats);
86
86
  }
87
- // Generic template (always deploy to trinity/templates/ci)
87
+ // Generic template (always deploy to .claude/trinity/templates/ci)
88
88
  try {
89
- await fs.ensureDir('trinity/templates/ci');
89
+ await fs.ensureDir('.claude/trinity/templates/ci');
90
90
  const genericTemplate = path.join(templatesPath, 'generic-ci.yml');
91
91
  if (await fs.pathExists(genericTemplate)) {
92
92
  const content = await fs.readFile(genericTemplate, 'utf8');
93
93
  // Validate destination path for security
94
- const destPath = validatePath('trinity/templates/ci/generic-ci.yml');
94
+ const destPath = validatePath('.claude/trinity/templates/ci/generic-ci.yml');
95
95
  await fs.writeFile(destPath, content);
96
- stats.deployed.push('trinity/templates/ci/generic-ci.yml');
96
+ stats.deployed.push('.claude/trinity/templates/ci/generic-ci.yml');
97
97
  }
98
98
  }
99
99
  catch (error) {
100
100
  const { getErrorMessage } = await import('./errors.js');
101
101
  stats.errors.push({
102
- file: 'trinity/templates/ci/generic-ci.yml',
102
+ file: '.claude/trinity/templates/ci/generic-ci.yml',
103
103
  error: getErrorMessage(error),
104
104
  });
105
105
  }
@@ -1,5 +1,6 @@
1
1
  import fs from 'fs-extra';
2
2
  import path from 'path';
3
+ import chalk from 'chalk';
3
4
  import { processTemplate } from './template-processor.js';
4
5
  import { validatePath } from './validate-path.js';
5
6
  export async function deployLintingTool(tool, stack, templatesPath, variables) {
@@ -14,7 +15,7 @@ export async function deployLintingTool(tool, stack, templatesPath, variables) {
14
15
  await deployPrettier(tool, templateDir, variables);
15
16
  break;
16
17
  case 'precommit':
17
- await deployPreCommit(tool, templateDir, variables);
18
+ await deployPreCommit(tool, stack, templateDir, variables);
18
19
  break;
19
20
  case 'typescript-eslint':
20
21
  await deployTypeScriptESLint(tool, stack, templateDir, variables);
@@ -46,7 +47,22 @@ function getFrameworkDirectory(framework) {
46
47
  };
47
48
  return frameworkMap[framework] || 'nodejs';
48
49
  }
49
- async function deployESLint(tool, stack, templateDir, variables) {
50
+ async function deployESLint(_tool, stack, templateDir, variables) {
51
+ // Skip if ESLint config already exists
52
+ const eslintConfigs = [
53
+ '.eslintrc.json',
54
+ '.eslintrc.js',
55
+ '.eslintrc.cjs',
56
+ '.eslintrc.yml',
57
+ 'eslint.config.js',
58
+ 'eslint.config.mjs',
59
+ ];
60
+ for (const config of eslintConfigs) {
61
+ if (await fs.pathExists(config)) {
62
+ console.warn(chalk.yellow(` Skipped: .eslintrc.json (${config} already exists, use --force to overwrite)`));
63
+ return;
64
+ }
65
+ }
50
66
  let templateFile;
51
67
  if (stack.language === 'TypeScript') {
52
68
  templateFile = '.eslintrc-typescript.json.template';
@@ -64,7 +80,22 @@ async function deployESLint(tool, stack, templateDir, variables) {
64
80
  const destPath = validatePath('.eslintrc.json');
65
81
  await fs.writeFile(destPath, processed);
66
82
  }
67
- async function deployPrettier(tool, templateDir, variables) {
83
+ async function deployPrettier(_tool, templateDir, variables) {
84
+ // Skip if Prettier config already exists
85
+ const prettierConfigs = [
86
+ '.prettierrc.json',
87
+ '.prettierrc',
88
+ '.prettierrc.js',
89
+ '.prettierrc.cjs',
90
+ '.prettierrc.yml',
91
+ 'prettier.config.js',
92
+ ];
93
+ for (const config of prettierConfigs) {
94
+ if (await fs.pathExists(config)) {
95
+ console.warn(chalk.yellow(` Skipped: .prettierrc.json (${config} already exists, use --force to overwrite)`));
96
+ return;
97
+ }
98
+ }
68
99
  const templatePath = path.join(templateDir, '.prettierrc.json.template');
69
100
  const content = await fs.readFile(templatePath, 'utf8');
70
101
  const processed = processTemplate(content, variables);
@@ -72,7 +103,71 @@ async function deployPrettier(tool, templateDir, variables) {
72
103
  const destPath = validatePath('.prettierrc.json');
73
104
  await fs.writeFile(destPath, processed);
74
105
  }
75
- async function deployPreCommit(tool, templateDir, variables) {
106
+ async function deployPreCommit(tool, stack, templateDir, variables) {
107
+ // Skip if existing pre-commit setup detected
108
+ if (await hasExistingPreCommitSetup()) {
109
+ console.warn(chalk.yellow(' Existing pre-commit configuration detected, skipping deployment'));
110
+ return;
111
+ }
112
+ const framework = stack.framework;
113
+ if (framework === 'Node.js' || framework === 'React' || framework === 'Next.js') {
114
+ await deployHuskyPreCommit(tool, templateDir, variables);
115
+ }
116
+ else {
117
+ await deployPythonPreCommit(tool, templateDir, variables);
118
+ }
119
+ }
120
+ async function hasExistingPreCommitSetup() {
121
+ // Check for .husky/ directory
122
+ if (await fs.pathExists('.husky')) {
123
+ return true;
124
+ }
125
+ // Check for .pre-commit-config.yaml
126
+ if (await fs.pathExists('.pre-commit-config.yaml')) {
127
+ return true;
128
+ }
129
+ // Check package.json for husky or lint-staged
130
+ if (await fs.pathExists('package.json')) {
131
+ const pkg = await fs.readJson('package.json');
132
+ const allDeps = {
133
+ ...pkg.dependencies,
134
+ ...pkg.devDependencies,
135
+ };
136
+ if (allDeps.husky || allDeps['lint-staged']) {
137
+ return true;
138
+ }
139
+ }
140
+ return false;
141
+ }
142
+ async function deployHuskyPreCommit(_tool, templateDir, variables) {
143
+ // Create .husky directory
144
+ await fs.ensureDir('.husky');
145
+ // Deploy pre-commit hook from template
146
+ const templatePath = path.join(templateDir, '.husky-pre-commit.template');
147
+ const content = await fs.readFile(templatePath, 'utf8');
148
+ const processed = processTemplate(content, variables);
149
+ const destPath = validatePath('.husky/pre-commit');
150
+ await fs.writeFile(destPath, processed, { mode: 0o755 });
151
+ // Add lint-staged config to package.json
152
+ await addLintStagedConfig();
153
+ }
154
+ async function addLintStagedConfig() {
155
+ const packageJsonPath = 'package.json';
156
+ if (!(await fs.pathExists(packageJsonPath))) {
157
+ return;
158
+ }
159
+ const pkg = await fs.readJson(packageJsonPath);
160
+ if (pkg['lint-staged']) {
161
+ return; // Already has lint-staged config
162
+ }
163
+ pkg['lint-staged'] = {
164
+ '*.{ts,tsx}': ['eslint --fix', 'prettier --write'],
165
+ '*.{js,jsx}': ['eslint --fix', 'prettier --write'],
166
+ '*.{json,md,yml,yaml}': ['prettier --write'],
167
+ };
168
+ await fs.writeJson(packageJsonPath, pkg, { spaces: 2 });
169
+ }
170
+ async function deployPythonPreCommit(_tool, templateDir, variables) {
76
171
  const templatePath = path.join(templateDir, '.pre-commit-config.yaml.template');
77
172
  const content = await fs.readFile(templatePath, 'utf8');
78
173
  const processed = processTemplate(content, variables);
@@ -116,7 +211,7 @@ async function deployPythonTool(tool, templateDir, variables) {
116
211
  await fs.writeFile(destPath, processed);
117
212
  }
118
213
  }
119
- async function deployDartAnalyzer(tool, templateDir, variables) {
214
+ async function deployDartAnalyzer(_tool, templateDir, variables) {
120
215
  const templatePath = path.join(templateDir, 'analysis_options.yaml.template');
121
216
  const content = await fs.readFile(templatePath, 'utf8');
122
217
  const processed = processTemplate(content, variables);
@@ -10,7 +10,7 @@
10
10
  export declare class TrinityCLIError extends Error {
11
11
  readonly code: string;
12
12
  readonly exitCode: number;
13
- readonly context?: Record<string, unknown>;
13
+ readonly context?: Record<string, unknown> | undefined;
14
14
  /**
15
15
  * Create a Trinity CLI error
16
16
  * @param message - Human-readable error message
@@ -18,7 +18,7 @@ export declare class TrinityCLIError extends Error {
18
18
  * @param exitCode - Process exit code (default: 1)
19
19
  * @param context - Additional context for debugging
20
20
  */
21
- constructor(message: string, code: string, exitCode?: number, context?: Record<string, unknown>);
21
+ constructor(message: string, code: string, exitCode?: number, context?: Record<string, unknown> | undefined);
22
22
  /**
23
23
  * Format error for user display
24
24
  * @returns Formatted error message with code
@@ -27,10 +27,14 @@ export const lintingTools = {
27
27
  {
28
28
  id: 'precommit',
29
29
  name: 'Pre-commit hooks',
30
- description: 'Git hooks for code quality',
31
- file: '.pre-commit-config.yaml',
30
+ description: 'Git hooks for code quality (husky + lint-staged)',
31
+ file: '.husky/pre-commit',
32
32
  recommended: true,
33
- dependencies: [],
33
+ dependencies: ['husky@^9.1.7', 'lint-staged@^16.2.0'],
34
+ scripts: {
35
+ prepare: 'husky',
36
+ },
37
+ postInstall: 'npm install',
34
38
  },
35
39
  {
36
40
  id: 'typescript-eslint',
@@ -69,10 +73,14 @@ export const lintingTools = {
69
73
  {
70
74
  id: 'precommit',
71
75
  name: 'Pre-commit hooks',
72
- description: 'Git hooks for code quality',
73
- file: '.pre-commit-config.yaml',
76
+ description: 'Git hooks for code quality (husky + lint-staged)',
77
+ file: '.husky/pre-commit',
74
78
  recommended: true,
75
- dependencies: [],
79
+ dependencies: ['husky@^9.1.7', 'lint-staged@^16.2.0'],
80
+ scripts: {
81
+ prepare: 'husky',
82
+ },
83
+ postInstall: 'npm install',
76
84
  },
77
85
  {
78
86
  id: 'typescript-eslint',
@@ -29,9 +29,7 @@ const VARIABLE_RESOLVERS = {
29
29
  PRIMARY_FRAMEWORK: (v) => toString(v.PRIMARY_FRAMEWORK || v.FRAMEWORK || v.framework) || 'Generic',
30
30
  CURRENT_DATE: (v) => toString(v.CURRENT_DATE) || new Date().toISOString().split('T')[0],
31
31
  PROJECT_VAR_NAME: (v) => resolveProjectVarName(v),
32
- TRINITY_HOME: (v) => toString(v.TRINITY_HOME) ||
33
- process.env.TRINITY_HOME ||
34
- 'C:/Users/lukaf/Desktop/Dev Work/trinity-method',
32
+ TRINITY_HOME: (v) => toString(v.TRINITY_HOME) || process.env.TRINITY_HOME || process.cwd(),
35
33
  };
36
34
  export function processTemplate(content, variables) {
37
35
  let processed = content;
@@ -27,11 +27,11 @@
27
27
 
28
28
  ### AJ MAESTRO (Implementation Orchestrator)
29
29
  **File:** [.claude/agents/leadership/aj-maestro.md](.claude/agents/leadership/aj-maestro.md)
30
- **Role:** Implementation coordination using 19-agent team (organized in 5 role-based subdirectories)
30
+ **Role:** Implementation coordination using 18-agent team (organized in 5 role-based subdirectories)
31
31
  **Specialization:** Planning layer, execution layer, support layer coordination
32
32
 
33
33
  **Agent Organization:**
34
- - **Leadership:** ALY, AJ MAESTRO, AJ CC (3 agents)
34
+ - **Leadership:** ALY, AJ MAESTRO (2 agents)
35
35
  - **Deployment:** TAN, ZEN, INO, EIN (4 agents)
36
36
  - **Planning:** MON, ROR, TRA, EUS (4 agents)
37
37
  - **Implementation:** KIL, BAS, DRA, APO, BON, CAP, URO (7 agents)
@@ -49,13 +49,6 @@
49
49
 
50
50
  ---
51
51
 
52
- ### AJ CC (Code Coordinator)
53
- **File:** [.claude/agents/leadership/aj-cc.md](.claude/agents/leadership/aj-cc.md)
54
- **Role:** Code quality and implementation oversight
55
- **Specialization:** Tactical implementation coordination
56
-
57
- ---
58
-
59
52
  ## 🚀 DEPLOYMENT TEAM (4 Specialists)
60
53
 
61
54
  ### TAN (Structure Specialist)
@@ -371,7 +364,7 @@ npx trinity-method-sdk deploy --skip-audit
371
364
  - Reference: "Please review `.claude/agents/leadership/aly-cto.md` to investigate [feature name] and create work order"
372
365
 
373
366
  **2. Implementation phase (AJ):**
374
- - Reference: "Please review `.claude/agents/leadership/aj-cc.md` to implement work order WO-XXX-[feature-name]"
367
+ - Reference: "Please review `.claude/agents/leadership/aj-maestro.md` to implement work order WO-XXX-[feature-name]"
375
368
 
376
369
  **3. Quality review (JUNO):**
377
370
  - Reference: "Please review `.claude/agents/audit/juno-auditor.md` to review implementation of WO-XXX"
@@ -381,7 +374,7 @@ npx trinity-method-sdk deploy --skip-audit
381
374
  - Reference: "Please review `.claude/agents/leadership/aly-cto.md` to investigate bug: [description]"
382
375
 
383
376
  **2. Implement fix (AJ):**
384
- - Reference: "Please review `.claude/agents/leadership/aj-cc.md` to fix bug per investigation findings"
377
+ - Reference: "Please review `.claude/agents/leadership/aj-maestro.md` to fix bug per investigation findings"
385
378
 
386
379
  ### Documentation Updates
387
380
  **Update architecture docs (ZEN):**
@@ -429,6 +422,7 @@ npx trinity-method-sdk deploy --ci-deploy
429
422
  |------|-------|-------|---------------|
430
423
  | **Scale Determination** | ALY | Leadership | N/A (always first) |
431
424
  | **AI Orchestration** | AJ MAESTRO | Leadership | `/trinity-orchestrate` |
425
+ | **Guided Implementation** | AJ MAESTRO | Leadership | `/trinity-breakdown` |
432
426
  | **Requirements** | MON | Planning | `/trinity-requirements` |
433
427
  | **Technical Design** | ROR | Planning | `/trinity-design` |
434
428
  | **Work Planning** | TRA | Planning | `/trinity-plan` |
@@ -457,14 +451,14 @@ npx trinity-method-sdk deploy --ci-deploy
457
451
  ## 📚 ADDITIONAL RESOURCES
458
452
 
459
453
  ### Trinity Method Documentation
460
- - [Trinity Methodology](../trinity/knowledge-base/Trinity.md)
461
- - [Project Architecture](../trinity/knowledge-base/ARCHITECTURE.md)
462
- - [Current Tasks](../trinity/knowledge-base/To-do.md)
463
- - [Known Issues](../trinity/knowledge-base/ISSUES.md)
464
- - [Technical Debt](../trinity/knowledge-base/Technical-Debt.md)
454
+ - [Trinity Methodology](trinity/knowledge-base/Trinity.md)
455
+ - [Project Architecture](trinity/knowledge-base/ARCHITECTURE.md)
456
+ - [Current Tasks](trinity/knowledge-base/To-do.md)
457
+ - [Known Issues](trinity/knowledge-base/ISSUES.md)
458
+ - [Technical Debt](trinity/knowledge-base/Technical-Debt.md)
465
459
 
466
460
  ### Work Order Templates
467
- Located in `trinity/templates/work-orders/`:
461
+ Located in `.claude/trinity/templates/work-orders/`:
468
462
  - INVESTIGATION-TEMPLATE.md
469
463
  - IMPLEMENTATION-TEMPLATE.md
470
464
  - ANALYSIS-TEMPLATE.md
@@ -473,7 +467,7 @@ Located in `trinity/templates/work-orders/`:
473
467
  - VERIFICATION-TEMPLATE.md
474
468
 
475
469
  ### Investigation Templates
476
- Located in `trinity/templates/investigations/`:
470
+ Located in `.claude/trinity/templates/investigations/`:
477
471
  - bug.md - Bug investigation with Five Whys analysis
478
472
  - feature.md - Feature analysis with epic breakdown
479
473
  - technical.md - Technical investigation with ADR format
@@ -531,13 +525,13 @@ pre-commit install
531
525
 
532
526
  **Trinity Method Context Files**:
533
527
  - [../CLAUDE.md](../CLAUDE.md) - Project overview and global requirements
534
- - [../trinity/CLAUDE.md](../trinity/CLAUDE.md) - Trinity Method enforcement and protocols
528
+ - [trinity/CLAUDE.md](trinity/CLAUDE.md) - Trinity Method enforcement and protocols
535
529
  - [../src/CLAUDE.md](../src/CLAUDE.md) - Framework-specific implementation rules
536
530
 
537
531
  **Knowledge Base**:
538
- - [Investigation Protocols](../trinity/CLAUDE.md#investigation-protocols) - Investigation-first methodology
539
- - [Quality Gates](../trinity/CLAUDE.md#quality-standards) - BAS 6-phase quality gates
540
- - [Crisis Management](../trinity/CLAUDE.md#crisis-management) - Emergency escalation protocols
532
+ - [Investigation Protocols](trinity/CLAUDE.md#investigation-protocols) - Investigation-first methodology
533
+ - [Quality Gates](trinity/CLAUDE.md#quality-standards) - BAS 6-phase quality gates
534
+ - [Crisis Management](trinity/CLAUDE.md#crisis-management) - Emergency escalation protocols
541
535
 
542
536
  ---
543
537
 
@@ -27,7 +27,7 @@ You are primarily invoked via three focused documentation slash commands for tar
27
27
  /trinity-readme # Ensure all directories with CLAUDE.md have README.md
28
28
  ```
29
29
 
30
- **Deliverable:** `trinity/reports/README-AUDIT-{date}.md`
30
+ **Deliverable:** `.claude/trinity/reports/README-AUDIT-{date}.md`
31
31
 
32
32
  **Process:** 7-phase README management with validation checkpoints
33
33
 
@@ -41,7 +41,7 @@ You are primarily invoked via three focused documentation slash commands for tar
41
41
  /trinity-docs # Create/organize docs/ directory structure
42
42
  ```
43
43
 
44
- **Deliverable:** `trinity/reports/DOCS-ORGANIZATION-{date}.md`
44
+ **Deliverable:** `.claude/trinity/reports/DOCS-ORGANIZATION-{date}.md`
45
45
 
46
46
  **Process:** 4-phase docs/ organization (discovery, structure, navigation, report)
47
47
 
@@ -55,15 +55,15 @@ You are primarily invoked via three focused documentation slash commands for tar
55
55
  /trinity-changelog # Ensure CHANGELOG.md exists and is compliant
56
56
  ```
57
57
 
58
- **Deliverable:** `trinity/reports/CHANGELOG-AUDIT-{date}.md`
58
+ **Deliverable:** `.claude/trinity/reports/CHANGELOG-AUDIT-{date}.md`
59
59
 
60
60
  **Process:** 3-phase CHANGELOG management (discovery, validation, compliance)
61
61
 
62
62
  ---
63
63
 
64
64
  **README Templates Available:**
65
- - `trinity/templates/documentation/ROOT-README.md`
66
- - `trinity/templates/documentation/SUBDIRECTORY-README.md`
65
+ - `.claude/trinity/templates/documentation/ROOT-README.md`
66
+ - `.claude/trinity/templates/documentation/SUBDIRECTORY-README.md`
67
67
 
68
68
  **Workflow Integration:**
69
69
  ```
@@ -92,8 +92,8 @@ You are **APO**, the Documentation Specialist for Trinity Method SDK v2.0. You m
92
92
 
93
93
  Read these Trinity documents:
94
94
 
95
- 1. **trinity/knowledge-base/DOCUMENTATION-CRITERIA.md** - Documentation standards
96
- 2. **trinity/knowledge-base/CODING-PRINCIPLES.md** - Code documentation requirements
95
+ 1. **.claude/trinity/knowledge-base/DOCUMENTATION-CRITERIA.md** - Documentation standards
96
+ 2. **.claude/trinity/knowledge-base/CODING-PRINCIPLES.md** - Code documentation requirements
97
97
  3. **docs/plans/design/DESIGN-{feature}.md** - Feature specifications for context
98
98
 
99
99
  ---
@@ -26,9 +26,9 @@ You are **BAS**, the Quality Gate for Trinity Method SDK v2.0. You execute a rig
26
26
 
27
27
  Read these Trinity documents:
28
28
 
29
- 1. **trinity/knowledge-base/CODING-PRINCIPLES.md** - Code quality standards
30
- 2. **trinity/knowledge-base/TESTING-PRINCIPLES.md** - Test quality standards
31
- 3. **trinity/knowledge-base/AI-DEVELOPMENT-GUIDE.md** - Quality gate workflow
29
+ 1. **.claude/trinity/knowledge-base/CODING-PRINCIPLES.md** - Code quality standards
30
+ 2. **.claude/trinity/knowledge-base/TESTING-PRINCIPLES.md** - Test quality standards
31
+ 3. **.claude/trinity/knowledge-base/AI-DEVELOPMENT-GUIDE.md** - Quality gate workflow
32
32
 
33
33
  ---
34
34
 
@@ -55,7 +55,7 @@ Phase 6: Final Review (best practices)
55
55
  ```
56
56
 
57
57
  **Coverage Threshold Configuration:**
58
- - Check `trinity/knowledge-base/TESTING-PRINCIPLES.md` for `COVERAGE_THRESHOLD`
58
+ - Check `.claude/trinity/knowledge-base/TESTING-PRINCIPLES.md` for `COVERAGE_THRESHOLD`
59
59
  - Check environment variable `TRINITY_COVERAGE_THRESHOLD`
60
60
  - Default: 80% (if not configured)
61
61
 
@@ -239,7 +239,7 @@ npm test
239
239
 
240
240
  **Purpose**: Validate code coverage ≥threshold% (configured or default 80%)
241
241
 
242
- **Configuration**: Read from `trinity/knowledge-base/TESTING-PRINCIPLES.md` (`COVERAGE_THRESHOLD`) or env var `TRINITY_COVERAGE_THRESHOLD`
242
+ **Configuration**: Read from `.claude/trinity/knowledge-base/TESTING-PRINCIPLES.md` (`COVERAGE_THRESHOLD`) or env var `TRINITY_COVERAGE_THRESHOLD`
243
243
 
244
244
  **Commands**:
245
245
  ```bash
@@ -725,7 +725,7 @@ Before approving task:
725
725
 
726
726
  ### Coverage Threshold
727
727
 
728
- **Configuration**: Read from `trinity/knowledge-base/TESTING-PRINCIPLES.md` (`COVERAGE_THRESHOLD`) or env var `TRINITY_COVERAGE_THRESHOLD`
728
+ **Configuration**: Read from `.claude/trinity/knowledge-base/TESTING-PRINCIPLES.md` (`COVERAGE_THRESHOLD`) or env var `TRINITY_COVERAGE_THRESHOLD`
729
729
 
730
730
  **Threshold% minimum** (default 80%) for:
731
731
  - Line coverage
@@ -782,10 +782,10 @@ Trinity supports configuration at multiple levels. Priority (highest to lowest):
782
782
 
783
783
  2. **Knowledge Base Configuration** (Project Standard)
784
784
  ```markdown
785
- # trinity/knowledge-base/TESTING-PRINCIPLES.md
785
+ # .claude/trinity/knowledge-base/TESTING-PRINCIPLES.md
786
786
  COVERAGE_THRESHOLD=85
787
787
 
788
- # trinity/knowledge-base/CODING-PRINCIPLES.md
788
+ # .claude/trinity/knowledge-base/CODING-PRINCIPLES.md
789
789
  MAX_FUNCTION_LENGTH=50
790
790
  ```
791
791
 
@@ -26,9 +26,9 @@ You are **DRA**, the Code Reviewer for Trinity Method SDK v2.0. You handle quali
26
26
 
27
27
  Read these Trinity documents:
28
28
 
29
- 1. **trinity/knowledge-base/CODING-PRINCIPLES.md** - Code quality standards
30
- 2. **trinity/knowledge-base/TESTING-PRINCIPLES.md** - Test quality standards
31
- 3. **trinity/knowledge-base/AI-DEVELOPMENT-GUIDE.md** - Development workflows
29
+ 1. **.claude/trinity/knowledge-base/CODING-PRINCIPLES.md** - Code quality standards
30
+ 2. **.claude/trinity/knowledge-base/TESTING-PRINCIPLES.md** - Test quality standards
31
+ 3. **.claude/trinity/knowledge-base/AI-DEVELOPMENT-GUIDE.md** - Development workflows
32
32
  4. **docs/plans/design/DESIGN-{feature}.md** - Design specifications
33
33
  5. **docs/plans/tasks/TASKS-{feature}.md** - Task breakdown
34
34
 
@@ -26,9 +26,9 @@ You are **KIL**, the Task Executor for Trinity Method SDK v2.0. You implement at
26
26
 
27
27
  Read these Trinity documents:
28
28
 
29
- 1. **trinity/knowledge-base/TESTING-PRINCIPLES.md** - TDD cycle (RED-GREEN-REFACTOR)
30
- 2. **trinity/knowledge-base/CODING-PRINCIPLES.md** - Code quality standards
31
- 3. **trinity/knowledge-base/AI-DEVELOPMENT-GUIDE.md** - Task execution standards
29
+ 1. **.claude/trinity/knowledge-base/TESTING-PRINCIPLES.md** - TDD cycle (RED-GREEN-REFACTOR)
30
+ 2. **.claude/trinity/knowledge-base/CODING-PRINCIPLES.md** - Code quality standards
31
+ 3. **.claude/trinity/knowledge-base/AI-DEVELOPMENT-GUIDE.md** - Task execution standards
32
32
  4. **docs/plans/design/DESIGN-{feature}.md** - Design specifications for current feature
33
33
  5. **docs/plans/tasks/TASKS-{feature}.md** - Task breakdown from EUS
34
34
 
@@ -80,7 +80,7 @@ Each task you execute:
80
80
  4. Escalate if high similarity found (threshold: {{DUPLICATION_THRESHOLD}} matches or default 3+ matches)
81
81
 
82
82
  **Duplication Threshold Configuration:**
83
- - Check `trinity/knowledge-base/CODING-PRINCIPLES.md` for `DUPLICATION_THRESHOLD`
83
+ - Check `.claude/trinity/knowledge-base/CODING-PRINCIPLES.md` for `DUPLICATION_THRESHOLD`
84
84
  - Check environment variable `TRINITY_DUPLICATION_THRESHOLD`
85
85
  - Default: 3 matches (if not configured)
86
86
 
@@ -139,7 +139,7 @@ Update todos in real-time:
139
139
 
140
140
  #### Similar Function Duplication Check
141
141
 
142
- **Configuration**: Read threshold from `trinity/knowledge-base/CODING-PRINCIPLES.md` (`DUPLICATION_THRESHOLD`) or env var `TRINITY_DUPLICATION_THRESHOLD` (default: 3)
142
+ **Configuration**: Read threshold from `.claude/trinity/knowledge-base/CODING-PRINCIPLES.md` (`DUPLICATION_THRESHOLD`) or env var `TRINITY_DUPLICATION_THRESHOLD` (default: 3)
143
143
 
144
144
  **High Duplication (Escalate)** - Threshold or more matches (default: 3+):
145
145
  - [ ] Same domain/responsibility
@@ -705,7 +705,7 @@ Trinity supports configuration at multiple levels. Priority (highest to lowest):
705
705
 
706
706
  2. **Knowledge Base Configuration** (Project Standard)
707
707
  ```markdown
708
- # trinity/knowledge-base/CODING-PRINCIPLES.md
708
+ # .claude/trinity/knowledge-base/CODING-PRINCIPLES.md
709
709
  DUPLICATION_THRESHOLD=3
710
710
  COMPLEXITY_THRESHOLD=10
711
711
  ```