Start with Standard
Most teams should use --scope standard. It provides the full TMS experience without overwhelming complexity.
The cortex-tms init command scaffolds a complete Tiered Memory System in your project. It creates the file structure, installs templates, and configures the documentation architecture based on your chosen scope.
cortex-tms init [options]Interactive by default. The init command walks you through a series of prompts to configure your TMS installation. For CI/CD environments, use --scope and --force flags for non-interactive mode.
What it does:
.cortexrc configuration file-s, --scope <scope>Specify project scope for non-interactive mode. Determines which template set to install.
Valid values: nano | standard | enterprise | custom
Scope comparison:
| Scope | Files Installed | Best For | Size |
|---|---|---|---|
| Nano | Core files only (4-6 files) | Solo developers, side projects | Minimal |
| Standard | Full TMS (12-15 files) | Professional projects, teams | Recommended |
| Enterprise | Complete suite (20+ files) | Large teams, compliance needs | Comprehensive |
| Custom | User-selected files | Specific requirements | Variable |
Example:
# Non-interactive install with Standard scopecortex-tms init --scope standard --force-f, --forceSkip confirmation prompts and overwrite existing files.
Use cases:
Behavior:
Example:
# Force install without prompts (CI-friendly)cortex-tms init --scope standard --force
# Reset installationcortex-tms init --force-m, --minimalInstall minimal template set (equivalent to --scope nano).
What gets installed:
NEXT-TASKS.md (HOT tier)CLAUDE.md (HOT tier).github/copilot-instructions.md (HOT tier)docs/core/PATTERNS.md (WARM tier).cortexrc (Configuration)Example:
# Minimal installation for solo developerscortex-tms init --minimal --forceWhen to use minimal:
-v, --verboseShow detailed output during initialization.
Extra information displayed:
Example:
cortex-tms init --verboseOutput example:
Project Context: Git repository: Yes Package.json: Yes Package manager: pnpm Existing TMS files: None
Placeholder Replacements: [Project Name] → acme-api [Project Description] → RESTful API for Acme Corp [Current Year] → 2026
Copying templates: ✓ NEXT-TASKS.md ✓ CLAUDE.md ✓ .github/copilot-instructions.md ...-d, --dry-runPreview changes without writing to disk.
What it shows:
Example:
cortex-tms init --dry-runOutput:
🔍 DRY RUN MODE: No files will be modified.
✓ Project context detected✓ Analysis complete: 12 files would be affected
Next Steps: 1. Review files above 2. Run without --dry-run to apply changesUse cases:
--scope nano --dry-run vs --scope standard --dry-run)When run without --scope or --force, the init command presents these prompts:
Project Name
What is your project name? [acme-api]Default: Directory name (normalized to lowercase-with-dashes)
Project Scope
Select your project scope:❯ Standard (Recommended for most teams) Nano (Minimal for solo developers) Enterprise (Full governance suite) Custom (Choose specific files)Determines which template files to install
VS Code Snippets (Standard/Enterprise only)
Install VS Code snippets for rapid documentation? (Y/n)Installs tms-adr, tms-pattern, and other shortcuts
Confirmation Summary
📋 Installation Summary: Project: acme-api Scope: Standard Files: 12 files to be created Snippets: Yes
Continue? (Y/n)Final check before writing files
For: Solo developers, side projects, MVP prototypes
Files installed (4 core files):
NEXT-TASKS.md # Current sprint tasksCLAUDE.md # AI workflow config.github/copilot-instructions.md # Critical rulesdocs/core/PATTERNS.md # Coding standardsCharacteristics:
Example project: Personal blog, weekend hackathon project
For: Professional projects, small-to-medium teams, startups
Files installed (12 files):
HOT Tier: NEXT-TASKS.md CLAUDE.md FUTURE-ENHANCEMENTS.md .github/copilot-instructions.md
WARM Tier: docs/core/ARCHITECTURE.md docs/core/PATTERNS.md docs/core/DOMAIN-LOGIC.md docs/core/GLOSSARY.md docs/core/SCHEMA.md docs/core/TROUBLESHOOTING.md docs/decisions/.gitkeep
COLD Tier: docs/archive/.gitkeepCharacteristics:
Example project: SaaS product, mobile app, enterprise API
For: Large teams, regulated industries, complex systems
Files installed (20+ files):
All Standard files, plus: docs/core/SECURITY.md docs/core/COMPLIANCE.md docs/core/DEPLOYMENT.md docs/core/MONITORING.md docs/runbooks/incident-response.md docs/runbooks/deployment-checklist.md docs/compliance/audit-log.md docs/compliance/data-privacy.md .cortex-validation.jsonCharacteristics:
Example project: Healthcare platform, financial services, government systems
For: Specific requirements, partial adoption, legacy systems
Interactive file selection:
Select files to install: [x] NEXT-TASKS.md [x] CLAUDE.md [ ] FUTURE-ENHANCEMENTS.md [x] docs/core/PATTERNS.md [ ] docs/core/ARCHITECTURE.md ...Use cases:
cd my-projectcortex-tms init🧠 Cortex TMS Initialization
✓ Project context detected
What is your project name? my-projectSelect your project scope: Standard (Recommended)Install VS Code snippets? Yes
📋 Installation Summary: Project: my-project Scope: Standard Files: 12 files to be created Snippets: Yes
Continue? Yes
✓ Templates copied: 12 files✓ VS Code snippets installed✓ Configuration saved
✨ Success! Cortex TMS initialized.
Next Steps: 1. Review NEXT-TASKS.md for active sprint tasks 2. Update docs/core/ with your project details 3. Customize .github/copilot-instructions.md for AI rulesname: Initialize Documentation
on: workflow_dispatch:
jobs: init-docs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4
- name: Setup Node.js uses: actions/setup-node@v4 with: node-version: '20'
- name: Install Cortex TMS
- name: Initialize TMS run: cortex-tms init --scope standard --force
- name: Commit Changes run: | git config user.name "GitHub Actions" git config user.email "[email protected]" git add . git commit -m "docs: initialize Cortex TMS structure" git pushinit-docs: stage: setup image: node:20 script: - cortex-tms init --scope standard --force - git config user.name "GitLab CI" - git add . - git commit -m "docs: initialize Cortex TMS" - git push only: - manual# Quick setup for solo developercortex-tms init --minimal --force
# Result: 4 files installed# - NEXT-TASKS.md# - CLAUDE.md# - .github/copilot-instructions.md# - docs/core/PATTERNS.md# See what would be installed without making changescortex-tms init --scope enterprise --dry-run
# Output shows:# - 24 files would be created# - Placeholder replacements preview# - No actual files written# Overwrite corrupted files with fresh templatescortex-tms init --force
# Better approach: Use migrate insteadcortex-tms migrate --apply| Code | Meaning | Scenario |
|---|---|---|
0 | Success | TMS initialized successfully |
1 | Error | Invalid scope, missing dependencies, file system errors |
Check exit code in scripts:
cortex-tms init --scope standard --forceif [ $? -eq 0 ]; then echo "TMS initialized successfully"else echo "Initialization failed" exit 1fiProblem: Running in CI/CD without --scope and --force flags
Solution:
# Wrong (interactive mode in CI)cortex-tms init
# Correct (non-interactive mode)cortex-tms init --scope standard --forceProblem: Typo in scope name
Solution:
# Wrongcortex-tms init --scope standar
# Correctcortex-tms init --scope standardValid scopes: nano, standard, enterprise, custom
Problem: Running init in directory with existing TMS files
Output:
⚠️ Warning: 5 TMS file(s) already exist: - NEXT-TASKS.md - CLAUDE.md - .cortexrc - docs/core/PATTERNS.md - .github/copilot-instructions.md
Use --force to overwrite, or remove existing files first.Solutions:
# Overwrite everything (loses custom changes)cortex-tms init --force# Preserve customizations (recommended)cortex-tms migrate# Remove existing files firstrm NEXT-TASKS.md CLAUDE.md .cortexrcrm -rf docs/cortex-tms initProblem: Corrupted or incomplete Cortex TMS installation
Solution:
# Reinstall Cortex TMS globallynpm uninstall -g cortex-tmsnpm install -g cortex-tms@latest
# Verify installationcortex-tms --version
# Retry initcortex-tms initCheck installation:
ls -la .vscode/tms.code-snippetsIf missing:
# Manually copy from templatescp node_modules/cortex-tms/templates/vscode/tms.code-snippets .vscode/
# Or reinstallcortex-tms init --forceActivate snippets:
tms- and press TabExample: File contains [Project Name] instead of actual project name
Cause: Non-interactive mode uses directory name as default
Fix:
# Manually edit filesvim NEXT-TASKS.md# Replace [Project Name] with your actual name
# Or reinitialize with interactive promptsrm .cortexrccortex-tms initProblem: Cannot create .github/ directory
Check permissions:
ls -la .github/Fix:
# Ensure directory exists and is writablemkdir -p .githubchmod 755 .github
# Retry initcortex-tms init --forceStart with Standard
Most teams should use --scope standard. It provides the full TMS experience without overwhelming complexity.
Commit Before Init
Always commit your existing work before running init --force. This makes rollback easy if something goes wrong.
Use Dry Run First
Run --dry-run to preview changes before installing. Compare different scopes to find the right fit.
Customize After Install
Init creates templates with placeholder text. Replace [Project Name], [Tech Stack], etc. with actual values immediately after installation.
# Initialize projectcortex-tms init --scope standard
# Validate installationcortex-tms validate --strict
# Should show all checks passed# Initialize projectcortex-tms init
# View dashboardcortex-tms status
# Output shows:# - Project name# - Scope (Standard)# - Health status# - Active sprint (placeholder)# Initialize projectcortex-tms init
# Learn the systemcortex-tms tutorial
# Interactive walkthrough of all featuresThe init command creates a .cortexrc file with project metadata:
{ "version": "2.6.0", "scope": "standard", "projectName": "acme-api", "createdAt": "2026-01-19T10:30:00.000Z", "metadata": { "packageManager": "pnpm", "isGitRepo": true }}Fields:
version: Cortex TMS version used during initscope: Template scope installedprojectName: Normalized project namecreatedAt: ISO timestamp of initializationmetadata: Additional context for toolingUsed by:
cortex-tms validate (checks configuration validity)cortex-tms status (displays project identity)cortex-tms migrate (determines upgrade path)After initializing Cortex TMS:
Replace Placeholder Text
Open NEXT-TASKS.md, CLAUDE.md, and other files to replace:
[Project Name] → Your actual project name[Tech Stack] → Your framework/language[e.g., examples] → Real examples from your codebaseAdd Your First Sprint
Edit NEXT-TASKS.md:
## Active Sprint: Initial Setup
**Why this matters**: Establish development workflow
- [ ] Configure linting and formatting- [ ] Set up CI/CD pipeline- [ ] Document architecture in ARCHITECTURE.mdConfigure AI Instructions
Edit .github/copilot-instructions.md:
## Tech Stack
- Framework: Next.js 15- Database: PostgreSQL- ORM: Drizzle
## Critical Rules
- Never commit secrets to Git- All API routes require authentication- Follow patterns in docs/core/PATTERNS.mdRun Validation
cortex-tms validate --strictFix any warnings or errors
Commit Changes
git add .git commit -m "docs: initialize Cortex TMS documentation structure"git pushcortex-tms validate - Verify TMS installation healthcortex-tms status - View project dashboardcortex-tms migrate - Upgrade templates to latest versioncortex-tms tutorial - Learn TMS interactively