Routes to appropriate agents based on detected context
Routes to specialized agents based on code context and language detection.
/plugin marketplace add turingmindai/turingmind-code-review/plugin install turingmindai-turingmind-code-review-plugins-turingmind@turingmindai/turingmind-code-reviewThis file helps select the right agents based on the code being reviewed. Only load agents that are relevant to reduce context and improve accuracy.
| Detected | Load Agents |
|---|---|
| Any code | @agents/bugs.md, @agents/security.md |
| Has CLAUDE.md | @agents/compliance.md |
| TypeScript/JavaScript | @agents/language-typescript.md |
| Python | @agents/language-python.md |
| Deep review mode | @agents/architecture.md |
These agents apply to all code reviews:
bugs.md - Logic errors, null access, race conditionssecurity.md - OWASP Top 10, injection, XSS, secretsLoad when: CLAUDE.md exists in project root or modified directories
@agents/compliance.md
Load based on file extensions detected in diff:
| Extensions | Agent |
|---|---|
.ts, .tsx, .js, .jsx, .mjs | @agents/language-typescript.md |
.py | @agents/language-python.md |
Load when: Deep review mode (/turingmind-code-review:deep-review)
@agents/architecture.md
Step 1: Detect languages from git diff
└─ Extract file extensions from changed files
Step 2: Check for CLAUDE.md
└─ Look in root and directories with changes
Step 3: Load minimum required agents
└─ Core: bugs + security (always)
└─ Language: based on Step 1
└─ Compliance: if Step 2 found CLAUDE.md
└─ Architecture: only for deep review
Step 4: Run agents in parallel
└─ Each agent returns structured issues
Step 5: Score and filter
└─ Apply confidence scoring
└─ Filter based on threshold
| Approach | Context Size | Accuracy |
|---|---|---|
| Load all agents | Large | Lower (noise) |
| Progressive load | Minimal | Higher (focused) |
By only loading relevant agents:
To add support for a new language or framework:
agents/language-{name}.md or agents/framework-{name}.mdcommands/review.md Step 3 with detection logicTemplate for new language agent:
---
name: {Language} Issues
model: sonnet
applies_to: ["*.ext"]
---
Language-specific checks for {Language}.
## Checks
- [Check 1]
- [Check 2]
## Output Format
(Use same format as bugs.md with diff-style fixes)