Expert skilltree layer-1 dispatcher. Receives porting task commands from tasks.md, parses arguments, loads porting_item data and spec descriptions, then routes to the appropriate leaf skill for actual migration execution. Invoked as: /dispatcher-skill <porting_item_id> --specs <ids> --source <path> or /dispatcher-skill <porting_item_id> --mode llm-freeform --source <path>. Does NOT contain migration logic itself — only routing and data assembly.
Instalar com Codex ou Claude Copie este prompt, cole no Codex, Claude ou outro assistente e deixe que ele revise a página da skill e instale para você.
Um comando direto ignora o prompt de revisão. Verifique a origem antes de executá-lo.
O comando permanece em uma só linha. Role horizontalmente para revisá-lo antes de copiar.
Prefere uma cópia local? Baixe os arquivos disponíveis atualmente no SkillsMP.
Explorador de arquivos
2 arquivos
Exibindo SKILL.md
SKILL.md
Instruções da origem · Visualização somente leitura
name
dispatcher-skill
description
Expert skilltree layer-1 dispatcher. Receives porting task commands from tasks.md, parses arguments, loads porting_item data and spec descriptions, then routes to the appropriate leaf skill for actual migration execution. Invoked as: /dispatcher-skill <porting_item_id> --specs <ids> --source <path> or /dispatcher-skill <porting_item_id> --mode llm-freeform --source <path>. Does NOT contain migration logic itself — only routing and data assembly.
This skill is the routing layer of the expert skilltree. It receives porting
commands from tasks.md, loads the relevant data, and dispatches to the correct
leaf skill for execution.
ID of the porting_item to process (first positional arg)
--specs <ids>
One of specs/mode
Comma-separated global spec IDs from combined collection
--mode llm-freeform
One of specs/mode
Freeform mode (no spec matched)
--source <path>
Yes
Path to the matched YAML file
--feedback <path>
No
Path to a feedback file from a prior failed attempt at this item. Present only on loop re-entry (attempt ≥ 2). When present, the dispatcher loads it into prior_attempt_feedback (§2.7) and passes it to the leaf skill so the retry corrects the specific prior failure instead of re-emitting the same output.
1.3 Validation rules
porting_item_id MUST be present (first argument)
--source MUST be present
Exactly ONE of --specs or --mode MUST be present (mutually exclusive)
If --specs is present, value must be non-empty comma-separated integers
--feedback <path> is OPTIONAL; if present, the file MUST exist and parse (see §2.7). A missing/unreadable feedback file is a hard error — do NOT silently proceed as a first attempt, because that would drop the failure signal and let the loop re-emit the same broken output.
If validation fails, report error and stop
2. Data Loading & Assembly
2.1 Load porting_item from matched YAML
Read the file at --source path
Find the porting_item whose id matches <porting_item_id>
Find the markdown section corresponding to the spec name
Extract the full section content as porting_logic
2.5 Assemble data contract
Combine all loaded data into the standardized contract:
porting_item:id:<porting_item_id>context:<sourcecodefrommatchedYAML>semantics:<description>constraints:<list>register_mapping:<mapping>code_range:<range>matched_specs:-id:<global_spec_id>name:<spec_name>source:<leaf-skill-name>source_sub_dimension:<file-basename>source_id:<local-id>description:<specdescriptionfromyaml>porting_logic:<detailedmigrationguidancefrommd>match_confidence:rules_hit:<count>scope_verified:<bool>llm_confidence:<level># Present ONLY on a retry (--feedback given); omitted on the first attempt.prior_attempt_feedback:<see§2.7>
2.6 Freeform mode data contract
When --mode llm-freeform:
porting_item:id:<porting_item_id>context:<sourcecode>semantics:<description>constraints:<list>register_mapping:<mapping>code_range:<range>matched_specs: []
directive:Loadarm64-baseline-portingskillasconstraintframework# Present ONLY on a retry (--feedback given); omitted on the first attempt.prior_attempt_feedback:<see§2.7>
2.7 Prior-Attempt Feedback (loop re-entry)
The dispatcher is the re-entry point of the per-item porting loop:
On a first attempt there is no --feedback, and prior_attempt_feedback is
omitted from the data contract entirely. On any retry the orchestrator passes
--feedback <path>; the dispatcher loads that file and places it in the data
contract so the leaf skill corrects the specific prior failure instead of
regenerating the same output.
2.7.1 Feedback file schema
The feedback file is YAML written by the verification stage after a failed
build or test. The dispatcher does not author it — it only loads and forwards
it. Expected shape:
attempt:2# 1-based; this is the attempt about to runprior_attempts:-attempt:1stage:build|test# where it failedfailure_kind:compile_error|link_error|assertion|crash|timeoutdetail:|# verbatim, truncated compiler/gtest outputtest_pixel_sad.cpp:41:FailureExpected equality of these values:ref_sad->1184arm64_sad->1152failing_fixtures: [SadTest.Block16x16] # gtest names, if stage == testhypothesis:|# optional: verifier's guess at root causeHorizontalreductionlikelyusedvaddvqoverthewronglanewidth,droppingthehigh
2.7.2 How the leaf skill must use it
The dispatcher passes prior_attempt_feedback through verbatim and instructs
the routed leaf skill to, BEFORE emitting new code:
Treat every failing_fixtures / detail entry as a hard constraint the new
output MUST satisfy — do not reproduce the same construct that failed.
Prefer addressing the hypothesis root cause over cosmetic edits.
If the same failure_kind has now recurred across attempts (visible in
prior_attempts), change approach (e.g. different NEON reduction, or fall
back per §3.5) rather than retrying the same fix — a repeated identical
failure means the current strategy is exhausted.
2.7.3 Retry budget and terminal handling
The orchestrator owns the retry counter, not the dispatcher. The dispatcher
executes whatever attempt it is handed. But it MUST surface the attempt number
in its output so a stuck loop is visible:
[ATTEMPT 2/K] <porting_item_id> — retrying after test failure (SadTest.Block16x16)
When the orchestrator's retry budget K is exhausted, it stops calling the
dispatcher for that item and marks it [NEEDS REVIEW] (see §5.4) — the loop
must have a terminal exit so one hard item never blocks the batch.
Apply all baseline constraints (16-byte alignment, flag discipline, etc.)
Execute migration using LLM's own knowledge within those constraints
3.4 Inline-asm handling (spec-routed, with detection fallback)
ARM64 inline-asm kernels are matched through the NORMAL spec pipeline:
arm64-inlineasm-to-intrinsics publishes specs
(references/specs/inline-asm-neon.yaml) whose match_rules fire on
__asm__ __volatile__ blocks and quoted AArch64 NEON mnemonics (matcher scope
inline_asm). When those specs match, they resolve via source to this leaf
skill through the same routing as any other spec (§3.1–3.2, §4). Spec-based
routing is PRIMARY.
Detection fallback (safety net, subordinate to spec routing): if
porting_item.context contains __asm or __asm__ but NO spec resolved to
arm64-inlineasm-to-intrinsics (e.g. the matcher missed it, or the item came
through --mode llm-freeform), route to skills/arm64-inlineasm-to-intrinsics/
anyway and pass any matched_specs as supplementary context. This fallback only
engages when spec routing did not already select the inline-asm skill; it never
overrides a spec-selected primary from §4.2.
3.5 Leaf skill not found fallback
If the resolved source leaf skill directory does not exist:
Log warning: "Leaf skill '' not found, falling back to baseline"
Execute as freeform mode with arm64-baseline-porting constraints
Pass the spec description and porting_logic as supplementary guidance
4. Multi-Spec Combination
4.1 Same source — merge
When multiple spec_ids resolve to the same source (same leaf skill):
Combine all porting_logic sections into matched_specs array
Route to that single leaf skill with all specs as context
4.2 Cross-source — primary selection
When spec_ids resolve to different source values:
Group specs by source
Select primary: the source group with highest total rules_hit (from match_confidence)
Route to primary leaf skill
Include non-primary specs in matched_specs as supplementary guidance (marked as supplementary: true)
5. Confidence & Output
5.1 Normal output
After leaf skill executes, output the ARM64 code directly.
5.2 Low confidence handling
If match_confidence.llm_confidence == "low":
Execute routing and migration normally
Append to output: \n\n[NEEDS REVIEW] — Low confidence match. Human verification recommended.
5.3 Error handling
Error
Action
porting_item not found in source YAML
Report error, stop
Spec ID not found in combined collection
Report error, stop
Leaf skill directory missing
Fallback to baseline (Section 3.5)
spec.yaml file missing in leaf skill
Fallback to baseline, log warning
spec.md section not found
Use yaml description only, log warning
--feedback given but file missing/unparseable
Hard error, stop (§1.3 rule 5) — never proceed as a first attempt
5.4 Retry exhaustion (terminal loop exit)
When the orchestrator has spent its retry budget K on an item and calls the
dispatcher no further, that item is marked [NEEDS REVIEW] with the last
feedback attached, and the batch continues with the next item. The per-item
loop MUST always terminate — either PASS (gtest green) or exhausted → review.
An item that neither passes nor exhausts is a hung loop and is a bug in the
orchestrator, not a valid state.
6. Spec Collection Management
The combined spec collection at skills/combined-spec-summary.yaml is generated by:
A new leaf skill is created (with new references/specs/*.yaml files)
Any existing leaf skill's *.yaml file is modified
After running leaf-skill-creator in either create or add-yaml mode
The script scans skills/*/references/specs/*.yaml and aggregates all specs
with globally unique IDs, preserving source, source_sub_dimension, and source_id.