cortex-tms 3.2.0 β†’ 4.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 (120) hide show
  1. package/README.md +238 -529
  2. package/dist/cli.js +14 -2
  3. package/dist/cli.js.map +1 -1
  4. package/dist/commands/archive.d.ts +5 -0
  5. package/dist/commands/archive.d.ts.map +1 -0
  6. package/dist/commands/archive.js +83 -0
  7. package/dist/commands/archive.js.map +1 -0
  8. package/dist/commands/dashboard.d.ts +3 -0
  9. package/dist/commands/dashboard.d.ts.map +1 -0
  10. package/dist/commands/dashboard.js +20 -0
  11. package/dist/commands/dashboard.js.map +1 -0
  12. package/dist/commands/review.js +19 -1
  13. package/dist/commands/review.js.map +1 -1
  14. package/dist/commands/status.d.ts +1 -0
  15. package/dist/commands/status.d.ts.map +1 -1
  16. package/dist/commands/status.js +4 -100
  17. package/dist/commands/status.js.map +1 -1
  18. package/dist/types/cli.d.ts +8 -0
  19. package/dist/types/cli.d.ts.map +1 -1
  20. package/dist/ui/components/Dashboard.d.ts +11 -0
  21. package/dist/ui/components/Dashboard.d.ts.map +1 -0
  22. package/dist/ui/components/Dashboard.js +63 -0
  23. package/dist/ui/components/Dashboard.js.map +1 -0
  24. package/dist/ui/components/dashboard/ContextReductionCard.d.ts +9 -0
  25. package/dist/ui/components/dashboard/ContextReductionCard.d.ts.map +1 -0
  26. package/dist/ui/components/dashboard/ContextReductionCard.js +38 -0
  27. package/dist/ui/components/dashboard/ContextReductionCard.js.map +1 -0
  28. package/dist/ui/components/dashboard/CostSavingsCard.d.ts +10 -0
  29. package/dist/ui/components/dashboard/CostSavingsCard.d.ts.map +1 -0
  30. package/dist/ui/components/dashboard/CostSavingsCard.js +45 -0
  31. package/dist/ui/components/dashboard/CostSavingsCard.js.map +1 -0
  32. package/dist/ui/components/dashboard/FileDistributionCard.d.ts +10 -0
  33. package/dist/ui/components/dashboard/FileDistributionCard.d.ts.map +1 -0
  34. package/dist/ui/components/dashboard/FileDistributionCard.js +51 -0
  35. package/dist/ui/components/dashboard/FileDistributionCard.js.map +1 -0
  36. package/dist/ui/components/dashboard/FileSizeHealthCard.d.ts +15 -0
  37. package/dist/ui/components/dashboard/FileSizeHealthCard.d.ts.map +1 -0
  38. package/dist/ui/components/dashboard/FileSizeHealthCard.js +48 -0
  39. package/dist/ui/components/dashboard/FileSizeHealthCard.js.map +1 -0
  40. package/dist/ui/components/dashboard/Footer.d.ts +3 -0
  41. package/dist/ui/components/dashboard/Footer.d.ts.map +1 -0
  42. package/dist/ui/components/dashboard/Footer.js +13 -0
  43. package/dist/ui/components/dashboard/Footer.js.map +1 -0
  44. package/dist/ui/components/dashboard/GovernanceHealthCard.d.ts +10 -0
  45. package/dist/ui/components/dashboard/GovernanceHealthCard.d.ts.map +1 -0
  46. package/dist/ui/components/dashboard/GovernanceHealthCard.js +43 -0
  47. package/dist/ui/components/dashboard/GovernanceHealthCard.js.map +1 -0
  48. package/dist/ui/components/dashboard/GuardianStatusCard.d.ts +10 -0
  49. package/dist/ui/components/dashboard/GuardianStatusCard.d.ts.map +1 -0
  50. package/dist/ui/components/dashboard/GuardianStatusCard.js +58 -0
  51. package/dist/ui/components/dashboard/GuardianStatusCard.js.map +1 -0
  52. package/dist/ui/components/dashboard/Header.d.ts +7 -0
  53. package/dist/ui/components/dashboard/Header.d.ts.map +1 -0
  54. package/dist/ui/components/dashboard/Header.js +21 -0
  55. package/dist/ui/components/dashboard/Header.js.map +1 -0
  56. package/dist/ui/components/dashboard/HotFilesCard.d.ts +8 -0
  57. package/dist/ui/components/dashboard/HotFilesCard.d.ts.map +1 -0
  58. package/dist/ui/components/dashboard/HotFilesCard.js +28 -0
  59. package/dist/ui/components/dashboard/HotFilesCard.js.map +1 -0
  60. package/dist/ui/components/dashboard/NotConfiguredCard.d.ts +10 -0
  61. package/dist/ui/components/dashboard/NotConfiguredCard.d.ts.map +1 -0
  62. package/dist/ui/components/dashboard/NotConfiguredCard.js +13 -0
  63. package/dist/ui/components/dashboard/NotConfiguredCard.js.map +1 -0
  64. package/dist/ui/components/dashboard/SprintProgressCard.d.ts +11 -0
  65. package/dist/ui/components/dashboard/SprintProgressCard.d.ts.map +1 -0
  66. package/dist/ui/components/dashboard/SprintProgressCard.js +33 -0
  67. package/dist/ui/components/dashboard/SprintProgressCard.js.map +1 -0
  68. package/dist/ui/components/dashboard/StalenessCard.d.ts +10 -0
  69. package/dist/ui/components/dashboard/StalenessCard.d.ts.map +1 -0
  70. package/dist/ui/components/dashboard/StalenessCard.js +43 -0
  71. package/dist/ui/components/dashboard/StalenessCard.js.map +1 -0
  72. package/dist/ui/components/dashboard/TabBar.d.ts +8 -0
  73. package/dist/ui/components/dashboard/TabBar.d.ts.map +1 -0
  74. package/dist/ui/components/dashboard/TabBar.js +16 -0
  75. package/dist/ui/components/dashboard/TabBar.js.map +1 -0
  76. package/dist/ui/components/dashboard/ValidationCard.d.ts +10 -0
  77. package/dist/ui/components/dashboard/ValidationCard.d.ts.map +1 -0
  78. package/dist/ui/components/dashboard/ValidationCard.js +62 -0
  79. package/dist/ui/components/dashboard/ValidationCard.js.map +1 -0
  80. package/dist/ui/components/dashboard/ViewContainer.d.ts +14 -0
  81. package/dist/ui/components/dashboard/ViewContainer.d.ts.map +1 -0
  82. package/dist/ui/components/dashboard/ViewContainer.js +53 -0
  83. package/dist/ui/components/dashboard/ViewContainer.js.map +1 -0
  84. package/dist/ui/components/dashboard/index.d.ts +14 -0
  85. package/dist/ui/components/dashboard/index.d.ts.map +1 -0
  86. package/dist/ui/components/dashboard/index.js +14 -0
  87. package/dist/ui/components/dashboard/index.js.map +1 -0
  88. package/dist/ui/index.d.ts +5 -0
  89. package/dist/ui/index.d.ts.map +1 -0
  90. package/dist/ui/index.js +46 -0
  91. package/dist/ui/index.js.map +1 -0
  92. package/dist/utils/git-staleness.d.ts +13 -0
  93. package/dist/utils/git-staleness.d.ts.map +1 -0
  94. package/dist/utils/git-staleness.js +129 -0
  95. package/dist/utils/git-staleness.js.map +1 -0
  96. package/dist/utils/stats-collector.d.ts +62 -0
  97. package/dist/utils/stats-collector.d.ts.map +1 -0
  98. package/dist/utils/stats-collector.js +253 -0
  99. package/dist/utils/stats-collector.js.map +1 -0
  100. package/dist/utils/validation.d.ts +1 -10
  101. package/dist/utils/validation.d.ts.map +1 -1
  102. package/dist/utils/validation.js +1 -15
  103. package/dist/utils/validation.js.map +1 -1
  104. package/dist/utils/validator.d.ts.map +1 -1
  105. package/dist/utils/validator.js +66 -1
  106. package/dist/utils/validator.js.map +1 -1
  107. package/package.json +6 -2
  108. package/templates/CLAUDE.md +1 -1
  109. package/templates/FUTURE-ENHANCEMENTS.md +1 -1
  110. package/templates/NEXT-TASKS.md +1 -1
  111. package/templates/PROMPTS.md +1 -1
  112. package/templates/README.md +1 -1
  113. package/templates/docs/archive/v1.0-CHANGELOG.md +1 -1
  114. package/templates/docs/core/ARCHITECTURE.md +1 -1
  115. package/templates/docs/core/DECISIONS.md +1 -1
  116. package/templates/docs/core/DOMAIN-LOGIC.md +1 -1
  117. package/templates/docs/core/GLOSSARY.md +1 -1
  118. package/templates/docs/core/PATTERNS.md +1 -1
  119. package/templates/docs/core/SCHEMA.md +1 -1
  120. package/templates/docs/core/TROUBLESHOOTING.md +1 -1
