cortex-tms 3.2.0 β 4.0.1
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/README.md +245 -526
- package/dist/cli.js +52 -32
- package/dist/cli.js.map +1 -1
- package/dist/commands/archive.d.ts +5 -0
- package/dist/commands/archive.d.ts.map +1 -0
- package/dist/commands/archive.js +85 -0
- package/dist/commands/archive.js.map +1 -0
- package/dist/commands/auto-tier.d.ts +1 -1
- package/dist/commands/auto-tier.d.ts.map +1 -1
- package/dist/commands/auto-tier.js +77 -76
- package/dist/commands/auto-tier.js.map +1 -1
- package/dist/commands/dashboard.d.ts +3 -0
- package/dist/commands/dashboard.d.ts.map +1 -0
- package/dist/commands/dashboard.js +20 -0
- package/dist/commands/dashboard.js.map +1 -0
- package/dist/commands/init.d.ts +1 -1
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +73 -73
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/migrate.d.ts +2 -2
- package/dist/commands/migrate.d.ts.map +1 -1
- package/dist/commands/migrate.js +147 -136
- package/dist/commands/migrate.js.map +1 -1
- package/dist/commands/prompt.d.ts +1 -1
- package/dist/commands/prompt.d.ts.map +1 -1
- package/dist/commands/prompt.js +32 -31
- package/dist/commands/prompt.js.map +1 -1
- package/dist/commands/review.d.ts +1 -1
- package/dist/commands/review.d.ts.map +1 -1
- package/dist/commands/review.js +76 -58
- package/dist/commands/review.js.map +1 -1
- package/dist/commands/status.d.ts +2 -1
- package/dist/commands/status.d.ts.map +1 -1
- package/dist/commands/status.js +54 -144
- package/dist/commands/status.js.map +1 -1
- package/dist/commands/tutorial.d.ts +1 -1
- package/dist/commands/tutorial.js +168 -168
- package/dist/commands/tutorial.js.map +1 -1
- package/dist/commands/validate.d.ts +1 -1
- package/dist/commands/validate.d.ts.map +1 -1
- package/dist/commands/validate.js +60 -60
- package/dist/commands/validate.js.map +1 -1
- package/dist/types/cli.d.ts +23 -15
- package/dist/types/cli.d.ts.map +1 -1
- package/dist/types/guardian.d.ts +2 -2
- package/dist/ui/components/Dashboard.d.ts +11 -0
- package/dist/ui/components/Dashboard.d.ts.map +1 -0
- package/dist/ui/components/Dashboard.js +64 -0
- package/dist/ui/components/Dashboard.js.map +1 -0
- package/dist/ui/components/dashboard/ContextReductionCard.d.ts +9 -0
- package/dist/ui/components/dashboard/ContextReductionCard.d.ts.map +1 -0
- package/dist/ui/components/dashboard/ContextReductionCard.js +38 -0
- package/dist/ui/components/dashboard/ContextReductionCard.js.map +1 -0
- package/dist/ui/components/dashboard/CostSavingsCard.d.ts +10 -0
- package/dist/ui/components/dashboard/CostSavingsCard.d.ts.map +1 -0
- package/dist/ui/components/dashboard/CostSavingsCard.js +45 -0
- package/dist/ui/components/dashboard/CostSavingsCard.js.map +1 -0
- package/dist/ui/components/dashboard/FileDistributionCard.d.ts +10 -0
- package/dist/ui/components/dashboard/FileDistributionCard.d.ts.map +1 -0
- package/dist/ui/components/dashboard/FileDistributionCard.js +51 -0
- package/dist/ui/components/dashboard/FileDistributionCard.js.map +1 -0
- package/dist/ui/components/dashboard/FileSizeHealthCard.d.ts +15 -0
- package/dist/ui/components/dashboard/FileSizeHealthCard.d.ts.map +1 -0
- package/dist/ui/components/dashboard/FileSizeHealthCard.js +48 -0
- package/dist/ui/components/dashboard/FileSizeHealthCard.js.map +1 -0
- package/dist/ui/components/dashboard/Footer.d.ts +3 -0
- package/dist/ui/components/dashboard/Footer.d.ts.map +1 -0
- package/dist/ui/components/dashboard/Footer.js +13 -0
- package/dist/ui/components/dashboard/Footer.js.map +1 -0
- package/dist/ui/components/dashboard/GovernanceHealthCard.d.ts +10 -0
- package/dist/ui/components/dashboard/GovernanceHealthCard.d.ts.map +1 -0
- package/dist/ui/components/dashboard/GovernanceHealthCard.js +46 -0
- package/dist/ui/components/dashboard/GovernanceHealthCard.js.map +1 -0
- package/dist/ui/components/dashboard/GuardianStatusCard.d.ts +10 -0
- package/dist/ui/components/dashboard/GuardianStatusCard.d.ts.map +1 -0
- package/dist/ui/components/dashboard/GuardianStatusCard.js +71 -0
- package/dist/ui/components/dashboard/GuardianStatusCard.js.map +1 -0
- package/dist/ui/components/dashboard/Header.d.ts +7 -0
- package/dist/ui/components/dashboard/Header.d.ts.map +1 -0
- package/dist/ui/components/dashboard/Header.js +21 -0
- package/dist/ui/components/dashboard/Header.js.map +1 -0
- package/dist/ui/components/dashboard/HotFilesCard.d.ts +8 -0
- package/dist/ui/components/dashboard/HotFilesCard.d.ts.map +1 -0
- package/dist/ui/components/dashboard/HotFilesCard.js +28 -0
- package/dist/ui/components/dashboard/HotFilesCard.js.map +1 -0
- package/dist/ui/components/dashboard/NotConfiguredCard.d.ts +10 -0
- package/dist/ui/components/dashboard/NotConfiguredCard.d.ts.map +1 -0
- package/dist/ui/components/dashboard/NotConfiguredCard.js +13 -0
- package/dist/ui/components/dashboard/NotConfiguredCard.js.map +1 -0
- package/dist/ui/components/dashboard/SprintProgressCard.d.ts +11 -0
- package/dist/ui/components/dashboard/SprintProgressCard.d.ts.map +1 -0
- package/dist/ui/components/dashboard/SprintProgressCard.js +33 -0
- package/dist/ui/components/dashboard/SprintProgressCard.js.map +1 -0
- package/dist/ui/components/dashboard/StalenessCard.d.ts +10 -0
- package/dist/ui/components/dashboard/StalenessCard.d.ts.map +1 -0
- package/dist/ui/components/dashboard/StalenessCard.js +43 -0
- package/dist/ui/components/dashboard/StalenessCard.js.map +1 -0
- package/dist/ui/components/dashboard/TabBar.d.ts +8 -0
- package/dist/ui/components/dashboard/TabBar.d.ts.map +1 -0
- package/dist/ui/components/dashboard/TabBar.js +16 -0
- package/dist/ui/components/dashboard/TabBar.js.map +1 -0
- package/dist/ui/components/dashboard/ValidationCard.d.ts +10 -0
- package/dist/ui/components/dashboard/ValidationCard.d.ts.map +1 -0
- package/dist/ui/components/dashboard/ValidationCard.js +62 -0
- package/dist/ui/components/dashboard/ValidationCard.js.map +1 -0
- package/dist/ui/components/dashboard/ViewContainer.d.ts +14 -0
- package/dist/ui/components/dashboard/ViewContainer.d.ts.map +1 -0
- package/dist/ui/components/dashboard/ViewContainer.js +53 -0
- package/dist/ui/components/dashboard/ViewContainer.js.map +1 -0
- package/dist/ui/components/dashboard/index.d.ts +14 -0
- package/dist/ui/components/dashboard/index.d.ts.map +1 -0
- package/dist/ui/components/dashboard/index.js +14 -0
- package/dist/ui/components/dashboard/index.js.map +1 -0
- package/dist/ui/index.d.ts +5 -0
- package/dist/ui/index.d.ts.map +1 -0
- package/dist/ui/index.js +46 -0
- package/dist/ui/index.js.map +1 -0
- package/dist/utils/backup.d.ts.map +1 -1
- package/dist/utils/backup.js +20 -20
- package/dist/utils/backup.js.map +1 -1
- package/dist/utils/config.d.ts +1 -1
- package/dist/utils/config.js +68 -68
- package/dist/utils/detection.d.ts +1 -1
- package/dist/utils/detection.js +25 -25
- package/dist/utils/errors.d.ts.map +1 -1
- package/dist/utils/errors.js +4 -4
- package/dist/utils/errors.js.map +1 -1
- package/dist/utils/git-history.d.ts.map +1 -1
- package/dist/utils/git-history.js +9 -5
- package/dist/utils/git-history.js.map +1 -1
- package/dist/utils/git-staleness.d.ts +13 -0
- package/dist/utils/git-staleness.d.ts.map +1 -0
- package/dist/utils/git-staleness.js +129 -0
- package/dist/utils/git-staleness.js.map +1 -0
- package/dist/utils/guardian-prompt.d.ts.map +1 -1
- package/dist/utils/guardian-prompt.js +1 -1
- package/dist/utils/guardian-prompt.js.map +1 -1
- package/dist/utils/llm-client.d.ts +5 -5
- package/dist/utils/llm-client.d.ts.map +1 -1
- package/dist/utils/llm-client.js +56 -53
- package/dist/utils/llm-client.js.map +1 -1
- package/dist/utils/prompt-parser.d.ts.map +1 -1
- package/dist/utils/prompt-parser.js +13 -17
- package/dist/utils/prompt-parser.js.map +1 -1
- package/dist/utils/prompts.d.ts +1 -1
- package/dist/utils/prompts.d.ts.map +1 -1
- package/dist/utils/prompts.js +74 -49
- package/dist/utils/prompts.js.map +1 -1
- package/dist/utils/sanitize.js +6 -6
- package/dist/utils/sanitize.js.map +1 -1
- package/dist/utils/stats-collector.d.ts +56 -0
- package/dist/utils/stats-collector.d.ts.map +1 -0
- package/dist/utils/stats-collector.js +244 -0
- package/dist/utils/stats-collector.js.map +1 -0
- package/dist/utils/status.d.ts +1 -1
- package/dist/utils/status.d.ts.map +1 -1
- package/dist/utils/status.js +16 -16
- package/dist/utils/status.js.map +1 -1
- package/dist/utils/templates.d.ts +3 -3
- package/dist/utils/templates.d.ts.map +1 -1
- package/dist/utils/templates.js +59 -54
- package/dist/utils/templates.js.map +1 -1
- package/dist/utils/tier-tags.d.ts +1 -1
- package/dist/utils/tier-tags.js +2 -2
- package/dist/utils/token-counter.d.ts +1 -43
- package/dist/utils/token-counter.d.ts.map +1 -1
- package/dist/utils/token-counter.js +32 -80
- package/dist/utils/token-counter.js.map +1 -1
- package/dist/utils/validation.d.ts +2 -11
- package/dist/utils/validation.d.ts.map +1 -1
- package/dist/utils/validation.js +26 -39
- package/dist/utils/validation.js.map +1 -1
- package/dist/utils/validator.d.ts +1 -1
- package/dist/utils/validator.d.ts.map +1 -1
- package/dist/utils/validator.js +145 -73
- package/dist/utils/validator.js.map +1 -1
- package/package.json +10 -5
- package/templates/CLAUDE.md +1 -1
- package/templates/FUTURE-ENHANCEMENTS.md +1 -1
- package/templates/NEXT-TASKS.md +1 -1
- package/templates/PROMPTS.md +1 -1
- package/templates/README.md +1 -1
- package/templates/docs/archive/v1.0-CHANGELOG.md +1 -1
- package/templates/docs/core/ARCHITECTURE.md +1 -1
- package/templates/docs/core/DECISIONS.md +1 -1
- package/templates/docs/core/DOMAIN-LOGIC.md +1 -1
- package/templates/docs/core/GLOSSARY.md +1 -1
- package/templates/docs/core/PATTERNS.md +1 -1
- package/templates/docs/core/SCHEMA.md +1 -1
- 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>
|
|
8
|
+
<strong>Documentation Governance for AI Coding Agents</strong>
|
|
9
9
|
</p>
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
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
|
[](https://www.npmjs.com/package/cortex-tms)
|
|
24
16
|
[](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
|
[](https://nodejs.org)
|
|
27
19
|
[](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
|
-
##
|
|
34
|
-
|
|
35
|
-
Get started in under 60 seconds (no installation required):
|
|
23
|
+
## What is Cortex TMS?
|
|
36
24
|
|
|
37
|
-
|
|
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
|
-
|
|
42
|
-
npx cortex-tms@latest status
|
|
27
|
+
**The Challenge**: Modern AI agents 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
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
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
|
-
|
|
35
|
+
---
|
|
53
36
|
|
|
54
|
-
|
|
37
|
+
## Three Pillars
|
|
55
38
|
|
|
56
|
-
|
|
39
|
+
### 1. π Consistency - Document Your Standards
|
|
57
40
|
|
|
58
|
-
|
|
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
|
-
|
|
47
|
+
**Result**: AI writes code that follows YOUR patterns, not random conventions from its training data.
|
|
61
48
|
|
|
62
|
-
|
|
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
|
-
|
|
53
|
+
```bash
|
|
54
|
+
cortex-tms validate
|
|
67
55
|
|
|
68
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
**
|
|
67
|
+
**Note**: Staleness v1 uses git timestamps (temporal comparison only). Cannot detect semantic misalignment. Future versions will add semantic analysis.
|
|
82
68
|
|
|
83
|
-
|
|
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
|
-
|
|
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
|
-
**
|
|
76
|
+
**Result**: AI agents stay powerful but don't run wild.
|
|
90
77
|
|
|
91
78
|
---
|
|
92
79
|
|
|
93
|
-
##
|
|
80
|
+
## What Cortex Does (and Doesn't Do)
|
|
94
81
|
|
|
95
|
-
|
|
82
|
+
### β
What Cortex Does
|
|
96
83
|
|
|
97
|
-
|
|
98
|
-
-
|
|
99
|
-
-
|
|
100
|
-
-
|
|
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
|
-
|
|
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
|
-
**
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
**
|
|
93
|
+
- **Not a token optimizer** - Validates documentation health, not context size
|
|
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
|
-
##
|
|
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
|
-
|
|
141
|
-
|
|
142
|
-
|
|
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
|
-
|
|
106
|
+
# Validate doc health (including staleness detection)
|
|
107
|
+
npx cortex-tms@latest validate
|
|
151
108
|
|
|
152
|
-
|
|
109
|
+
# Strict mode (warnings = errors, for CI)
|
|
110
|
+
npx cortex-tms@latest validate --strict
|
|
153
111
|
|
|
154
|
-
|
|
112
|
+
# Check project status
|
|
113
|
+
npx cortex-tms@latest status
|
|
155
114
|
|
|
156
|
-
|
|
157
|
-
cortex-tms
|
|
115
|
+
# Archive completed tasks
|
|
116
|
+
npx cortex-tms@latest archive --dry-run
|
|
158
117
|
```
|
|
159
118
|
|
|
160
|
-
**
|
|
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
|
-
|
|
127
|
+
Scaffold TMS documentation structure with interactive scope selection.
|
|
175
128
|
|
|
176
129
|
```bash
|
|
177
130
|
cortex-tms init # Interactive mode
|
|
@@ -181,230 +134,99 @@ cortex-tms init --dry-run # Preview changes
|
|
|
181
134
|
|
|
182
135
|
### `cortex-tms validate`
|
|
183
136
|
|
|
184
|
-
Verify
|
|
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
|
|
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
|
-
|
|
154
|
+
Text summary of project health and sprint progress.
|
|
195
155
|
|
|
196
156
|
```bash
|
|
197
|
-
cortex-tms status
|
|
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 # Health summary with progress bars
|
|
200
158
|
```
|
|
201
159
|
|
|
202
|
-
|
|
160
|
+
Shows: project identity, validation status, sprint progress, backlog size.
|
|
203
161
|
|
|
204
|
-
-
|
|
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)
|
|
162
|
+
### `cortex-tms dashboard` β¨ New in v4.0
|
|
209
163
|
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
Git-based automatic tier assignment - reduce manual tier management using file recency as a relevance signal.
|
|
164
|
+
Full-screen interactive terminal UI for governance health monitoring.
|
|
213
165
|
|
|
214
166
|
```bash
|
|
215
|
-
cortex-tms
|
|
216
|
-
cortex-tms
|
|
217
|
-
cortex-tms auto-tier --hot 14 --warm 60 # Custom thresholds
|
|
218
|
-
cortex-tms auto-tier --force # Overwrite existing tags
|
|
167
|
+
cortex-tms dashboard # Interactive dashboard (navigate with 1/2/3 keys)
|
|
168
|
+
cortex-tms dashboard --live # Auto-refresh every 5 seconds
|
|
219
169
|
```
|
|
220
170
|
|
|
221
|
-
**
|
|
171
|
+
**Three views** (switch with number keys):
|
|
172
|
+
- **1 β Overview**: Governance health score (0β100), staleness status, sprint progress
|
|
173
|
+
- **2 β Files**: HOT files list, HOT/WARM/COLD distribution, file size health
|
|
174
|
+
- **3 β Health**: Validation status, Guardian violation summary
|
|
175
|
+
|
|
176
|
+
### `cortex-tms archive`
|
|
222
177
|
|
|
223
|
-
|
|
178
|
+
Archive completed tasks and old content.
|
|
224
179
|
|
|
225
|
-
|
|
226
|
-
-
|
|
227
|
-
-
|
|
228
|
-
|
|
229
|
-
- Adds `<!-- @cortex-tms-tier HOT -->` tags to markdown files
|
|
230
|
-
- Respects explicit tier tags unless `--force` is used
|
|
180
|
+
```bash
|
|
181
|
+
cortex-tms archive # Archive completed tasks
|
|
182
|
+
cortex-tms archive --dry-run # Preview what would be archived
|
|
183
|
+
```
|
|
231
184
|
|
|
232
|
-
|
|
185
|
+
Archives completed tasks from NEXT-TASKS.md to `docs/archive/` with timestamp.
|
|
233
186
|
|
|
234
|
-
-
|
|
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
|
|
187
|
+
**Note**: `cortex-tms auto-tier` is deprecatedβuse `archive` instead.
|
|
238
188
|
|
|
239
189
|
### `cortex-tms migrate`
|
|
240
190
|
|
|
241
|
-
Intelligent version managementβdetect outdated templates and
|
|
191
|
+
Intelligent version managementβdetect outdated templates and upgrade safely.
|
|
242
192
|
|
|
243
193
|
```bash
|
|
244
194
|
cortex-tms migrate # Analyze version status
|
|
245
|
-
cortex-tms migrate --apply # Auto-upgrade OUTDATED files
|
|
246
|
-
cortex-tms migrate --
|
|
247
|
-
cortex-tms migrate --rollback # Restore from backup (interactive selection)
|
|
248
|
-
cortex-tms migrate --dry-run # Preview migration plan
|
|
195
|
+
cortex-tms migrate --apply # Auto-upgrade OUTDATED files
|
|
196
|
+
cortex-tms migrate --rollback # Restore from backup
|
|
249
197
|
```
|
|
250
198
|
|
|
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
199
|
### `cortex-tms prompt`
|
|
266
200
|
|
|
267
201
|
Access project-aware AI prompts from the Essential 7 library.
|
|
268
202
|
|
|
269
203
|
```bash
|
|
270
204
|
cortex-tms prompt # Interactive selection
|
|
271
|
-
cortex-tms prompt init-session #
|
|
272
|
-
cortex-tms prompt --list # Browse all prompts
|
|
205
|
+
cortex-tms prompt init-session # Auto-copies to clipboard
|
|
273
206
|
```
|
|
274
207
|
|
|
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
208
|
### `cortex-tms review` π‘οΈ
|
|
286
209
|
|
|
287
|
-
|
|
210
|
+
Guardian: AI-powered semantic validation against project patterns.
|
|
288
211
|
|
|
289
212
|
```bash
|
|
290
|
-
cortex-tms review src/index.ts # Validate
|
|
291
|
-
cortex-tms review src/index.ts --safe #
|
|
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
|
|
213
|
+
cortex-tms review src/index.ts # Validate against PATTERNS.md
|
|
214
|
+
cortex-tms review src/index.ts --safe # High-confidence violations only
|
|
335
215
|
```
|
|
336
216
|
|
|
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` |
|
|
217
|
+
### `cortex-tms tutorial`
|
|
384
218
|
|
|
385
|
-
|
|
219
|
+
Interactive walkthrough teaching the Cortex Way.
|
|
386
220
|
|
|
387
|
-
```
|
|
388
|
-
|
|
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/*'
|
|
221
|
+
```bash
|
|
222
|
+
cortex-tms tutorial # 5-lesson guided tour (~15 minutes)
|
|
394
223
|
```
|
|
395
224
|
|
|
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
225
|
---
|
|
404
226
|
|
|
405
|
-
##
|
|
227
|
+
## Documentation Structure
|
|
406
228
|
|
|
407
|
-
| Folder / File | Purpose |
|
|
229
|
+
| Folder / File | Purpose | Tier |
|
|
408
230
|
| :-------------------------------- | :------------------------------------- | :------------------------ |
|
|
409
231
|
| `NEXT-TASKS.md` | Active sprint and current focus | **HOT** (Always Read) |
|
|
410
232
|
| `PROMPTS.md` | AI interaction templates (Essential 7) | **HOT** (Always Read) |
|
|
@@ -417,312 +239,209 @@ jobs:
|
|
|
417
239
|
| `docs/core/GIT-STANDARDS.md` | Git & PM conventions | **WARM** (Read on Demand) |
|
|
418
240
|
| `docs/core/DECISIONS.md` | Architecture Decision Records | **WARM** (Read on Demand) |
|
|
419
241
|
| `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
242
|
| `docs/archive/` | Historical changelogs | **COLD** (Ignore) |
|
|
423
243
|
|
|
424
|
-
**
|
|
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`.
|
|
244
|
+
**HOT/WARM/COLD System**: Organizes docs by access frequency (not token optimization). Helps AI find what's relevant for each task.
|
|
430
245
|
|
|
431
246
|
---
|
|
432
247
|
|
|
433
|
-
##
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
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)
|
|
248
|
+
## Staleness Detection Configuration
|
|
249
|
+
|
|
250
|
+
Configure staleness thresholds in `.cortexrc`:
|
|
251
|
+
|
|
252
|
+
```json
|
|
253
|
+
{
|
|
254
|
+
"version": "4.0.0",
|
|
255
|
+
"scope": "standard",
|
|
256
|
+
"staleness": {
|
|
257
|
+
"enabled": true,
|
|
258
|
+
"thresholdDays": 30,
|
|
259
|
+
"minCommits": 3,
|
|
260
|
+
"docs": {
|
|
261
|
+
"docs/core/PATTERNS.md": ["src/"],
|
|
262
|
+
"docs/core/ARCHITECTURE.md": ["src/", "infrastructure/"],
|
|
263
|
+
"docs/core/DOMAIN-LOGIC.md": ["src/"]
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
```
|
|
458
268
|
|
|
459
|
-
|
|
460
|
-
-
|
|
461
|
-
-
|
|
269
|
+
**How it works**:
|
|
270
|
+
- Compares doc last modified date vs code commit activity
|
|
271
|
+
- Flags stale if: `daysSinceDocUpdate > thresholdDays AND meaningfulCommits >= minCommits`
|
|
272
|
+
- Excludes merge commits, test-only changes, lockfile-only changes
|
|
462
273
|
|
|
463
|
-
|
|
274
|
+
**Limitations (v1)**:
|
|
275
|
+
- Temporal comparison only (git timestamps)
|
|
276
|
+
- Cannot detect semantic misalignment
|
|
277
|
+
- Requires full git history (not shallow clones)
|
|
464
278
|
|
|
465
|
-
|
|
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
|
|
279
|
+
**CI Setup**: Ensure `fetch-depth: 0` in GitHub Actions to enable staleness detection.
|
|
471
280
|
|
|
472
281
|
---
|
|
473
282
|
|
|
474
|
-
##
|
|
475
|
-
|
|
476
|
-
This repo is a **"Machine-Legible Project Constitution."** To get the best results:
|
|
283
|
+
## CI/CD Integration
|
|
477
284
|
|
|
478
|
-
|
|
285
|
+
Add to `.github/workflows/validate.yml`:
|
|
479
286
|
|
|
480
|
-
```
|
|
481
|
-
|
|
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
|
-
```
|
|
287
|
+
```yaml
|
|
288
|
+
name: Cortex TMS Validation
|
|
485
289
|
|
|
486
|
-
|
|
290
|
+
on: [push, pull_request]
|
|
487
291
|
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
292
|
+
jobs:
|
|
293
|
+
validate:
|
|
294
|
+
runs-on: ubuntu-latest
|
|
295
|
+
steps:
|
|
296
|
+
- uses: actions/checkout@v4
|
|
297
|
+
with:
|
|
298
|
+
fetch-depth: 0 # Required for staleness detection
|
|
299
|
+
|
|
300
|
+
- uses: actions/setup-node@v4
|
|
301
|
+
with:
|
|
302
|
+
node-version: '20'
|
|
303
|
+
|
|
304
|
+
- name: Validate TMS Health
|
|
305
|
+
run: npx cortex-tms@latest validate --strict
|
|
492
306
|
```
|
|
493
307
|
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
### 4. Check Current Sprint
|
|
501
|
-
|
|
502
|
-
```bash
|
|
503
|
-
cortex-tms status # Visual dashboard with current tasks
|
|
504
|
-
```
|
|
308
|
+
**Strict mode**: Warnings become errors, failing the build if:
|
|
309
|
+
- Governance docs are stale
|
|
310
|
+
- File size limits exceeded
|
|
311
|
+
- Mandatory files missing
|
|
312
|
+
- Placeholders not replaced
|
|
505
313
|
|
|
506
314
|
---
|
|
507
315
|
|
|
508
|
-
##
|
|
509
|
-
|
|
510
|
-
**Completed Phases** (All β
):
|
|
316
|
+
## What's New in v4.0
|
|
511
317
|
|
|
512
|
-
|
|
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
|
|
318
|
+
**π― Strategic Repositioning**: Quality governance over token optimization
|
|
518
319
|
|
|
519
|
-
**
|
|
320
|
+
**Context**: Modern AI models handle large contexts and improved reasoning. The bottleneck shifted from "can AI see enough?" to "will AI stay aligned with project standards?"
|
|
520
321
|
|
|
521
|
-
|
|
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)
|
|
322
|
+
### New Features
|
|
526
323
|
|
|
527
|
-
**
|
|
324
|
+
**Staleness Detection** (v4.0):
|
|
325
|
+
- β
Git-based freshness checks for governance docs
|
|
326
|
+
- β
Configurable thresholds (days + commit count)
|
|
327
|
+
- β
Per-doc watch directories
|
|
328
|
+
- β
Exclude merges, test-only, lockfile-only commits
|
|
329
|
+
- β
CI-ready (with `fetch-depth: 0`)
|
|
528
330
|
|
|
529
|
-
|
|
530
|
-
-
|
|
531
|
-
-
|
|
532
|
-
-
|
|
331
|
+
**Archive Command**:
|
|
332
|
+
- β
`cortex-tms archive` - Archive completed tasks
|
|
333
|
+
- β
Replaces deprecated `auto-tier` command
|
|
334
|
+
- β
Dry-run mode for previewing changes
|
|
533
335
|
|
|
534
|
-
|
|
336
|
+
**Simplified Status**:
|
|
337
|
+
- β
Removed `--tokens` flag (streamlined to governance focus)
|
|
338
|
+
- β
Shows: project health, sprint progress, backlog
|
|
535
339
|
|
|
536
|
-
|
|
340
|
+
### Breaking Changes
|
|
537
341
|
|
|
538
|
-
|
|
342
|
+
**Removed**:
|
|
343
|
+
- β `cortex-tms status --tokens` flag
|
|
344
|
+
- β Token counting and cost analysis features
|
|
539
345
|
|
|
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
|
-
---
|
|
346
|
+
**Deprecated**:
|
|
347
|
+
- β οΈ `cortex-tms auto-tier` β Use `cortex-tms archive` (still works with warning)
|
|
582
348
|
|
|
583
|
-
|
|
349
|
+
**Migration**:
|
|
350
|
+
- Status command: Use `cortex-tms status` (no flags needed)
|
|
351
|
+
- Archive tasks: Use `cortex-tms archive` instead of `auto-tier`
|
|
584
352
|
|
|
585
|
-
|
|
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?" β
|
|
353
|
+
See [CHANGELOG.md](CHANGELOG.md) for full version history.
|
|
592
354
|
|
|
593
355
|
---
|
|
594
356
|
|
|
595
|
-
##
|
|
357
|
+
## When to Use Cortex TMS
|
|
596
358
|
|
|
597
|
-
|
|
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
|
|
359
|
+
### β
Good Fit
|
|
601
360
|
|
|
602
|
-
|
|
361
|
+
- **Multi-file projects** - Complex codebases with established patterns
|
|
362
|
+
- **Team projects** - Multiple developers + AI agents need consistency
|
|
363
|
+
- **Long-running projects** - Documentation drift is a real risk
|
|
364
|
+
- **AI-heavy workflows** - Using Claude Code, Cursor, Copilot extensively
|
|
365
|
+
- **Quality-focused** - You value consistent code over speed
|
|
603
366
|
|
|
604
|
-
|
|
367
|
+
### β οΈ Maybe Not
|
|
605
368
|
|
|
606
|
-
|
|
607
|
-
-
|
|
608
|
-
-
|
|
609
|
-
-
|
|
610
|
-
- Code style and testing requirements
|
|
611
|
-
- Areas where we need help
|
|
369
|
+
- **Single-file projects** - Overhead may outweigh benefits
|
|
370
|
+
- **Throwaway prototypes** - Documentation governance not worth setup time
|
|
371
|
+
- **Solo dev, simple project** - Mental model may be sufficient
|
|
372
|
+
- **Pure exploration** - Constraints may slow discovery
|
|
612
373
|
|
|
613
|
-
**
|
|
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
|
|
374
|
+
**Start simple**: Use `--scope nano` for minimal setup, expand as needed.
|
|
620
375
|
|
|
621
376
|
---
|
|
622
377
|
|
|
623
|
-
##
|
|
378
|
+
## Developer Experience
|
|
624
379
|
|
|
625
|
-
- **
|
|
626
|
-
- **
|
|
627
|
-
- **
|
|
628
|
-
- **
|
|
629
|
-
- **
|
|
380
|
+
- **Instant Setup**: `npx cortex-tms init` - 60 seconds to governance docs
|
|
381
|
+
- **Zero Config**: Works out of the box with sensible defaults
|
|
382
|
+
- **CI Ready**: GitHub Actions templates included
|
|
383
|
+
- **Production Grade**: 316 tests (97% pass rate), enterprise-grade security (v3.2)
|
|
384
|
+
- **Open Source**: MIT license, community-driven
|
|
630
385
|
|
|
631
|
-
|
|
386
|
+
**Tested With**: Claude Code, GitHub Copilot (in VS Code). Architecture supports any AI tool.
|
|
632
387
|
|
|
633
|
-
|
|
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
|
|
388
|
+
---
|
|
664
389
|
|
|
665
|
-
|
|
390
|
+
## Community & Support
|
|
666
391
|
|
|
667
|
-
|
|
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.).
|
|
392
|
+
### Get Help
|
|
671
393
|
|
|
672
|
-
|
|
394
|
+
- **[GitHub Discussions](https://github.com/cortex-tms/cortex-tms/discussions)** - Ask questions, share ideas
|
|
395
|
+
- [Q&A](https://github.com/cortex-tms/cortex-tms/discussions/categories/q-a) - Get help from community
|
|
396
|
+
- [Ideas](https://github.com/cortex-tms/cortex-tms/discussions/categories/ideas) - Suggest features
|
|
397
|
+
- [Show and Tell](https://github.com/cortex-tms/cortex-tms/discussions/categories/show-and-tell) - Share projects
|
|
673
398
|
|
|
674
|
-
|
|
399
|
+
### Report Issues
|
|
675
400
|
|
|
676
|
-
|
|
401
|
+
- **[Bug Reports](https://github.com/cortex-tms/cortex-tms/issues/new)** - Found a bug? Let us know
|
|
402
|
+
- **[Security Issues](https://github.com/cortex-tms/cortex-tms/security/advisories/new)** - Responsible disclosure
|
|
677
403
|
|
|
678
|
-
|
|
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
|
|
404
|
+
### Contributing
|
|
682
405
|
|
|
683
|
-
**
|
|
684
|
-
- [
|
|
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)
|
|
406
|
+
- **[Contributing Guide](CONTRIBUTING.md)** - How to contribute
|
|
407
|
+
- **[Community Guide](docs/COMMUNITY.md)** - Community guidelines
|
|
687
408
|
|
|
688
|
-
**
|
|
409
|
+
**Star us on GitHub** β if Cortex TMS helps your AI development workflow!
|
|
689
410
|
|
|
690
411
|
---
|
|
691
412
|
|
|
692
|
-
##
|
|
693
|
-
|
|
694
|
-
We have an active and growing community! β **146 stars** and counting.
|
|
413
|
+
## Roadmap
|
|
695
414
|
|
|
696
|
-
|
|
697
|
-
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
- [Announcements](https://github.com/cortex-tms/cortex-tms/discussions/categories/announcements) - Release notes and updates
|
|
415
|
+
**v4.0** (Current - Feb 2026):
|
|
416
|
+
- β
Staleness detection (git-based, v1)
|
|
417
|
+
- β
Archive command
|
|
418
|
+
- β
Validation-first positioning
|
|
419
|
+
- β
Token claims removed
|
|
702
420
|
|
|
703
|
-
|
|
704
|
-
-
|
|
705
|
-
-
|
|
421
|
+
**v4.1** (Planned - Mar 2026):
|
|
422
|
+
- π Git hooks integration (`cortex-tms hooks install`)
|
|
423
|
+
- π Staleness v2 (improved heuristics, fewer false positives)
|
|
424
|
+
- π Incremental doc updates
|
|
706
425
|
|
|
707
|
-
|
|
708
|
-
-
|
|
709
|
-
-
|
|
426
|
+
**v4.2+** (Future):
|
|
427
|
+
- π MCP Server (expose docs to any AI tool)
|
|
428
|
+
- π Multi-tool config generation (.cursorrules, .windsurfrules)
|
|
429
|
+
- π Skills integration
|
|
710
430
|
|
|
711
|
-
|
|
431
|
+
See [FUTURE-ENHANCEMENTS.md](FUTURE-ENHANCEMENTS.md) for full roadmap.
|
|
712
432
|
|
|
713
433
|
---
|
|
714
434
|
|
|
715
435
|
## License
|
|
716
436
|
|
|
717
|
-
MIT
|
|
437
|
+
MIT - See [LICENSE](LICENSE) for details
|
|
718
438
|
|
|
719
439
|
---
|
|
720
440
|
|
|
721
441
|
## Status
|
|
722
442
|
|
|
723
|
-
**Version**:
|
|
724
|
-
**Last Updated**: 2026-
|
|
725
|
-
**Current Sprint**:
|
|
726
|
-
**Recent Sprints**: v3.1 (Git-Based Auto-Tiering), v3.0 (AI-Powered Onboarding) β see [docs/archive/](docs/archive/)
|
|
443
|
+
**Version**: 4.0.0
|
|
444
|
+
**Last Updated**: 2026-02-21
|
|
445
|
+
**Current Sprint**: v4.0 - "Quality Governance & Staleness Detection"
|
|
727
446
|
|
|
728
|
-
<!-- @cortex-tms-version
|
|
447
|
+
<!-- @cortex-tms-version 4.0.0 -->
|