trinity-method-sdk 2.0.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 (191) hide show
  1. package/CHANGELOG.md +116 -0
  2. package/LICENSE +21 -0
  3. package/README.md +555 -0
  4. package/dist/cli/commands/deploy/agents.d.ts +14 -0
  5. package/dist/cli/commands/deploy/agents.js +59 -0
  6. package/dist/cli/commands/deploy/ci-cd.d.ts +13 -0
  7. package/dist/cli/commands/deploy/ci-cd.js +50 -0
  8. package/dist/cli/commands/deploy/claude-setup.d.ts +17 -0
  9. package/dist/cli/commands/deploy/claude-setup.js +91 -0
  10. package/dist/cli/commands/deploy/configuration.d.ts +13 -0
  11. package/dist/cli/commands/deploy/configuration.js +215 -0
  12. package/dist/cli/commands/deploy/directories.d.ts +12 -0
  13. package/dist/cli/commands/deploy/directories.js +38 -0
  14. package/dist/cli/commands/deploy/gitignore.d.ts +12 -0
  15. package/dist/cli/commands/deploy/gitignore.js +53 -0
  16. package/dist/cli/commands/deploy/index.d.ts +38 -0
  17. package/dist/cli/commands/deploy/index.js +156 -0
  18. package/dist/cli/commands/deploy/knowledge-base.d.ts +16 -0
  19. package/dist/cli/commands/deploy/knowledge-base.js +75 -0
  20. package/dist/cli/commands/deploy/linting.d.ts +18 -0
  21. package/dist/cli/commands/deploy/linting.js +51 -0
  22. package/dist/cli/commands/deploy/metrics.d.ts +13 -0
  23. package/dist/cli/commands/deploy/metrics.js +34 -0
  24. package/dist/cli/commands/deploy/pre-flight.d.ts +13 -0
  25. package/dist/cli/commands/deploy/pre-flight.js +29 -0
  26. package/dist/cli/commands/deploy/root-files.d.ts +16 -0
  27. package/dist/cli/commands/deploy/root-files.js +178 -0
  28. package/dist/cli/commands/deploy/sdk-install.d.ts +12 -0
  29. package/dist/cli/commands/deploy/sdk-install.js +57 -0
  30. package/dist/cli/commands/deploy/summary.d.ts +14 -0
  31. package/dist/cli/commands/deploy/summary.js +130 -0
  32. package/dist/cli/commands/deploy/templates.d.ts +14 -0
  33. package/dist/cli/commands/deploy/templates.js +84 -0
  34. package/dist/cli/commands/deploy/types.d.ts +39 -0
  35. package/dist/cli/commands/deploy/types.js +5 -0
  36. package/dist/cli/commands/update/agents.d.ts +14 -0
  37. package/dist/cli/commands/update/agents.js +31 -0
  38. package/dist/cli/commands/update/backup.d.ts +31 -0
  39. package/dist/cli/commands/update/backup.js +97 -0
  40. package/dist/cli/commands/update/commands.d.ts +14 -0
  41. package/dist/cli/commands/update/commands.js +75 -0
  42. package/dist/cli/commands/update/index.d.ts +15 -0
  43. package/dist/cli/commands/update/index.js +118 -0
  44. package/dist/cli/commands/update/knowledge-base.d.ts +14 -0
  45. package/dist/cli/commands/update/knowledge-base.js +38 -0
  46. package/dist/cli/commands/update/pre-flight.d.ts +13 -0
  47. package/dist/cli/commands/update/pre-flight.js +37 -0
  48. package/dist/cli/commands/update/summary.d.ts +20 -0
  49. package/dist/cli/commands/update/summary.js +47 -0
  50. package/dist/cli/commands/update/templates.d.ts +14 -0
  51. package/dist/cli/commands/update/templates.js +25 -0
  52. package/dist/cli/commands/update/types.d.ts +13 -0
  53. package/dist/cli/commands/update/types.js +7 -0
  54. package/dist/cli/commands/update/utils.d.ts +11 -0
  55. package/dist/cli/commands/update/utils.js +19 -0
  56. package/dist/cli/commands/update/verification.d.ts +20 -0
  57. package/dist/cli/commands/update/verification.js +54 -0
  58. package/dist/cli/commands/update/version.d.ts +18 -0
  59. package/dist/cli/commands/update/version.js +36 -0
  60. package/dist/cli/commands/update.d.ts +7 -0
  61. package/dist/cli/commands/update.js +7 -0
  62. package/dist/cli/index.d.ts +3 -0
  63. package/dist/cli/index.js +36 -0
  64. package/dist/cli/types.d.ts +77 -0
  65. package/dist/cli/types.js +5 -0
  66. package/dist/cli/utils/deploy-ci.d.ts +22 -0
  67. package/dist/cli/utils/deploy-ci.js +138 -0
  68. package/dist/cli/utils/deploy-linting.d.ts +3 -0
  69. package/dist/cli/utils/deploy-linting.js +136 -0
  70. package/dist/cli/utils/detect-stack.d.ts +3 -0
  71. package/dist/cli/utils/detect-stack.js +270 -0
  72. package/dist/cli/utils/error-classes.d.ts +63 -0
  73. package/dist/cli/utils/error-classes.js +84 -0
  74. package/dist/cli/utils/error-handler.d.ts +59 -0
  75. package/dist/cli/utils/error-handler.js +127 -0
  76. package/dist/cli/utils/errors.d.ts +52 -0
  77. package/dist/cli/utils/errors.js +102 -0
  78. package/dist/cli/utils/get-sdk-path.d.ts +18 -0
  79. package/dist/cli/utils/get-sdk-path.js +31 -0
  80. package/dist/cli/utils/inject-dependencies.d.ts +2 -0
  81. package/dist/cli/utils/inject-dependencies.js +55 -0
  82. package/dist/cli/utils/linting-tools.d.ts +8 -0
  83. package/dist/cli/utils/linting-tools.js +206 -0
  84. package/dist/cli/utils/metrics/code-quality.d.ts +32 -0
  85. package/dist/cli/utils/metrics/code-quality.js +122 -0
  86. package/dist/cli/utils/metrics/dependency-parser.d.ts +21 -0
  87. package/dist/cli/utils/metrics/dependency-parser.js +153 -0
  88. package/dist/cli/utils/metrics/file-complexity.d.ts +26 -0
  89. package/dist/cli/utils/metrics/file-complexity.js +77 -0
  90. package/dist/cli/utils/metrics/framework-detector.d.ts +17 -0
  91. package/dist/cli/utils/metrics/framework-detector.js +120 -0
  92. package/dist/cli/utils/metrics/git-metrics.d.ts +30 -0
  93. package/dist/cli/utils/metrics/git-metrics.js +83 -0
  94. package/dist/cli/utils/metrics/index.d.ts +28 -0
  95. package/dist/cli/utils/metrics/index.js +100 -0
  96. package/dist/cli/utils/template-processor.d.ts +10 -0
  97. package/dist/cli/utils/template-processor.js +188 -0
  98. package/dist/cli/utils/validate-path.d.ts +80 -0
  99. package/dist/cli/utils/validate-path.js +180 -0
  100. package/dist/index.d.ts +6 -0
  101. package/dist/index.js +8 -0
  102. package/dist/templates/agents/aj-team/apo-documentation-specialist.md.template +572 -0
  103. package/dist/templates/agents/aj-team/bas-quality-gate.md.template +906 -0
  104. package/dist/templates/agents/aj-team/bon-dependency-manager.md.template +636 -0
  105. package/dist/templates/agents/aj-team/cap-configuration-specialist.md.template +670 -0
  106. package/dist/templates/agents/aj-team/dra-code-reviewer.md.template +768 -0
  107. package/dist/templates/agents/aj-team/kil-task-executor.md.template +764 -0
  108. package/dist/templates/agents/aj-team/uro-refactoring-specialist.md.template +759 -0
  109. package/dist/templates/agents/audit/juno-auditor.md.template +447 -0
  110. package/dist/templates/agents/deployment/ein-cicd.md.template +694 -0
  111. package/dist/templates/agents/deployment/ino-context.md.template +733 -0
  112. package/dist/templates/agents/deployment/tan-structure.md.template +661 -0
  113. package/dist/templates/agents/deployment/zen-knowledge.md.template +451 -0
  114. package/dist/templates/agents/leadership/aj-cc.md.template +462 -0
  115. package/dist/templates/agents/leadership/aj-maestro.md.template +943 -0
  116. package/dist/templates/agents/leadership/aly-cto.md.template +407 -0
  117. package/dist/templates/agents/planning/eus-decomposer.md.template +496 -0
  118. package/dist/templates/agents/planning/mon-requirements.md.template +323 -0
  119. package/dist/templates/agents/planning/ror-design.md.template +465 -0
  120. package/dist/templates/agents/planning/tra-planner.md.template +432 -0
  121. package/dist/templates/ci/cd.yml.template +175 -0
  122. package/dist/templates/ci/ci.yml.template +196 -0
  123. package/dist/templates/ci/generic-ci.yml +115 -0
  124. package/dist/templates/ci/github-actions.yml +86 -0
  125. package/dist/templates/ci/gitlab-ci.yml +103 -0
  126. package/dist/templates/claude/EMPLOYEE-DIRECTORY.md.template +545 -0
  127. package/dist/templates/documentation/ROOT-README.md.template +307 -0
  128. package/dist/templates/documentation/SUBDIRECTORY-README.md.template +261 -0
  129. package/dist/templates/investigations/bug.md.template +484 -0
  130. package/dist/templates/investigations/feature.md.template +564 -0
  131. package/dist/templates/investigations/performance.md.template +625 -0
  132. package/dist/templates/investigations/security.md.template +714 -0
  133. package/dist/templates/investigations/technical.md.template +433 -0
  134. package/dist/templates/knowledge-base/AI-DEVELOPMENT-GUIDE.md.template +957 -0
  135. package/dist/templates/knowledge-base/ARCHITECTURE.md.template +452 -0
  136. package/dist/templates/knowledge-base/CODING-PRINCIPLES.md.template +750 -0
  137. package/dist/templates/knowledge-base/DOCUMENTATION-CRITERIA.md.template +1118 -0
  138. package/dist/templates/knowledge-base/ISSUES.md.template +539 -0
  139. package/dist/templates/knowledge-base/TESTING-PRINCIPLES.md.template +894 -0
  140. package/dist/templates/knowledge-base/Technical-Debt.md.template +640 -0
  141. package/dist/templates/knowledge-base/To-do.md.template +407 -0
  142. package/dist/templates/knowledge-base/Trinity.md.template +464 -0
  143. package/dist/templates/linting/flutter/.pre-commit-config.yaml.template +27 -0
  144. package/dist/templates/linting/flutter/analysis_options.yaml.template +26 -0
  145. package/dist/templates/linting/nodejs/.eslintrc-commonjs.json.template +19 -0
  146. package/dist/templates/linting/nodejs/.eslintrc-esm.json.template +19 -0
  147. package/dist/templates/linting/nodejs/.eslintrc-typescript.json.template +22 -0
  148. package/dist/templates/linting/nodejs/.pre-commit-config.yaml.template +51 -0
  149. package/dist/templates/linting/nodejs/.prettierrc.json.template +10 -0
  150. package/dist/templates/linting/python/.flake8.template +16 -0
  151. package/dist/templates/linting/python/.pre-commit-config.yaml.template +30 -0
  152. package/dist/templates/linting/python/pyproject.toml.template +38 -0
  153. package/dist/templates/linting/rust/.pre-commit-config.yaml.template +28 -0
  154. package/dist/templates/linting/rust/clippy.toml.template +14 -0
  155. package/dist/templates/linting/rust/rustfmt.toml.template +12 -0
  156. package/dist/templates/root/CLAUDE.md.template +65 -0
  157. package/dist/templates/root/TRINITY.md.template +52 -0
  158. package/dist/templates/shared/claude-commands/trinity-agents.md.template +168 -0
  159. package/dist/templates/shared/claude-commands/trinity-audit.md.template +646 -0
  160. package/dist/templates/shared/claude-commands/trinity-changelog.md.template +624 -0
  161. package/dist/templates/shared/claude-commands/trinity-continue.md.template +549 -0
  162. package/dist/templates/shared/claude-commands/trinity-create-investigation.md.template +232 -0
  163. package/dist/templates/shared/claude-commands/trinity-decompose.md.template +181 -0
  164. package/dist/templates/shared/claude-commands/trinity-design.md.template +347 -0
  165. package/dist/templates/shared/claude-commands/trinity-docs.md.template +2093 -0
  166. package/dist/templates/shared/claude-commands/trinity-end.md.template +397 -0
  167. package/dist/templates/shared/claude-commands/trinity-init.md.template +606 -0
  168. package/dist/templates/shared/claude-commands/trinity-investigate-templates.md.template +725 -0
  169. package/dist/templates/shared/claude-commands/trinity-orchestrate.md.template +1061 -0
  170. package/dist/templates/shared/claude-commands/trinity-plan-investigation.md.template +135 -0
  171. package/dist/templates/shared/claude-commands/trinity-plan.md.template +201 -0
  172. package/dist/templates/shared/claude-commands/trinity-readme.md.template +1971 -0
  173. package/dist/templates/shared/claude-commands/trinity-requirements.md.template +148 -0
  174. package/dist/templates/shared/claude-commands/trinity-start.md.template +268 -0
  175. package/dist/templates/shared/claude-commands/trinity-verify.md.template +453 -0
  176. package/dist/templates/shared/claude-commands/trinity-workorder.md.template +249 -0
  177. package/dist/templates/source/base-CLAUDE.md.template +310 -0
  178. package/dist/templates/source/flutter-CLAUDE.md.template +593 -0
  179. package/dist/templates/source/nodejs-CLAUDE.md.template +531 -0
  180. package/dist/templates/source/python-CLAUDE.md.template +510 -0
  181. package/dist/templates/source/react-CLAUDE.md.template +513 -0
  182. package/dist/templates/source/rust-CLAUDE.md.template +653 -0
  183. package/dist/templates/source/tests-CLAUDE.md.template +432 -0
  184. package/dist/templates/trinity/CLAUDE.md.template +372 -0
  185. package/dist/templates/work-orders/ANALYSIS-TEMPLATE.md.template +276 -0
  186. package/dist/templates/work-orders/AUDIT-TEMPLATE.md.template +262 -0
  187. package/dist/templates/work-orders/IMPLEMENTATION-TEMPLATE.md.template +260 -0
  188. package/dist/templates/work-orders/INVESTIGATION-TEMPLATE.md.template +206 -0
  189. package/dist/templates/work-orders/PATTERN-TEMPLATE.md.template +320 -0
  190. package/dist/templates/work-orders/VERIFICATION-TEMPLATE.md.template +273 -0
  191. package/package.json +94 -0
