Automatic agent activation based on context, keywords, and file patterns.
Automates agent activation based on keywords, file patterns, and workflow events.
/plugin marketplace add NickCrew/claude-ctx-plugin/plugin install nickcrew-claude-ctx@NickCrew/claude-ctx-pluginAutomatic agent activation based on context, keywords, and file patterns.
The trigger system intelligently suggests or auto-activates agents based on:
Triggers are defined in triggers.yaml:
agent-name:
keywords: # Words that trigger this agent
file_patterns: # File glob patterns
events: # Git/workflow events
auto: # Auto-activate (true) or suggest (false)
priority: # critical, high, medium, low
threshold: # Performance/metric thresholds
Agent is automatically activated when conditions match.
Example: security-auditor auto-activates for security-related files
security-auditor:
auto: true
priority: critical
file_patterns:
- "**/auth/**"
- "**/*security*.{js,ts,py}"
Agent is suggested but requires confirmation.
Example: code-reviewer is suggested for code reviews
code-reviewer:
auto: false
priority: high
keywords:
- "review"
- "PR"
Activated when specific words appear in requests:
"Review this code" → Suggests: code-reviewer
"Check for security issues" → Auto-activates: security-auditor
"Optimize performance" → Suggests: performance-engineer
Activated when modifying matched files:
Editing: auth/login.ts → Suggests: security-auditor
Editing: *.test.ts → Suggests: test-automator
Editing: migrations/*.sql → Suggests: database-optimizer
Activated during specific workflow events:
pre-commit → test-automator, code-reviewer
pre-deploy → security-auditor, deployment-engineer
post-commit → code-reviewer
Activated when metrics exceed thresholds:
Response time >500ms → performance-engineer
Memory usage >500MB → performance-engineer
CPU usage >80% → performance-engineer
Critical - Must-run agents (security, blocking issues) High - Important agents (code review, deployment) Medium - Helpful agents (optimization, analysis) Low - Nice-to-have agents (language-specific helpers)
Pre-defined agent suites for common scenarios:
code_review_suite:
agents:
- code-reviewer
- security-auditor
- test-automator
keywords:
- "full review"
- "PR review"
security_audit_suite:
agents:
- security-auditor
- code-reviewer
keywords:
- "security audit"
performance_suite:
agents:
- performance-engineer
- database-optimizer
keywords:
- "performance audit"
when: keywords_match >= 2
and: auto == true
action: activate_agent
when: file_pattern_match
and: priority == critical
action: suggest_agent
when: keywords_match == 1
action: suggest_agent
User: "Check for security vulnerabilities in auth module"
Triggers:
- Keywords: "security", "vulnerabilities", "auth"
- File patterns: **/auth/**
- Priority: critical
- Auto: true
Result: Auto-activates security-auditor
User: "Review this pull request"
Triggers:
- Keywords: "review", "pull request"
- Priority: high
- Auto: false
Result: Suggests code-reviewer
User: "The API is slow, need to optimize"
Triggers:
- Keywords: "slow", "optimize"
- Priority: high
- Auto: false
Result: Suggests performance-engineer
User: "Do a comprehensive review before deployment"
Triggers:
- Keywords: "comprehensive review", "deployment"
- Combination: code_review_suite + deployment_suite
Result: Activates:
- code-reviewer
- security-auditor
- test-automator
- deployment-engineer
# Automatically runs before git commit
Triggers:
- test-automator (run tests)
- code-reviewer (check quality)
# Automatically runs before deployment
Triggers:
- security-auditor (security scan)
- deployment-engineer (deployment prep)
development: relaxed_triggers (suggestions only)
staging: moderate_triggers (some auto-activation)
production: strict_triggers (mandatory security/tests)
branch_name: feature/* → Suggests test-automator
branch_name: hotfix/* → Auto-activates security-auditor
modified_files: *.test.ts → Suggests test-automator
my-custom-agent:
keywords:
- "custom keyword"
file_patterns:
- "**/*custom*.ts"
auto: false
priority: medium
code-reviewer:
keywords:
- "review"
- "check"
- "my custom keyword" # Add your keyword
auto: true # Change to auto-activate
my_custom_suite:
agents:
- agent1
- agent2
trigger_keywords:
- "my suite trigger"
Temporarily disable triggers:
# Disable all triggers
export CLAUDE_CTX_TRIGGERS=false
# Disable specific agent
export CLAUDE_CTX_NO_SECURITY_AUDITOR=true
View what triggered an agent:
claude-ctx triggers explain
claude-ctx triggers list-active
claude-ctx triggers test "your request text"
You are an elite AI agent architect specializing in crafting high-performance agent configurations. Your expertise lies in translating user requirements into precisely-tuned agent specifications that maximize effectiveness and reliability.