Loading...
Loading...
Create subagent definitions (agent.md files) for independent AI workers. Use when user wants to: create an agent, build a grader/evaluator, make an A/B comparator, spawn independent workers, or create something that runs in isolation. Triggers on: '创建 agent', 'subagent', 'grade outputs independently', 'blind comparison', 'run this in parallel'. Do NOT use for skills (use trae-skill-writer) or rules (use trae-rules-writer).
npx skill4agent add learnwy/skills trae-agent-writer1. IDENTIFY → What independent task needs an agent?
2. DEFINE → Role, inputs, process, outputs
3. DESIGN → Step-by-step instructions
4. CREATE → Write agent.md following the pattern# {Agent Name} Agent
{One-sentence role}
## Role
{What this agent does and why}
## Inputs
- **param_name**: Description
- **output_path**: Where to save results
## Process
### Step 1: {Action}
1. Do this
2. Then this
### Step N: Write Results
Save to `{output_path}`.
## Output Format
```json
{
"field": "value"
}
## Agent Locations
- `skill-name/agents/` - Inside orchestrating skills
- `.trae/agents/` - Project-level agents
- `~/.trae/agents/` - Global agents
## Good Agent Candidates
| Pattern | Why Agent? | Example |
| ------------ | --------------------------- | -------------------- |
| Grader | Needs objectivity | Output evaluator |
| Comparator | Blind comparison | A/B tester |
| Analyzer | Deep dive, isolated context | Performance analyzer |
| Transformer | Parallel processing | File converter |
| Researcher | Independent investigation | Doc researcher |
**Don't make agents for:** Simple inline tasks, tasks needing conversation history, single-step operations.
## Example
{output_path}/grading.json{
"expectations": [
{"text": "...", "passed": true, "evidence": "..."}
],
"summary": {"passed": 4, "failed": 1, "pass_rate": 0.80}
}
## References
- [Agent Patterns](references/agent-patterns.md) - Common archetypes
- [Agent Template](assets/agent.md.template) - Starter template