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.
$ npx -y skills add cortex-tms/cortex-tms --agent claude-code
Run the curl in your terminal, the rest in Claude Code.
Repo: cortex-tms/cortex-tms
What's inside
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.
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 --preset node # Node.js governance pack
cortex-tms init --preset python # Python governance pack
cortex-tms init --preset go # Go governance pack
cortex-tms init --preset node --scope standard --force # CI-friendly
cortex-tms init --dry-run # Preview changes
Governance packs (--preset) fill template content with ecosystem-specific
patterns, conventions, and idioms. Independent of --scope (which controls the
file set). Available presets: node, python, go.
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).
cortex-tms mcp πStart a read-only MCP (Model Context Protocol) server that exposes your TMS governance docs as resources to any AI tool that speaks MCP β Claude Desktop, Cursor, Windsurf, and future clients.
cortex-tms mcp # Start MCP server (STDIO transport)
cortex-tms mcp --print-config # Print paste-ready client config snippets
Resources exposed (only files that exist on disk are advertised):
| URI | File | Description |
|---|---|---|
cortex://next-tasks | NEXT-TASKS.md | Active tasks and sprint backlog |
cortex://claude | CLAUDE.md | AI agent instructions and workflow |
cortex://patterns | docs/core/PATTERNS.md | Code patterns and conventions |
cortex://architecture | docs/core/ARCHITECTURE.md | System architecture |
cortex://domain-logic | docs/core/DOMAIN-LOGIC.md | Business logic and domain model |
cortex://decisions | docs/core/DECISIONS.md | Architecture decision records |
cortex://troubleshooting | docs/core/TROUBLESHOOTING.md | Common issues and solutions |
cortex://glossary | docs/core/GLOSSARY.md | Terminology and definitions |
cortex://schema | docs/core/SCHEMA.md | Data schemas and API contracts |
cortex://copilot-instructions | .github/copilot-instructions.md | Copilot instructions |
cortex://prompts | PROMPTS.md | Reusable prompt templates |
cortex://agents | AGENTS.md | Multi-agent governance registry |
cortex://future-enhancements | FUTURE-ENHANCEMENTS.md | Roadmap and backlog |
Client setup β run cortex-tms mcp --print-config for paste-ready snippets. Quick reference:
Claude Desktop (~/Library/Application Support/Claude/claude_desktop_config.json):
{
"mcpServers": {
"cortex-tms": {
"command": "npx",
"args": ["-y", "cortex-tms", "mcp"],
"cwd": "/path/to/your/project"
}
}
}
Notes:
.cortexrc custom paths (paths.docs, paths.tasks)..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 .cortexrc:
{
"version": "4.0.0",
"scope": "standard",
"staleness": {
"enabled": true,
"thresholdDays": 30,
"minCommits": 3,
"docs": {
"docs/core/PATTERNS.md": ["src/"],
"docs/core/ARCHITECTURE.md": ["src/", "infrastructure/"],
"docs/core/DOMAIN-LOGIC.md": ["src/"]
}
}
}
How it works:
daysSinceDocUpdate > thresholdDays AND meaningfulCommits >= minCommitsLimitations (v1):
CI Setup: Ensure fetch-depth: 0 in GitHub Actions to enable staleness detection.
Add to .github/workflows/validate.yml:
name: Cortex TMS Validation
on: [push, pull_request]
jobs:
validate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # Required for staleness detection
- uses: actions/setup-node@v4
with:
node-version: '20'
- name: Validate TMS Health
run: npx cortex-tms@latest validate --strict
Strict mode: Warnings become errors, failing the build if:
π― Strategic Repositioning: Quality governance over token optimization
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?"
Staleness Detection (v4.0):
fetch-depth: 0)Archive Command:
cortex-tms archive - Archive completed tasksauto-tier commandSimplified Status:
--tokens flag (streamlined to governance focus)Removed:
cortex-tms status --tokens flagDeprecated:
cortex-tms auto-tier β Use cortex-tms archive (still works with warning)Migration:
cortex-tms status (no flags needed)cortex-tms archive instead of auto-tierSee CHANGELOG.md for full version history.
Start simple: Use --scope nano for minimal setup, expand as needed.
npx cortex-tms init - 60 seconds to governance docsTested With: Claude Code, GitHub Copilot (in VS Code). Architecture supports any AI tool.
Star us on GitHub β if Cortex TMS helps your AI development workflow!
v4.0 (Released - Feb 2026):
v4.1 (In Progress - Mar 2026):
cortex-tms hooks install)v4.2+ (Future):
See FUTURE-ENHANCEMENTS.md for full roadmap.
MIT - See LICENSE for details
Version: 4.1.0 Last Updated: 2026-02-21 Current Sprint: v4.0 - "Quality Governance & Staleness Detection"
.claude/
skills/
implement/
SKILL.md
new-command/
SKILL.md
plan/
SKILL.md
release/
SKILL.md
sync/
SKILL.md
validate/
SKILL.md
.cortex/
backups/
release-2026-01-28T07-18-52/
CHANGELOG.md
manifest.json
NEXT-TASKS.md
package.json
pnpm-lock.yaml
README.md
release-2026-02-23T06-43-20/
CHANGELOG.md
manifest.json
NEXT-TASKS.md
package.json
pnpm-lock.yaml
README.md
.cortexrc
.cortexrc.example
.github/
assets/
README.md
social-preview-with-logo.png
social-preview-with-logo.svg
copilot-instructions.md
dependabot.yml
DISCUSSION_TEMPLATE/
ideas.yml
question.yml
README.md
show-and-tell.yml
GITHUB-TEMPLATE-SETUP.md
ISSUE_TEMPLATE/
bug_report.md
config.yml
feature_request.md
question.md
PULL_REQUEST_TEMPLATE.md
template.yml
workflows/
pr-checks.yml
stale-pr.yml
tms-validate.yml
validate-reusable.yml
.gitignore
.husky/
pre-commit
.npmrc
assets/
demo.gif
demo.tape
README.md
AUDIT-v4.0.0.md
bin/
cortex-tms.js
cortex.js
CHANGELOG.md
CLAUDE.md
CONTRIBUTING.md
docs/
archive/
AUDIT-v4.0.0.md
bootstrap-v3.0-implementation-feedback.md
bootstrap-v3.0-strategy-feedback-v2.md
bootstrap-v3.0-strategy-plan.md
dashboard-v3.3.0-sprint.md
dogfooding-bootstrap-v3.0.md
error-audit-summary.md
planning/
phase3-plan.md
plans/
agent-skills-integration.md
agents-md-plan.md
OPT-1-guardian-json-output.md
sprint-2026-01-dogfooding.md
sprint-2026-01.md
sprint-v2.3-confidence-comfort.md
sprint-v2.5-guidance-growth.md
sprint-v2.6-integrity-atomicity.md
sprint-v2.6.1-emergency-patch.md
sprint-v2.6.1-implementation-checklist.md
sprint-v2.7-jan-2026.md
sprint-v2.9-jan-2026.md
sprint-v3.0-boot-1.md
sprint-v3.1-jan-2026.md
sprint-v3.2-jan-2026.md
v1.0-CHANGELOG.md
v3.1-security-tasks.md
v3.2-polish-docs.md
v3.3-phase1-implementation.md
v4.0-phase1-website-alignment.md
v4.0-sprint.md
v4.1-sprint.md
v4.2-phase2-sprint.md
v4.2-phase3-sprint.md
v4.2-phase4-mcp.md
validation/
phase2-sandbox.md
COMMUNITY.md
core/
AI-COLLABORATION-POLICY.md
ARCHITECTURE.md
CONTENT-STANDARDS.md
DECISIONS.md
DOMAIN-LOGIC.md
GIT-STANDARDS.md
GLOSSARY.md
INFRASTRUCTURE.md
PATTERNS.md
SCHEMA.md
SECURITY.md
TROUBLESHOOTING.md
DISCUSSION_SETUP_CHECKLIST.md
guides/
API.md
BEST-PRACTICES.md
CLI-USAGE.md
MIGRATION-GUIDE.md
QUICK-START.md
SECURITY-TESTING.md
learning/
2026-01-21-liquid-glass-design-retrospective.md
plans/
tms-429-mcp-server.md
tms-430-agent-skills.md
troubleshooting/
nodejs-25-esm-error.md
WELCOME_DISCUSSION.md
eslint.config.mjs
examples/
todo-app/
.cortex/
project.json
README.md
.cortexrc
.github/
copilot-instructions.md
.gitignore
CLAUDE.md
components.json
docs/
archive/
v1.0-CHANGELOG.md
core/
ARCHITECTURE.md
DECISIONS.md
DOMAIN-LOGIC.md
GLOSSARY.md
PATTERNS.md
SCHEMA.md
TROUBLESHOOTING.md
eslint.config.mjs
FUTURE-ENHANCEMENTS.md
NEXT-TASKS.md
next.config.ts
package.json
pnpm-lock.yaml
pnpm-workspace.yaml
postcss.config.mjs
PROMPTS.md
public/
file.svg
globe.svg
next.svg
vercel.svg
window.svg
README.md
src/
app/
favicon.ico
globals.css
layout.tsx
page.tsx
components/
todo-filters.tsx
todo-form.tsx
todo-item.tsx
todo-list.tsx
ui/
button.tsx
card.tsx
checkbox.tsx
dialog.tsx
input.tsx
lib/
storage.ts
utils.ts
types/
todo.ts
tsconfig.json
FUTURE-ENHANCEMENTS.md
GITHUB-TOPICS.md
LICENSE
NEXT-TASKS.md
package.json
pnpm-lock.yaml
pnpm-workspace.yaml
PROMPTS.md
README.md
scripts/
git-guardian.js
release-hotfix.js
release.js
sync-project.js
tag-root-docs.js
tag-templates.js
src/
__tests__/
agents.test.ts
api-key-redaction-integration.test.ts
archive.test.ts
auto-tier-e2e.test.ts
auto-tier.test.ts
errors.test.ts
fixtures/
tms-project/
CLAUDE.md
docs/
archive/
old-doc.md
core/
PATTERNS.md
NEXT-TASKS.md
README.md
git-staleness.test.ts
guardian-accuracy.test.ts
hooks.test.ts
init-e2e.test.ts
init.test.ts
integration.test.ts
llm-client.test.ts
mcp.test.ts
migrate-e2e.test.ts
migrate.test.ts
package-manager.test.ts
presets.test.ts
release.test.ts
review-e2e.test.ts
review.test.ts
sanitize.test.ts
utils/
cli-runner.ts
populate-placeholders.ts
review-runner.ts
stats-collector.test.ts
temp-dir.ts
validate-e2e.test.ts
validate.test.ts
validation.test.ts
cli.ts
commands/
archive.ts
auto-tier.ts
dashboard.ts
hooks.ts
init.ts
mcp.ts
migrate.ts
prompt.ts
review.ts
status.ts
tutorial.ts
validate.ts
README.md
types/
cli.ts
guardian.ts
ui/
components/
dashboard/
Dashboard.tsx
FileDistributionCard.tsx
FileSizeHealthCard.tsx
Footer.tsx
GovernanceHealthCard.tsx
GuardianStatusCard.tsx
Header.tsx
HotFilesCard.tsx
index.tsx
NotConfiguredCard.tsx
SprintProgressCard.tsx
StalenessCard.tsx
TabBar.tsx
ValidationCard.tsx
ViewContainer.tsx
index.tsx
utils/
backup.ts
config.ts
detection.ts
errors.ts
git-history.ts
git-staleness.ts
guardian-prompt.ts
llm-client.ts
package-manager.ts
prompt-parser.ts
prompts.ts
resources.ts
sanitize.ts
stats-collector.ts
status.ts
templates.ts
tier-tags.ts
validation.ts
validator.ts
templates/
.github/
copilot-instructions.md
AGENTS.md
CLAUDE.md
docs/
archive/
v1.0-CHANGELOG.md
core/
ARCHITECTURE.md
DECISIONS.md
DOMAIN-LOGIC.md
GLOSSARY.md
PATTERNS.md
SCHEMA.md
TROUBLESHOOTING.md
FUTURE-ENHANCEMENTS.md
NEXT-TASKS.md
presets/
go/
.github/
copilot-instructions.md
AGENTS.md
CLAUDE.md
docs/
core/
ARCHITECTURE.md
DOMAIN-LOGIC.md
PATTERNS.md
node/
.github/
copilot-instructions.md
AGENTS.md
CLAUDE.md
docs/
core/
ARCHITECTURE.md
DOMAIN-LOGIC.md
PATTERNS.md
python/
.github/
copilot-instructions.md
AGENTS.md
CLAUDE.md
docs/
core/
ARCHITECTURE.md
DOMAIN-LOGIC.md
PATTERNS.md
PROMPTS.md
README.md
vscode/
tms.code-snippets
tsconfig.cli.json
videos/
test-video/
hero-video-final-50s.mp4
vitest.config.ts
website/
.env.example
astro.config.mjs
package-lock.json
package.json
public/
external-links.js
favicon.png
glass-effects.js
images/
blog/
ai-powered-bootstrapping.webp
cortex-dogfooding-case-study.webp
default-hero.webp
measuring-context-optimization.svg
measuring-context-optimization.webp
preventing-ai-pr-tsunami.webp
why-ai-agents-need-more-than-readme.webp
logo.svg
src/
assets/
logo-dark.svg
logo.svg
... 148 moreFAQ
cortex-tms is a Claude Code plugin with 6 hand-picked skills for documentation work, indexed on Flowy. Install it with the command on its page. It includes implement, new-command, plan. Its skills do not fire on their own yet. Request auto-invocation to have Flowy route them as you prompt. Free and open source.