package/README.md CHANGED
@@ -5,20 +5,12 @@
5
5
  <h1 align="center">Cortex TMS</h1>
6
6
 
7
7
  <p align="center">
8
- <strong>AI Governance Platform - Stop Wasting Tokens. Stop Burning GPU Cycles on Old Docs.</strong>
8
+ <strong>Documentation Governance for AI Coding Agents</strong>
9
9
  </p>
10
10
 
11
- ---
12
-
13
- Cortex TMS is an **AI Governance Platform** built on three pillars:
14
-
15
- 1. **πŸ’° Cost Efficiency** - Reduce input tokens by **60-70%** through intelligent context management (works with ANY model)
16
- 2. **βœ… Quality** - Reduce hallucinations from outdated docs with semantic validation and focused context
17
- 3. **🌱 Sustainability** - Cut compute requirements by **60-70%** with Green Governanceβ€”less energy, greener development
18
-
19
- Stop feeding your AI coding tool thousands of outdated lines. **60-70% input token reduction** (measured across 47 sessions on Cortex TMS itself) means **lower costs for paid models**, **less compute for free models**, and **fewer hallucinations** from irrelevant context.
20
-
21
- **Works with any AI coding tool** - Claude Code, Copilot, Cursor, Warp, Augment, you name it. The architecture is model-agnostic. Input token reduction is universal.
11
+ <p align="center">
12
+ ⭐ 166+ GitHub Stars | Open source, community-driven
13
+ </p>
22
14
 
