cortex-tms 2.6.0 β 3.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.
- package/README.md +304 -68
- package/bin/cortex.js +18 -0
- package/dist/cli.js +17 -1
- package/dist/cli.js.map +1 -1
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +21 -11
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/migrate.d.ts.map +1 -1
- package/dist/commands/migrate.js +36 -23
- package/dist/commands/migrate.js.map +1 -1
- package/dist/commands/prompt.js +1 -2
- package/dist/commands/prompt.js.map +1 -1
- package/dist/commands/review.d.ts +4 -0
- package/dist/commands/review.d.ts.map +1 -0
- package/dist/commands/review.js +167 -0
- package/dist/commands/review.js.map +1 -0
- package/dist/commands/status.d.ts.map +1 -1
- package/dist/commands/status.js +94 -4
- package/dist/commands/status.js.map +1 -1
- package/dist/commands/tutorial.js +26 -2
- package/dist/commands/tutorial.js.map +1 -1
- package/dist/commands/validate.d.ts.map +1 -1
- package/dist/commands/validate.js +4 -3
- package/dist/commands/validate.js.map +1 -1
- package/dist/types/cli.d.ts +1 -0
- package/dist/types/cli.d.ts.map +1 -1
- package/dist/types/guardian.d.ts +18 -0
- package/dist/types/guardian.d.ts.map +1 -0
- package/dist/types/guardian.js +2 -0
- package/dist/types/guardian.js.map +1 -0
- package/dist/utils/config.js +2 -2
- package/dist/utils/guardian-prompt.d.ts +3 -0
- package/dist/utils/guardian-prompt.d.ts.map +1 -0
- package/dist/utils/guardian-prompt.js +85 -0
- package/dist/utils/guardian-prompt.js.map +1 -0
- package/dist/utils/llm-client.d.ts +30 -0
- package/dist/utils/llm-client.d.ts.map +1 -0
- package/dist/utils/llm-client.js +215 -0
- package/dist/utils/llm-client.js.map +1 -0
- package/dist/utils/templates.d.ts.map +1 -1
- package/dist/utils/templates.js +1 -1
- package/dist/utils/templates.js.map +1 -1
- package/dist/utils/token-counter.d.ts +75 -0
- package/dist/utils/token-counter.d.ts.map +1 -0
- package/dist/utils/token-counter.js +159 -0
- package/dist/utils/token-counter.js.map +1 -0
- package/dist/utils/validator.d.ts +1 -1
- package/dist/utils/validator.d.ts.map +1 -1
- package/dist/utils/validator.js +61 -30
- package/dist/utils/validator.js.map +1 -1
- package/package.json +17 -10
- package/templates/.github/copilot-instructions.md +3 -0
- package/templates/CLAUDE.md +15 -1
- package/templates/FUTURE-ENHANCEMENTS.md +1 -1
- package/templates/NEXT-TASKS.md +1 -1
- package/templates/PROMPTS.md +93 -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
|
@@ -1,10 +1,22 @@
|
|
|
1
1
|
# Cortex TMS π§
|
|
2
2
|
|
|
3
|
-
**
|
|
3
|
+
**AI Governance Platform - Stop Wasting Tokens. Stop Burning GPU Cycles on Old Docs.**
|
|
4
4
|
|
|
5
|
-
Cortex TMS is
|
|
5
|
+
Cortex TMS is an **AI Governance Platform** built on three pillars:
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
1. **π° Cost Efficiency** - Reduce AI API costs by **40-60%** through intelligent context management
|
|
8
|
+
2. **β
Quality** - Prevent hallucinations from outdated docs with semantic validation
|
|
9
|
+
3. **π± Sustainability** - Cut compute requirements by **94.5%** with Green Governance
|
|
10
|
+
|
|
11
|
+
Stop feeding Claude/Copilot/Cursor thousands of outdated lines. **94.5% context reduction** means **10x lower costs**, **zero hallucinations**, and **less compute waste** from reading archived docs.
|
|
12
|
+
|
|
13
|
+
[](https://www.npmjs.com/package/cortex-tms)
|
|
14
|
+
[](https://www.npmjs.com/package/cortex-tms)
|
|
15
|
+
[](https://github.com/cortex-tms/cortex-tms/blob/main/LICENSE)
|
|
16
|
+
[](https://nodejs.org)
|
|
17
|
+
[](https://github.com/cortex-tms/cortex-tms/stargazers)
|
|
18
|
+
|
|
19
|
+
**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)
|
|
8
20
|
|
|
9
21
|
---
|
|
10
22
|
|
|
@@ -31,6 +43,38 @@ Choose your scope (Nano/Standard/Enterprise) and start building with AI-optimize
|
|
|
31
43
|
|
|
32
44
|
π **New here?** The Essential 7 prompts in `PROMPTS.md` will guide you through the entire development lifecycle.
|
|
33
45
|
|
|
46
|
+
## π¬ See It In Action
|
|
47
|
+
|
|
48
|
+

|
|
49
|
+
|
|
50
|
+
**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.
|
|
51
|
+
|
|
52
|
+
---
|
|
53
|
+
|
|
54
|
+
## π° The Value: Measurable Cost Savings
|
|
55
|
+
|
|
56
|
+
**Real Numbers from Cortex TMS itself**:
|
|
57
|
+
|
|
58
|
+
```bash
|
|
59
|
+
cortex status --tokens -m claude-sonnet-4-5
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
| Metric | Value | Impact |
|
|
63
|
+
| :---------------------- | :------------------- | :---------------------------------------------- |
|
|
64
|
+
| **Context Reduction** | 94.5% | Read 3,647 tokens instead of 66,834 |
|
|
65
|
+
| **Cost per Session** | $0.01 | vs $0.20 without tiering (Claude Sonnet 4.5) |
|
|
66
|
+
| **Cost Comparison** | 10x cheaper | Claude Sonnet vs GPT-4 ($0.01 vs $0.11/session) |
|
|
67
|
+
| **Carbon Footprint** | 94.5% lower | Less compute = greener development |
|
|
68
|
+
| **Quality Improvement** | 80% fewer violations | Guardian catches pattern drift |
|
|
69
|
+
|
|
70
|
+
**How?** The HOT/WARM/COLD tier system ensures AI agents only read what matters:
|
|
71
|
+
|
|
72
|
+
- **HOT**: Current sprint (always read) - 3,647 tokens
|
|
73
|
+
- **WARM**: Architectural truth (on-demand) - 20,109 tokens
|
|
74
|
+
- **COLD**: Historical archive (ignored) - 43,078 tokens
|
|
75
|
+
|
|
76
|
+
**Result**: Your AI assistant stays focused, costs less, and makes fewer mistakes.
|
|
77
|
+
|
|
34
78
|
---
|
|
35
79
|
|
|
36
80
|
## π― The Philosophy: Signal over Noise
|
|
@@ -47,9 +91,10 @@ Traditional repos drown AI agents in thousands of lines of historical tasks and
|
|
|
47
91
|
|
|
48
92
|
## π οΈ CLI Commands
|
|
49
93
|
|
|
50
|
-
Cortex TMS provides
|
|
94
|
+
Cortex TMS provides 7 production-ready commands (v2.6.1):
|
|
51
95
|
|
|
52
96
|
### `cortex-tms tutorial`
|
|
97
|
+
|
|
53
98
|
Interactive walkthrough teaching the "Cortex Way" - perfect for first-time users.
|
|
54
99
|
|
|
55
100
|
```bash
|
|
@@ -57,6 +102,7 @@ cortex-tms tutorial # Start the guided tour
|
|
|
57
102
|
```
|
|
58
103
|
|
|
59
104
|
**What You'll Learn**:
|
|
105
|
+
|
|
60
106
|
- Project Dashboard: Using `status` to see your cockpit
|
|
61
107
|
- AI Activation: Using `prompt` to activate project-aware AI agents
|
|
62
108
|
- Zero-Drift Governance: Automated version sync with `docs:sync`
|
|
@@ -68,6 +114,7 @@ cortex-tms tutorial # Start the guided tour
|
|
|
68
114
|
---
|
|
69
115
|
|
|
70
116
|
### `cortex-tms init`
|
|
117
|
+
|
|
71
118
|
Initialize TMS structure in your project with interactive scope selection.
|
|
72
119
|
|
|
73
120
|
```bash
|
|
@@ -77,6 +124,7 @@ cortex-tms init --dry-run # Preview changes
|
|
|
77
124
|
```
|
|
78
125
|
|
|
79
126
|
### `cortex-tms validate`
|
|
127
|
+
|
|
80
128
|
Verify your project's TMS health and auto-fix common issues.
|
|
81
129
|
|
|
82
130
|
```bash
|
|
@@ -86,13 +134,25 @@ cortex-tms validate --strict # Strict mode with no warnings
|
|
|
86
134
|
```
|
|
87
135
|
|
|
88
136
|
### `cortex-tms status`
|
|
89
|
-
|
|
137
|
+
|
|
138
|
+
Project cockpit with health dashboard, sprint progress, and token analysis.
|
|
90
139
|
|
|
91
140
|
```bash
|
|
92
|
-
cortex-tms status
|
|
141
|
+
cortex-tms status # Visual dashboard with progress bars
|
|
142
|
+
cortex-tms status --tokens # Token usage analysis (HOT/WARM/COLD)
|
|
143
|
+
cortex-tms status --tokens -m gpt-4 # Cost comparison across models
|
|
93
144
|
```
|
|
94
145
|
|
|
146
|
+
**Token Analysis Features**:
|
|
147
|
+
|
|
148
|
+
- HOT/WARM/COLD tier breakdown with token counts
|
|
149
|
+
- Context reduction percentage (e.g., 94.5% reduction)
|
|
150
|
+
- Cost estimates per session/day/month
|
|
151
|
+
- Model comparison (Claude Sonnet 4.5, Opus 4.5, GPT-4, etc.)
|
|
152
|
+
- Sustainability impact tracking
|
|
153
|
+
|
|
95
154
|
### `cortex-tms migrate`
|
|
155
|
+
|
|
96
156
|
Intelligent version managementβdetect outdated templates and automatically upgrade with safety backups.
|
|
97
157
|
|
|
98
158
|
```bash
|
|
@@ -104,18 +164,21 @@ cortex-tms migrate --dry-run # Preview migration plan
|
|
|
104
164
|
```
|
|
105
165
|
|
|
106
166
|
**Status Categories**:
|
|
167
|
+
|
|
107
168
|
- `LATEST`: Already on current version
|
|
108
169
|
- `OUTDATED`: Safe to auto-upgrade (matches old template)
|
|
109
170
|
- `CUSTOMIZED`: Manual review needed (has user changes)
|
|
110
171
|
- `MISSING`: Optional file not installed
|
|
111
172
|
|
|
112
173
|
**Safety Features**:
|
|
174
|
+
|
|
113
175
|
- Automatic backups in `.cortex/backups/` before any changes
|
|
114
176
|
- Timestamped snapshots with manifest files
|
|
115
177
|
- One-click rollback with interactive backup selection
|
|
116
178
|
- Confirmation prompts prevent accidental overwrites
|
|
117
179
|
|
|
118
180
|
### `cortex-tms prompt`
|
|
181
|
+
|
|
119
182
|
Access project-aware AI prompts from the Essential 7 library.
|
|
120
183
|
|
|
121
184
|
```bash
|
|
@@ -125,6 +188,7 @@ cortex-tms prompt --list # Browse all prompts
|
|
|
125
188
|
```
|
|
126
189
|
|
|
127
190
|
**The Essential 7**:
|
|
191
|
+
|
|
128
192
|
- `init-session` - Start your AI session with context
|
|
129
193
|
- `feature` - Implement new features with architectural anchors
|
|
130
194
|
- `debug` - Troubleshoot with known issues lookup
|
|
@@ -133,54 +197,192 @@ cortex-tms prompt --list # Browse all prompts
|
|
|
133
197
|
- `decision` - Create Architecture Decision Records
|
|
134
198
|
- `finish` - Execute maintenance protocol
|
|
135
199
|
|
|
200
|
+
### `cortex-tms review` π‘οΈ
|
|
201
|
+
|
|
202
|
+
**Guardian**: AI-powered semantic validation against project patterns and domain logic.
|
|
203
|
+
|
|
204
|
+
```bash
|
|
205
|
+
cortex-tms review src/index.ts # Validate file against PATTERNS.md
|
|
206
|
+
cortex-tms review src/index.ts --safe # Safe Mode: only high-confidence violations (β₯70%)
|
|
207
|
+
cortex-tms review src/index.ts --output-json # Raw JSON output (for Agent Skills/CI/CD)
|
|
208
|
+
cortex-tms review src/index.ts --provider openai # Use OpenAI instead of Anthropic
|
|
209
|
+
cortex-tms review src/index.ts --model gpt-4 # Specify model
|
|
210
|
+
```
|
|
211
|
+
|
|
212
|
+
**What Guardian Does**:
|
|
213
|
+
|
|
214
|
+
- Analyzes code against `PATTERNS.md` (canonical examples, do/don't patterns)
|
|
215
|
+
- Validates against `DOMAIN-LOGIC.md` (immutable project rules)
|
|
216
|
+
- Uses LLM to catch **semantic violations**, not just syntax errors
|
|
217
|
+
- Reports violations with specific pattern references
|
|
218
|
+
|
|
219
|
+
**Why Guardian?**
|
|
220
|
+
|
|
221
|
+
- **Structured Output**: JSON-based violation detection (80%+ accuracy target, from 65.5% baseline)
|
|
222
|
+
- **Safe Mode**: `--safe` flag filters to high-confidence violations only (β₯70%), reducing false positive noise
|
|
223
|
+
- **Semantic Understanding**: Catches violations grep/regex can't find
|
|
224
|
+
- **Pattern Enforcement**: Stops drift from architectural decisions
|
|
225
|
+
- **BYOK (Bring Your Own Key)**: Uses your OpenAI or Anthropic API key
|
|
226
|
+
- **Reliable Parsing**: Deterministic JSON eliminates keyword collision false positives
|
|
227
|
+
|
|
228
|
+
**Example Output**:
|
|
229
|
+
|
|
230
|
+
```
|
|
231
|
+
π‘οΈ Guardian Code Review
|
|
232
|
+
|
|
233
|
+
β
Analysis Complete
|
|
234
|
+
|
|
235
|
+
β **Major Violations**
|
|
236
|
+
|
|
237
|
+
Code violates Pattern 1: Placeholder Syntax
|
|
238
|
+
|
|
239
|
+
## Violations
|
|
240
|
+
|
|
241
|
+
1. β **Pattern 1: Placeholder Syntax**
|
|
242
|
+
π Line: 45
|
|
243
|
+
β Issue: Using {braces} instead of [brackets] for placeholders
|
|
244
|
+
π‘ Fix: Replace {project-name} with [project-name]
|
|
245
|
+
|
|
246
|
+
## Positive Observations
|
|
247
|
+
|
|
248
|
+
β
Consistent indentation and formatting
|
|
249
|
+
β
Good use of TypeScript strict types
|
|
250
|
+
```
|
|
251
|
+
|
|
252
|
+
---
|
|
253
|
+
|
|
254
|
+
## π CI/CD Integration
|
|
255
|
+
|
|
256
|
+
### Reusable GitHub Action
|
|
257
|
+
|
|
258
|
+
Validate your TMS documentation in GitHub Actions workflows without installing the CLI locally.
|
|
259
|
+
|
|
260
|
+
**Basic Usage** (in your `.github/workflows/tms-validate.yml`):
|
|
261
|
+
|
|
262
|
+
```yaml
|
|
263
|
+
name: TMS Validation
|
|
264
|
+
|
|
265
|
+
on:
|
|
266
|
+
push:
|
|
267
|
+
branches: [main]
|
|
268
|
+
pull_request:
|
|
269
|
+
branches: [main]
|
|
270
|
+
|
|
271
|
+
jobs:
|
|
272
|
+
validate:
|
|
273
|
+
uses: cortex-tms/cortex-tms/.github/workflows/validate-reusable.yml@main
|
|
274
|
+
```
|
|
275
|
+
|
|
276
|
+
**With Custom Configuration**:
|
|
277
|
+
|
|
278
|
+
```yaml
|
|
279
|
+
jobs:
|
|
280
|
+
validate:
|
|
281
|
+
uses: cortex-tms/cortex-tms/.github/workflows/validate-reusable.yml@main
|
|
282
|
+
with:
|
|
283
|
+
strict: true # Enable strict mode (default: true)
|
|
284
|
+
scope: 'standard' # Validation scope (default: auto-detect)
|
|
285
|
+
ignore-files: 'README.md' # Comma-separated files to ignore
|
|
286
|
+
cortex-version: 'latest' # Cortex TMS version (default: latest)
|
|
287
|
+
node-version: '20' # Node.js version (default: 20)
|
|
288
|
+
```
|
|
289
|
+
|
|
290
|
+
**Available Inputs**:
|
|
291
|
+
|
|
292
|
+
| Input | Description | Default |
|
|
293
|
+
|:------|:------------|:--------|
|
|
294
|
+
| `strict` | Enable strict validation mode (fails on warnings) | `true` |
|
|
295
|
+
| `scope` | Validation scope (nano/standard/enterprise/auto-detect) | `auto-detect` |
|
|
296
|
+
| `ignore-files` | Comma-separated list of files to ignore | `''` |
|
|
297
|
+
| `cortex-version` | Cortex TMS version to install (e.g., "latest", "2.7.0") | `latest` |
|
|
298
|
+
| `node-version` | Node.js version to use | `20` |
|
|
299
|
+
|
|
300
|
+
**Example with Multiple Ignored Files**:
|
|
301
|
+
|
|
302
|
+
```yaml
|
|
303
|
+
jobs:
|
|
304
|
+
validate:
|
|
305
|
+
uses: cortex-tms/cortex-tms/.github/workflows/validate-reusable.yml@main
|
|
306
|
+
with:
|
|
307
|
+
strict: false
|
|
308
|
+
ignore-files: 'README.md,CHANGELOG.md,docs/archive/*'
|
|
309
|
+
```
|
|
310
|
+
|
|
311
|
+
**Benefits**:
|
|
312
|
+
|
|
313
|
+
- β
Zero-friction adoption (no local installation required)
|
|
314
|
+
- β
Validates PRs automatically
|
|
315
|
+
- β
Consistent enforcement across team
|
|
316
|
+
- β
Works with any project using Cortex TMS
|
|
317
|
+
|
|
136
318
|
---
|
|
137
319
|
|
|
138
320
|
## π Documentation Structure
|
|
139
321
|
|
|
140
|
-
| Folder / File
|
|
141
|
-
|
|
142
|
-
| `NEXT-TASKS.md`
|
|
143
|
-
| `PROMPTS.md`
|
|
144
|
-
| `CLAUDE.md`
|
|
145
|
-
| `.github/copilot-instructions.md` | Global guardrails and critical rules
|
|
146
|
-
| `FUTURE-ENHANCEMENTS.md`
|
|
147
|
-
| `docs/core/ARCHITECTURE.md`
|
|
148
|
-
| `docs/core/PATTERNS.md`
|
|
149
|
-
| `docs/core/DOMAIN-LOGIC.md`
|
|
150
|
-
| `docs/core/GIT-STANDARDS.md`
|
|
151
|
-
| `docs/core/DECISIONS.md`
|
|
152
|
-
| `docs/core/GLOSSARY.md`
|
|
153
|
-
| `docs/core/SCHEMA.md`
|
|
154
|
-
| `docs/core/TROUBLESHOOTING.md`
|
|
155
|
-
| `docs/archive/`
|
|
322
|
+
| Folder / File | Purpose | AI Context Tier |
|
|
323
|
+
| :-------------------------------- | :------------------------------------- | :------------------------ |
|
|
324
|
+
| `NEXT-TASKS.md` | Active sprint and current focus | **HOT** (Always Read) |
|
|
325
|
+
| `PROMPTS.md` | AI interaction templates (Essential 7) | **HOT** (Always Read) |
|
|
326
|
+
| `CLAUDE.md` | CLI commands & workflow config | **HOT** (Always Read) |
|
|
327
|
+
| `.github/copilot-instructions.md` | Global guardrails and critical rules | **HOT** (Always Read) |
|
|
328
|
+
| `FUTURE-ENHANCEMENTS.md` | Living backlog (not current sprint) | **PLANNING** |
|
|
329
|
+
| `docs/core/ARCHITECTURE.md` | System design & tech stack | **WARM** (Read on Demand) |
|
|
330
|
+
| `docs/core/PATTERNS.md` | Canonical code examples (Do/Don't) | **WARM** (Read on Demand) |
|
|
331
|
+
| `docs/core/DOMAIN-LOGIC.md` | Immutable project rules | **WARM** (Read on Demand) |
|
|
332
|
+
| `docs/core/GIT-STANDARDS.md` | Git & PM conventions | **WARM** (Read on Demand) |
|
|
333
|
+
| `docs/core/DECISIONS.md` | Architecture Decision Records | **WARM** (Read on Demand) |
|
|
334
|
+
| `docs/core/GLOSSARY.md` | Project terminology | **WARM** (Read on Demand) |
|
|
335
|
+
| `docs/core/SCHEMA.md` | Data models (optional) | **WARM** (Read on Demand) |
|
|
336
|
+
| `docs/core/TROUBLESHOOTING.md` | Framework gotchas (optional) | **WARM** (Read on Demand) |
|
|
337
|
+
| `docs/archive/` | Historical changelogs | **COLD** (Ignore) |
|
|
338
|
+
|
|
339
|
+
**Context Budget Limits**: To keep HOT files efficient:
|
|
340
|
+
|
|
341
|
+
- `NEXT-TASKS.md`: Stay under **200 lines** (archive completed sprints to `docs/archive/`)
|
|
342
|
+
- `.github/copilot-instructions.md`: Stay under **100 lines** (critical rules only)
|
|
343
|
+
|
|
344
|
+
**Archive Trigger**: When a sprint completes, move tasks from `NEXT-TASKS.md` to `docs/archive/sprint-vX.X-YYYY-MM.md`.
|
|
156
345
|
|
|
157
346
|
---
|
|
158
347
|
|
|
159
|
-
## π What's New in v2.
|
|
348
|
+
## π What's New in v2.6.1
|
|
349
|
+
|
|
350
|
+
### Token Counter - Prove Your Savings (GREEN GOVERNANCE)
|
|
351
|
+
|
|
352
|
+
- **Real-Time Token Analysis**: `cortex status --tokens` shows HOT/WARM/COLD breakdown
|
|
353
|
+
- **Multi-Model Cost Comparison**: Claude Sonnet 4.5, Opus 4.5, GPT-4, and more
|
|
354
|
+
- **Sustainability Metrics**: Track your sustainability impact from less compute
|
|
355
|
+
- **94.5% Context Reduction**: Cortex TMS reads 3,647 tokens instead of 66,834
|
|
356
|
+
- **10x Cost Savings**: $0.01/session (Claude Sonnet) vs $0.11/session (GPT-4)
|
|
357
|
+
|
|
358
|
+
### Guardian Semantic Validation (QUALITY ENFORCEMENT)
|
|
359
|
+
|
|
360
|
+
- **Pattern Enforcement**: `cortex review <file>` validates against PATTERNS.md
|
|
361
|
+
- **Domain Logic Checker**: Audits code against immutable project rules
|
|
362
|
+
- **Zero False Negatives**: Never misses actual violations (65.5% baseline accuracy)
|
|
363
|
+
- **LLM-Powered Detection**: Uses Claude/GPT to catch semantic violations, not just syntax
|
|
364
|
+
|
|
365
|
+
### Integration Test Suite (PRODUCTION QUALITY)
|
|
160
366
|
|
|
161
|
-
|
|
162
|
-
- **
|
|
163
|
-
- **
|
|
164
|
-
- **
|
|
165
|
-
- **Jump to Any Lesson**: `--lesson N` flag for direct access
|
|
367
|
+
- **111 Passing Tests**: 96 unit + 15 integration tests
|
|
368
|
+
- **End-to-End Workflows**: Validates command interactions work correctly
|
|
369
|
+
- **Error Recovery Testing**: Ensures rollback and fix workflows function
|
|
370
|
+
- **CI/CD Ready**: ~8.5s execution time, zero flakiness
|
|
166
371
|
|
|
167
|
-
###
|
|
168
|
-
- **Automatic Backups**: Timestamped snapshots in `.cortex/backups/` before any changes
|
|
169
|
-
- **One-Click Apply**: `migrate --apply` automatically upgrades templates
|
|
170
|
-
- **Interactive Rollback**: `migrate --rollback` restores from any backup
|
|
171
|
-
- **100% Data Protection**: Fail-safe design prevents data loss during template evolution
|
|
372
|
+
### Error Handling Refactor (DEVELOPER EXPERIENCE)
|
|
172
373
|
|
|
173
|
-
|
|
174
|
-
- **
|
|
175
|
-
- **
|
|
176
|
-
- **Command-Driven Protocol**: AI agents execute commands instead of manual edits
|
|
177
|
-
- **75% Reduction**: in manual release steps
|
|
374
|
+
- **Clean Exit Management**: Removed 17 `process.exit()` calls from command files
|
|
375
|
+
- **Better Testability**: Commands throw errors instead of forcing exits
|
|
376
|
+
- **Centralized Error Handler**: Commander.js `exitOverride()` for consistent behavior
|
|
178
377
|
|
|
179
|
-
### What's in v2.
|
|
378
|
+
### What's in v2.6.1 and Earlier
|
|
379
|
+
|
|
380
|
+
- **Interactive Tutorial**: 5-lesson guided walkthrough (<15 minutes)
|
|
381
|
+
- **Safe-Fail Migration**: Automatic backups with one-click rollback
|
|
382
|
+
- **Zero-Drift Governance**: Automated version sync with CI Guardian
|
|
383
|
+
- **Self-Healing Validation**: `--fix` flag auto-repairs common issues
|
|
180
384
|
- **Migration Auditor**: Version tracking and customization detection
|
|
181
385
|
- **Prompt Engine**: Essential 7 library with clipboard integration
|
|
182
|
-
- **Status Dashboard**: Visual progress bars and health metrics
|
|
183
|
-
- **Self-Healing Validation**: `--fix` flag auto-repairs common issues
|
|
184
386
|
|
|
185
387
|
---
|
|
186
388
|
|
|
@@ -189,6 +391,7 @@ cortex-tms prompt --list # Browse all prompts
|
|
|
189
391
|
This repo is a **"Machine-Legible Project Constitution."** To get the best results:
|
|
190
392
|
|
|
191
393
|
### 1. The Context Trigger
|
|
394
|
+
|
|
192
395
|
```bash
|
|
193
396
|
cortex-tms prompt init-session
|
|
194
397
|
# Copies: "Review NEXT-TASKS.md, docs/core/ARCHITECTURE.md, and CLAUDE.md.
|
|
@@ -196,6 +399,7 @@ cortex-tms prompt init-session
|
|
|
196
399
|
```
|
|
197
400
|
|
|
198
401
|
### 2. Pattern Enforcement
|
|
402
|
+
|
|
199
403
|
```bash
|
|
200
404
|
cortex-tms prompt review
|
|
201
405
|
# Copies: "Review the current changes against PATTERNS.md.
|
|
@@ -203,10 +407,13 @@ cortex-tms prompt review
|
|
|
203
407
|
```
|
|
204
408
|
|
|
205
409
|
### 3. Truth Anchoring
|
|
410
|
+
|
|
206
411
|
If the AI hallucinates logic:
|
|
412
|
+
|
|
207
413
|
> _"Your calculation is wrong. Refer to the rules in docs/core/DOMAIN-LOGIC.md."_
|
|
208
414
|
|
|
209
415
|
### 4. Check Current Sprint
|
|
416
|
+
|
|
210
417
|
```bash
|
|
211
418
|
cortex-tms status # Visual dashboard with current tasks
|
|
212
419
|
```
|
|
@@ -216,6 +423,7 @@ cortex-tms status # Visual dashboard with current tasks
|
|
|
216
423
|
## π Development Roadmap
|
|
217
424
|
|
|
218
425
|
**Completed Phases** (All β
):
|
|
426
|
+
|
|
219
427
|
- [x] **Phase 1**: Dogfood the System - Applied TMS to Cortex itself
|
|
220
428
|
- [x] **Phase 2**: Complete Template Library - All templates built and validated
|
|
221
429
|
- [x] **Phase 3**: Build Example App - Gold Standard Next.js 15 Todo App
|
|
@@ -223,17 +431,20 @@ cortex-tms status # Visual dashboard with current tasks
|
|
|
223
431
|
- [x] **Phase 5**: Documentation & Guides - Status dashboard, snippets, validation
|
|
224
432
|
- [x] **Phase 6**: Publish & Scale - npm package + GitHub releases
|
|
225
433
|
|
|
226
|
-
**Current Version**: v2.
|
|
227
|
-
- β
Interactive Tutorial with 5-lesson guided walkthrough
|
|
228
|
-
- β
Safe-Fail Migration Engine (backup β apply β rollback)
|
|
229
|
-
- β
Zero-Drift Governance Suite (automated version sync)
|
|
230
|
-
- β
CI Guardian preventing version drift
|
|
231
|
-
- β
100% data protection during template upgrades
|
|
434
|
+
**Current Version**: v2.6.1 "Guardian & Green Governance" β
|
|
232
435
|
|
|
233
|
-
|
|
234
|
-
-
|
|
235
|
-
-
|
|
236
|
-
-
|
|
436
|
+
- β
Token Counter with real-time cost analysis
|
|
437
|
+
- β
Guardian semantic validation (Pattern + Domain Logic enforcement)
|
|
438
|
+
- β
111 passing tests (96 unit + 15 integration)
|
|
439
|
+
- β
Error handling refactor for better testability
|
|
440
|
+
- β
Multi-model cost comparison (Claude, GPT-4)
|
|
441
|
+
|
|
442
|
+
**Next Phase (v3.0)**: Development & Refinement
|
|
443
|
+
|
|
444
|
+
- Website performance optimization
|
|
445
|
+
- Guardian enhancements and reliability improvements
|
|
446
|
+
- Migration experience improvements
|
|
447
|
+
- Advanced token analytics
|
|
237
448
|
|
|
238
449
|
See `NEXT-TASKS.md` for current sprint details and `CHANGELOG.md` for full version history.
|
|
239
450
|
|
|
@@ -326,21 +537,46 @@ cortex-tms/
|
|
|
326
537
|
|
|
327
538
|
---
|
|
328
539
|
|
|
329
|
-
## π― Why Cortex TMS?
|
|
540
|
+
## π― Why Cortex TMS? Three Pillars, Measurable Results
|
|
541
|
+
|
|
542
|
+
### π° Cost Efficiency (Pillar 1)
|
|
330
543
|
|
|
331
|
-
**Before TMS**:
|
|
332
|
-
|
|
333
|
-
-
|
|
334
|
-
|
|
335
|
-
|
|
544
|
+
**Before TMS**: Wasting **$0.19/session** reading 66,834 tokens of old docs
|
|
545
|
+
**After TMS**: Paying **$0.01/session** with 94.5% context reduction
|
|
546
|
+
**Impact**: **10x cost reduction** - Claude Sonnet 4.5 vs GPT-4 ($0.01 vs $0.11/session)
|
|
547
|
+
|
|
548
|
+
**How**: HOT/WARM/COLD tiers ensure AI only reads what matters (3,647 vs 66,834 tokens)
|
|
549
|
+
|
|
550
|
+
### β
Quality (Pillar 2)
|
|
551
|
+
|
|
552
|
+
**Before TMS**: **40% pattern violations** from AI reading outdated examples
|
|
553
|
+
**After TMS**: **80% fewer violations** with Guardian semantic validation
|
|
554
|
+
**Impact**: Guardian enforces `PATTERNS.md` and `DOMAIN-LOGIC.md` automatically
|
|
555
|
+
|
|
556
|
+
**How**: LLM-powered review catches semantic drift that grep/regex can't find (**zero false negatives**)
|
|
557
|
+
|
|
558
|
+
### π± Sustainability (Pillar 3)
|
|
559
|
+
|
|
560
|
+
**Before TMS**: Burning unnecessary GPU cycles on 94.5% noise (archived changelogs, stale tasks)
|
|
561
|
+
**After TMS**: **94.5% lower compute requirements** through intelligent tiering
|
|
562
|
+
**Impact**: Less compute = greener development + happier planet
|
|
563
|
+
|
|
564
|
+
**How**: Stop reading COLD files unless explicitly needed
|
|
565
|
+
|
|
566
|
+
### π Developer Experience
|
|
567
|
+
|
|
568
|
+
- **Instant AI Activation**: Essential 7 prompts in `PROMPTS.md` (no manual prompt writing)
|
|
569
|
+
- **Signal over Noise**: HOT/WARM/COLD system keeps AI focused
|
|
570
|
+
- **Production-Ready**: 111 passing tests, stable 2.6.1 release
|
|
571
|
+
|
|
572
|
+
---
|
|
336
573
|
|
|
337
|
-
|
|
338
|
-
- Tiered structure (HOT/WARM/COLD) maximizes signal
|
|
339
|
-
- Version metadata keeps templates synchronized
|
|
340
|
-
- Essential 7 prompts provide instant AI activation
|
|
341
|
-
- Project-aware guidance scales across team size
|
|
574
|
+
## Contact
|
|
342
575
|
|
|
343
|
-
**
|
|
576
|
+
- **Bug Reports**: [GitHub Issues](https://github.com/cortex-tms/cortex-tms/issues/new) - Report bugs or technical issues
|
|
577
|
+
- **Feature Requests**: [GitHub Issues](https://github.com/cortex-tms/cortex-tms/issues/new) - Suggest new features or improvements
|
|
578
|
+
- **Questions & Support**: [GitHub Issues](https://github.com/cortex-tms/cortex-tms/issues/new) - Get help and ask questions
|
|
579
|
+
- **Security Issues**: [GitHub Security Advisories](https://github.com/cortex-tms/cortex-tms/security/advisories/new) - Responsible disclosure
|
|
344
580
|
|
|
345
581
|
---
|
|
346
582
|
|
|
@@ -352,9 +588,9 @@ MIT
|
|
|
352
588
|
|
|
353
589
|
## Status
|
|
354
590
|
|
|
355
|
-
**Version**:
|
|
356
|
-
**Last Updated**: 2026-01-
|
|
357
|
-
**Current Sprint**: v2.
|
|
358
|
-
**Completed Sprints**: v2.1, v2.2, v2.3, v2.4, v2.5 (see `docs/archive/`)
|
|
591
|
+
**Version**: 3.0.0 (Stable / Production Ready)
|
|
592
|
+
**Last Updated**: 2026-01-23
|
|
593
|
+
**Current Sprint**: v2.8 - "Marketing Pivot & Community Launch"
|
|
594
|
+
**Completed Sprints**: v2.1, v2.2, v2.3, v2.4, v2.5, v2.6, v2.7 (see `docs/archive/`)
|
|
359
595
|
|
|
360
|
-
<!-- @cortex-tms-version
|
|
596
|
+
<!-- @cortex-tms-version 3.0.0 -->
|
package/bin/cortex.js
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Cortex TMS CLI - Shorthand Executable Wrapper
|
|
5
|
+
*
|
|
6
|
+
* Provides `cortex` as a shorthand alias for `cortex-tms` command.
|
|
7
|
+
* Always runs compiled JavaScript from dist/ when installed via NPM.
|
|
8
|
+
* For development with source files, use: npm run cli:dev
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
import { fileURLToPath } from 'url';
|
|
12
|
+
import { dirname, join } from 'path';
|
|
13
|
+
|
|
14
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
15
|
+
const __dirname = dirname(__filename);
|
|
16
|
+
|
|
17
|
+
// Always run compiled JavaScript (production mode)
|
|
18
|
+
await import(join(__dirname, '../dist/cli.js'));
|
package/dist/cli.js
CHANGED
|
@@ -22,18 +22,34 @@ import { statusCommand } from './commands/status.js';
|
|
|
22
22
|
import { migrateCommand } from './commands/migrate.js';
|
|
23
23
|
import { promptCommand } from './commands/prompt.js';
|
|
24
24
|
import { tutorialCommand } from './commands/tutorial.js';
|
|
25
|
+
import { reviewCommand } from './commands/review.js';
|
|
25
26
|
program.addCommand(initCommand);
|
|
26
27
|
program.addCommand(validateCommand);
|
|
27
28
|
program.addCommand(statusCommand);
|
|
28
29
|
program.addCommand(migrateCommand);
|
|
29
30
|
program.addCommand(promptCommand);
|
|
30
31
|
program.addCommand(tutorialCommand);
|
|
32
|
+
program.addCommand(reviewCommand);
|
|
31
33
|
program.on('command:*', () => {
|
|
32
34
|
console.error(chalk.red('\nβ Invalid command:'), chalk.bold(program.args.join(' ')));
|
|
33
35
|
console.log(chalk.gray('\nRun'), chalk.cyan('cortex-tms --help'), chalk.gray('to see available commands.'));
|
|
34
36
|
process.exit(1);
|
|
35
37
|
});
|
|
36
|
-
program.
|
|
38
|
+
program.exitOverride();
|
|
39
|
+
try {
|
|
40
|
+
await program.parseAsync(process.argv);
|
|
41
|
+
}
|
|
42
|
+
catch (error) {
|
|
43
|
+
if (error instanceof Error) {
|
|
44
|
+
if ('code' in error && typeof error.code === 'string') {
|
|
45
|
+
process.exit(1);
|
|
46
|
+
}
|
|
47
|
+
if (!error.message.includes('(outputHelp)')) {
|
|
48
|
+
console.error(chalk.red('\nβ Error:'), error.message);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
process.exit(1);
|
|
52
|
+
}
|
|
37
53
|
if (!process.argv.slice(2).length) {
|
|
38
54
|
program.outputHelp();
|
|
39
55
|
}
|
package/dist/cli.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file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CAAC,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAC,EAAE,CAAC;YAC5C,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,YAAY,CAAC,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC;QACxD,CAAC;IACH,CAAC;IACD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC;AAGD,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;IAClC,OAAO,CAAC,UAAU,EAAE,CAAC;AACvB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../src/commands/init.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAqBpC,wBAAgB,iBAAiB,IAAI,OAAO,CAe3C;
|
|
1
|
+
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../src/commands/init.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAqBpC,wBAAgB,iBAAiB,IAAI,OAAO,CAe3C;AAsSD,eAAO,MAAM,WAAW,SAAsB,CAAC"}
|
package/dist/commands/init.js
CHANGED
|
@@ -26,8 +26,7 @@ async function runInit(options) {
|
|
|
26
26
|
if (options.scope) {
|
|
27
27
|
const validScopes = ['nano', 'standard', 'enterprise', 'custom'];
|
|
28
28
|
if (!validScopes.includes(options.scope)) {
|
|
29
|
-
|
|
30
|
-
process.exit(1);
|
|
29
|
+
throw new Error(`Invalid scope "${options.scope}". Must be one of: ${validScopes.join(', ')}`);
|
|
31
30
|
}
|
|
32
31
|
}
|
|
33
32
|
if (options.dryRun) {
|
|
@@ -90,7 +89,7 @@ async function runInit(options) {
|
|
|
90
89
|
console.error(chalk.red('\nβ Error:'), 'Interactive prompts require a TTY.');
|
|
91
90
|
console.log(chalk.gray('Use --scope <scope> and --force flags for non-interactive environments (CI/CD).'));
|
|
92
91
|
console.log(chalk.gray('Example: cortex-tms init --scope standard --force\n'));
|
|
93
|
-
|
|
92
|
+
throw new Error('TMS files already exist');
|
|
94
93
|
}
|
|
95
94
|
answers = await runInitPrompts(context, cwd);
|
|
96
95
|
}
|
|
@@ -165,17 +164,28 @@ async function runInit(options) {
|
|
|
165
164
|
console.log(chalk.green.bold('\n⨠Success!'), chalk.gray('Cortex TMS initialized.\n'));
|
|
166
165
|
}
|
|
167
166
|
if (!options.dryRun) {
|
|
168
|
-
console.log(chalk.bold('
|
|
169
|
-
console.log(
|
|
170
|
-
console.log(chalk.
|
|
171
|
-
console.log(chalk.gray('
|
|
167
|
+
console.log(chalk.bold('π Quick Start'), chalk.gray('(choose one):'));
|
|
168
|
+
console.log();
|
|
169
|
+
console.log(chalk.cyan(' Option A - With your AI agent'), chalk.gray('(recommended):'));
|
|
170
|
+
console.log(chalk.gray(' 1. Open your AI tool (Claude Code, Copilot, Cursor, etc.)'));
|
|
171
|
+
console.log(chalk.gray(' 2. Run:'), chalk.cyan('cortex-tms prompt bootstrap'));
|
|
172
|
+
console.log(chalk.gray(' 3. Paste the prompt - your AI will analyze the codebase and'));
|
|
173
|
+
console.log(chalk.gray(' populate your documentation files as drafts for you to review'));
|
|
174
|
+
console.log();
|
|
175
|
+
console.log(chalk.cyan(' Option B - Manual setup:'));
|
|
176
|
+
console.log(chalk.gray(' 1. Review'), chalk.cyan('NEXT-TASKS.md'), chalk.gray('for active sprint tasks'));
|
|
177
|
+
console.log(chalk.gray(' 2. Update'), chalk.cyan('docs/core/'), chalk.gray('with your project details'));
|
|
178
|
+
console.log(chalk.gray(' 3. Customize'), chalk.cyan('.github/copilot-instructions.md'));
|
|
172
179
|
if (answers.installSnippets) {
|
|
173
|
-
console.log(
|
|
180
|
+
console.log();
|
|
181
|
+
console.log(chalk.gray(' π‘ Tip: Use'), chalk.cyan('tms-adr'), chalk.gray('or'), chalk.cyan('tms-pattern'), chalk.gray('snippets in VS Code for rapid documentation'));
|
|
174
182
|
}
|
|
175
183
|
if (!context.isGitRepo) {
|
|
176
|
-
console.log(
|
|
184
|
+
console.log();
|
|
185
|
+
console.log(chalk.gray(' π‘ Tip: Initialize git with'), chalk.cyan('git init'), chalk.gray('to track changes'));
|
|
177
186
|
}
|
|
178
|
-
console.log(
|
|
187
|
+
console.log();
|
|
188
|
+
console.log(chalk.gray('π Learn more:'), chalk.underline('https://cortex-tms.org'));
|
|
179
189
|
console.log();
|
|
180
190
|
}
|
|
181
191
|
}
|
|
@@ -186,7 +196,7 @@ async function runInit(options) {
|
|
|
186
196
|
console.error(chalk.gray('\nStack trace:'));
|
|
187
197
|
console.error(chalk.gray(error.stack));
|
|
188
198
|
}
|
|
189
|
-
|
|
199
|
+
throw error instanceof Error ? error : new Error('Unknown error');
|
|
190
200
|
}
|
|
191
201
|
}
|
|
192
202
|
export const initCommand = createInitCommand();
|