agent-detection
Skill0 starsChanged 7 months agoMITView on GitHub
Use during Build phase to assign agents to structured tasks from tasks.md. Maps task metadata and keywords to specialized agents. NOT for interactive user requests — see auto-delegation for that.
In this repository17 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- auto-delegationSkill
- bookstackSkill
- delegatorSkill
- faceswapSkill
- git-standardsSkill
- headswapSkill
- health-dashboardSkill
- imageSkill
- motionSkill
- multi-terminalSkill
- project-docsSkill
- quality-gatesSkill
- safety-gateSkill
- upscaleSkill
- videoSkill
- web-researchSkill
The file
Files
Agent Detection
Assign the right agent to structured tasks during the Build phase.
Scope: Task-to-agent assignment in /cwe:start Build phase and parallel orchestration.
Not for: Free-text user requests in chat (→ use auto-delegation).
Detection Logic
Task from tasks.md
↓
1. metadata.agent set? → Use explicit agent
↓ no
2. metadata.skill set? → Infer agent from skill
↓ no
3. Keyword scan (subject + description) → First match wins
↓ no match
4. Fallback → builderKeyword → Agent Mapping
Keyword table: see skills/auto-delegation/SKILL.md and hooks/scripts/intent-router.py (source of truth).
Detection order: first match wins, starting with builder (highest priority) and falling through to specialized agents. Fallback: builder (if no keywords match).
Metadata Override
Tasks in tasks.md can specify agent and skill explicitly:
metadata:
agent: security # Skip keyword detection
skill: systematic-debugging # Specific skill to invoke
priority: 1 # Execution order (lower = first)metadata.agent always takes precedence over keyword detection.
"test" Routing in Tasks
Tasks with "test" keywords are assigned to quality. Quality agent decides execution:
- Coverage gaps, metrics, validation → handles directly
- Writing implementation tests → delegates to builder via subagent
- CI/pipeline test config → delegates to devops via subagent
Integration with Parallel Execution
During wave execution in /cwe:start:
- Pending tasks filtered by
blockedBystatus - Up to 3 unblocked tasks selected per wave (sorted by
metadata.priority) - Each task assigned an agent via this detection logic
- Agents spawned in parallel via
Tasktool
Examples
# Explicit agent (metadata override)
- subject: "Audit auth endpoints"
metadata:
agent: security
→ security (explicit)
# Keyword detection
- subject: "Implement user profile API"
→ builder (keyword: implement)
# Test task
- subject: "Write integration tests for payments"
→ quality (keyword: test)
# No match
- subject: "Update the README"
→ builder (fallback)Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