@@ -0,0 +1,624 @@
1
+ # Trinity CHANGELOG Management
2
+
3
+ **Purpose:** Launch APO (Documentation Specialist) to maintain CHANGELOG.md in Keep-a-Changelog format.
4
+
5
+ **Use Case:** Ensure CHANGELOG.md exists, follows Keep-a-Changelog format, and documents project changes.
6
+
7
+ **Deliverable:** CHANGELOG audit report in `trinity/reports/CHANGELOG-AUDIT-{date}.md`
8
+
9
+ ---
10
+
11
+ ## Overview
12
+
13
+ The `/trinity-changelog` command invokes APO (Documentation Specialist) to manage CHANGELOG.md. This command focuses exclusively on ensuring the project has a properly formatted CHANGELOG that follows the Keep-a-Changelog standard.
14
+
15
+ **APO's Responsibilities:**
16
+ - Check if CHANGELOG.md exists
17
+ - Validate Keep-a-Changelog format compliance
18
+ - Ensure [Unreleased] section exists at top
19
+ - Document recent changes (if identifiable)
20
+ - Generate CHANGELOG audit report
21
+
22
+ **What This Command Does NOT Handle:**
23
+ - ❌ README.md files (use `/trinity-readme`)
24
+ - ❌ docs/ directory organization (use `/trinity-docs`)
25
+ - ❌ API documentation generation (use specialized tools)
26
+
27
+ ---
28
+
29
+ ## CRITICAL: APO Must Perform Work DIRECTLY
30
+
31
+ **APO is NOT a planning agent. APO is an EXECUTION agent for documentation.**
32
+
33
+ **✅ APO MUST:**
34
+ - CHECK CHANGELOG.md existence **in this command execution**
35
+ - VALIDATE format compliance **in this command execution**
36
+ - CREATE or UPDATE CHANGELOG.md **in this command execution**
37
+ - Report COMPLETED work in Phase 3 (past tense: "Created CHANGELOG.md")
38
+
39
+ **❌ APO MUST NOT:**
40
+ - Create work orders for CHANGELOG management
41
+ - Create "recommendations" instead of performing updates
42
+ - Skip work because "it's too much effort"
43
+ - Defer work to future execution
44
+
45
+ ---
46
+
47
+ ## When to Use `/trinity-changelog`
48
+
49
+ ### Perfect Use Cases:
50
+ ✅ **Missing CHANGELOG** - No CHANGELOG.md exists
51
+ ✅ **Format Issues** - CHANGELOG exists but not Keep-a-Changelog compliant
52
+ ✅ **No [Unreleased] Section** - Missing section for tracking changes
53
+ ✅ **Pre-Release** - Ensure CHANGELOG is up-to-date before release
54
+ ✅ **Documentation Audit** - Verify CHANGELOG compliance
55
+
56
+ ### When NOT to Use:
57
+ ❌ **Version Releases** - Use semantic versioning tools/git tags
58
+ ❌ **README Updates** - Use `/trinity-readme` instead
59
+ ❌ **API Documentation** - Use API-specific generators
60
+
61
+ ---
62
+
63
+ ## Usage
64
+
65
+ ### Basic Usage
66
+ ```bash
67
+ /trinity-changelog
68
+ ```
69
+
70
+ APO performs complete CHANGELOG management:
71
+ 1. Checks if CHANGELOG.md exists
72
+ 2. Validates Keep-a-Changelog format
73
+ 3. Ensures [Unreleased] section exists
74
+ 4. Documents recent changes (if detectable)
75
+ 5. Generates CHANGELOG audit report
76
+
77
+ ---
78
+
79
+ ## APO Execution Principles
80
+
81
+ ### Unlimited Token Budget
82
+
83
+ **CRITICAL: APO has NO token budget limits for this command.**
84
+
85
+ **✅ APO MUST:**
86
+ 1. Complete ALL 3 phases regardless of token usage
87
+ 2. Validate entire CHANGELOG format (no "budget exceeded" stops)
88
+ 3. NEVER claim "token budget constraints" as reason for incomplete work
89
+
90
+ **❌ APO MUST NOT:**
91
+ 1. Stop execution due to token concerns
92
+ 2. Skip validation due to "budget constraints"
93
+ 3. Defer work to future sessions
94
+
95
+ ---
96
+
97
+ ## Phase Execution Rules
98
+
99
+ **ALL 3 phases are MANDATORY. APO MUST execute phases in sequence.**
100
+
101
+ **FORBIDDEN:**
102
+ - ❌ Skipping phases
103
+ - ❌ "Deferring" phases to future sessions
104
+ - ❌ Claiming phases are "optional"
105
+
106
+ ---
107
+
108
+ ## APO's 3-Phase CHANGELOG Management Process
109
+
110
+ ### Phase 1: CHANGELOG Discovery & Format Validation
111
+
112
+ **Goal:** Check CHANGELOG.md existence and validate Keep-a-Changelog format compliance
113
+
114
+ **Step 1: Check CHANGELOG.md Existence**
115
+
116
+ ```bash
117
+ # Use Glob to find CHANGELOG.md
118
+ Use Glob pattern: "CHANGELOG.md"
119
+ ```
120
+
121
+ **Expected Results:**
122
+ - **FOUND:** CHANGELOG.md exists → Proceed to Step 2
123
+ - **NOT FOUND:** No CHANGELOG.md → Skip to Step 4 (Creation)
124
+
125
+ **Step 2: Read CHANGELOG.md**
126
+
127
+ If CHANGELOG.md exists:
128
+
129
+ ```javascript
130
+ Use Read tool on CHANGELOG.md
131
+ changelog_content = read_result
132
+ changelog_lines = changelog_content.split('\n')
133
+ ```
134
+
135
+ **Step 3: Validate Keep-a-Changelog Format**
136
+
137
+ Check for required Keep-a-Changelog elements:
138
+
139
+ ```javascript
140
+ // Required elements
141
+ has_title = changelog_lines.some(line => line.match(/^# Changelog/i))
142
+ has_keepachangelog_link = changelog_content.includes('keepachangelog.com')
143
+ has_unreleased = changelog_content.includes('[Unreleased]')
144
+ has_version_format = changelog_content.match(/## \[\d+\.\d+\.\d+\]/)
145
+
146
+ // Section categories (should exist in some entries)
147
+ has_added = changelog_content.includes('### Added')
148
+ has_changed = changelog_content.includes('### Changed')
149
+ has_deprecated = changelog_content.includes('### Deprecated')
150
+ has_removed = changelog_content.includes('### Removed')
151
+ has_fixed = changelog_content.includes('### Fixed')
152
+ has_security = changelog_content.includes('### Security')
153
+
154
+ // Calculate format score
155
+ format_score = (
156
+ (has_title ? 20 : 0) +
157
+ (has_keepachangelog_link ? 15 : 0) +
158
+ (has_unreleased ? 25 : 0) +
159
+ (has_version_format ? 20 : 0) +
160
+ (has_added || has_changed || has_fixed ? 20 : 0)
161
+ )
162
+ ```
163
+
164
+ **Format Score Interpretation:**
165
+ - **80-100:** Excellent format compliance
166
+ - **60-79:** Good format, minor improvements needed
167
+ - **40-59:** Moderate format issues
168
+ - **0-39:** Poor format compliance, major fixes needed
169
+
170
+ **Step 4: Analyze [Unreleased] Section**
171
+
172
+ If CHANGELOG exists and has [Unreleased]:
173
+
174
+ ```javascript
175
+ // Extract [Unreleased] section
176
+ unreleased_section = extract_section_between(
177
+ start_marker: '## [Unreleased]',
178
+ end_marker: next '##' header
179
+ )
180
+
181
+ // Check if [Unreleased] has content
182
+ unreleased_has_content = unreleased_section.length > 2 // More than just header
183
+
184
+ // Count changes in [Unreleased]
185
+ unreleased_added = count_items_under(unreleased_section, '### Added')
186
+ unreleased_changed = count_items_under(unreleased_section, '### Changed')
187
+ unreleased_fixed = count_items_under(unreleased_section, '### Fixed')
188
+ unreleased_total = unreleased_added + unreleased_changed + unreleased_fixed
189
+ ```
190
+
191
+ **APO Output:**
192
+
193
+ ```markdown
194
+ === PHASE 1: CHANGELOG DISCOVERY & VALIDATION ===
195
+
196
+ **CHANGELOG.md:** {✅ EXISTS | ❌ NOT FOUND}
197
+
198
+ {If EXISTS:}
199
+
200
+ **Format Validation:**
201
+ - Title (# Changelog): {✅ | ❌}
202
+ - Keep-a-Changelog link: {✅ | ❌}
203
+ - [Unreleased] section: {✅ | ❌}
204
+ - Version format (## [X.Y.Z]): {✅ | ❌}
205
+ - Change categories (Added/Changed/Fixed): {✅ | ❌}
206
+
207
+ **Format Score:** {format_score}/100
208
+ - 80-100: ✅ Excellent compliance
209
+ - 60-79: ⚠️ Good, minor improvements
210
+ - 40-59: ⚠️ Moderate issues
211
+ - 0-39: ❌ Major fixes needed
212
+
213
+ **[Unreleased] Section:**
214
+ - Exists: {✅ YES | ❌ NO}
215
+ - Has content: {✅ YES | ❌ EMPTY}
216
+ - Total changes: {unreleased_total}
217
+ - Added: {unreleased_added}
218
+ - Changed: {unreleased_changed}
219
+ - Fixed: {unreleased_fixed}
220
+
221
+ {If NOT FOUND:}
222
+
223
+ **Action Required:** Create CHANGELOG.md from template
224
+ ```
225
+
226
+ ---
227
+
228
+ ### Phase 2: CHANGELOG Creation or Update
229
+
230
+ **Goal:** Create CHANGELOG.md if missing, or update existing CHANGELOG to ensure compliance
231
+
232
+ **Path A: CHANGELOG Does NOT Exist (Create)**
233
+
234
+ **Step 1: Create CHANGELOG.md from Template**
235
+
236
+ ```markdown
237
+ # Changelog
238
+
239
+ All notable changes to this project will be documented in this file.
240
+
241
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
242
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
243
+
244
+ ## [Unreleased]
245
+
246
+ ### Added
247
+ - Initial project setup
248
+
249
+ ### Changed
250
+
251
+ ### Deprecated
252
+
253
+ ### Removed
254
+
255
+ ### Fixed
256
+
257
+ ### Security
258
+
259
+ ## [1.0.0] - {current_date}
260
+
261
+ ### Added
262
+ - First release
263
+ ```
264
+
265
+ **Step 2: Write CHANGELOG.md to Root**
266
+
267
+ ```javascript
268
+ Use Write tool to create CHANGELOG.md
269
+ changelog_created = true
270
+ ```
271
+
272
+ **APO Output (Path A):**
273
+
274
+ ```markdown
275
+ === PHASE 2: CHANGELOG CREATION ===
276
+
277
+ **Action:** CREATED CHANGELOG.md from Keep-a-Changelog template
278
+
279
+ **File Location:** CHANGELOG.md (project root)
280
+
281
+ **Template Includes:**
282
+ - ✅ # Changelog title
283
+ - ✅ Keep-a-Changelog link
284
+ - ✅ Semantic Versioning link
285
+ - ✅ [Unreleased] section with all categories
286
+ - ✅ [1.0.0] initial version entry
287
+
288
+ **Status:** ✅ CHANGELOG.md created successfully
289
+ ```
290
+
291
+ ---
292
+
293
+ **Path B: CHANGELOG Exists BUT Missing [Unreleased] (Update)**
294
+
295
+ **Step 1: Insert [Unreleased] Section**
296
+
297
+ ```javascript
298
+ // Find insertion point (after intro, before first version)
299
+ intro_end = find_line_index(changelog_lines, /^## \[/)
300
+
301
+ // Create [Unreleased] section
302
+ unreleased_section = `
303
+ ## [Unreleased]
304
+
305
+ ### Added
306
+
307
+ ### Changed
308
+
309
+ ### Deprecated
310
+
311
+ ### Removed
312
+
313
+ ### Fixed
314
+
315
+ ### Security
316
+ `
317
+
318
+ // Insert [Unreleased] section
319
+ new_changelog = insert_at_line(changelog_lines, intro_end, unreleased_section)
320
+
321
+ // Write updated CHANGELOG
322
+ Use Edit tool to add [Unreleased] section
323
+ ```
324
+
325
+ **APO Output (Path B):**
326
+
327
+ ```markdown
328
+ === PHASE 2: CHANGELOG UPDATE ===
329
+
330
+ **Action:** ADDED [Unreleased] section to existing CHANGELOG.md
331
+
332
+ **Insertion Point:** Line {intro_end} (before first version entry)
333
+
334
+ **Sections Added:**
335
+ - ✅ [Unreleased] header
336
+ - ✅ Added category
337
+ - ✅ Changed category
338
+ - ✅ Deprecated category
339
+ - ✅ Removed category
340
+ - ✅ Fixed category
341
+ - ✅ Security category
342
+
343
+ **Status:** ✅ [Unreleased] section added successfully
344
+ ```
345
+
346
+ ---
347
+
348
+ **Path C: CHANGELOG Exists with [Unreleased] (Validate Only)**
349
+
350
+ **Step 1: Verify [Unreleased] Section Structure**
351
+
352
+ ```javascript
353
+ // Check if [Unreleased] has all standard categories
354
+ missing_categories = []
355
+
356
+ if (!unreleased_section.includes('### Added')) missing_categories.push('Added')
357
+ if (!unreleased_section.includes('### Changed')) missing_categories.push('Changed')
358
+ if (!unreleased_section.includes('### Deprecated')) missing_categories.push('Deprecated')
359
+ if (!unreleased_section.includes('### Removed')) missing_categories.push('Removed')
360
+ if (!unreleased_section.includes('### Fixed')) missing_categories.push('Fixed')
361
+ if (!unreleased_section.includes('### Security')) missing_categories.push('Security')
362
+ ```
363
+
364
+ **Step 2: Add Missing Categories (if any)**
365
+
366
+ ```javascript
367
+ if (missing_categories.length > 0) {
368
+ // Find [Unreleased] section end
369
+ unreleased_end = find_next_version_header(changelog_lines)
370
+
371
+ // Insert missing categories before next version
372
+ for (category in missing_categories) {
373
+ insert_line = `\n### ${category}\n`
374
+ // Use Edit tool to insert category
375
+ }
376
+ }
377
+ ```
378
+
379
+ **APO Output (Path C):**
380
+
381
+ ```markdown
382
+ === PHASE 2: CHANGELOG VALIDATION ===
383
+
384
+ **Action:** VALIDATED [Unreleased] section structure
385
+
386
+ **[Unreleased] Section:**
387
+ - Header: ✅ Present
388
+ - Added: {✅ | ❌ ADDED}
389
+ - Changed: {✅ | ❌ ADDED}
390
+ - Deprecated: {✅ | ❌ ADDED}
391
+ - Removed: {✅ | ❌ ADDED}
392
+ - Fixed: {✅ | ❌ ADDED}
393
+ - Security: {✅ | ❌ ADDED}
394
+
395
+ {If missing categories:}
396
+ **Missing Categories Added:** {missing_categories.join(', ')}
397
+
398
+ {If all categories present:}
399
+ **Status:** ✅ All standard categories present
400
+ ```
401
+
402
+ ---
403
+
404
+ ### Phase 3: CHANGELOG Audit Report
405
+
406
+ **APO Generates:** `trinity/reports/CHANGELOG-AUDIT-{date}.md`
407
+
408
+ **Required Report Structure:**
409
+
410
+ ```markdown
411
+ # CHANGELOG Audit Report
412
+
413
+ **Project:** {{PROJECT_NAME}}
414
+ **Audit Date:** {date}
415
+ **Auditor:** APO (Documentation Specialist)
416
+ **Command:** /trinity-changelog
417
+
418
+ ---
419
+
420
+ ## Executive Summary
421
+
422
+ **CHANGELOG.md:** {✅ EXISTS | ❌ CREATED}
423
+ **Format Score:** {format_score}/100
424
+ **[Unreleased] Section:** {✅ EXISTS | ❌ CREATED}
425
+ **Keep-a-Changelog Compliance:** {✅ COMPLIANT | ⚠️ PARTIAL | ❌ NON-COMPLIANT}
426
+
427
+ **COMMAND EXECUTION STATUS:** {✅ SUCCESS | ⚠️ PARTIAL SUCCESS}
428
+
429
+ ---
430
+
431
+ ## Phase Execution Summary
432
+
433
+ ### Phase 1: Discovery & Validation
434
+ - **CHANGELOG.md existed:** {✅ YES | ❌ NO}
435
+ - **Format score:** {format_score}/100
436
+ - **[Unreleased] existed:** {✅ YES | ❌ NO}
437
+
438
+ ### Phase 2: Creation or Update
439
+ - **Action taken:** {CREATED | UPDATED [Unreleased] | ADDED CATEGORIES | VALIDATED}
440
+ - **File location:** CHANGELOG.md (project root)
441
+
442
+ ---
443
+
444
+ ## Format Compliance
445
+
446
+ **Keep-a-Changelog Elements:**
447
+ - ✅ Title: # Changelog
448
+ - {✅ | ❌} Link to keepachangelog.com
449
+ - {✅ | ❌} Link to semver.org
450
+ - ✅ [Unreleased] section
451
+ - {✅ | ❌} Version entries (## [X.Y.Z])
452
+
453
+ **[Unreleased] Section Categories:**
454
+ - ✅ Added
455
+ - ✅ Changed
456
+ - ✅ Deprecated
457
+ - ✅ Removed
458
+ - ✅ Fixed
459
+ - ✅ Security
460
+
461
+ **Format Score:** {format_score}/100
462
+ - 80-100: ✅ Excellent compliance
463
+ - 60-79: ⚠️ Good, minor improvements
464
+ - 40-59: ⚠️ Moderate issues
465
+ - 0-39: ❌ Major fixes needed
466
+
467
+ ---
468
+
469
+ ## [Unreleased] Section Analysis
470
+
471
+ **Status:** {✅ READY | ⚠️ EMPTY | ❌ MISSING}
472
+
473
+ **Current Changes Documented:**
474
+ - Added: {unreleased_added} items
475
+ - Changed: {unreleased_changed} items
476
+ - Fixed: {unreleased_fixed} items
477
+ - Total: {unreleased_total} items
478
+
479
+ {If unreleased_total > 0:}
480
+ **Recent Changes:**
481
+ {list items from [Unreleased] section}
482
+
483
+ {If unreleased_total == 0:}
484
+ **Note:** [Unreleased] section is empty. Add changes as they are made.
485
+
486
+ ---
487
+
488
+ ## Version History
489
+
490
+ **Total Versions:** {count version entries}
491
+
492
+ **Latest Version:** {latest_version} ({latest_date})
493
+
494
+ **Versions:**
495
+ {list all version entries with dates}
496
+
497
+ ---
498
+
499
+ ## Recommendations
500
+
501
+ {If format_score < 80:}
502
+ **Format Improvements:**
503
+ - {list specific improvements needed}
504
+
505
+ {If unreleased_total == 0:}
506
+ **Documentation:**
507
+ - ⚠️ [Unreleased] section is empty
508
+ - Consider documenting recent changes
509
+
510
+ {If format_score >= 80 && unreleased exists:}
511
+ **No recommendations** - CHANGELOG is well-maintained ✅
512
+
513
+ ---
514
+
515
+ ## Success Criteria
516
+
517
+ **Required Elements:**
518
+ - {✅ | ❌} CHANGELOG.md exists
519
+ - {✅ | ❌} Keep-a-Changelog format
520
+ - {✅ | ❌} [Unreleased] section present
521
+ - {✅ | ❌} All standard categories in [Unreleased]
522
+
523
+ {If all ✅:}
524
+ **SUCCESS Criteria:** All required elements present ✅
525
+
526
+ {If any ❌:}
527
+ **PARTIAL SUCCESS:** {list missing elements}
528
+
529
+ ---
530
+
531
+ **Report Generated:** {timestamp}
532
+ **Report Location:** trinity/reports/CHANGELOG-AUDIT-{date}.md
533
+ ```
534
+
535
+ ---
536
+
537
+ ## Success Criteria
538
+
539
+ **Command succeeds when:**
540
+
541
+ 1. **CHANGELOG.md Exists:** File present in project root
542
+ 2. **Format Compliance:** Format score ≥ 60/100
543
+ 3. **[Unreleased] Section:** Exists with all standard categories
544
+ 4. **All Phases Complete:** 3/3 phases executed
545
+
546
+ **If ALL criteria met: STATUS = ✅ SUCCESS**
547
+
548
+ **If missing elements: STATUS = ⚠️ PARTIAL SUCCESS**
549
+ - Report lists missing elements
550
+ - User can re-run command to complete
551
+
552
+ ---
553
+
554
+ ## Post-Execution Checklist
555
+
556
+ **After `/trinity-changelog` completes, verify:**
557
+
558
+ 1. ✅ Check `trinity/reports/CHANGELOG-AUDIT-{date}.md`
559
+ 2. ✅ Verify CHANGELOG.md exists in root
560
+ 3. ✅ Check [Unreleased] section present
561
+ 4. ✅ Verify format score ≥ 60/100
562
+ 5. ✅ Check "COMMAND EXECUTION STATUS" = "✅ SUCCESS"
563
+
564
+ ---
565
+
566
+ ## Keep-a-Changelog Format Reference
567
+
568
+ **Standard Template:**
569
+
570
+ ```markdown
571
+ # Changelog
572
+
573
+ All notable changes to this project will be documented in this file.
574
+
575
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
576
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
577
+
578
+ ## [Unreleased]
579
+
580
+ ### Added
581
+ - New features
582
+
583
+ ### Changed
584
+ - Changes to existing features
585
+
586
+ ### Deprecated
587
+ - Soon-to-be removed features
588
+
589
+ ### Removed
590
+ - Removed features
591
+
592
+ ### Fixed
593
+ - Bug fixes
594
+
595
+ ### Security
596
+ - Security fixes
597
+
598
+ ## [1.0.0] - 2024-01-01
599
+
600
+ ### Added
601
+ - Initial release
602
+ ```
603
+
604
+ **Category Guidelines:**
605
+
606
+ - **Added:** New features
607
+ - **Changed:** Changes to existing functionality
608
+ - **Deprecated:** Soon-to-be removed features
609
+ - **Removed:** Removed features
610
+ - **Fixed:** Bug fixes
611
+ - **Security:** Security-related changes
612
+
613
+ **Version Format:** `## [X.Y.Z] - YYYY-MM-DD`
614
+
615
+ **Links Section (optional):**
616
+ ```markdown
617
+ [Unreleased]: https://github.com/user/repo/compare/v1.0.0...HEAD
618
+ [1.0.0]: https://github.com/user/repo/releases/tag/v1.0.0
619
+ ```
620
+
621
+ ---
622
+
623
+ **Command Specification Version:** 2.0.0
624
+ **Last Updated:** 2025-12-27