Always Start with init-session
Every AI conversation should begin with the init-session prompt. It establishes project context so AI knows your docs structure.
The cortex-tms prompt command provides quick access to the “Essential 7” AI prompt library. These project-aware templates activate AI agents with proper context from your TMS documentation.
cortex-tms prompt [name] [options]AI Agent Activation in One Command. The prompt library contains curated prompts that reference your project’s documentation structure. Each prompt:
The Essential 7 Prompts:
init-session - Start AI conversation with full project contextfeature - Implement feature following architectural anchorsdebug - Troubleshoot systematically using patternsreview - Code review against documented standardsrefactor - Structural improvements with pattern compliancedecision - Create Architecture Decision Record (ADR)finish - Execute maintenance protocol after task completionTypical usage:
# Start AI conversationcortex-tms prompt init-session
# Output:# 📋 init-session## [Prompt content displayed and copied to clipboard]## ✅ Copied to clipboard!# 💡 Tip: Paste this prompt into your AI conversation.
# → Paste into Claude/ChatGPT/Copilot[name]Prompt name to display and copy.
Valid names:
init-session - AI session activationfeature - Feature implementationdebug - Debugging workflowreview - Code reviewrefactor - Refactoring guidancedecision - ADR creationfinish - Maintenance protocolExample:
cortex-tms prompt init-sessioncortex-tms prompt featurecortex-tms prompt debugIf omitted: Interactive prompt selector appears
-l, --listList all available prompts with descriptions.
Example:
cortex-tms prompt --listOutput:
📋 Available Prompts:
init-session Start AI conversation with full project context
feature Implement new feature following architectural anchors
debug Systematic debugging using documented patterns
review Code review against project standards
refactor Refactor code while maintaining pattern compliance
decision Create Architecture Decision Record (ADR)
finish Execute maintenance protocol after task completion
Use: cortex-tms prompt <name> to access a promptExample: cortex-tms prompt init-session--no-copyDisplay prompt without copying to clipboard (stdout only).
Use cases:
Example:
# Display onlycortex-tms prompt init-session --no-copy
# Pipe to filecortex-tms prompt feature --no-copy > feature-prompt.txt
# Use in scriptPROMPT=$(cortex-tms prompt debug --no-copy)echo "$PROMPT"Purpose: Start AI conversation with project context
When to use:
What it includes:
NEXT-TASKS.md for current sprint.github/copilot-instructions.md for tech stack and rulesCLAUDE.md for workflow guidanceExample prompt content:
# AI Session Initialization
You are assisting with the [Project Name] project.
## Step 1: Load Current Context
Read these files in order:1. `NEXT-TASKS.md` - Active sprint tasks2. `.github/copilot-instructions.md` - Tech stack and critical rules3. `CLAUDE.md` - AI workflow configuration
## Step 2: Understand Documentation Structure
HOT Tier (Always read):- `NEXT-TASKS.md` - Current 1-2 week sprint- `.github/copilot-instructions.md` - Security/critical rules
WARM Tier (Read on demand):- `docs/core/PATTERNS.md` - Coding standards- `docs/core/ARCHITECTURE.md` - System design- `docs/core/DOMAIN-LOGIC.md` - Business rules
COLD Tier (Skip unless asked):- `docs/archive/` - Historical context
## Step 3: Confirm Understanding
After reading, summarize:- Current sprint focus- Tech stack- Critical rules- Next task to work onUsage:
cortex-tms prompt init-session# Paste into AI chat# AI loads context and summarizes project statePurpose: Implement feature following architectural anchors
When to use:
What it includes:
NEXT-TASKS.md for feature contextdocs/core/PATTERNS.md for canonical examplesExample prompt content:
# Feature Implementation
I need to implement: [Feature Name]
## Step 1: Understand Requirements
Read `NEXT-TASKS.md` to find this task and its context.
## Step 2: Find Architectural Anchors
Check `docs/core/PATTERNS.md` for:- Canonical examples of similar features- Naming conventions- File organization patterns- Testing requirements
## Step 3: Implement
Follow the established patterns. If this is a new pattern:- Document it in `docs/core/PATTERNS.md`- Create canonical example- Add to glossary if introduces new terms
## Step 4: Update Documentation
After implementation:- Mark task `[x]` done in `NEXT-TASKS.md`- Update `docs/core/ARCHITECTURE.md` if system design changed- Add to `CHANGELOG.md`Purpose: Systematic debugging using documented patterns
When to use:
What it includes:
docs/core/TROUBLESHOOTING.md for known issuesdocs/core/PATTERNS.md for correct implementationExample prompt content:
# Debugging Workflow
Issue: [Describe the problem]
## Step 1: Check Known Issues
Read `docs/core/TROUBLESHOOTING.md` for similar problems.
## Step 2: Verify Pattern Compliance
Compare implementation with `docs/core/PATTERNS.md`:- Does it follow naming conventions?- Are dependencies injected correctly?- Is error handling consistent?
## Step 3: Reproduce
Create minimal reproduction case.
## Step 4: Fix
Implement fix following documented patterns.
## Step 5: Document
If this was a novel issue:- Add to `docs/core/TROUBLESHOOTING.md`- Update patterns if needed- Create test to prevent regressionPurpose: Code review against project standards
When to use:
What it includes:
docs/core/PATTERNS.md standardsCLAUDE.md workflow followedcopilot-instructions.mdExample prompt content:
# Code Review Checklist
Review PR/commit: [Link or description]
## 1. Pattern Compliance
Check against `docs/core/PATTERNS.md`:- [ ] Follows naming conventions- [ ] Matches canonical examples- [ ] Error handling consistent- [ ] Logging follows standards
## 2. Critical Rules
Verify `.github/copilot-instructions.md` rules:- [ ] No secrets in code- [ ] Authentication required (if applicable)- [ ] Data validation present
## 3. Documentation
Verify updates:- [ ] Task marked done in `NEXT-TASKS.md`- [ ] PATTERNS.md updated if new pattern- [ ] ARCHITECTURE.md updated if design changed- [ ] Tests included
## 4. Maintenance Protocol
Check `CLAUDE.md` workflow:- [ ] Tests pass- [ ] Build succeeds- [ ] Validation passes: `cortex-tms validate`Purpose: Structural improvements with pattern compliance
When to use:
What it includes:
docs/core/PATTERNS.md with new patternsExample prompt content:
# Refactoring Workflow
Goal: [What needs refactoring]
## Step 1: Identify Pattern
What pattern should be extracted?- Reusable component?- Utility function?- Business logic abstraction?
## Step 2: Document Pattern
Before refactoring, add to `docs/core/PATTERNS.md`:- Pattern name- When to use it- Canonical example- Anti-patterns to avoid
## Step 3: Refactor
Apply refactoring:- Extract pattern- Update all call sites- Maintain existing behavior
## Step 4: Validate
- [ ] All tests still pass- [ ] No behavior changes- [ ] Pattern documented- [ ] Canonical example createdPurpose: Create Architecture Decision Record (ADR)
When to use:
What it includes:
docs/decisions/Example prompt content:
# Create Architecture Decision Record
Decision: [What are we deciding?]
## Step 1: Find Next ADR Number
Check `docs/decisions/` directory:```bashls docs/decisions/ | grep -E "^[0-9]+" | sort -n | tail -1Next number = highest + 1
File: docs/decisions/NNNN-title-in-kebab-case.md
Template:
# ADR-NNNN: [Title]
**Status**: Proposed | Accepted | Deprecated | Superseded
**Date**: YYYY-MM-DD
**Context**:What is the issue we're trying to solve? What constraints exist?
**Decision**:What did we decide to do?
**Consequences**:What becomes easier or harder as a result?
**Alternatives Considered**:- Option A: [Why rejected]- Option B: [Why rejected]Update docs/core/ARCHITECTURE.md to reference the ADR.
---
### 7. finish
**Purpose**: Execute maintenance protocol after task completion
**When to use**:- Task marked done- Before committing- End of work session
**What it includes**:- Run tests- Run build- Validate documentation- Archive if needed- Commit with proper message
**Example prompt content**:```markdown# Maintenance Protocol
Task completed: [Task name]
## Step 1: Mark Task Done
Edit `NEXT-TASKS.md`:- Change `[ ]` to `[x]`- Add completion notes if helpful
## Step 2: Validate
Run health checks:```bash# Run testsnpm test
# Run buildnpm run build
# Validate TMScortex-tms validate --strictIf NEXT-TASKS.md exceeds 200 lines:
docs/archive/sprint-YYYY-MM.mdFollow conventional commit format:
git add .git commit -m "feat: implement [feature name]
Co-Authored-By: Claude Sonnet 4.5 <[email protected]>"Check NEXT-TASKS.md or FUTURE-ENHANCEMENTS.md for next task.
---
## Interactive Mode
**When no prompt name provided**:```bashcortex-tms promptInteractive selector appears:
? Select a prompt:❯ init-session - Start AI conversation with full project context feature - Implement new feature following architectural anchors debug - Systematic debugging using documented patterns review - Code review against project standards refactor - Refactor code while maintaining pattern compliance decision - Create Architecture Decision Record (ADR) finish - Execute maintenance protocol after task completionNavigate with arrow keys, press Enter to select.
Auto-detection:
pbcopy/pbpastexclip or xselclip.exeIf clipboard unavailable:
⚠️ Could not copy to clipboard (no clipboard access)Prompt is still displayed, just not copied.
Linux/WSL: Install clipboard utility
# Ubuntu/Debiansudo apt install xclip
# Or xselsudo apt install xsel
# Verifyecho "test" | xclip -selection clipboardxclip -selection clipboard -o # Should output "test"macOS: Built-in (pbcopy/pbpaste)
Windows: Built-in (clip.exe)
| Code | Meaning | Scenario |
|---|---|---|
0 | Success | Prompt displayed/copied successfully |
1 | Error | Prompt not found, PROMPTS.md missing, file read error |
# Copy init-session promptcortex-tms prompt init-session
# Output:# 📋 init-session## [Prompt content]## ✅ Copied to clipboard!
# → Paste into Claude/ChatGPT# AI loads project context# Copy feature promptcortex-tms prompt feature
# Paste into AI chat# AI says: "Read NEXT-TASKS.md - what feature should I implement?"# You say: "Implement JWT token generation"# AI reads PATTERNS.md for auth patterns and implements# Copy review promptcortex-tms prompt review
# Paste into AI chat# AI performs checklist review of your PR# Points out pattern violations# Suggests documentation updates#!/bin/bash# ai-assist.sh - Helper script for AI workflows
case "$1" in start) cortex-tms prompt init-session echo "Prompt copied. Paste into AI chat to begin." ;; feature) cortex-tms prompt feature echo "Feature prompt copied." ;; done) cortex-tms prompt finish echo "Maintenance prompt copied." ;; *) echo "Usage: ai-assist.sh {start|feature|done}" ;;esacUsage:
chmod +x ai-assist.sh./ai-assist.sh start./ai-assist.sh feature./ai-assist.sh doneAdd to PROMPTS.md:
## deploy
**Description**: Deploy application to production
**Prompt**:Deploy [Project Name] to production.
npm testnpm run buildcortex-tms validate --strictIf issues arise:
git revert HEADnpm run deploy:rollback```
**Access custom prompt**:```bashcortex-tms prompt deployProblem: Typo in prompt name
Solution:
# List available promptscortex-tms prompt --list
# Use exact namecortex-tms prompt init-session # Correctcortex-tms prompt init # WrongProblem: Project not initialized or file deleted
Solution:
# Reinitialize TMScortex-tms init --scope standard --force
# Or manually copy from templatescp node_modules/cortex-tms/templates/PROMPTS.md ./Problem: No clipboard utility installed (Linux)
Solution:
# Install xclipsudo apt install xclip
# Or use --no-copycortex-tms prompt init-session --no-copy# Manually copy outputProblem: WSL doesn’t detect Windows clipboard
Solution:
# Install wslu packagesudo apt install wslu
# Verifyecho "test" | clip.exepowershell.exe Get-Clipboard # Should show "test"
# Retry promptcortex-tms prompt init-sessionProblem: PROMPTS.md not customized during init
Example:
You are assisting with [Project Name] project.Solution:
# Replace placeholders manuallyvim PROMPTS.md# Find: [Project Name]# Replace: Acme API
# Or use validate --fixcortex-tms validate --fixProblem: Terminal not supporting interactive input
Solution:
# Use direct prompt namecortex-tms prompt init-session
# Avoid interactive mode in non-TTY environmentsAlways Start with init-session
Every AI conversation should begin with the init-session prompt. It establishes project context so AI knows your docs structure.
Customize Prompts
Edit PROMPTS.md to add project-specific prompts. The library is extensible.
Use finish Religiously
End every task with the finish prompt. It enforces the maintenance protocol (tests, validation, archive).
Chain Prompts
Use init-session → feature → finish for complete workflow. Each prompt builds on the previous context.
Initialize Session
cortex-tms prompt init-sessionGet Feature Context
cortex-tms prompt featureImplement (AI-assisted coding)
Review
cortex-tms prompt reviewFinish
cortex-tms prompt finishInitialize Session
cortex-tms prompt init-sessionDebug Workflow
cortex-tms prompt debugFix Issue (AI-assisted)
Review Fix
cortex-tms prompt reviewFinish
cortex-tms prompt finishInitialize Session
cortex-tms prompt init-sessionCreate ADR
cortex-tms prompt decisionDocument Decision (AI-assisted ADR writing)
Finish
cortex-tms prompt finish# Initialize projectcortex-tms init --scope standard
# Access prompts immediatelycortex-tms prompt init-session# Check project statecortex-tms status
# If sprint in progress, use feature promptcortex-tms prompt feature
# If sprint complete, use finish promptcortex-tms prompt finish# Execute finish promptcortex-tms prompt finish
# AI says: "Run cortex-tms validate --strict"cortex-tms validate --strict
# Fix issues, then commitcortex-tms init - Initialize TMS (creates PROMPTS.md)cortex-tms status - View project state before promptingcortex-tms tutorial - Learn prompt workflow