cortex-tms 2.6.1 β 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 +282 -67
- package/bin/cortex-tms.js +0 -0
- package/bin/cortex.js +0 -0
- package/dist/cli.js +15 -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.js +4 -7
- 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.map +1 -1
- package/dist/commands/review.js +105 -68
- package/dist/commands/review.js.map +1 -1
- 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/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 +10 -0
- package/dist/utils/llm-client.d.ts.map +1 -1
- package/dist/utils/llm-client.js +192 -60
- package/dist/utils/llm-client.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.map +1 -1
- package/dist/utils/validator.js +46 -26
- package/dist/utils/validator.js.map +1 -1
- package/package.json +4 -4
- 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,8 +1,14 @@
|
|
|
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
|
+
|
|
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.
|
|
6
12
|
|
|
7
13
|
[](https://www.npmjs.com/package/cortex-tms)
|
|
8
14
|
[](https://www.npmjs.com/package/cortex-tms)
|
|
@@ -45,6 +51,32 @@ Choose your scope (Nano/Standard/Enterprise) and start building with AI-optimize
|
|
|
45
51
|
|
|
46
52
|
---
|
|
47
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
|
+
|
|
78
|
+
---
|
|
79
|
+
|
|
48
80
|
## π― The Philosophy: Signal over Noise
|
|
49
81
|
|
|
50
82
|
Traditional repos drown AI agents in thousands of lines of historical tasks and stale documentation. **Cortex TMS** forces agents into a "Tiered" approach:
|
|
@@ -59,9 +91,10 @@ Traditional repos drown AI agents in thousands of lines of historical tasks and
|
|
|
59
91
|
|
|
60
92
|
## π οΈ CLI Commands
|
|
61
93
|
|
|
62
|
-
Cortex TMS provides
|
|
94
|
+
Cortex TMS provides 7 production-ready commands (v2.6.1):
|
|
63
95
|
|
|
64
96
|
### `cortex-tms tutorial`
|
|
97
|
+
|
|
65
98
|
Interactive walkthrough teaching the "Cortex Way" - perfect for first-time users.
|
|
66
99
|
|
|
67
100
|
```bash
|
|
@@ -69,6 +102,7 @@ cortex-tms tutorial # Start the guided tour
|
|
|
69
102
|
```
|
|
70
103
|
|
|
71
104
|
**What You'll Learn**:
|
|
105
|
+
|
|
72
106
|
- Project Dashboard: Using `status` to see your cockpit
|
|
73
107
|
- AI Activation: Using `prompt` to activate project-aware AI agents
|
|
74
108
|
- Zero-Drift Governance: Automated version sync with `docs:sync`
|
|
@@ -80,6 +114,7 @@ cortex-tms tutorial # Start the guided tour
|
|
|
80
114
|
---
|
|
81
115
|
|
|
82
116
|
### `cortex-tms init`
|
|
117
|
+
|
|
83
118
|
Initialize TMS structure in your project with interactive scope selection.
|
|
84
119
|
|
|
85
120
|
```bash
|
|
@@ -89,6 +124,7 @@ cortex-tms init --dry-run # Preview changes
|
|
|
89
124
|
```
|
|
90
125
|
|
|
91
126
|
### `cortex-tms validate`
|
|
127
|
+
|
|
92
128
|
Verify your project's TMS health and auto-fix common issues.
|
|
93
129
|
|
|
94
130
|
```bash
|
|
@@ -98,13 +134,25 @@ cortex-tms validate --strict # Strict mode with no warnings
|
|
|
98
134
|
```
|
|
99
135
|
|
|
100
136
|
### `cortex-tms status`
|
|
101
|
-
|
|
137
|
+
|
|
138
|
+
Project cockpit with health dashboard, sprint progress, and token analysis.
|
|
102
139
|
|
|
103
140
|
```bash
|
|
104
|
-
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
|
|
105
144
|
```
|
|
106
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
|
+
|
|
107
154
|
### `cortex-tms migrate`
|
|
155
|
+
|
|
108
156
|
Intelligent version managementβdetect outdated templates and automatically upgrade with safety backups.
|
|
109
157
|
|
|
110
158
|
```bash
|
|
@@ -116,18 +164,21 @@ cortex-tms migrate --dry-run # Preview migration plan
|
|
|
116
164
|
```
|
|
117
165
|
|
|
118
166
|
**Status Categories**:
|
|
167
|
+
|
|
119
168
|
- `LATEST`: Already on current version
|
|
120
169
|
- `OUTDATED`: Safe to auto-upgrade (matches old template)
|
|
121
170
|
- `CUSTOMIZED`: Manual review needed (has user changes)
|
|
122
171
|
- `MISSING`: Optional file not installed
|
|
123
172
|
|
|
124
173
|
**Safety Features**:
|
|
174
|
+
|
|
125
175
|
- Automatic backups in `.cortex/backups/` before any changes
|
|
126
176
|
- Timestamped snapshots with manifest files
|
|
127
177
|
- One-click rollback with interactive backup selection
|
|
128
178
|
- Confirmation prompts prevent accidental overwrites
|
|
129
179
|
|
|
130
180
|
### `cortex-tms prompt`
|
|
181
|
+
|
|
131
182
|
Access project-aware AI prompts from the Essential 7 library.
|
|
132
183
|
|
|
133
184
|
```bash
|
|
@@ -137,6 +188,7 @@ cortex-tms prompt --list # Browse all prompts
|
|
|
137
188
|
```
|
|
138
189
|
|
|
139
190
|
**The Essential 7**:
|
|
191
|
+
|
|
140
192
|
- `init-session` - Start your AI session with context
|
|
141
193
|
- `feature` - Implement new features with architectural anchors
|
|
142
194
|
- `debug` - Troubleshoot with known issues lookup
|
|
@@ -145,54 +197,192 @@ cortex-tms prompt --list # Browse all prompts
|
|
|
145
197
|
- `decision` - Create Architecture Decision Records
|
|
146
198
|
- `finish` - Execute maintenance protocol
|
|
147
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
|
+
|
|
148
318
|
---
|
|
149
319
|
|
|
150
320
|
## π Documentation Structure
|
|
151
321
|
|
|
152
|
-
| Folder / File
|
|
153
|
-
|
|
154
|
-
| `NEXT-TASKS.md`
|
|
155
|
-
| `PROMPTS.md`
|
|
156
|
-
| `CLAUDE.md`
|
|
157
|
-
| `.github/copilot-instructions.md` | Global guardrails and critical rules
|
|
158
|
-
| `FUTURE-ENHANCEMENTS.md`
|
|
159
|
-
| `docs/core/ARCHITECTURE.md`
|
|
160
|
-
| `docs/core/PATTERNS.md`
|
|
161
|
-
| `docs/core/DOMAIN-LOGIC.md`
|
|
162
|
-
| `docs/core/GIT-STANDARDS.md`
|
|
163
|
-
| `docs/core/DECISIONS.md`
|
|
164
|
-
| `docs/core/GLOSSARY.md`
|
|
165
|
-
| `docs/core/SCHEMA.md`
|
|
166
|
-
| `docs/core/TROUBLESHOOTING.md`
|
|
167
|
-
| `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`.
|
|
168
345
|
|
|
169
346
|
---
|
|
170
347
|
|
|
171
|
-
## π 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)
|
|
172
359
|
|
|
173
|
-
|
|
174
|
-
- **
|
|
175
|
-
- **
|
|
176
|
-
- **
|
|
177
|
-
- **Jump to Any Lesson**: `--lesson N` flag for direct access
|
|
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
|
|
178
364
|
|
|
179
|
-
###
|
|
180
|
-
- **Automatic Backups**: Timestamped snapshots in `.cortex/backups/` before any changes
|
|
181
|
-
- **One-Click Apply**: `migrate --apply` automatically upgrades templates
|
|
182
|
-
- **Interactive Rollback**: `migrate --rollback` restores from any backup
|
|
183
|
-
- **100% Data Protection**: Fail-safe design prevents data loss during template evolution
|
|
365
|
+
### Integration Test Suite (PRODUCTION QUALITY)
|
|
184
366
|
|
|
185
|
-
|
|
186
|
-
- **
|
|
187
|
-
- **
|
|
188
|
-
- **
|
|
189
|
-
- **75% Reduction**: in manual release steps
|
|
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
|
|
190
371
|
|
|
191
|
-
###
|
|
372
|
+
### Error Handling Refactor (DEVELOPER EXPERIENCE)
|
|
373
|
+
|
|
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
|
|
377
|
+
|
|
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
|
|
192
384
|
- **Migration Auditor**: Version tracking and customization detection
|
|
193
385
|
- **Prompt Engine**: Essential 7 library with clipboard integration
|
|
194
|
-
- **Status Dashboard**: Visual progress bars and health metrics
|
|
195
|
-
- **Self-Healing Validation**: `--fix` flag auto-repairs common issues
|
|
196
386
|
|
|
197
387
|
---
|
|
198
388
|
|
|
@@ -201,6 +391,7 @@ cortex-tms prompt --list # Browse all prompts
|
|
|
201
391
|
This repo is a **"Machine-Legible Project Constitution."** To get the best results:
|
|
202
392
|
|
|
203
393
|
### 1. The Context Trigger
|
|
394
|
+
|
|
204
395
|
```bash
|
|
205
396
|
cortex-tms prompt init-session
|
|
206
397
|
# Copies: "Review NEXT-TASKS.md, docs/core/ARCHITECTURE.md, and CLAUDE.md.
|
|
@@ -208,6 +399,7 @@ cortex-tms prompt init-session
|
|
|
208
399
|
```
|
|
209
400
|
|
|
210
401
|
### 2. Pattern Enforcement
|
|
402
|
+
|
|
211
403
|
```bash
|
|
212
404
|
cortex-tms prompt review
|
|
213
405
|
# Copies: "Review the current changes against PATTERNS.md.
|
|
@@ -215,10 +407,13 @@ cortex-tms prompt review
|
|
|
215
407
|
```
|
|
216
408
|
|
|
217
409
|
### 3. Truth Anchoring
|
|
410
|
+
|
|
218
411
|
If the AI hallucinates logic:
|
|
412
|
+
|
|
219
413
|
> _"Your calculation is wrong. Refer to the rules in docs/core/DOMAIN-LOGIC.md."_
|
|
220
414
|
|
|
221
415
|
### 4. Check Current Sprint
|
|
416
|
+
|
|
222
417
|
```bash
|
|
223
418
|
cortex-tms status # Visual dashboard with current tasks
|
|
224
419
|
```
|
|
@@ -228,6 +423,7 @@ cortex-tms status # Visual dashboard with current tasks
|
|
|
228
423
|
## π Development Roadmap
|
|
229
424
|
|
|
230
425
|
**Completed Phases** (All β
):
|
|
426
|
+
|
|
231
427
|
- [x] **Phase 1**: Dogfood the System - Applied TMS to Cortex itself
|
|
232
428
|
- [x] **Phase 2**: Complete Template Library - All templates built and validated
|
|
233
429
|
- [x] **Phase 3**: Build Example App - Gold Standard Next.js 15 Todo App
|
|
@@ -235,17 +431,20 @@ cortex-tms status # Visual dashboard with current tasks
|
|
|
235
431
|
- [x] **Phase 5**: Documentation & Guides - Status dashboard, snippets, validation
|
|
236
432
|
- [x] **Phase 6**: Publish & Scale - npm package + GitHub releases
|
|
237
433
|
|
|
238
|
-
**Current Version**: v2.
|
|
239
|
-
- β
Interactive Tutorial with 5-lesson guided walkthrough
|
|
240
|
-
- β
Safe-Fail Migration Engine (backup β apply β rollback)
|
|
241
|
-
- β
Zero-Drift Governance Suite (automated version sync)
|
|
242
|
-
- β
CI Guardian preventing version drift
|
|
243
|
-
- β
100% data protection during template upgrades
|
|
434
|
+
**Current Version**: v2.6.1 "Guardian & Green Governance" β
|
|
244
435
|
|
|
245
|
-
|
|
246
|
-
-
|
|
247
|
-
-
|
|
248
|
-
-
|
|
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
|
|
249
448
|
|
|
250
449
|
See `NEXT-TASKS.md` for current sprint details and `CHANGELOG.md` for full version history.
|
|
251
450
|
|
|
@@ -338,21 +537,37 @@ cortex-tms/
|
|
|
338
537
|
|
|
339
538
|
---
|
|
340
539
|
|
|
341
|
-
## π― Why Cortex TMS?
|
|
540
|
+
## π― Why Cortex TMS? Three Pillars, Measurable Results
|
|
541
|
+
|
|
542
|
+
### π° Cost Efficiency (Pillar 1)
|
|
543
|
+
|
|
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
|
|
342
563
|
|
|
343
|
-
**
|
|
344
|
-
- AI agents waste time reading historical noise
|
|
345
|
-
- Documentation drifts from reality
|
|
346
|
-
- No standard way to constrain AI attention
|
|
347
|
-
- Manual prompt writing for every interaction
|
|
564
|
+
**How**: Stop reading COLD files unless explicitly needed
|
|
348
565
|
|
|
349
|
-
|
|
350
|
-
- Tiered structure (HOT/WARM/COLD) maximizes signal
|
|
351
|
-
- Version metadata keeps templates synchronized
|
|
352
|
-
- Essential 7 prompts provide instant AI activation
|
|
353
|
-
- Project-aware guidance scales across team size
|
|
566
|
+
### π Developer Experience
|
|
354
567
|
|
|
355
|
-
**
|
|
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
|
|
356
571
|
|
|
357
572
|
---
|
|
358
573
|
|
|
@@ -373,9 +588,9 @@ MIT
|
|
|
373
588
|
|
|
374
589
|
## Status
|
|
375
590
|
|
|
376
|
-
**Version**:
|
|
377
|
-
**Last Updated**: 2026-01-
|
|
378
|
-
**Current Sprint**: v2.
|
|
379
|
-
**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/`)
|
|
380
595
|
|
|
381
|
-
<!-- @cortex-tms-version
|
|
596
|
+
<!-- @cortex-tms-version 3.0.0 -->
|
package/bin/cortex-tms.js
CHANGED
|
File without changes
|
package/bin/cortex.js
CHANGED
|
File without changes
|
package/dist/cli.js
CHANGED
|
@@ -35,7 +35,21 @@ program.on('command:*', () => {
|
|
|
35
35
|
console.log(chalk.gray('\nRun'), chalk.cyan('cortex-tms --help'), chalk.gray('to see available commands.'));
|
|
36
36
|
process.exit(1);
|
|
37
37
|
});
|
|
38
|
-
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
|
+
}
|
|
39
53
|
if (!process.argv.slice(2).length) {
|
|
40
54
|
program.outputHelp();
|
|
41
55
|
}
|
package/dist/cli.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AASA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,YAAY,EAAE,MAAM,IAAI,CAAC;AAClC,OAAO,EAAE,aAAa,EAAE,MAAM,KAAK,CAAC;AACpC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AACrC,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,MAAM,UAAU,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAClD,MAAM,SAAS,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;AAGtC,MAAM,WAAW,GAAG,IAAI,CAAC,KAAK,CAC5B,YAAY,CAAC,IAAI,CAAC,SAAS,EAAE,iBAAiB,CAAC,EAAE,OAAO,CAAC,CAC1D,CAAC;AAEF,MAAM,OAAO,GAAG,IAAI,OAAO,EAAE,CAAC;AAG9B,OAAO;KACJ,IAAI,CAAC,YAAY,CAAC;KAClB,WAAW,CACV,KAAK,CAAC,IAAI,CAAC,eAAe,CAAC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,CAAC;IAEf,IAAI,KAAK,YAAY,KAAK,EAAE,CAAC;QAE3B,IAAI,MAAM,IAAI,KAAK,IAAI,OAAO,KAAK,CAAC,IAAI,KAAK,QAAQ,EAAE,CAAC;YAEtD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAClB,CAAC;QAGD,IAAI,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();
|