23
15
  [![npm version](https://img.shields.io/npm/v/cortex-tms.svg?style=flat-square)](https://www.npmjs.com/package/cortex-tms)
24
16
  [![npm downloads](https://img.shields.io/npm/dm/cortex-tms.svg?style=flat-square)](https://www.npmjs.com/package/cortex-tms)
@@ -26,152 +18,113 @@ Stop feeding your AI coding tool thousands of outdated lines. **60-70% input tok
26
18
  [![node version](https://img.shields.io/node/v/cortex-tms.svg?style=flat-square)](https://nodejs.org)
27
19
  [![GitHub stars](https://img.shields.io/github/stars/cortex-tms/cortex-tms.svg?style=flat-square)](https://github.com/cortex-tms/cortex-tms/stargazers)
28
20
 
29
- **Current Status**: βœ… **Stable / Production Ready** | [NPM Package](https://www.npmjs.com/package/cortex-tms) | [GitHub Repository](https://github.com/cortex-tms/cortex-tms) | [Documentation](https://cortex-tms.org)
30
-
31
21
  ---
32
22
 
33
- ## πŸš€ Instant Activation
34
-
35
- Get started in under 60 seconds (no installation required):
23
+ ## What is Cortex TMS?
36
24
 
37
- ```bash
38
- # 1. Initialize your project
39
- npx cortex-tms@latest init
25
+ Cortex TMS scaffolds and validates governance documentation for AI coding agents. As AI models get more powerful and autonomous, they need clear, current governance docs to stay aligned with your project standards.
40
26
 
41
- # 2. Open the Project Cockpit
42
- npx cortex-tms@latest status
27
+ **The Challenge**: Modern AI agents (Claude Opus 4.6, GPT-4, etc.) handle large context windows and can work autonomouslyβ€”but without governance, they drift from your standards, overengineer solutions, and write inconsistent code.
43
28
 
44
- # 3. Activate your AI Agent
45
- npx cortex-tms@latest prompt init-session
46
- # (Copies project-aware prompt to clipboard!)
47
-
48
- # 4. Check version health
49
- npx cortex-tms@latest migrate
50
- ```
29
+ **The Solution**: Cortex TMS provides:
30
+ - πŸ“‹ **Documentation scaffolding** - Templates for PATTERNS.md, ARCHITECTURE.md, CLAUDE.md
31
+ - βœ… **Staleness detection** - Detects when governance docs go stale relative to code changes (v4.0)
32
+ - πŸ” **Structure validation** - Automated health checks in CI or locally
33
+ - πŸ“¦ **Archive management** - Keep task lists focused and maintainable
51
34
 
52
- **Note**: Using `npx` requires no installation. For frequent use, install globally: `npm install -g cortex-tms@latest`
35
+ ---
53
36
 
54
- Choose your scope (Nano/Standard/Enterprise) and start building with AI-optimized documentation and intelligent CLI tooling.
37
+ ## Three Pillars
55
38
 
56
- πŸ“– **New here?** The Essential 7 prompts in `PROMPTS.md` will guide you through the entire development lifecycle.
39
+ ### 1. πŸ“‹ Consistency - Document Your Standards
57
40
 
58
- ## 🎬 See It In Action
41
+ Scaffold governance docs that AI agents actually read:
42
+ - `PATTERNS.md` - Code patterns and conventions
43
+ - `CLAUDE.md` - Agent workflow rules (git protocol, scope discipline, human approval gates)
44
+ - `ARCHITECTURE.md` - System design and tech stack
45
+ - `DOMAIN-LOGIC.md` - Business rules and constraints
59
46
 
60
- ![Cortex TMS Demo](assets/demo.gif)
47
+ **Result**: AI writes code that follows YOUR patterns, not random conventions from its training data.
61
48
 
62
- **Watch** the `cortex status` dashboard and `cortex migrate` workflow in action. See how Cortex TMS provides real-time project health metrics and intelligent version management.
49
+ ### 2. πŸ” Freshness - Detect Staleness
63
50
 
64
- ---
51
+ New in v4.0: Git-based staleness detection catches when docs go stale:
65
52
 
66
- ## πŸ’° The Value: Measurable Efficiency Gains
53
+ ```bash
54
+ cortex-tms validate
67
55
 
68
- **Real Numbers from Cortex TMS itself** (TypeScript monorepo, measured across 47 development sessions):
56
+ ⚠️ Doc Staleness
57
+ PATTERNS.md may be outdated
58
+ Doc is 45 days older than code with 12 meaningful commits
59
+ Code: 2026-02-20
60
+ Doc: 2026-01-06
69
61
 
70
- ```bash
71
- cortex status --tokens -m claude-sonnet-4-5
62
+ Review docs/core/PATTERNS.md to ensure it reflects current codebase
72
63
  ```
73
64
 
74
- | Metric | Value | Impact |
75
- | :---------------------- | :------------------- | :---------------------------------------------- |
76
- | **Input Token Reduction** | 60-70% typical | Read 3,647 tokens instead of 66,834 (measured on our project) |
77
- | **Cost Savings (Paid Models)** | ~60-70% lower costs | Example: Claude Sonnet $0.20 β†’ $0.06/session |
78
- | **Compute Savings (Free Models)** | ~60-70% less processing | Less GPU cycles = lower electricity + greener development |
79
- | **Quality Improvement** | Fewer hallucinations | AI reads focused context, not thousands of irrelevant lines |
65
+ **How it works**: Compares doc modification dates vs code commit activity. Flags stale docs before they mislead AI agents.
80
66
 
81
- **How?** The HOT/WARM/COLD tier system ensures AI agents only read what matters:
67
+ **Note**: Staleness v1 uses git timestamps (temporal comparison only). Cannot detect semantic misalignment. Future versions will add semantic analysis.
82
68
 
83
- - **HOT**: Current sprint (always read) - 3,647 tokens
84
- - **WARM**: Architectural truth (on-demand) - 20,109 tokens
85
- - **COLD**: Historical archive (ignored) - 43,078 tokens
69
+ ### 3. πŸ›‘οΈ Safety - Human Oversight
86
70
 
87
- **Result**: Your AI assistant stays focused, costs less (paid models) or uses less compute (free models), and makes fewer mistakes.
71
+ `CLAUDE.md` governance rules require human approval for critical operations:
72
+ - Git commits/pushes require approval
73
+ - Scope discipline prevents overengineering
74
+ - Pattern adherence enforced through validation
88
75
 
89
- **Tested Models**: Claude Sonnet/Opus, GPT-4. Architecture is model-agnosticβ€”should work with any AI tool. Input token reduction benefit is universal.
76
+ **Result**: AI agents stay powerful but don't run wild.
90
77
 
91
78
  ---
92
79
 
93
- ## πŸ“Š Measurement & Validation
80
+ ## What Cortex Does (and Doesn't Do)
94
81
 
95
- **How We Measured These Numbers**:
82
+ ### βœ… What Cortex Does
96
83
 
97
- The 60-70% input token reduction is based on 47 development sessions working on Cortex TMS itself (TypeScript monorepo, ~66K total tokens). We tracked:
98
- - HOT tier tokens: ~3,647 (what AI actually reads)
99
- - Full repository: ~66,834 (without TMS)
100
- - Reduction: ~94.5% when comparing HOT tier vs full repo with archives
84
+ - **Scaffolds governance docs** - Templates for common project documentation
85
+ - **Validates doc health** - Checks structure, freshness, completeness
86
+ - **Detects staleness** - Flags when docs are outdated relative to code (v4.0)
87
+ - **Enforces size limits** - Keeps docs focused and scannable
88
+ - **Archives completed tasks** - Maintains clean NEXT-TASKS.md
89
+ - **Works in CI/CD** - GitHub Actions validation templates included
101
90
 
102
- **Transparency**:
103
- - Sample: 47 sessions over 24 days (Jan 2026)
104
- - Project type: TypeScript monorepo (Cortex TMS dogfooding itself)
105
- - Tools tested: Claude Code, GitHub Copilot (in VS Code)
106
- - Models tested: Claude Sonnet/Opus, GPT-4, and other Copilot models
107
- - Your results may vary based on project size, structure, usage patterns, and model choice
108
- - Read our measurement methodology: [Measuring Context Optimization](website/src/content/blog/measuring-context-optimization.mdx)
91
+ ### ❌ What Cortex Does NOT Do
109
92
 
110
- **Community Feedback Welcome**:
111
- If you use other models (local LLMs, etc.) and your experience differs, please share! We're building a public benchmark suite to validate findings across diverse projects and models. See [FUTURE-ENHANCEMENTS.md](FUTURE-ENHANCEMENTS.md) for roadmap.
112
-
113
- **Honest Approach**: These are our real measurements from dogfooding with the models we actually use. Not marketing fluff, not fake data. We invite the community to validate, challenge, and improve these findings.
93
+ - **Not a token optimizer** - Modern models (200K+ contexts) make this less relevant
94
+ - **Not code enforcement** - Validates DOCUMENTATION health, not code directly
95
+ - **Not a replacement for code review** - Complements human review, doesn't replace it
96
+ - **Not semantic analysis (yet)** - Staleness v1 uses timestamps, not AI-powered diff analysis
114
97
 
115
98
  ---
116
99
 
117
- ## 🎯 The Philosophy: Signal over Noise
118
-
119
- Traditional repos drown AI agents in thousands of lines of historical tasks and stale documentation. **Cortex TMS** forces agents into a "Tiered" approach:
120
-
121
- 1. **HOT (Active)**: `NEXT-TASKS.md`, `PROMPTS.md` β€” What we are doing _now_ and how to ask the AI for help.
122
- 2. **WARM (Truth)**: `docs/core/` β€” The project's "Laws" (Architecture, Patterns, Domain Logic).
123
- 3. **COLD (History)**: `docs/archive/` β€” Historical changelogs (Ignore unless asked).
124
-
125
- **Why this works**: AI agents have limited context windows. Reading everything is wasteful. The tier system maximizes signal, minimizes noise.
126
-
127
- ---
128
-
129
- ## πŸ†• What's New in v3.2 (Upcoming)
130
-
131
- **Security & Production Readiness** - Making Cortex TMS enterprise-grade:
132
-
133
- - πŸ›‘οΈ **Centralized Error Handling** β€” No more process crashes. All commands use consistent `CLIError` patterns with proper cleanup
134
- - βœ… **Zod-Based Input Validation** β€” Runtime type safety for all CLI commands with clear, actionable error messages
135
- - πŸ§ͺ **Comprehensive E2E Tests** β€” 61 E2E tests covering full CLI workflows (init, validate, migrate, review, auto-tier)
136
- - πŸ”’ **Path Traversal Protection** β€” Template operations secured against `../../etc/passwd` attacks with `validateSafePath()`
137
- - πŸ” **API Key Sanitization** β€” Guardian automatically redacts Anthropic/OpenAI keys in all error messages and logs
138
- - πŸ“Š **Automated Security Scanning** β€” CI pipeline runs `pnpm audit` on every PR to catch dependency vulnerabilities
100
+ ## Quick Start
139
101
 
140
- **Test Coverage**: 316 tests (97% pass rate) β€” up from 269 tests (+17%)
141
-
142
- **For Developers**: See [Security Testing Guide](docs/guides/SECURITY-TESTING.md) for how to verify security patterns.
143
-
144
- **Full Details**: [CHANGELOG.md](CHANGELOG.md#320---unreleased)
145
-
146
- ---
147
-
148
- ## πŸ› οΈ CLI Commands
102
+ ```bash
103
+ # Initialize governance docs in your project
104
+ npx cortex-tms@latest init
149
105
 
150
- Cortex TMS provides 8 production-ready commands:
106
+ # Validate doc health (including staleness detection)
107
+ npx cortex-tms@latest validate
151
108
 
152
- ### `cortex-tms tutorial`
109
+ # Strict mode (warnings = errors, for CI)
110
+ npx cortex-tms@latest validate --strict
153
111
 
154
- Interactive walkthrough teaching the "Cortex Way" - perfect for first-time users.
112
+ # Check project status
113
+ npx cortex-tms@latest status
155
114
 
156
- ```bash
157
- cortex-tms tutorial # Start the guided tour
115
+ # Archive completed tasks
116
+ npx cortex-tms@latest archive --dry-run
158
117
  ```
159
118
 
160
- **What You'll Learn**:
161
-
162
- - Project Dashboard: Using `status` to see your cockpit
163
- - AI Activation: Using `prompt` to activate project-aware AI agents
164
- - Zero-Drift Governance: Automated version sync with `docs:sync`
165
- - Health Checks: Understanding `validate` and the Archive Protocol
166
- - Safe Migration: Fearless template upgrades with backup/rollback
167
-
168
- **Navigation**: Use arrow keys and Enter to progress, select Exit to quit anytime
119
+ **Installation**: No installation required with `npx`. For frequent use: `npm install -g cortex-tms@latest`
169
120
 
170
121
  ---
171
122
 
123
+ ## CLI Commands
124
+
172
125
  ### `cortex-tms init`
173
126
 
174
- Initialize TMS structure in your project with interactive scope selection.
127
+ Scaffold TMS documentation structure with interactive scope selection.
175
128
 
176
129
  ```bash
177
130
  cortex-tms init # Interactive mode
@@ -181,230 +134,89 @@ cortex-tms init --dry-run # Preview changes
181
134
 
182
135
  ### `cortex-tms validate`
183
136
 
184
- Verify your project's TMS health and auto-fix common issues.
137
+ Verify project TMS health with automated checks.
185
138
 
186
139
  ```bash
187
140
  cortex-tms validate # Check project health
188
141
  cortex-tms validate --fix # Auto-repair missing files
189
- cortex-tms validate --strict # Strict mode with no warnings
142
+ cortex-tms validate --strict # Strict mode (warnings = errors)
190
143
  ```
191
144
 
145
+ **What it checks:**
146
+ - βœ… Mandatory files exist (NEXT-TASKS.md, CLAUDE.md, copilot-instructions.md)
147
+ - βœ… File size limits (Rule 4: HOT files < 200 lines)
148
+ - βœ… Placeholder completion (no `[Project Name]` markers left)
149
+ - βœ… Archive status (completed tasks should be archived)
150
+ - βœ… **Doc staleness** (NEW in v4.0) - governance docs current with code
151
+
192
152
  ### `cortex-tms status`
193
153
 
194
- Project cockpit with health dashboard, sprint progress, and token analysis.
154
+ Project cockpit with health dashboard and sprint progress.
195
155
 
196
156
  ```bash
197
- cortex-tms status # Visual dashboard with progress bars
198
- cortex-tms status --tokens # Token usage analysis (HOT/WARM/COLD)
199
- cortex-tms status --tokens -m gpt-4 # Cost comparison across models
157
+ cortex-tms status # Visual dashboard with progress bars
200
158
  ```
201
159
 
202
- **Token Analysis Features**:
160
+ Shows:
161
+ - Project identity (name, scope, TMS version)
162
+ - Health status (validation checks passed/failed)
163
+ - Sprint progress (current tasks, completion %)
164
+ - Backlog size (future enhancements)
203
165
 
204
- - HOT/WARM/COLD tier breakdown with token counts
205
- - Context reduction percentage (typically 60-70%)
206
- - Cost estimates per session/day/month (for paid models)
207
- - Model comparison (Claude Sonnet 4.5, Opus 4.5, GPT-4, etc.)
208
- - Sustainability impact tracking (compute savings for all models)
166
+ ### `cortex-tms archive`
209
167
 
210
- ### `cortex-tms auto-tier`
211
-
212
- Git-based automatic tier assignment - reduce manual tier management using file recency as a relevance signal.
168
+ Archive completed tasks and old content.
213
169
 
214
170
  ```bash
215
- cortex-tms auto-tier # Apply tier tags based on git history
216
- cortex-tms auto-tier --dry-run # Preview tier suggestions
217
- cortex-tms auto-tier --hot 14 --warm 60 # Custom thresholds
218
- cortex-tms auto-tier --force # Overwrite existing tags
171
+ cortex-tms archive # Archive completed tasks
172
+ cortex-tms archive --dry-run # Preview what would be archived
219
173
  ```
220
174
 
221
- **Community-requested feature**: Built in response to feedback from Reddit users [Illustrious-Report96](https://www.reddit.com/user/Illustrious-Report96/), [pbalIII](https://www.reddit.com/user/pbalIII/), and [durable-racoon](https://www.reddit.com/user/durable-racoon/) who identified manual tier management as a scalability bottleneck and suggested using git history to determine file "heat".
222
-
223
- **How It Works**:
224
-
225
- - Analyzes git commit history and file paths to calculate priority scores
226
- - **Scoring system**: Canonical files (100 pts) > docs/ (40 pts) + recency (15 pts)
227
- - **Strict cap**: Maximum 10 HOT files (prevents context bloat)
228
- - **Smart defaults**: `docs/archive/` β†’ COLD, `docs/guides/` β†’ WARM, canonical files always HOT
229
- - Adds `<!-- @cortex-tms-tier HOT -->` tags to markdown files
230
- - Respects explicit tier tags unless `--force` is used
231
-
232
- **Why Auto-Tier?**
175
+ Archives completed tasks from NEXT-TASKS.md to `docs/archive/` with timestamp.
233
176
 
234
- - **Automates tier management**: No more manual tier decisions
235
- - **Objective signal**: Git history provides measurable recency data
236
- - **Aligns with "Lost in the Middle" research**: Recent files (likely relevant) placed at context beginning
237
- - **Adapts to workflow**: Tiers stay current as project evolves
177
+ **Note**: `cortex-tms auto-tier` is deprecatedβ€”use `archive` instead.
238
178
 
239
179
  ### `cortex-tms migrate`
240
180
 
241
- Intelligent version managementβ€”detect outdated templates and automatically upgrade with safety backups.
181
+ Intelligent version managementβ€”detect outdated templates and upgrade safely.
242
182
 
243
183
  ```bash
244
184
  cortex-tms migrate # Analyze version status
245
- cortex-tms migrate --apply # Auto-upgrade OUTDATED files (creates backup)
246
- cortex-tms migrate --apply --force # Upgrade ALL files including customized
247
- cortex-tms migrate --rollback # Restore from backup (interactive selection)
248
- cortex-tms migrate --dry-run # Preview migration plan
185
+ cortex-tms migrate --apply # Auto-upgrade OUTDATED files
186
+ cortex-tms migrate --rollback # Restore from backup
249
187
  ```
250
188
 
251
- **Status Categories**:
252
-
253
- - `LATEST`: Already on current version
254
- - `OUTDATED`: Safe to auto-upgrade (matches old template)
255
- - `CUSTOMIZED`: Manual review needed (has user changes)
256
- - `MISSING`: Optional file not installed
257
-
258
- **Safety Features**:
259
-
260
- - Automatic backups in `.cortex/backups/` before any changes
261
- - Timestamped snapshots with manifest files
262
- - One-click rollback with interactive backup selection
263
- - Confirmation prompts prevent accidental overwrites
264
-
265
189
  ### `cortex-tms prompt`
266
190
 
267
191
  Access project-aware AI prompts from the Essential 7 library.
268
192
 
269
193
  ```bash
270
194
  cortex-tms prompt # Interactive selection
271
- cortex-tms prompt init-session # Direct access (auto-copies to clipboard!)
272
- cortex-tms prompt --list # Browse all prompts
195
+ cortex-tms prompt init-session # Auto-copies to clipboard
273
196
  ```
274
197
 
275
- **The Essential 7**:
276
-
277
- - `init-session` - Start your AI session with context
278
- - `feature` - Implement new features with architectural anchors
279
- - `debug` - Troubleshoot with known issues lookup
280
- - `review` - Code review against project patterns
281
- - `refactor` - Structural improvements
282
- - `decision` - Create Architecture Decision Records
283
- - `finish` - Execute maintenance protocol
284
-
285
198
  ### `cortex-tms review` πŸ›‘οΈ
286
199
 
287
- **Guardian**: AI-powered semantic validation against project patterns and domain logic.
200
+ Guardian: AI-powered semantic validation against project patterns.
288
201
 
289
202
  ```bash
290
- cortex-tms review src/index.ts # Validate file against PATTERNS.md
291
- cortex-tms review src/index.ts --safe # Safe Mode: only high-confidence violations (β‰₯70%)
292
- cortex-tms review src/index.ts --output-json # Raw JSON output (for Agent Skills/CI/CD)
293
- cortex-tms review src/index.ts --provider openai # Use OpenAI instead of Anthropic
294
- cortex-tms review src/index.ts --model gpt-4 # Specify model
295
- ```
296
-
297
- **What Guardian Does**:
298
-
299
- - Analyzes code against `PATTERNS.md` (canonical examples, do/don't patterns)
300
- - Validates against `DOMAIN-LOGIC.md` (immutable project rules)
301
- - Uses LLM to catch **semantic violations**, not just syntax errors
302
- - Reports violations with specific pattern references
303
-
304
- **Why Guardian?**
305
-
306
- - **Structured Output**: JSON-based violation detection (80%+ accuracy target, from 65.5% baseline)
307
- - **Safe Mode**: `--safe` flag filters to high-confidence violations only (β‰₯70%), reducing false positive noise
308
- - **Semantic Understanding**: Catches violations grep/regex can't find
309
- - **Pattern Enforcement**: Stops drift from architectural decisions
310
- - **BYOK (Bring Your Own Key)**: Uses your OpenAI or Anthropic API key
311
- - **Reliable Parsing**: Deterministic JSON eliminates keyword collision false positives
312
-
313
- **Example Output**:
314
-
315
- ```
316
- πŸ›‘οΈ Guardian Code Review
317
-
318
- βœ… Analysis Complete
319
-
320
- ❌ **Major Violations**
321
-
322
- Code violates Pattern 1: Placeholder Syntax
323
-
324
- ## Violations
325
-
326
- 1. ❌ **Pattern 1: Placeholder Syntax**
327
- πŸ“ Line: 45
328
- ❗ Issue: Using {braces} instead of [brackets] for placeholders
329
- πŸ’‘ Fix: Replace {project-name} with [project-name]
330
-
331
- ## Positive Observations
332
-
333
- βœ… Consistent indentation and formatting
334
- βœ… Good use of TypeScript strict types
203
+ cortex-tms review src/index.ts # Validate against PATTERNS.md
204
+ cortex-tms review src/index.ts --safe # High-confidence violations only
335
205
  ```
336
206
 
337
- ---
338
-
339
- ## πŸ”„ CI/CD Integration
340
-
341
- ### Reusable GitHub Action
342
-
343
- Validate your TMS documentation in GitHub Actions workflows without installing the CLI locally.
344
-
345
- **Basic Usage** (in your `.github/workflows/tms-validate.yml`):
346
-
347
- ```yaml
348
- name: TMS Validation
349
-
350
- on:
351
- push:
352
- branches: [main]
353
- pull_request:
354
- branches: [main]
355
-
356
- jobs:
357
- validate:
358
- uses: cortex-tms/cortex-tms/.github/workflows/validate-reusable.yml@main
359
- ```
360
-
361
- **With Custom Configuration**:
362
-
363
- ```yaml
364
- jobs:
365
- validate:
366
- uses: cortex-tms/cortex-tms/.github/workflows/validate-reusable.yml@main
367
- with:
368
- strict: true # Enable strict mode (default: true)
369
- scope: 'standard' # Validation scope (default: auto-detect)
370
- ignore-files: 'README.md' # Comma-separated files to ignore
371
- cortex-version: 'latest' # Cortex TMS version (default: latest)
372
- node-version: '20' # Node.js version (default: 20)
373
- ```
374
-
375
- **Available Inputs**:
376
-
377
- | Input | Description | Default |
378
- |:------|:------------|:--------|
379
- | `strict` | Enable strict validation mode (fails on warnings) | `true` |
380
- | `scope` | Validation scope (nano/standard/enterprise/auto-detect) | `auto-detect` |
381
- | `ignore-files` | Comma-separated list of files to ignore | `''` |
382
- | `cortex-version` | Cortex TMS version to install (e.g., "latest", "2.7.0") | `latest` |
383
- | `node-version` | Node.js version to use | `20` |
207
+ ### `cortex-tms tutorial`
384
208
 
385
- **Example with Multiple Ignored Files**:
209
+ Interactive walkthrough teaching the Cortex Way.
386
210
 
387
- ```yaml
388
- jobs:
389
- validate:
390
- uses: cortex-tms/cortex-tms/.github/workflows/validate-reusable.yml@main
391
- with:
392
- strict: false
393
- ignore-files: 'README.md,CHANGELOG.md,docs/archive/*'
211
+ ```bash
212
+ cortex-tms tutorial # 5-lesson guided tour (~15 minutes)
394
213
  ```
395
214
 
396
- **Benefits**:
397
-
398
- - βœ… Zero-friction adoption (no local installation required)
399
- - βœ… Validates PRs automatically
400
- - βœ… Consistent enforcement across team
401
- - βœ… Works with any project using Cortex TMS
402
-
403
215
  ---
404
216
 
405
- ## πŸ“‚ Documentation Structure
217
+ ## Documentation Structure
406
218
 
407
- | Folder / File | Purpose | AI Context Tier |
219
+ | Folder / File | Purpose | Tier |
408
220
  | :-------------------------------- | :------------------------------------- | :------------------------ |
409
221
  | `NEXT-TASKS.md` | Active sprint and current focus | **HOT** (Always Read) |
410
222
  | `PROMPTS.md` | AI interaction templates (Essential 7) | **HOT** (Always Read) |
@@ -417,312 +229,209 @@ jobs:
417
229
  | `docs/core/GIT-STANDARDS.md` | Git & PM conventions | **WARM** (Read on Demand) |
418
230
  | `docs/core/DECISIONS.md` | Architecture Decision Records | **WARM** (Read on Demand) |
419
231
  | `docs/core/GLOSSARY.md` | Project terminology | **WARM** (Read on Demand) |
420
- | `docs/core/SCHEMA.md` | Data models (optional) | **WARM** (Read on Demand) |
421
- | `docs/core/TROUBLESHOOTING.md` | Framework gotchas (optional) | **WARM** (Read on Demand) |
422
232
  | `docs/archive/` | Historical changelogs | **COLD** (Ignore) |
423
233
 
424
- **Context Budget Limits**: To keep HOT files efficient:
425
-
426
- - `NEXT-TASKS.md`: Stay under **200 lines** (archive completed sprints to `docs/archive/`)
427
- - `.github/copilot-instructions.md`: Stay under **100 lines** (critical rules only)
428
-
429
- **Archive Trigger**: When a sprint completes, move tasks from `NEXT-TASKS.md` to `docs/archive/sprint-vX.X-YYYY-MM.md`.
234
+ **HOT/WARM/COLD System**: Organizes docs by access frequency (not token optimization). Helps AI find what's relevant for each task.
430
235
 
431
236
  ---
432
237
 
433
- ## πŸš€ What's New in v2.6.1 (Current Published Release)
434
-
435
- ### Token Counter - Prove Your Savings (GREEN GOVERNANCE)
436
-
437
- - **Real-Time Token Analysis**: `cortex status --tokens` shows HOT/WARM/COLD breakdown
438
- - **Multi-Model Cost Comparison**: Claude Sonnet 4.5, Opus 4.5, GPT-4, and more
439
- - **Sustainability Metrics**: Track your sustainability impact from less compute
440
- - **60-70% Input Token Reduction**: Measured on Cortex TMS itself (3,647 vs 66,834 tokens)
441
- - **Universal Savings**: Lower costs for paid models, less compute for free models
442
-
443
- ### Guardian Semantic Validation (QUALITY ENFORCEMENT)
444
-
445
- - **Pattern Enforcement**: `cortex review <file>` validates against PATTERNS.md
446
- - **Domain Logic Checker**: Audits code against immutable project rules
447
- - **High Accuracy**: 80%+ accuracy target with Safe Mode (from 65.5% baseline)
448
- - **LLM-Powered Detection**: Uses Claude/GPT to catch semantic violations, not just syntax
449
-
450
- ### Integration Test Suite (PRODUCTION QUALITY)
451
-
452
- - **111 Passing Tests**: 96 unit + 15 integration tests
453
- - **End-to-End Workflows**: Validates command interactions work correctly
454
- - **Error Recovery Testing**: Ensures rollback and fix workflows function
455
- - **CI/CD Ready**: ~8.5s execution time, zero flakiness
456
-
457
- ### Error Handling Refactor (DEVELOPER EXPERIENCE)
238
+ ## Staleness Detection Configuration
239
+
240
+ Configure staleness thresholds in `.cortexrc`:
241
+
242
+ ```json
243
+ {
244
+ "version": "4.0.0",
245
+ "scope": "standard",
246
+ "staleness": {
247
+ "enabled": true,
248
+ "thresholdDays": 30,
249
+ "minCommits": 3,
250
+ "docs": {
251
+ "docs/core/PATTERNS.md": ["src/"],
252
+ "docs/core/ARCHITECTURE.md": ["src/", "infrastructure/"],
253
+ "docs/core/DOMAIN-LOGIC.md": ["src/"]
254
+ }
255
+ }
256
+ }
257
+ ```
458
258
 
459
- - **Clean Exit Management**: Removed 17 `process.exit()` calls from command files
460
- - **Better Testability**: Commands throw errors instead of forcing exits
461
- - **Centralized Error Handler**: Commander.js `exitOverride()` for consistent behavior
259
+ **How it works**:
260
+ - Compares doc last modified date vs code commit activity
261
+ - Flags stale if: `daysSinceDocUpdate > thresholdDays AND meaningfulCommits >= minCommits`
262
+ - Excludes merge commits, test-only changes, lockfile-only changes
462
263
 
463
- ### What's in v2.6.1 and Earlier
264
+ **Limitations (v1)**:
265
+ - Temporal comparison only (git timestamps)
266
+ - Cannot detect semantic misalignment
267
+ - Requires full git history (not shallow clones)
464
268
 
465
- - **Interactive Tutorial**: 5-lesson guided walkthrough (<15 minutes)
466
- - **Safe-Fail Migration**: Automatic backups with one-click rollback
467
- - **Zero-Drift Governance**: Automated version sync with CI Guardian
468
- - **Self-Healing Validation**: `--fix` flag auto-repairs common issues
469
- - **Migration Auditor**: Version tracking and customization detection
470
- - **Prompt Engine**: Essential 7 library with clipboard integration
269
+ **CI Setup**: Ensure `fetch-depth: 0` in GitHub Actions to enable staleness detection.
471
270
 
472
271
  ---
473
272
 
474
- ## πŸ€– How to Work with AI Agents
475
-
476
- This repo is a **"Machine-Legible Project Constitution."** To get the best results:
273
+ ## CI/CD Integration
477
274
 
478
- ### 1. The Context Trigger
275
+ Add to `.github/workflows/validate.yml`:
479
276
 
480
- ```bash
481
- cortex-tms prompt init-session
482
- # Copies: "Review NEXT-TASKS.md, docs/core/ARCHITECTURE.md, and CLAUDE.md.
483
- # Summarize current priorities and propose a step-by-step plan..."
484
- ```
277
+ ```yaml
278
+ name: Cortex TMS Validation
485
279
 
486
- ### 2. Pattern Enforcement
280
+ on: [push, pull_request]
487
281
 
488
- ```bash
489
- cortex-tms prompt review
490
- # Copies: "Review the current changes against PATTERNS.md.
491
- # Flag any violations and suggest specific fixes."
282
+ jobs:
283
+ validate:
284
+ runs-on: ubuntu-latest
285
+ steps:
286
+ - uses: actions/checkout@v4
287
+ with:
288
+ fetch-depth: 0 # Required for staleness detection
289
+
290
+ - uses: actions/setup-node@v4
291
+ with:
292
+ node-version: '20'
293
+
294
+ - name: Validate TMS Health
295
+ run: npx cortex-tms@latest validate --strict
492
296
  ```
493
297
 
494
- ### 3. Truth Anchoring
495
-
496
- If the AI hallucinates logic:
497
-
498
- > _"Your calculation is wrong. Refer to the rules in docs/core/DOMAIN-LOGIC.md."_
499
-
500
- ### 4. Check Current Sprint
501
-
502
- ```bash
503
- cortex-tms status # Visual dashboard with current tasks
504
- ```
298
+ **Strict mode**: Warnings become errors, failing the build if:
299
+ - Governance docs are stale
300
+ - File size limits exceeded
301
+ - Mandatory files missing
302
+ - Placeholders not replaced
505
303
 
506
304
  ---
507
305
 
508
- ## πŸ“‹ Development Roadmap
509
-
510
- **Completed Phases** (All βœ…):
306
+ ## What's New in v4.0
511
307
 
512
- - [x] **Phase 1**: Dogfood the System - Applied TMS to Cortex itself
513
- - [x] **Phase 2**: Complete Template Library - All templates built and validated
514
- - [x] **Phase 3**: Build Example App - Gold Standard Next.js 15 Todo App
515
- - [x] **Phase 4**: Create CLI Tool - Full-featured CLI with 6 commands
516
- - [x] **Phase 5**: Documentation & Guides - Status dashboard, snippets, validation
517
- - [x] **Phase 6**: Publish & Scale - npm package + GitHub releases
308
+ **🎯 Strategic Repositioning**: Quality governance over token optimization
518
309
 
519
- **Current Version**: v2.6.1 "Guardian & Green Governance" βœ…
310
+ **Context**: Modern AI models (GPT-4, Claude Opus 4.6) now handle large contexts (200K+ tokens). The bottleneck shifted from "can AI see enough?" to "will AI stay aligned with project standards?"
520
311
 
521
- - βœ… Token Counter with real-time cost analysis
522
- - βœ… Guardian semantic validation (Pattern + Domain Logic enforcement)
523
- - βœ… 111 passing tests (96 unit + 15 integration)
524
- - βœ… Error handling refactor for better testability
525
- - βœ… Multi-model cost comparison (Claude, GPT-4)
312
+ ### New Features
526
313
 
527
- **Next Phase (v3.0)**: Development & Refinement
314
+ **Staleness Detection** (v4.0):
315
+ - βœ… Git-based freshness checks for governance docs
316
+ - βœ… Configurable thresholds (days + commit count)
317
+ - βœ… Per-doc watch directories
318
+ - βœ… Exclude merges, test-only, lockfile-only commits
319
+ - βœ… CI-ready (with `fetch-depth: 0`)
528
320
 
529
- - Website performance optimization
530
- - Guardian enhancements and reliability improvements
531
- - Migration experience improvements
532
- - Advanced token analytics
321
+ **Archive Command**:
322
+ - βœ… `cortex-tms archive` - Archive completed tasks
323
+ - βœ… Replaces deprecated `auto-tier` command
324
+ - βœ… Dry-run mode for previewing changes
533
325
 
534
- See `NEXT-TASKS.md` for current sprint details and `CHANGELOG.md` for full version history.
326
+ **Simplified Status**:
327
+ - βœ… Removed `--tokens` flag (streamlined to governance focus)
328
+ - βœ… Shows: project health, sprint progress, backlog
535
329
 
536
- ---
330
+ ### Breaking Changes
537
331
 
538
- ## πŸ—οΈ Project Structure
332
+ **Removed**:
333
+ - ❌ `cortex-tms status --tokens` flag
334
+ - ❌ Token counting and cost analysis features
539
335
 
540
- ```
541
- cortex-tms/
542
- β”œβ”€β”€ NEXT-TASKS.md # HOT: Current sprint
543
- β”œβ”€β”€ PROMPTS.md # HOT: AI interaction templates
544
- β”œβ”€β”€ FUTURE-ENHANCEMENTS.md # PLANNING: Backlog
545
- β”œβ”€β”€ CLAUDE.md # HOT: Workflow config
546
- β”œβ”€β”€ README.md # This file
547
- β”œβ”€β”€ .github/
548
- β”‚ └── copilot-instructions.md # HOT: AI guardrails
549
- β”œβ”€β”€ bin/ # CLI executable
550
- β”œβ”€β”€ src/ # CLI source code
551
- β”‚ β”œβ”€β”€ commands/ # CLI commands (init, validate, status, migrate, prompt, tutorial)
552
- β”‚ β”œβ”€β”€ utils/ # Template processing, validation, prompt parsing, backup
553
- β”‚ └── types/ # TypeScript definitions
554
- β”œβ”€β”€ templates/ # User-facing boilerplate
555
- β”‚ β”œβ”€β”€ NEXT-TASKS.md
556
- β”‚ β”œβ”€β”€ PROMPTS.md # Essential 7 prompt library
557
- β”‚ β”œβ”€β”€ CLAUDE.md
558
- β”‚ β”œβ”€β”€ .github/
559
- β”‚ β”‚ └── copilot-instructions.md
560
- β”‚ β”œβ”€β”€ vscode/
561
- β”‚ β”‚ └── tms.code-snippets # VS Code productivity snippets
562
- β”‚ └── docs/
563
- β”‚ β”œβ”€β”€ core/
564
- β”‚ β”‚ β”œβ”€β”€ ARCHITECTURE.md
565
- β”‚ β”‚ β”œβ”€β”€ PATTERNS.md
566
- β”‚ β”‚ β”œβ”€β”€ DOMAIN-LOGIC.md
567
- β”‚ β”‚ β”œβ”€β”€ GIT-STANDARDS.md
568
- β”‚ β”‚ β”œβ”€β”€ DECISIONS.md
569
- β”‚ β”‚ β”œβ”€β”€ GLOSSARY.md
570
- β”‚ β”‚ β”œβ”€β”€ SCHEMA.md
571
- β”‚ β”‚ └── TROUBLESHOOTING.md
572
- β”‚ └── archive/
573
- β”‚ └── v1.0-CHANGELOG.md
574
- β”œβ”€β”€ docs/ # Cortex TMS project documentation
575
- β”‚ β”œβ”€β”€ core/
576
- β”‚ └── archive/
577
- └── examples/ # Reference implementations
578
- └── todo-app/ # βœ… Gold Standard Next.js 15 App
579
- ```
580
-
581
- ---
336
+ **Deprecated**:
337
+ - ⚠️ `cortex-tms auto-tier` β†’ Use `cortex-tms archive` (still works with warning)
582
338
 
583
- ## πŸ§ͺ Validation: Dogfooding
339
+ **Migration**:
340
+ - Status command: Use `cortex-tms status` (no flags needed)
341
+ - Archive tasks: Use `cortex-tms archive` instead of `auto-tier`
584
342
 
585
- **This repository uses TMS to build itself.**
586
-
587
- - Cortex's own `NEXT-TASKS.md` tracks Cortex development
588
- - Cortex's own `docs/core/PATTERNS.md` documents template patterns
589
- - Cortex's own `PROMPTS.md` guides AI collaboration on Cortex
590
-
591
- **Validation Test**: "Can an AI agent working on Cortex find what it needs in < 3 file reads?" βœ…
343
+ See [CHANGELOG.md](CHANGELOG.md) for full version history.
592
344
 
593
345
  ---
594
346
 
595
- ## πŸ“š Key Documentation
347
+ ## When to Use Cortex TMS
596
348
 
597
- - **For AI Agents**: Read `.github/copilot-instructions.md` and `PROMPTS.md` first
598
- - **For Developers**: Read `docs/core/ARCHITECTURE.md` for system design
599
- - **For Contributors**: Read `docs/core/PATTERNS.md` for template patterns
600
- - **For Understanding**: Read `docs/core/DOMAIN-LOGIC.md` for TMS principles
349
+ ### βœ… Good Fit
601
350
 
602
- ---
351
+ - **Multi-file projects** - Complex codebases with established patterns
352
+ - **Team projects** - Multiple developers + AI agents need consistency
353
+ - **Long-running projects** - Documentation drift is a real risk
354
+ - **AI-heavy workflows** - Using Claude Code, Cursor, Copilot extensively
355
+ - **Quality-focused** - You value consistent code over speed
603
356
 
604
- ## 🀝 Contributing
357
+ ### ⚠️ Maybe Not
605
358
 
606
- We welcome contributions! Please read **[CONTRIBUTING.md](CONTRIBUTING.md)** for detailed guidelines on:
607
- - How to submit bug reports and feature requests
608
- - Development setup and workflow
609
- - Pull request process and quality standards
610
- - Code style and testing requirements
611
- - Areas where we need help
359
+ - **Single-file projects** - Overhead may outweigh benefits
360
+ - **Throwaway prototypes** - Documentation governance not worth setup time
361
+ - **Solo dev, simple project** - Mental model may be sufficient
362
+ - **Pure exploration** - Constraints may slow discovery
612
363
 
613
- **Quick Start for Contributors**:
614
- 1. Read [CONTRIBUTING.md](CONTRIBUTING.md) - **Required for all contributions**
615
- 2. Check [open issues](https://github.com/cortex-tms/cortex-tms/issues) for `good-first-issue` labels
616
- 3. For significant changes, open an issue for discussion **before** coding
617
- 4. Follow patterns in `docs/core/PATTERNS.md`
618
- 5. Ensure tests pass: `npm test`
619
- 6. Submit PR with clear description and linked issue
364
+ **Start simple**: Use `--scope nano` for minimal setup, expand as needed.
620
365
 
621
366
  ---
622
367
 
623
- ## πŸ“– Learn More
368
+ ## Developer Experience
624
369
 
625
- - **Release Notes**: See `CHANGELOG.md` for version history
626
- - **Architecture**: See `docs/core/ARCHITECTURE.md` for system design
627
- - **Decisions**: See `docs/core/DECISIONS.md` for ADRs
628
- - **Glossary**: See `docs/core/GLOSSARY.md` for terminology
629
- - **Patterns**: See `docs/core/PATTERNS.md` for implementation examples
370
+ - **Instant Setup**: `npx cortex-tms init` - 60 seconds to governance docs
371
+ - **Zero Config**: Works out of the box with sensible defaults
372
+ - **CI Ready**: GitHub Actions templates included
373
+ - **Production Grade**: 316 tests (97% pass rate), enterprise-grade security (v3.2)
374
+ - **Open Source**: MIT license, community-driven
630
375
 
631
- ---
376
+ **Tested With**: Claude Code, GitHub Copilot (in VS Code). Architecture supports any AI tool.
632
377
 
633
- ## 🎯 Why Cortex TMS? Three Pillars, Measurable Results
634
-
635
- **Based on 47 development sessions on Cortex TMS itself (TypeScript monorepo) using Claude Code and GitHub Copilot with various models. Your results may vary.**
636
-
637
- ### πŸ’° Cost Efficiency (Pillar 1) - Input Token Reduction
638
-
639
- **Before TMS**: AI reads entire repository (66,834 tokens in our case)
640
- **After TMS**: AI reads focused context (3,647 tokensβ€”60-70% reduction)
641
- **Impact**:
642
- - **Paid models** (tested: Claude, GPT-4): ~60-70% lower API costs
643
- - **Free/local models** (untested, but architecturally supported): Should see ~60-70% less compute/electricity
644
- - **Universal benefit**: Input token reduction works with any AI tool
645
-
646
- **How**: HOT/WARM/COLD tiers ensure AI only reads what matters (3,647 vs 66,834 tokens measured on our project with Claude/GPT)
647
-
648
- ### βœ… Quality (Pillar 2) - Focused Context Means Fewer Hallucinations
649
-
650
- **Before TMS**: AI reads thousands of outdated lines, leading to pattern violations
651
- **After TMS**: AI reads focused, current contextβ€”fewer mistakes from irrelevant information
652
- **Impact**: Guardian enforces `PATTERNS.md` and `DOMAIN-LOGIC.md` automatically
653
-
654
- **How**: LLM-powered semantic review catches drift that grep/regex can't find
655
-
656
- ### 🌱 Sustainability (Pillar 3) - Greener Development Through Efficiency
657
-
658
- **Before TMS**: Burning GPU cycles on archived changelogs and stale tasks
659
- **After TMS**: 60-70% lower compute requirements through intelligent tiering
660
- **Impact**: Less compute = lower electricity costs + greener development
661
- - Especially important for free/local models where YOU pay the electricity bill
662
-
663
- **How**: Stop reading COLD files unless explicitly needed
378
+ ---
664
379
 
665
- ### πŸš€ Developer Experience
380
+ ## Community & Support
666
381
 
667
- - **Instant AI Activation**: Essential 7 prompts in `PROMPTS.md` (no manual prompt writing)
668
- - **Signal over Noise**: HOT/WARM/COLD system keeps AI focused
669
- - **Production-Ready**: 316 tests (97% pass rate), enterprise-grade security (v3.2)
670
- - **Tested With**: Claude Code, GitHub Copilot (in VS Code). Architecture supports any AI tool (Cursor, etc.).
382
+ ### Get Help
671
383
 
672
- ---
384
+ - **[GitHub Discussions](https://github.com/cortex-tms/cortex-tms/discussions)** - Ask questions, share ideas
385
+ - [Q&A](https://github.com/cortex-tms/cortex-tms/discussions/categories/q-a) - Get help from community
386
+ - [Ideas](https://github.com/cortex-tms/cortex-tms/discussions/categories/ideas) - Suggest features
387
+ - [Show and Tell](https://github.com/cortex-tms/cortex-tms/discussions/categories/show-and-tell) - Share projects
673
388
 
674
- ## πŸ”’ Security
389
+ ### Report Issues
675
390
 
676
- Cortex TMS implements enterprise-grade security practices:
391
+ - **[Bug Reports](https://github.com/cortex-tms/cortex-tms/issues/new)** - Found a bug? Let us know
392
+ - **[Security Issues](https://github.com/cortex-tms/cortex-tms/security/advisories/new)** - Responsible disclosure
677
393
 
678
- - **API Key Protection**: Guardian automatically sanitizes API keys in all output (errors, logs, console)
679
- - **Input Validation**: All CLI commands use Zod schemas for runtime type safety
680
- - **Path Security**: Template operations protected against directory traversal attacks
681
- - **Automated Scanning**: CI pipeline includes `pnpm audit` to catch dependency vulnerabilities
394
+ ### Contributing
682
395
 
683
- **Documentation**:
684
- - [Security Overview](docs/core/SECURITY.md) β€” Threat model, mitigations, and best practices
685
- - [Security Testing Guide](docs/guides/SECURITY-TESTING.md) β€” How to verify security patterns
686
- - [Security Patterns](docs/core/PATTERNS.md) β€” Implementation patterns (Error Handling, Input Validation)
396
+ - **[Contributing Guide](CONTRIBUTING.md)** - How to contribute
397
+ - **[Community Guide](docs/COMMUNITY.md)** - Community guidelines
687
398
 
688
- **Reporting Vulnerabilities**: Use [GitHub Security Advisories](https://github.com/cortex-tms/cortex-tms/security/advisories/new) for responsible disclosure.
399
+ **Star us on GitHub** ⭐ if Cortex TMS helps your AI development workflow!
689
400
 
690
401
  ---
691
402
 
692
- ## πŸ’¬ Community & Support
693
-
694
- We have an active and growing community! ⭐ **146 stars** and counting.
403
+ ## Roadmap
695
404
 
696
- ### Get Help & Connect
697
- - **[GitHub Discussions](https://github.com/cortex-tms/cortex-tms/discussions)** - Ask questions, share ideas, showcase projects
698
- - [Q&A](https://github.com/cortex-tms/cortex-tms/discussions/categories/q-a) - Get help from the community
699
- - [Ideas](https://github.com/cortex-tms/cortex-tms/discussions/categories/ideas) - Suggest features (vote with πŸ‘)
700
- - [Show and Tell](https://github.com/cortex-tms/cortex-tms/discussions/categories/show-and-tell) - Share what you've built
701
- - [Announcements](https://github.com/cortex-tms/cortex-tms/discussions/categories/announcements) - Release notes and updates
405
+ **v4.0** (Current - Feb 2026):
406
+ - βœ… Staleness detection (git-based, v1)
407
+ - βœ… Archive command
408
+ - βœ… Validation-first positioning
409
+ - βœ… Token claims removed
702
410
 
703
- ### Report Issues
704
- - **[Bug Reports](https://github.com/cortex-tms/cortex-tms/issues/new)** - Found a bug? Let us know!
705
- - **[Security Issues](https://github.com/cortex-tms/cortex-tms/security/advisories/new)** - Responsible disclosure for security vulnerabilities
411
+ **v4.1** (Planned - Mar 2026):
412
+ - πŸ”„ Git hooks integration (`cortex-tms hooks install`)
413
+ - πŸ”„ Staleness v2 (improved heuristics, fewer false positives)
414
+ - πŸ”„ Incremental doc updates
706
415
 
707
- ### Contributing
708
- - **[Contributing Guide](CONTRIBUTING.md)** - How to contribute code, docs, or ideas
709
- - **[Community Guide](docs/COMMUNITY.md)** - Community guidelines and best practices
416
+ **v4.2+** (Future):
417
+ - πŸ“‹ MCP Server (expose docs to any AI tool)
418
+ - πŸ“‹ Multi-tool config generation (.cursorrules, .windsurfrules)
419
+ - πŸ“‹ Skills integration
710
420
 
711
- **Star us on GitHub** ⭐ if you find Cortex TMS useful!
421
+ See [FUTURE-ENHANCEMENTS.md](FUTURE-ENHANCEMENTS.md) for full roadmap.
712
422
 
713
423
  ---
714
424
 
715
425
  ## License
716
426
 
717
- MIT
427
+ MIT - See [LICENSE](LICENSE) for details
718
428
 
719
429
  ---
720
430
 
721
431
  ## Status
722
432
 
723
- **Version**: 3.2.0 (Upcoming - Phase 1 Complete)
724
- **Last Updated**: 2026-01-31
725
- **Current Sprint**: v3.2 - "Security Hardening + Production Readiness"
726
- **Recent Sprints**: v3.1 (Git-Based Auto-Tiering), v3.0 (AI-Powered Onboarding) β€” see [docs/archive/](docs/archive/)
433
+ **Version**: 4.0.0 (In Development)
434
+ **Last Updated**: 2026-02-21
435
+ **Current Sprint**: v4.0 - "Quality Governance & Staleness Detection"
727
436
 
728
- <!-- @cortex-tms-version 3.2.0 -->
437
+ <!-- @cortex-tms-version 4.0.0 -->