trinity-method-sdk 2.0.1 → 2.0.3
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 +36 -0
- package/README.md +1 -1
- package/dist/cli/commands/deploy/index.js +1 -1
- package/dist/cli/commands/deploy/root-files.js +1 -1
- package/dist/cli/commands/deploy/sdk-install.js +1 -1
- package/dist/cli/utils/get-sdk-path.d.ts +1 -1
- package/dist/cli/utils/get-sdk-path.js +14 -4
- package/dist/cli/utils/template-processor.js +1 -1
- package/dist/templates/shared/claude-commands/trinity-changelog.md.template +24 -0
- package/dist/templates/shared/claude-commands/trinity-docs.md.template +120 -5
- package/dist/templates/shared/claude-commands/trinity-readme.md.template +24 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -19,6 +19,42 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
19
19
|
|
|
20
20
|
### Security
|
|
21
21
|
|
|
22
|
+
## [2.0.3] - 2026-01-06
|
|
23
|
+
|
|
24
|
+
### Fixed
|
|
25
|
+
|
|
26
|
+
- **CRITICAL: Global install support** - Fixed SDK path resolution to work with global installations
|
|
27
|
+
- Changed package name from incorrect `@trinity-method/sdk` to `trinity-method-sdk` in path resolution
|
|
28
|
+
- Added `import.meta.url` support for resolving SDK location in global installs
|
|
29
|
+
- `trinity update` command now works correctly when SDK is installed globally
|
|
30
|
+
- Fixed "ENOENT: no such file or directory" error when running update command
|
|
31
|
+
|
|
32
|
+
## [2.0.2] - 2026-01-02
|
|
33
|
+
|
|
34
|
+
### Added
|
|
35
|
+
|
|
36
|
+
- **DOCUMENTATION RULES** section to all APO documentation commands (`/trinity-docs`, `/trinity-readme`, `/trinity-changelog`)
|
|
37
|
+
- Rule 1: No Self-Serving Trinity Documentation - Prevents APO from including Trinity Method information in user project documentation
|
|
38
|
+
- Provides clear ✅/❌ examples and rationale for focusing exclusively on user's codebase
|
|
39
|
+
- Explicit **Write tool execution commands** throughout `/trinity-docs` Phase 2
|
|
40
|
+
- Added 🚨 CRITICAL EXECUTION REQUIREMENT section at Phase 2 start
|
|
41
|
+
- Added **EXECUTION REQUIRED** code blocks for each seeding step
|
|
42
|
+
- Added **Phase 2 Execution Summary** with mandatory file creation checklist
|
|
43
|
+
- Ensures APO creates actual documentation files instead of just showing templates
|
|
44
|
+
|
|
45
|
+
### Changed
|
|
46
|
+
|
|
47
|
+
- **`/trinity-docs` command:** Enhanced Phase 2 with explicit Write tool requirements
|
|
48
|
+
- Step 2 (Guides): Added execution requirements for getting-started.md and framework-specific guides
|
|
49
|
+
- Step 3 (API): Added execution requirements for api/README.md
|
|
50
|
+
- Step 4 (Architecture): Added execution requirements for architecture/overview.md
|
|
51
|
+
- Step 5 (Reference): Added execution requirements for reference/README.md
|
|
52
|
+
- Phase now requires minimum 4 files to be created: getting-started.md, api/README.md, architecture/overview.md, reference/README.md
|
|
53
|
+
|
|
54
|
+
### Fixed
|
|
55
|
+
|
|
56
|
+
- **APO file creation issue:** `/trinity-docs` now explicitly commands APO to use Write tool, preventing scenario where directory structure is created but documentation files are not written
|
|
57
|
+
|
|
22
58
|
## [2.0.1] - 2025-12-29
|
|
23
59
|
|
|
24
60
|
### Added
|
package/README.md
CHANGED
|
@@ -98,7 +98,7 @@ export async function deploy(options) {
|
|
|
98
98
|
PACKAGE_MANAGER: stack.packageManager || 'npm',
|
|
99
99
|
BACKEND_FRAMEWORK: stack.framework,
|
|
100
100
|
CURRENT_DATE: new Date().toISOString(),
|
|
101
|
-
TRINITY_VERSION: pkg.version || '2.0.
|
|
101
|
+
TRINITY_VERSION: pkg.version || '2.0.3',
|
|
102
102
|
};
|
|
103
103
|
// STEP 4: Create directory structure
|
|
104
104
|
const directoriesCreated = await createDirectories(spinner);
|
|
@@ -39,7 +39,7 @@ async function deployRootClaudeMarkdown(templatesPath, variables) {
|
|
|
39
39
|
*/
|
|
40
40
|
async function deployVersionFile(pkgVersion) {
|
|
41
41
|
const versionPath = validatePath('trinity/VERSION');
|
|
42
|
-
await fs.writeFile(versionPath, pkgVersion || '2.0.
|
|
42
|
+
await fs.writeFile(versionPath, pkgVersion || '2.0.3');
|
|
43
43
|
return 1;
|
|
44
44
|
}
|
|
45
45
|
/**
|
|
@@ -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.0.3';
|
|
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
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
/**
|
|
6
6
|
* Get the SDK root directory path
|
|
7
|
-
* Auto-detects: SDK root (tests/dev) or
|
|
7
|
+
* Auto-detects: SDK root (tests/dev), local install, or global install
|
|
8
8
|
*/
|
|
9
9
|
export declare function getSDKPath(): Promise<string>;
|
|
10
10
|
/**
|
|
@@ -3,18 +3,28 @@
|
|
|
3
3
|
* Automatically detects whether running from SDK root (dev/test) or installed package
|
|
4
4
|
*/
|
|
5
5
|
import path from 'path';
|
|
6
|
+
import { fileURLToPath } from 'url';
|
|
6
7
|
import fs from 'fs-extra';
|
|
7
8
|
/**
|
|
8
9
|
* Get the SDK root directory path
|
|
9
|
-
* Auto-detects: SDK root (tests/dev) or
|
|
10
|
+
* Auto-detects: SDK root (tests/dev), local install, or global install
|
|
10
11
|
*/
|
|
11
12
|
export async function getSDKPath() {
|
|
12
|
-
// Check if dist/templates exists in current directory (running from SDK root)
|
|
13
|
+
// Check if dist/templates exists in current directory (running from SDK root during dev/test)
|
|
13
14
|
if (await fs.pathExists(path.join(process.cwd(), 'dist/templates'))) {
|
|
14
15
|
return process.cwd();
|
|
15
16
|
}
|
|
16
|
-
//
|
|
17
|
-
|
|
17
|
+
// Check local node_modules (for local installs)
|
|
18
|
+
const localPath = path.join(process.cwd(), 'node_modules', 'trinity-method-sdk');
|
|
19
|
+
if (await fs.pathExists(localPath)) {
|
|
20
|
+
return localPath;
|
|
21
|
+
}
|
|
22
|
+
// For global install, use import.meta.url to find the SDK root
|
|
23
|
+
// import.meta.url points to dist/cli/utils/get-sdk-path.js, so go up 3 levels to reach SDK root
|
|
24
|
+
const currentFilePath = fileURLToPath(import.meta.url);
|
|
25
|
+
const globalPath = path.resolve(path.dirname(currentFilePath), '..', '..', '..');
|
|
26
|
+
// Return global path (works for global installs)
|
|
27
|
+
return globalPath;
|
|
18
28
|
}
|
|
19
29
|
/**
|
|
20
30
|
* Get the templates directory path
|
|
@@ -24,7 +24,7 @@ const VARIABLE_RESOLVERS = {
|
|
|
24
24
|
DEPLOYMENT_TIMESTAMP: (v) => toString(v.DEPLOYMENT_TIMESTAMP || v.timestamp) || new Date().toISOString(),
|
|
25
25
|
LANGUAGE: (v) => toString(v.LANGUAGE || v.language) || 'Unknown',
|
|
26
26
|
PACKAGE_MANAGER: (v) => toString(v.PACKAGE_MANAGER || v.packageManager) || 'npm',
|
|
27
|
-
TRINITY_VERSION: (v) => toString(v.TRINITY_VERSION) || '2.0.
|
|
27
|
+
TRINITY_VERSION: (v) => toString(v.TRINITY_VERSION) || '2.0.3',
|
|
28
28
|
TECHNOLOGY_STACK: (v) => toString(v.TECHNOLOGY_STACK || v.TECH_STACK || v.techStack) || 'Unknown',
|
|
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],
|
|
@@ -44,6 +44,30 @@ The `/trinity-changelog` command invokes APO (Documentation Specialist) to manag
|
|
|
44
44
|
|
|
45
45
|
---
|
|
46
46
|
|
|
47
|
+
## DOCUMENTATION RULES
|
|
48
|
+
|
|
49
|
+
**These rules apply to ALL documentation created by this command. NO EXCEPTIONS.**
|
|
50
|
+
|
|
51
|
+
### Rule 1: No Self-Serving Trinity Documentation
|
|
52
|
+
|
|
53
|
+
**❌ FORBIDDEN:**
|
|
54
|
+
- Including information about Trinity Method in project documentation
|
|
55
|
+
- Explaining what Trinity Method is in README/docs
|
|
56
|
+
- Mentioning Trinity agents (APO, MON, ROR, KIL, BAS, etc.) in user-facing docs
|
|
57
|
+
- Documenting Trinity slash commands in project docs
|
|
58
|
+
- Adding Trinity Method badges, links, or references to project documentation
|
|
59
|
+
- Describing the Trinity Method SDK in project documentation
|
|
60
|
+
|
|
61
|
+
**✅ CORRECT:**
|
|
62
|
+
- Document the USER'S codebase exclusively
|
|
63
|
+
- Focus on the project's functionality, architecture, and usage
|
|
64
|
+
- Trinity Method is a development tool, not the subject of documentation
|
|
65
|
+
- The project documentation is about the project, not about how it was documented
|
|
66
|
+
|
|
67
|
+
**Why:** Trinity Method SDK is a tool for developers. The project's documentation should focus exclusively on the project's code, features, and usage - not on the development methodology used to create it.
|
|
68
|
+
|
|
69
|
+
---
|
|
70
|
+
|
|
47
71
|
## When to Use `/trinity-changelog`
|
|
48
72
|
|
|
49
73
|
### Perfect Use Cases:
|
|
@@ -56,6 +56,30 @@ The `/trinity-docs` command invokes APO (Documentation Specialist) to **create a
|
|
|
56
56
|
|
|
57
57
|
---
|
|
58
58
|
|
|
59
|
+
## DOCUMENTATION RULES
|
|
60
|
+
|
|
61
|
+
**These rules apply to ALL documentation created by this command. NO EXCEPTIONS.**
|
|
62
|
+
|
|
63
|
+
### Rule 1: No Self-Serving Trinity Documentation
|
|
64
|
+
|
|
65
|
+
**❌ FORBIDDEN:**
|
|
66
|
+
- Including information about Trinity Method in project documentation
|
|
67
|
+
- Explaining what Trinity Method is in README/docs
|
|
68
|
+
- Mentioning Trinity agents (APO, MON, ROR, KIL, BAS, etc.) in user-facing docs
|
|
69
|
+
- Documenting Trinity slash commands in project docs
|
|
70
|
+
- Adding Trinity Method badges, links, or references to project documentation
|
|
71
|
+
- Describing the Trinity Method SDK in project documentation
|
|
72
|
+
|
|
73
|
+
**✅ CORRECT:**
|
|
74
|
+
- Document the USER'S codebase exclusively
|
|
75
|
+
- Focus on the project's functionality, architecture, and usage
|
|
76
|
+
- Trinity Method is a development tool, not the subject of documentation
|
|
77
|
+
- The project documentation is about the project, not about how it was documented
|
|
78
|
+
|
|
79
|
+
**Why:** Trinity Method SDK is a tool for developers. The project's documentation should focus exclusively on the project's code, features, and usage - not on the development methodology used to create it.
|
|
80
|
+
|
|
81
|
+
---
|
|
82
|
+
|
|
59
83
|
## When to Use `/trinity-docs`
|
|
60
84
|
|
|
61
85
|
### Perfect Use Cases:
|
|
@@ -440,6 +464,14 @@ for each file1 in all_md_files:
|
|
|
440
464
|
|
|
441
465
|
**Goal:** Create hierarchical docs/ structure with seeded initial content
|
|
442
466
|
|
|
467
|
+
**🚨 CRITICAL EXECUTION REQUIREMENT:**
|
|
468
|
+
|
|
469
|
+
APO MUST use the **Write tool** to create documentation files in this phase.
|
|
470
|
+
- Creating directories is NOT enough
|
|
471
|
+
- Showing content templates is NOT enough
|
|
472
|
+
- APO MUST execute `Write("docs/guides/getting-started.md", content)` commands
|
|
473
|
+
- Minimum 4 files MUST be created: getting-started.md, api/README.md, architecture/overview.md, reference/README.md
|
|
474
|
+
|
|
443
475
|
**Standard Directory Structure:**
|
|
444
476
|
|
|
445
477
|
```
|
|
@@ -479,8 +511,34 @@ for each dir in required_dirs:
|
|
|
479
511
|
|
|
480
512
|
**CRITICAL: Create useful starter guides based on project type, not empty placeholders**
|
|
481
513
|
|
|
514
|
+
**✅ APO MUST:**
|
|
515
|
+
1. USE Write tool to create docs/guides/getting-started.md with project-specific content
|
|
516
|
+
2. USE Write tool to create framework-specific guides (if applicable)
|
|
517
|
+
3. Content MUST be based on actual project metadata from Phase 1
|
|
518
|
+
4. NO generic placeholders - use real project name, version, dependencies
|
|
519
|
+
|
|
520
|
+
**EXECUTION REQUIRED:**
|
|
521
|
+
```javascript
|
|
522
|
+
// APO MUST execute these Write commands:
|
|
523
|
+
|
|
524
|
+
// 1. Create getting-started.md
|
|
525
|
+
Write("docs/guides/getting-started.md", getting_started_content);
|
|
526
|
+
|
|
527
|
+
// 2. Create framework-specific guide (if detected)
|
|
528
|
+
if (framework === "Express" || framework === "NestJS") {
|
|
529
|
+
Write("docs/guides/api-development.md", api_dev_content);
|
|
530
|
+
}
|
|
531
|
+
if (framework === "React" || framework === "Next.js") {
|
|
532
|
+
Write("docs/guides/component-development.md", component_dev_content);
|
|
533
|
+
}
|
|
534
|
+
if (framework === "Django" || framework === "Flask") {
|
|
535
|
+
Write("docs/guides/django-development.md", django_dev_content);
|
|
536
|
+
}
|
|
537
|
+
```
|
|
538
|
+
|
|
539
|
+
**CONTENT TEMPLATE for docs/guides/getting-started.md:**
|
|
540
|
+
|
|
482
541
|
```markdown
|
|
483
|
-
### docs/guides/getting-started.md
|
|
484
542
|
|
|
485
543
|
# Getting Started with {{PROJECT_NAME}}
|
|
486
544
|
|
|
@@ -663,8 +721,20 @@ python manage.py startapp myapp
|
|
|
663
721
|
|
|
664
722
|
**Step 3: Seed docs/api/ Content (ENHANCEMENT 2 + 8)**
|
|
665
723
|
|
|
724
|
+
**✅ APO MUST:**
|
|
725
|
+
1. USE Write tool to create docs/api/README.md
|
|
726
|
+
2. Include links to auto-generated API docs if detected in Phase 1
|
|
727
|
+
3. If no auto-generated docs, create basic API documentation structure
|
|
728
|
+
|
|
729
|
+
**EXECUTION REQUIRED:**
|
|
730
|
+
```javascript
|
|
731
|
+
// APO MUST execute this Write command:
|
|
732
|
+
Write("docs/api/README.md", api_readme_content);
|
|
733
|
+
```
|
|
734
|
+
|
|
735
|
+
**CONTENT TEMPLATE for docs/api/README.md:**
|
|
736
|
+
|
|
666
737
|
```markdown
|
|
667
|
-
### docs/api/README.md
|
|
668
738
|
|
|
669
739
|
# API Documentation
|
|
670
740
|
|
|
@@ -729,8 +799,21 @@ Consider using tools like:
|
|
|
729
799
|
|
|
730
800
|
**CRITICAL: Create real architecture documentation from codebase analysis**
|
|
731
801
|
|
|
802
|
+
**✅ APO MUST:**
|
|
803
|
+
1. USE Write tool to create docs/architecture/overview.md
|
|
804
|
+
2. Content MUST be auto-generated from Phase 1 codebase analysis
|
|
805
|
+
3. Include actual directory structure, detected patterns, entry points
|
|
806
|
+
4. NO generic templates - use real project metadata
|
|
807
|
+
|
|
808
|
+
**EXECUTION REQUIRED:**
|
|
809
|
+
```javascript
|
|
810
|
+
// APO MUST execute this Write command:
|
|
811
|
+
Write("docs/architecture/overview.md", architecture_overview_content);
|
|
812
|
+
```
|
|
813
|
+
|
|
814
|
+
**CONTENT TEMPLATE for docs/architecture/overview.md:**
|
|
815
|
+
|
|
732
816
|
```markdown
|
|
733
|
-
### docs/architecture/overview.md
|
|
734
817
|
|
|
735
818
|
# Architecture Overview
|
|
736
819
|
|
|
@@ -864,8 +947,21 @@ For detailed API documentation, see [../api/](../api/).
|
|
|
864
947
|
|
|
865
948
|
**Step 5: Seed docs/reference/ Content (ENHANCEMENT 2)**
|
|
866
949
|
|
|
950
|
+
**✅ APO MUST:**
|
|
951
|
+
1. USE Write tool to create docs/reference/README.md
|
|
952
|
+
2. Include actual CLI commands from package.json scripts
|
|
953
|
+
3. Document environment variables if .env.example exists
|
|
954
|
+
4. List configuration options if detected
|
|
955
|
+
|
|
956
|
+
**EXECUTION REQUIRED:**
|
|
957
|
+
```javascript
|
|
958
|
+
// APO MUST execute this Write command:
|
|
959
|
+
Write("docs/reference/README.md", reference_readme_content);
|
|
960
|
+
```
|
|
961
|
+
|
|
962
|
+
**CONTENT TEMPLATE for docs/reference/README.md:**
|
|
963
|
+
|
|
867
964
|
```markdown
|
|
868
|
-
### docs/reference/README.md
|
|
869
965
|
|
|
870
966
|
# Reference Documentation
|
|
871
967
|
|
|
@@ -1028,6 +1124,23 @@ See [../README.md](../README.md) for complete documentation index.
|
|
|
1028
1124
|
{Content from Step 5 - already seeded with CLI commands, env vars}
|
|
1029
1125
|
```
|
|
1030
1126
|
|
|
1127
|
+
**Phase 2 Execution Summary:**
|
|
1128
|
+
|
|
1129
|
+
**✅ MANDATORY FILE CREATIONS:**
|
|
1130
|
+
|
|
1131
|
+
APO MUST have executed Write tool for these files (minimum required):
|
|
1132
|
+
1. ✅ docs/guides/getting-started.md
|
|
1133
|
+
2. ✅ docs/api/README.md
|
|
1134
|
+
3. ✅ docs/architecture/overview.md
|
|
1135
|
+
4. ✅ docs/reference/README.md
|
|
1136
|
+
|
|
1137
|
+
**Optional (based on detected framework):**
|
|
1138
|
+
- docs/guides/{framework}-development.md (if Express/React/Django/etc detected)
|
|
1139
|
+
|
|
1140
|
+
**VERIFICATION:**
|
|
1141
|
+
|
|
1142
|
+
If APO did NOT create these files using Write tool, APO has FAILED Phase 2.
|
|
1143
|
+
|
|
1031
1144
|
**APO Output:**
|
|
1032
1145
|
|
|
1033
1146
|
```markdown
|
|
@@ -1040,7 +1153,9 @@ See [../README.md](../README.md) for complete documentation index.
|
|
|
1040
1153
|
- ✅ docs/reference/
|
|
1041
1154
|
- ✅ docs/images/
|
|
1042
1155
|
|
|
1043
|
-
**
|
|
1156
|
+
**Files Created with Write Tool:** {count} files
|
|
1157
|
+
|
|
1158
|
+
**VERIFICATION - Files Created:**
|
|
1044
1159
|
|
|
1045
1160
|
**Guides:**
|
|
1046
1161
|
- ✅ docs/guides/getting-started.md ({line_count} lines)
|
|
@@ -49,6 +49,30 @@ The `/trinity-readme` command invokes APO (Documentation Specialist) to manage R
|
|
|
49
49
|
|
|
50
50
|
---
|
|
51
51
|
|
|
52
|
+
## DOCUMENTATION RULES
|
|
53
|
+
|
|
54
|
+
**These rules apply to ALL documentation created by this command. NO EXCEPTIONS.**
|
|
55
|
+
|
|
56
|
+
### Rule 1: No Self-Serving Trinity Documentation
|
|
57
|
+
|
|
58
|
+
**❌ FORBIDDEN:**
|
|
59
|
+
- Including information about Trinity Method in project documentation
|
|
60
|
+
- Explaining what Trinity Method is in README/docs
|
|
61
|
+
- Mentioning Trinity agents (APO, MON, ROR, KIL, BAS, etc.) in user-facing docs
|
|
62
|
+
- Documenting Trinity slash commands in project docs
|
|
63
|
+
- Adding Trinity Method badges, links, or references to project documentation
|
|
64
|
+
- Describing the Trinity Method SDK in project documentation
|
|
65
|
+
|
|
66
|
+
**✅ CORRECT:**
|
|
67
|
+
- Document the USER'S codebase exclusively
|
|
68
|
+
- Focus on the project's functionality, architecture, and usage
|
|
69
|
+
- Trinity Method is a development tool, not the subject of documentation
|
|
70
|
+
- The project documentation is about the project, not about how it was documented
|
|
71
|
+
|
|
72
|
+
**Why:** Trinity Method SDK is a tool for developers. The project's documentation should focus exclusively on the project's code, features, and usage - not on the development methodology used to create it.
|
|
73
|
+
|
|
74
|
+
---
|
|
75
|
+
|
|
52
76
|
## When to Use `/trinity-readme`
|
|
53
77
|
|
|
54
78
|
### Perfect Use Cases:
|