Read this only after the route is clear. For generation routes, recipe / template-mode choice comes first; backend arbitration comes second.
Execution is a routing decision, not a personal preference. Choose the backend from input shape and preservation requirements, not from what feels strongest.
Shared roots:
# macOS / Linux / WSL
DOCX_ROOT="<skill_dir>"
CLI="dotnet run --project $DOCX_ROOT/scripts/dotnet/MiniMaxAIDocx.Cli --"
# Windows
$env:DOCX_ROOT = "<skill_dir>"
$CLI = "dotnet run --project $env:DOCX_ROOT\scripts\dotnet\MiniMaxAIDocx.Cli --"
Use when:
Hard no:
Gate:
# macOS / Linux / WSL
test -d "$DOCX_ROOT" || { echo "FATAL: docx skill root missing" >&2; exit 1; }
bash "$DOCX_ROOT/scripts/env_check.sh" | grep -E "^\[OK\][[:space:]]+dotnet\b" || {
echo "FATAL: dotnet SDK not available" >&2
exit 1
}
# Windows
if (-not (Test-Path $env:DOCX_ROOT)) { Write-Error "FATAL: docx skill root missing"; exit 1 }
$check = & powershell -ExecutionPolicy Bypass -File "$env:DOCX_ROOT\scripts\env_check.ps1" -Level Full
if (-not ($check | Select-String -Pattern '^\[OK\]\s+dotnet\b')) {
Write-Error "FATAL: dotnet SDK not available"; exit 1
}
Escalation:
D and reroute to SPUse when:
document.xml, styles.xml, numbering.xml, header/footer parts,
comments, fields, or relationshipsHard no:
Gate:
Same as D, plus read the relevant sample under:
$DOCX_ROOT/scripts/dotnet/MiniMaxAIDocx.Core/Samples/*.cs
Use when:
Hard no:
Gate:
No heavy toolchain gate. X uses bundled Python scripts only. But it is only valid for operations that
fit the X safety boundary. If topology risk appears, stop using X and reroute to D or S.
For CREATE_DOCX / APPLY_TEMPLATE, use this table only after recipe family or template mode is already chosen.
| Input shape | Output requirement | Pick |
|---|---|---|
| Markdown / LaTeX / HTML / RST | formal DOCX creation after normalization into document plan / structured config | D |
| Markdown / LaTeX / HTML / RST + complex graph requirements | normalized create, but CLI surface insufficient | S |
| Existing DOCX | content edits preserving styles/headers/sections | D |
| Existing DOCX + institutional template DOCX | template apply / section-aware formatting | D |
| Structured config | create styled DOCX | D |
| Existing DOCX | deterministic local low-risk XML patch | X |
| Any DOCX graph task beyond D surface | byte-level control | S |