Subtitle Extractslator Skill
Purpose
This repository is skill-first: the subtitle skill package is the primary deliverable, and execution authority is governed by Loom SO.
This skill has been enhanced by Loom SO and is now SO-exclusive governed (Beta channel, locked to 0.2.91-beta). Only dotnet so.dll run and dotnet so.dll resume count as official skill runs and official skill execution history. Direct CLI and direct MCP are runtime primitives for component operations only.
Deterministic orchestration is encoded in the checked-in workflow JSON template and validated by SO runtime 0.2.91-beta (see Workflow Contract below). The authoritative runtime lock is assets/so-workflow/so-package-lock.json. Runtime contracts remain in references/ for SO-orchestrated implementation.
Installation and Release Links
Use this repository's package index pages as the canonical runtime source. This skill package is binary-free and intentionally does not ship dll or bin runtime assets.
- Project URL: waynebaby/SubtitleExtractslator
- Stable package index: packages.released.md
- Stable package index (zh-CN): packages.released.zh-CN.md
- Beta package index: packages.beta.md
- Beta package index (zh-CN): packages.beta.zh-CN.md
- SO package index (Current Beta source of truth): Techne Loom packages.beta.md
- SO guide (Current Beta source of truth, zh-CN): Techne Loom so-guide.md
- SO package index (Released reference): Techne Loom packages.released.md
- SO guide (Released reference): Techne Loom so-guide.md
- Runtime fallback
.nupkglinks are maintained inside the package index pages above. - Runtime missing diagnosis and fallback guide:
references/binary-missing.md
SO workflow files in this skill package:
assets/so-workflow/skill-plan.md— Supporting maintainer-facing orchestration planassets/so-workflow/so-template.json— Workflow JSON template (execution authority)assets/so-workflow/so-package-lock.json— Authoritative SO runtime version lock- External audit artifacts — Compile validation and run/resume audit evidence must stay outside the skill folder
Workflow modification confirmation loop for maintainers:
- Update
assets/so-workflow/skill-plan.mdorassets/so-workflow/so-template.json. - Validate
assets/so-workflow/so-template.jsonwith the locked0.2.91-betaSO runtime and an external audit root. - Review Mermaid, HTML, workflow backup, and
workflow.analysis.json. - If governance, seam ownership, or route coverage is still unsatisfied, revise and recompile again.
- Update this
SKILL.mdonly after the compiled workflow is accepted.
Official SO guide refresh for governed maintenance and validation:
dotnet so.dll --guide --lang zh-cn
Component primitive guide entry (direct CLI runtime diagnostics only):
dotnet "<absolute-path>/SubtitleExtractslator.Cli.dll" --guide
Official skill execution entry:
dotnet so.dll run --workflow-file <runtime-workflow-copy>.json
dotnet so.dll resume --workflow-file <runtime-workflow-copy>.json --result-file <external-result>.json
Primary goals:
- Keep timeline and subtitle structure stable.
- Prioritize existing subtitle resources before extraction.
- Use grouped rolling context for better semantic consistency.
- Keep skill behavior consistent across agent (MCP) and script (CLI) execution paths.
Trigger Guidance
Use this skill when user asks to:
- Check whether a media file already has a specific subtitle language.
- Search online subtitle candidates before local extraction.
- Translate subtitles while preserving SRT timing and segmentation rhythm.
- Produce a final SRT file from a media file or existing subtitle file.
Reference Map
Read these reference files for operational details:
references/cli.md:
- runtime package acquisition and CLI primitive command surface
- CLI command and auth-contract examples
- output path policy
references/mcp.md:
- MCP primitive policy and setup contract
- exposed tools and return contract
- MCP runtime notes and constraints
references/opensubtitles.md:
- OpenSubtitles auth-command credential contract (CLI + MCP)
- search/download fallback strategy, rate-limit handling, and parameter matrix
references/troubleshooting.md:
- failure patterns and diagnostics checklist
references/binary-missing.md:
- release download links for current version binaries
- binary missing diagnosis, validation checklist, and recovery flow
references/localpaths.md:
- local machine path memory (for example FFmpeg bin path)
- persisted records for next skill run
references/batching.md:
- long-run queue batching and resume policy
- centralized temp tracking file contract for multi-file jobs
references/supervisor.md:
- persistent coordinator playbook for multi-file runs
- queue ownership, batch selection, and resume behavior
references/worker.md:
- bounded batch execution playbook
- per-item completion/failure handoff contract
Workflow Contract
SO template (assets/so-workflow/so-template.json) is the canonical and exclusive deterministic execution model. Official skill runs and official skill history are SO-owned.
skill-plan.md is maintainer-facing planning context. Public dotnet so.dll compile validates the existing workflow JSON template; it does not accept skill-plan.md as a CLI input.
Compilation Authority: Validate with:
dotnet so.dll compile \
--workflow-file assets/so-workflow/so-template.json \
[--audit-output <external-audit-root>]
Execution: Run via SO runtime against a runtime copy outside the skill folder:
dotnet so.dll run --workflow-file <runtime-workflow-copy>.json [--audit-output <external-audit-root>]
dotnet so.dll resume --workflow-file <current>.json --result-file <external-result>.json
High-level flow:
- Normalize input (media/SRT, target language, output path).
- Route execution mode (MCP vs CLI).
- Probe embedded tracks → check local files → OpenSubtitles search/download.
- Translate via grouped context-aware processing.
- Merge and emit final SRT.
- Update batch queue state (if applicable).
External seams (weave out):
AskUser: MCP setup, FFmpeg path, candidate selection, explicit policiesMcpCall: probe, extract, search, download, translate toolsWaitResume: batch cooldown, external async triggersSubagentCall: worker batch delegation
Guardrails
- Preserve timestamps and cue ordering.
- Do not merge/split cues unless user explicitly requests it.
- Stop on structural validation failure; never emit broken SRT.
- Preserve deterministic source selection order.
- Attempt local subtitle discovery before OpenSubtitles when embedded tracks are absent.
- Keep OpenSubtitles
search -> downloadstrict serial. - Require both
searchQueryPrimaryandsearchQueryNormalizedfor OpenSubtitles search. - Keep OpenSubtitles fallback order inside C# runtime, not skill-side parallel fanout.
- Keep OpenSubtitles auth in
login/aquire/status/clearcache flow. - Switch OpenSubtitles lane to delayed serial mode after any rate-limit signal.
- Keep queue state in centralized temp storage, never beside media files.
- Keep MCP orchestration agent-driven and avoid script-driven tool loops.
- Keep
subtitle-extractslator/binary-free; acquire runtime from this repository'spackages.*.mdabsolute URLs. - Never use workflow nodes or steps equivalent to
run a multistep plan; this pattern is prohibited because it weakens SO governance boundaries and can expose execution-leak paths.
Operational Notes
- Prefer deterministic behavior over creative rewriting.
- Keep translation natural and context-aware while preserving subtitle pacing.
- For commands and troubleshooting, use
references/cli.mdandreferences/troubleshooting.md. - For long-running folder jobs, use
references/batching.md,references/supervisor.md, andreferences/worker.md. - Platform-specific agent files are optional adapters; runtime behavior is defined by this skill and
references/contracts.