triage
Adaptive pipeline triage skill. Classify task complexity, blast radius, and domain in ≤8 file reads, then emit schema-valid workspace/triage.json that drives all downstream phase composition and agent selection.
- License 许可
- MIT
- 最近更新
- 2026-07-25
- Stars
- ★ 8
- Forks
- 0
01 前言 Front Matter
- name
- triage
- metadata
- { "tier": 1, "source": "internal", "version": "1.0.0" }
- use-when
- Load for the triage agent at the start of every /team pipeline run. Always the first skill loaded — required before any other agent is spawned.
- platforms
- [ "claude-code", "codex", "copilot", "cursor", "windsurf" ]
- description
- Adaptive pipeline triage skill. Classify task complexity, blast radius, and domain in ≤8 file reads, then emit schema-valid workspace/triage.json that drives all downstream phase composition and agent selection.
- do-not-use-when
- Do not load for unity-dev, architect, tester, or verifier roles. Triage runs only once per pipeline at the start; never re-loaded mid-pipeline.
- task-categories
- [ "orchestration", "classification", "pipeline" ]
03 SKILL.md 正文
Triage Skill
The triage agent runs ONCE per /team invocation, before any other agent.
It is the only agent that always runs. Everything downstream is derived from
its output.
Goal
Produce workspace/triage.json matching .claude/schemas/triage.schema.json
in under 8 file reads.
Inputs
<intent>from the user (bug | feature | refactor | explore)<depth>from the user (quick | normal | deep — default normal)<task description>free text- CRG MCP (
code-review-graph) — preferred ai-game-developerMCP — optional
Procedure
-
CRG first. No file reads until graph evidence exists.
get_architecture_overviewif domain unknowntrace_execution_flowfrom task keywordsget_impact_radius→ seedsystems_affectedandfiles_touched_estimate
-
Fingerprint up to 5 touched files for API evidence (see
.claude/docs/rules/api-fingerprinting-system.md).- Compute DOTS_score / Unity_score / Hybrid_score
(see
.claude/docs/rules/domain-scoring-engine.md). - Classify domain. If Ambiguous →
confidence_score ≤ 0.5.
- Compute DOTS_score / Unity_score / Hybrid_score
(see
-
Classify complexity using the rubric below.
-
Pick verification strategy:
bundle— tiny: deterministic verification bundle, no agentverifier— small/medium: verifier agent runs the bundletester— large/critical: full tester agentstepgated— refactor only
-
Partition ownership when the pipeline has more than one writer (data-tool plus unity-dev, or stepgated refactor). Use repo-root-relative globs. When in doubt: assign only
unity-dev(no parallelism). -
Emit
workspace/triage.jsonviapython .claude/scripts/triage.py. That helper writes a schema-valid file; do not hand-write the JSON.
Complexity Rubric
| Complexity | Files | Systems | Blast radius | Pipeline (default) |
|---|---|---|---|---|
| tiny | 1 | 1 | isolated | [unity-dev] |
| small | 1–3 | 1 | local | [unity-dev, verifier] |
| medium | 2–5 | 1–3 | local / multi-system | [architect, unity-dev, verifier] |
| large | 5–15 | 3–6 | multi-system | [architect, unity-dev, tester] |
| critical | >15 OR save/multiplayer/economy/world-init | any | cross-cutting | [architect, unity-dev, data-tool, tester] |
Examples:
- "Rename
EnemyHPtoEnemyHealth" → tiny - "Fix off-by-one in damage calc" → tiny
- "Health regen not firing after death respawn" → small (1 bug, 1 system)
- "Add stamina component + regen system" → medium
- "Spawner refactor across zones + dungeons" → large
- "Save system migration v3 → v4" → critical
Intent Overrides
bug→ prependbug-investigationregardless of complexityrefactor→ prependrefactor-agent+ forcearchitect+stepgatedverificationexplore→ pipeline is empty; triage is the only outputfeature→ no override
Depth Modifier
quick— downgrade complexity by one tier (small→tiny,medium→small). Refuse if blast_radius ≥multi-system.normal— use complexity as classified.deep— upgrade complexity by one tier (small→medium, etc.). Tester always spawned. Codex review required at design and at completion.
Confidence Scoring
confidence_score ∈ [0.0, 1.0]:
- 1.0 — Domain unambiguous, blast radius proven via CRG, prior session in
repo-knowledge.mdcovers the same area. - 0.8 — Domain clear; blast radius best-effort but evidence-backed.
- 0.6 — Domain clear; blast radius partly guessed.
- 0.4 — Domain ambiguous or CRG unavailable.
- ≤0.3 —
recommended_pipelineshould include an investigator (system-mapper or bug-investigation) before implementation begins.
Parallel execution requires confidence ≥ 0.8 AND complexity ≥ medium AND ownership partition ≥ 2. The orchestrate.py planner enforces this.
Skill Pack Selection
skill_packs[] holds DOTS extras only — modules layered on top of an agent's
lane-correct primary skills. Each agent's primary skills are resolved by
orchestrate.py (AGENT_PRIMARY_SKILLS), NOT from skill_packs. The Unity-classic
lane (unity-dev) gets unity-classic + unity-foundation as its primaries — it
does NOT use unity-dots-best-practices as a stand-in Unity layer.
Add up to 4 skill packs to skill_packs[] based on domain:
- DOTS:
ecs-job-patterns,burst-safety,memory-safety - Unity: (none — the Unity lane's
unity-classicprimary skill IS the Unity classic layer; do NOT addunity-dots-best-practices) - Hybrid:
ecs-job-patterns+ownership-partitioning
skill_packs attach to DOTS lanes only (unity-dots-dev); they are never
merged into unity-dev/tester/verifier/data-tool. ownership-partitioning
is added whenever parallel_allowed=true so downstream writers respect their
assigned globs.
Helper Command
python .claude/scripts/triage.py \
--intent <bug|feature|refactor|explore> \
--task "<one line task>" \
--depth <quick|normal|deep> \
--complexity <tiny|small|medium|large|critical> \
--blast-radius <isolated|local|multi-system|cross-cutting> \
--systems <SystemA> <SystemB> \
--files-est <N> \
--confidence <0.0-1.0> \
--domain <DOTS|Unity|Hybrid|Ambiguous> \
--pipeline <agent1> <agent2> ... \
--strategy <bundle|verifier|tester|stepgated> \
--skill-packs <pack1> <pack2> \
--own "unity-dev=Assets/Scripts/Combat/**" \
--own "data-tool=Assets/Editor/**" \
--rationale "<one paragraph justifying complexity, domain, and parallelism>"
Validate before exiting:
python .claude/scripts/orchestrate.py validate workspace/triage.json triage
If validation fails, fix the inputs and re-run. Do not hand-edit the JSON.
Anti-Patterns
- Reading more than 8 files. Triage is a scout, not the investigator.
- Recommending a 4-agent pipeline for a 1-file change.
- Setting
parallel_allowed=truewith confidence < 0.8. - Emitting
Ambiguousdomain withconfidence_score > 0.6. - Skipping CRG and grepping the repo.
- Hand-writing
triage.jsoninstead of using the helper.
04 同仓库更多 Skills
dots-update-groups
How to choose the right ECS system group and ordering so per-frame and per-fixed-step work is deterministic and never races its own readers. Covers InitializationSystemGroup / SimulationSystemGroup / PresentationSystemGroup / FixedStepSimulationSystemGroup / VariableRateSimulationSystemGroup, UpdateBefore / UpdateAfter peer ordering, OrderFirst / OrderLast group-boundary placement, RateManager, and the cross-group ordering trap. Use when adding an ISystem, fixing "value visible one frame late" bugs, or coupling simulation to a fixed timestep.
dots-transform-patterns
The Entities 1.x transform model — LocalTransform (writable input) vs LocalToWorld (system-owned matrix), Parent/Child hierarchy, reparenting cost, uniform vs non-uniform scale (PostTransformMatrix), and when to opt out with custom transform systems. Use when designing parent/child hierarchies, runtime reparenting (mount/dismount/socket), or choosing transform components at the Baker boundary.
dots-singleton-patterns
Model cross-system shared configuration and game state as a single-entity component with a strict single-writer contract. Covers RequireForUpdate gating, SystemAPI.GetSingleton / GetSingletonRW / HasSingleton / TryGetSingleton, bake-time vs runtime-created vs ECB-system singletons, the "exactly one entity" runtime invariant, and the single-writer rule. Use when designing frame-stable global config, shared mutable state, or any component intended to exist on exactly one entity.
dots-hybrid-bridge
The one-way bridge between DOTS-owned runtime state and Unity-owned presentation. Covers UnityObjectRef for managed asset refs in components, the DOTS-writes / Unity-reads ownership rule, when to use managed IComponentData vs UnityObjectRef vs CompanionComponent, baker-bridge vs runtime-bridge, and SubScene boundary rules. Use when an entity must reference Unity assets (Mesh, Material, AudioClip, ScriptableObject), a MonoBehaviour view must read entity state, or input/UI must trigger ECS work.
dots-event-driven-ecs
Model one-frame events and external requests in ECS without dual ownership, polling, or persistent state leaks. Covers request-tag pattern with ECB, enableable command components (no structural change), event buffers (IBufferElementData), explicit consumer ownership, one-frame latency rules, and the banned C# event / UnityEvent / static bus anti-patterns. Use when input/UI/network must trigger ECS work, when a one-frame signal fans out to N consumers (damage, hit, collision), or when state changes must be processed exactly once.
valid_skill
A complete, well-formed test fixture skill for SkillHub validation testing. Covers basic task routing and code review for Unity projects.