Triggers
How a role is scored
Recommendation is a weighted score plus score_explanation. Custom roles enter the same pool.
| Dimension | Weight in this lesson |
|---|---|
| Trigger match | 35% |
| Task type | 25% |
| Failure mode | 25% |
| History | 10% |
| User preference | 5% |
Outcome writes back. A role that verifies clean gets more weight later. A static prior is not a lifetime appointment. That is the v4 routing change: verify_completion and breakthroughs update the record.
| Task | A role the lesson suggests |
|---|---|
| Review | military-discipline |
| Architecture | silicon-architect |
| Debug | military-commander |
| A new idea | shaman-musk, or a dream |
| Performance | special-challenge-solver |
Code sample
# 角色推荐示例
recommend_role(
taskType="code-review",
failurePattern="performance-issue",
userPreference="阿里",
history=["silicon-architect", "military-discipline"]
)
# 返回结果:
{
"recommendations": [
{
"roleId": "military-discipline",
"score": 0.92,
"reason": "代码审查任务 + 性能问题模式 + 阿里风味偏好",
"methodology": {"fiveSteps": [...], "checklist": [...]}
},
{
"roleId": "silicon-auditor",
"score": 0.85,
"reason": "审计角色适合系统性问题排查"
}
],
"flavor": "阿里",
"pressureLevel": "L2"
}
Quiz
Which scoring dimension has the highest weight in the lesson?