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.
- package/CHANGELOG.md +702 -267
- package/README.md +550 -540
- package/dist/cli/commands/deploy/agents.js +1 -1
- package/dist/cli/commands/deploy/ci-cd.d.ts +4 -3
- package/dist/cli/commands/deploy/ci-cd.js +10 -9
- package/dist/cli/commands/deploy/claude-setup.js +28 -35
- package/dist/cli/commands/deploy/configuration.js +10 -11
- package/dist/cli/commands/deploy/directories.js +13 -14
- package/dist/cli/commands/deploy/gitignore.js +3 -5
- package/dist/cli/commands/deploy/index.d.ts +1 -1
- package/dist/cli/commands/deploy/index.js +7 -3
- package/dist/cli/commands/deploy/knowledge-base.js +3 -3
- package/dist/cli/commands/deploy/pre-flight.js +1 -1
- package/dist/cli/commands/deploy/root-files.js +3 -18
- package/dist/cli/commands/deploy/sdk-install.js +1 -1
- package/dist/cli/commands/deploy/summary.js +3 -3
- package/dist/cli/commands/deploy/templates.js +33 -20
- package/dist/cli/commands/update/agents.js +1 -1
- package/dist/cli/commands/update/backup.js +6 -12
- package/dist/cli/commands/update/commands.d.ts +1 -0
- package/dist/cli/commands/update/commands.js +18 -45
- package/dist/cli/commands/update/knowledge-base.js +2 -2
- package/dist/cli/commands/update/pre-flight.js +11 -11
- package/dist/cli/commands/update/summary.js +5 -5
- package/dist/cli/commands/update/templates.js +35 -13
- package/dist/cli/commands/update/verification.js +5 -5
- package/dist/cli/commands/update/version.js +1 -1
- package/dist/cli/utils/deploy-ci.d.ts +3 -2
- package/dist/cli/utils/deploy-ci.js +24 -24
- package/dist/cli/utils/deploy-linting.js +101 -6
- package/dist/cli/utils/error-classes.d.ts +2 -2
- package/dist/cli/utils/linting-tools.js +14 -6
- package/dist/cli/utils/template-processor.js +2 -4
- package/dist/templates/{claude → .claude}/EMPLOYEE-DIRECTORY.md.template +16 -22
- package/dist/templates/{agents → .claude/agents}/aj-team/apo-documentation-specialist.md.template +10 -10
- package/dist/templates/{agents → .claude/agents}/aj-team/bas-quality-gate.md.template +13 -15
- package/dist/templates/{agents → .claude/agents}/aj-team/bon-dependency-manager.md.template +4 -4
- package/dist/templates/{agents → .claude/agents}/aj-team/cap-configuration-specialist.md.template +3 -3
- package/dist/templates/{agents → .claude/agents}/aj-team/dra-code-reviewer.md.template +8 -10
- package/dist/templates/{agents → .claude/agents}/aj-team/kil-task-executor.md.template +11 -13
- package/dist/templates/{agents → .claude/agents}/aj-team/uro-refactoring-specialist.md.template +3 -3
- package/dist/templates/{agents → .claude/agents}/audit/juno-auditor.md.template +46 -42
- package/dist/templates/{agents → .claude/agents}/deployment/ein-cicd.md.template +59 -164
- package/dist/templates/{agents → .claude/agents}/deployment/ino-context.md.template +25 -22
- package/dist/templates/{agents → .claude/agents}/deployment/tan-structure.md.template +32 -30
- package/dist/templates/{agents → .claude/agents}/deployment/zen-knowledge.md.template +28 -23
- package/dist/templates/{agents → .claude/agents}/leadership/aj-maestro.md.template +10 -6
- package/dist/templates/{agents → .claude/agents}/leadership/aly-cto.md.template +22 -19
- package/dist/templates/{agents → .claude/agents}/planning/eus-decomposer.md.template +8 -4
- package/dist/templates/{agents → .claude/agents}/planning/mon-requirements.md.template +8 -4
- package/dist/templates/{agents → .claude/agents}/planning/ror-design.md.template +8 -4
- package/dist/templates/{agents → .claude/agents}/planning/tra-planner.md.template +10 -4
- package/dist/templates/{shared/claude-commands → .claude/commands/execution}/trinity-audit.md.template +15 -15
- package/dist/templates/.claude/commands/execution/trinity-breakdown.md.template +535 -0
- package/dist/templates/{shared/claude-commands → .claude/commands/execution}/trinity-orchestrate.md.template +48 -48
- package/dist/templates/{shared/claude-commands → .claude/commands/infrastructure}/trinity-init.md.template +32 -54
- package/dist/templates/{shared/claude-commands → .claude/commands/investigation}/trinity-create-investigation.md.template +13 -7
- package/dist/templates/{shared/claude-commands → .claude/commands/investigation}/trinity-investigate-templates.md.template +19 -15
- package/dist/templates/{shared/claude-commands → .claude/commands/investigation}/trinity-plan-investigation.md.template +12 -6
- package/dist/templates/{shared/claude-commands → .claude/commands/maintenance}/trinity-changelog.md.template +9 -8
- package/dist/templates/.claude/commands/maintenance/trinity-docs-update.md.template +279 -0
- package/dist/templates/.claude/commands/maintenance/trinity-docs.md.template +2828 -0
- package/dist/templates/{shared/claude-commands → .claude/commands/maintenance}/trinity-readme.md.template +21 -20
- package/dist/templates/{shared/claude-commands → .claude/commands/planning}/trinity-decompose.md.template +6 -4
- package/dist/templates/{shared/claude-commands → .claude/commands/planning}/trinity-design.md.template +6 -4
- package/dist/templates/{shared/claude-commands → .claude/commands/planning}/trinity-plan.md.template +7 -5
- package/dist/templates/{shared/claude-commands → .claude/commands/planning}/trinity-requirements.md.template +6 -4
- package/dist/templates/{shared/claude-commands → .claude/commands/session}/trinity-continue.md.template +30 -24
- package/dist/templates/{shared/claude-commands → .claude/commands/session}/trinity-end.md.template +403 -397
- package/dist/templates/{shared/claude-commands → .claude/commands/session}/trinity-start.md.template +9 -4
- package/dist/templates/{shared/claude-commands → .claude/commands/utility}/trinity-agents.md.template +11 -8
- package/dist/templates/{shared/claude-commands → .claude/commands/utility}/trinity-verify.md.template +56 -57
- package/dist/templates/{shared/claude-commands → .claude/commands/utility}/trinity-workorder.md.template +13 -9
- package/dist/templates/ci/ci.yml.template +2 -2
- package/dist/templates/root/CLAUDE.md.template +9 -9
- package/dist/templates/root/linting/nodejs/.husky-pre-commit.template +5 -0
- package/dist/templates/source/base-CLAUDE.md.template +310 -310
- package/dist/templates/source/flutter-CLAUDE.md.template +593 -593
- package/dist/templates/source/nodejs-CLAUDE.md.template +531 -531
- package/dist/templates/source/python-CLAUDE.md.template +510 -510
- package/dist/templates/source/react-CLAUDE.md.template +513 -513
- package/dist/templates/source/rust-CLAUDE.md.template +653 -653
- package/dist/templates/trinity/CLAUDE.md.template +14 -14
- package/dist/templates/{knowledge-base → trinity/knowledge-base}/AI-DEVELOPMENT-GUIDE.md.template +1 -1
- package/dist/templates/{knowledge-base → trinity/knowledge-base}/ARCHITECTURE.md.template +5 -5
- package/dist/templates/{knowledge-base → trinity/knowledge-base}/CODING-PRINCIPLES.md.template +1 -1
- package/dist/templates/{knowledge-base → trinity/knowledge-base}/DOCUMENTATION-CRITERIA.md.template +1 -1
- package/dist/templates/{knowledge-base → trinity/knowledge-base}/ISSUES.md.template +9 -9
- package/dist/templates/{knowledge-base → trinity/knowledge-base}/TESTING-PRINCIPLES.md.template +1 -1
- package/dist/templates/{knowledge-base → trinity/knowledge-base}/Technical-Debt.md.template +2 -4
- package/dist/templates/{knowledge-base → trinity/knowledge-base}/To-do.md.template +2 -2
- package/dist/templates/{knowledge-base → trinity/knowledge-base}/Trinity.md.template +6 -6
- package/dist/templates/trinity/templates/documentation/api-docs/README.md.template +218 -0
- package/dist/templates/trinity/templates/documentation/configuration/documentation-structure.md.template +71 -0
- package/dist/templates/trinity/templates/documentation/configuration/env-example-generator.md.template +387 -0
- package/dist/templates/trinity/templates/documentation/discovery/api-endpoint-scanner.md.template +343 -0
- package/dist/templates/trinity/templates/documentation/discovery/component-discovery.md.template +254 -0
- package/dist/templates/trinity/templates/documentation/discovery/env-variable-extraction.md.template +316 -0
- package/dist/templates/trinity/templates/documentation/discovery/framework-detection.md.template +205 -0
- package/dist/templates/trinity/templates/documentation/guides/api-development.md.template +375 -0
- package/dist/templates/trinity/templates/documentation/guides/contributing.md.template +488 -0
- package/dist/templates/trinity/templates/documentation/guides/deployment.md.template +565 -0
- package/dist/templates/trinity/templates/documentation/guides/getting-started.md.template +118 -0
- package/dist/templates/trinity/templates/documentation/mermaid-diagrams/api-endpoint-map.md.template +56 -0
- package/dist/templates/trinity/templates/documentation/mermaid-diagrams/component-hierarchy.md.template +60 -0
- package/dist/templates/trinity/templates/documentation/mermaid-diagrams/database-er.md.template +49 -0
- package/dist/templates/trinity/templates/documentation/mermaid-diagrams/mvc-flow.md.template +41 -0
- package/dist/templates/trinity/templates/documentation/processes/error-handling-protocol.md.template +166 -0
- package/dist/templates/trinity/templates/documentation/processes/fallback-mechanism.md.template +88 -0
- package/dist/templates/trinity/templates/documentation/reports/apo-docs-update-checklist.md.template +343 -0
- package/dist/templates/trinity/templates/documentation/reports/juno-docs-update-checklist.md.template +1337 -0
- package/dist/templates/trinity/templates/documentation/reports/juno-final-report.md.template +237 -0
- package/dist/templates/trinity/templates/documentation/reports/juno-internal-report.md.template +461 -0
- package/dist/templates/trinity/templates/documentation/validation/documentation-verification-rules.md.template +379 -0
- package/dist/templates/trinity/templates/documentation/validation/juno-quality-gates.md.template +282 -0
- package/dist/templates/{investigations → trinity/templates/investigations}/bug.md.template +14 -14
- package/dist/templates/{investigations → trinity/templates/investigations}/feature.md.template +14 -14
- package/dist/templates/{investigations → trinity/templates/investigations}/performance.md.template +14 -14
- package/dist/templates/{investigations → trinity/templates/investigations}/security.md.template +14 -14
- package/dist/templates/{investigations → trinity/templates/investigations}/technical.md.template +14 -14
- package/dist/templates/{work-orders → trinity/templates/work-orders}/ANALYSIS-TEMPLATE.md.template +10 -13
- package/dist/templates/{work-orders → trinity/templates/work-orders}/AUDIT-TEMPLATE.md.template +10 -26
- package/dist/templates/{work-orders → trinity/templates/work-orders}/IMPLEMENTATION-TEMPLATE.md.template +10 -26
- package/dist/templates/{work-orders → trinity/templates/work-orders}/INVESTIGATION-TEMPLATE.md.template +10 -25
- package/dist/templates/{work-orders → trinity/templates/work-orders}/PATTERN-TEMPLATE.md.template +10 -26
- package/dist/templates/{work-orders → trinity/templates/work-orders}/VERIFICATION-TEMPLATE.md.template +10 -26
- package/package.json +99 -94
- package/dist/templates/agents/leadership/aj-cc.md.template +0 -462
- package/dist/templates/ci/cd.yml.template +0 -175
- package/dist/templates/ci/github-actions.yml +0 -86
- package/dist/templates/root/TRINITY.md.template +0 -52
- package/dist/templates/shared/claude-commands/trinity-docs.md.template +0 -2577
- /package/dist/templates/{linting → root/linting}/flutter/.pre-commit-config.yaml.template +0 -0
- /package/dist/templates/{linting → root/linting}/flutter/analysis_options.yaml.template +0 -0
- /package/dist/templates/{linting → root/linting}/nodejs/.eslintrc-commonjs.json.template +0 -0
- /package/dist/templates/{linting → root/linting}/nodejs/.eslintrc-esm.json.template +0 -0
- /package/dist/templates/{linting → root/linting}/nodejs/.eslintrc-typescript.json.template +0 -0
- /package/dist/templates/{linting → root/linting}/nodejs/.pre-commit-config.yaml.template +0 -0
- /package/dist/templates/{linting → root/linting}/nodejs/.prettierrc.json.template +0 -0
- /package/dist/templates/{linting → root/linting}/python/.flake8.template +0 -0
- /package/dist/templates/{linting → root/linting}/python/.pre-commit-config.yaml.template +0 -0
- /package/dist/templates/{linting → root/linting}/python/pyproject.toml.template +0 -0
- /package/dist/templates/{linting → root/linting}/rust/.pre-commit-config.yaml.template +0 -0
- /package/dist/templates/{linting → root/linting}/rust/clippy.toml.template +0 -0
- /package/dist/templates/{linting → root/linting}/rust/rustfmt.toml.template +0 -0
- /package/dist/templates/{documentation → trinity/templates/documentation}/ROOT-README.md.template +0 -0
- /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
|
|
2
|
+
* CI workflow deployment
|
|
3
3
|
*/
|
|
4
4
|
import type { DeployOptions, Spinner } from './types.js';
|
|
5
5
|
/**
|
|
6
|
-
* Deploy CI
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
-
//
|
|
53
|
-
const
|
|
54
|
-
|
|
55
|
-
'
|
|
56
|
-
'
|
|
57
|
-
'
|
|
58
|
-
'
|
|
59
|
-
'
|
|
60
|
-
'
|
|
61
|
-
'
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
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?
|
|
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
|
|
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/
|
|
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/
|
|
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
|
|
137
|
-
console.log(chalk.white('Trinity can setup automated testing workflows for your CI
|
|
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
|
|
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
|
|
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/
|
|
19
|
-
await fs.ensureDir('trinity/
|
|
20
|
-
await fs.ensureDir('trinity/
|
|
21
|
-
await fs.ensureDir('trinity/
|
|
22
|
-
await fs.ensureDir('trinity/
|
|
23
|
-
await fs.ensureDir('trinity/archive/
|
|
24
|
-
await fs.ensureDir('trinity/archive/
|
|
25
|
-
await fs.ensureDir('trinity/archive/
|
|
26
|
-
|
|
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:
|
|
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:
|
|
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
|
|
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(
|
|
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
|
|
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
|
|
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,
|
|
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(
|
|
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(
|
|
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
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
const
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
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
|
-
|
|
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
|
|
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
|
|
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
|
*/
|