Triggers

How a role is scored

Recommendation is a weighted score plus score_explanation. Custom roles enter the same pool.

DimensionWeight in this lesson
Trigger match35%
Task type25%
Failure mode25%
History10%
User preference5%

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.

TaskA role the lesson suggests
Reviewmilitary-discipline
Architecturesilicon-architect
Debugmilitary-commander
A new ideashaman-musk, or a dream
Performancespecial-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?

Previous
Next