by cortex-tms
The Universal AI-Optimized Project Boilerplate. A Tiered Memory System (TMS) designed to maximize AI agent performance. Includes an interactive CLI tool and a high-signal documentation standard.
# Add to your Claude Code skills
git clone https://github.com/cortex-tms/cortex-tmsCortex 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.
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.
The Solution: Cortex TMS provides:
Scaffold governance docs that AI agents actually read:
PATTERNS.md - Code patterns and conventionsCLAUDE.md - Agent workflow rules (git protocol, scope discipline, human approval gates)ARCHITECTURE.md - System design and tech stackDOMAIN-LOGIC.md - Business rules and constraintsResult: AI writes code that follows YOUR patterns, not random conventions from its training data.
New in v4.0: Git-based staleness detection catches when docs go stale:
cortex-tms validate
⚠️ Doc Staleness
PATTERNS.md may be outdated
Doc is 45 days older than code with 12 meaningful commits
Code: 2026-02-20
Doc: 2026-01-06
Review docs/core/PATTERNS.md to ensure it reflects current codebase
How it works: Compares doc modification dates vs code commit activity. Flags stale docs before they mislead AI agents.
Note: Staleness v1 uses git timestamps (temporal comparison only). Cannot detect semantic misalignment. Future versions will add semantic analysis.
CLAUDE.md governance rules require human approval for critical operations:
Result: AI agents stay powerful but don't run wild.
# Initialize governance docs in your project
npx cortex-tms@latest init
# Validate doc health (including staleness detection)
npx cortex-tms@latest validate
# Strict mode (warnings = errors, for CI)
npx cortex-tms@latest validate --strict
# Check project status
npx cortex-tms@latest status
# Archive completed tasks
npx cortex-tms@latest archive --dry-run
Installation: No installation required with npx. For frequent use: npm install -g cortex-tms@latest
cortex-tms initScaffold TMS documentation structure with interactive scope selection.
cortex-tms init # Interactive mode
cortex-tms init --scope standard # Non-interactive
cortex-tms init --dry-run # Preview changes
cortex-tms validateVerify project TMS health with automated checks.
cortex-tms validate # Check project health
cortex-tms validate --fix # Auto-repair missing files
cortex-tms validate --strict # Strict mode (warnings = errors)
What it checks:
[Project Name] markers left)cortex-tms statusText summary of project health and sprint progress.
cortex-tms status # Health summary with progress bars
Shows: project identity, validation status, sprint progress, backlog size.
cortex-tms dashboard ✨ New in v4.0Full-screen interactive terminal UI for governance health monitoring.
cortex-tms dashboard # Interactive dashboard (navigate with 1/2/3 keys)
cortex-tms dashboard --live # Auto-refresh every 5 seconds
Three views (switch with number keys):
cortex-tms archiveArchive completed tasks and old content.
cortex-tms archive # Archive completed tasks
cortex-tms archive --dry-run # Preview what would be archived
Archives completed tasks from NEXT-TASKS.md to docs/archive/ with timestamp.
Note: cortex-tms auto-tier is deprecated—use archive instead.
cortex-tms migrateIntelligent version management—detect outdated templates and upgrade safely.
cortex-tms migrate # Analyze version status
cortex-tms migrate --apply # Auto-upgrade OUTDATED files
cortex-tms migrate --rollback # Restore from backup
cortex-tms promptAccess project-aware AI prompts from the Essential 7 library.
cortex-tms prompt # Interactive selection
cortex-tms prompt init-session # Auto-copies to clipboard
cortex-tms review 🛡️Guardian: AI-powered semantic validation against project patterns.
cortex-tms review src/index.ts # Validate against PATTERNS.md
cortex-tms review src/index.ts --safe # High-confidence violations only
cortex-tms tutorialInteractive walkthrough teaching the Cortex Way.
cortex-tms tutorial # 5-lesson guided tour (~15 minutes)
cortex-tms hooksManage git hooks for automatic documentation validation. Installs a pre-commit hook that runs cortex-tms validate before every commit.
cortex-tms hooks install # Install pre-commit hook (default mode)
cortex-tms hooks install --strict # Warnings also block commits
cortex-tms hooks install --skip-staleness # Skip staleness checks (faster)
cortex-tms hooks status # Show current hook configuration
cortex-tms hooks uninstall # Remove the hook
Safety: Never overwrites foreign hooks. Only manages hooks with its own marker. Requires .cortexrc (run cortex-tms init first).
| Folder / File | Purpose | Tier |
| :-------------------------------- | :------------------------------------- | :------------------------ |
| NEXT-TASKS.md | Active sprint and current focus | HOT (Always Read) |
| PROMPTS.md | AI interaction templates (Essential 7) | HOT (Always Read) |
| CLAUDE.md | CLI commands & workflow config | HOT (Always Read) |
| .github/copilot-instructions.md | Global guardrails and critical rules | HOT (Always Read) |
| FUTURE-ENHANCEMENTS.md | Living backlog (not current sprint) | PLANNING |
| docs/core/ARCHITECTURE.md | System design & tech stack | WARM (Read on Demand) |
| docs/core/PATTERNS.md | Canonical code examples (Do/Don't) | WARM (Read on Demand) |
| docs/core/DOMAIN-LOGIC.md | Immutable project rules | WARM (Read on Demand) |
| docs/core/GIT-STANDARDS.md | Git & PM conventions | WARM (Read on Demand) |
| docs/core/DECISIONS.md | Architecture Decision Records | WARM (Read on Demand) |
| docs/core/GLOSSARY.md | Project terminology | WARM (Read on Demand) |
| AGENTS.md | Multi-agent governance (optional) | WARM (Read on Demand) |
| docs/archive/ | Historical changelogs | COLD (Ignore) |
HOT/WARM/COLD System: Organizes docs by access frequency (not token optimization). Helps AI find what's relevant for each task.
Configure staleness thresholds in `.
No comments yet. Be the first to share your thoughts!