feat(mofa-slides): migrate 670→51 line SKILL.md to discovery+docs/ tree (PR-D2)#79
Merged
Conversation
…ee (PR-D2)
mofa-slides is the largest skill on the fleet — its 670-line SKILL.md is
the bulk of the standing token cost on every turn. This PR moves the
operational/reference content off SKILL.md and behind manifest
discovery hints the LLM reads on-demand.
Prerequisites (octos): PR-A #1327, PR-B #1333, PR-C #1339, PR-D1 #1340.
Trimmed SKILL.md (51 lines, was 670) keeps only what cannot be inferred
from tool descriptions:
- Output-path rebind rules (skill-output auto-prefix, no /tmp).
- Workspace-contract truth (check_background_tasks +
check_workspace_contract are authoritative; not chat history).
- Interactive flow one-liner.
- The four load-bearing anti-patterns:
1. Do NOT memorize the style catalog — call mofa_list_styles.
2. Language match end-to-end (Chinese stays Chinese; the runtime no
longer auto-appends an English clamp).
3. Mode 2 (clean bg + manual texts) is default for "editable PPT" —
NOT Mode 3 (auto_layout VQA).
4. Every deck is a self-contained script with a per-deck const VQA at
the top, spliced into every slide.prompt via ${VQA}.
- Pointer to docs/.
Migrated content → mofa-slides/docs/*.md (read on demand):
- modes.md Mode 1/2/3/4 decision tree, when NOT to use
auto_layout, costs, anti-leak rules.
- cc-ppt-authoring.md Required deck-script structure (top constants,
const VQA, module.exports), mandatory rules,
Chinese + English minimal worked examples.
- custom-styles.md Inline prompt overrides AND full-TOML custom style
authoring (PR #72 content: save path, schema,
workflow, "style not found" failure modes).
- worked-examples.md Full 5-slide editable business deck (texts,
runs, fill, margin, lineSpacing), Mode 3 / Mode 4
/ reference-image shapes, slide-canvas layout
reference, TextOverlay + TextRun schemas.
- style-prompts.md Inline style-prompt quick-reference table
(14 vibes), built-in style category cheatsheet
(verify with mofa_list_styles), API modes,
timing/timeout budget, CLI flags, config, OOXML +
pptx-scripts/ utilities for editing existing decks.
Manifest gets discovery: { summary, hints[] } with 8 hints (max),
plus skill_md_auto_inject: false so the host stops auto-injecting the
full SKILL.md and instead lets the LLM read docs/ on demand via the
hints. Tool descriptions are unchanged.
Combined with PR-A/B/C/D1 in octos, this is the single biggest
token-cost recovery in the fleet — ~11K tokens/turn savings post-PR-E
once the host stops shipping SKILL.md by default.
styles/, pptx-scripts/, and ooxml/ subdirs are untouched.
Version: 0.6.1 → 0.7.0 (major SKILL.md restructure).
… array
Codex review on octos schema flagged that PluginManifest expects each
discovery.hint to be { when, read?, list? } per PR-C, not a bare string.
Convert the 8 string hints to objects, mapping advisory-only hints
(style catalog, invocation contract, language match) at SKILL.md since
those rules live in the trimmed body, and the doc-specific hints at
their dedicated docs/*.md files.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Context
mofa-slides is the largest skill on the fleet — its 670-line
SKILL.mdis the bulk of every fleet turn's standing token cost. This PR ports it to the discovery+docs/tree model so the LLM reads reference content on-demand via manifest hints instead of paying for it up front on every turn.Prerequisites (octos): PR-A #1327, PR-B #1333, PR-C #1339, PR-D1 #1340.
This is the single biggest token-cost recovery in the fleet — ~11K tokens/turn savings post-PR-E once the host stops auto-injecting
SKILL.mdby default (skill_md_auto_inject: false).Before / after
SKILL.mddocs/discovery.summary+ 8 hintsskill_md_auto_injectfalseLoad-bearing anti-patterns preserved in the trimmed SKILL.md
The full 51-line
SKILL.mdkeeps only what cannot be inferred from tool descriptions:skill-output/auto-prefix; no/tmp/).check_background_tasks+check_workspace_contractare authoritative — not chat history).mofa_list_styles. The binary errors out (no silent fallback) on unknown names.texts) is the default for "editable PPT" — NOT Mode 3 (auto_layoutVQA). Mode 3 is slow, expensive, needs human cleanup.const VQAblock at the top, spliced into everyslides[i].promptvia${VQA}. Writescript.jsto disk first; invoke withinput: "<path>".docs/+ the manifest'sdiscovery.hints.Migrated content →
mofa-slides/docs/*.md5 new self-contained docs, each readable in isolation:
docs/modes.md— Mode 1/2/3/4 decision tree, when NOT to useauto_layout, costs of enabling it, anti-leak rules, full 4-phase pipeline description.docs/cc-ppt-authoring.md— Required deck-script structure (top constants,const VQA,module.exports), mandatory rules, full Chinese + English minimal worked examples.docs/custom-styles.md— Inline prompt overrides AND full-TOML custom style authoring (PR feat(slides): document full-TOML custom style authoring #72 content: workspace save path, TOML schema, workflow, the three "style not found" failure modes).docs/worked-examples.md— Full 5-slide editable business deck (Mode 2 withtexts,runs,fill,margin,lineSpacing), Mode 3 / Mode 4 / reference-image JSON shapes, slide-canvas layout reference (16:9, inch positions), completeTextOverlay+TextRunschemas.docs/style-prompts.md— Inline style-prompt quick-reference table (14 vibes: Art Deco, Bauhaus, Glassmorphism, 国潮, 水墨, 敦煌, 青花瓷, …), built-in style category cheatsheet (verify withmofa_list_styles), API modes, timing/timeout budget, CLI flags, config, OOXML +pptx-scripts/utilities for editing existing decks.Discovery hints (8 / 8 max, one per concern)
Each hint names a trigger condition + the doc to read:
mofa_list_styles(never recite).docs/modes.md.docs/cc-ppt-authoring.md.docs/custom-styles.md.docs/worked-examples.md.docs/style-prompts.md.input: "<path>"with${VQA}spliced (not inlineslides:).Untouched
manifest.json(mofa_list_styles,mofa_slides) — identical.mofa-slides/styles/(20 TOML files) — untouched.mofa-slides/pptx-scripts/— untouched.mofa-slides/ooxml/— untouched.mofa-slides/USER_GUIDE.mdand the pre-existingdocs/00-SKILL-完整制作指南.md— unchanged.Test plan
manifest.jsonparses as valid JSON.SKILL.mdis 51 lines (≤ 80 cap).discovery.hintsexist undermofa-slides/docs/.SKILL.md.styles/,pptx-scripts/,ooxml/subdirs untouched.