minimal-agent 0.8.2 → 0.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +14 -12
- package/package.json +34 -1
- package/plugins/cron-runner/.claude-plugin/plugin.json +5 -0
- package/plugins/cron-runner/commands/cron.md +26 -0
- package/plugins/cron-runner/commands/crons.md +7 -0
- package/plugins/cron-runner/plugin.js +34 -0
- package/plugins/cron-runner/src/commands.js +348 -0
- package/plugins/cron-runner/src/cronTime.js +148 -0
- package/plugins/cron-runner/src/lock.js +68 -0
- package/plugins/cron-runner/src/runs.js +89 -0
- package/plugins/cron-runner/src/scheduleEngine.js +72 -0
- package/plugins/cron-runner/src/scheduler.js +355 -0
- package/plugins/cron-runner/src/schema.js +140 -0
- package/plugins/cron-runner/src/service.js +167 -0
- package/plugins/cron-runner/src/store.js +298 -0
- package/plugins/cron-runner/src/types.js +1 -0
- package/plugins/workflow-runner/commands/workflow.md +4 -4
- package/plugins/workflow-runner/commands/workflows.md +1 -1
- package/plugins/workflow-runner/plugin.js +3 -1
- package/plugins/workflow-runner/src/agentCommon.js +249 -51
- package/plugins/workflow-runner/src/dslManifest.js +72 -0
- package/plugins/workflow-runner/src/expressions.js +198 -15
- package/plugins/workflow-runner/src/index.js +40 -8
- package/plugins/workflow-runner/src/jsonPayload.js +1 -1
- package/plugins/workflow-runner/src/loader.js +286 -72
- package/plugins/workflow-runner/src/multimodal.js +37 -0
- package/plugins/workflow-runner/src/recovery.js +49 -39
- package/plugins/workflow-runner/src/runner.js +802 -287
- package/plugins/workflow-runner/src/stepExecutors/agent.js +157 -39
- package/plugins/workflow-runner/src/stepExecutors/assert.js +16 -3
- package/plugins/workflow-runner/src/stepExecutors/llm.js +60 -111
- package/plugins/workflow-runner/src/stepExecutors/skill.js +47 -47
- package/plugins/workflow-runner/src/stepExecutors/tool.js +76 -10
- package/plugins/workflow-runner/src/stepExecutors/verify.js +27 -10
- package/plugins/workflow-runner/src/taskIdentity.js +296 -0
- package/plugins/workflow-runner/src/types.js +19 -9
- package/plugins/workflow-runner/src/workflowState.js +516 -33
- package/skills/adversarial-review/SKILL.md +0 -1
- package/skills/ai-image/SKILL.md +89 -0
- package/skills/ai-image/scripts/generate.mjs +497 -0
- package/skills/ai-image/scripts/generate_from_plan.mjs +469 -0
- package/skills/ai-image/scripts/generate_from_plan_test.mjs +223 -0
- package/skills/ai-image/scripts/generate_test.mjs +74 -0
- package/skills/browser-automation/SKILL.md +47 -0
- package/skills/docx/SKILL.md +25 -3
- package/skills/docx/scripts/office/helpers/__pycache__/__init__.cpython-314.pyc +0 -0
- package/skills/docx/scripts/office/helpers/__pycache__/merge_runs.cpython-314.pyc +0 -0
- package/skills/docx/scripts/office/helpers/__pycache__/simplify_redlines.cpython-314.pyc +0 -0
- package/skills/docx/scripts/office/validators/__pycache__/__init__.cpython-314.pyc +0 -0
- package/skills/docx/scripts/office/validators/__pycache__/base.cpython-314.pyc +0 -0
- package/skills/docx/scripts/office/validators/__pycache__/docx.cpython-314.pyc +0 -0
- package/skills/docx/scripts/office/validators/__pycache__/pptx.cpython-314.pyc +0 -0
- package/skills/docx/scripts/office/validators/__pycache__/redlining.cpython-314.pyc +0 -0
- package/skills/docx/scripts/opc_check.py +253 -0
- package/skills/image-gen-openrouter/SKILL.md +10 -2
- package/skills/image-stats/SKILL.md +65 -0
- package/skills/image-stats/scripts/__pycache__/image_stats.cpython-314.pyc +0 -0
- package/skills/image-stats/scripts/__pycache__/image_stats_test.cpython-314.pyc +0 -0
- package/skills/image-stats/scripts/image_stats.py +368 -0
- package/skills/image-stats/scripts/image_stats_test.py +181 -0
- package/skills/pptx/SKILL.md +123 -95
- package/skills/pptx/design.md +82 -0
- package/skills/pptx/examples/README.md +29 -0
- package/skills/pptx/examples/hybrid_example.mjs +107 -0
- package/skills/pptx/examples/hybrid_example.pptx +0 -0
- package/skills/pptx/pptxgenjs.md +41 -0
- package/skills/pptx/scripts/deck_helpers.mjs +224 -0
- package/skills/pptx/scripts/layout_lint.py +293 -0
- package/skills/pptx/scripts/layout_lint_test.py +160 -0
- package/skills/pptx/scripts/opc_check.py +339 -0
- package/skills/pptx/scripts/svg_fallback.mjs +145 -0
- package/skills/pptx/svg.md +67 -0
- package/skills/tts-zh/SKILL.md +19 -2
- package/skills/ui-design/SKILL.md +158 -0
- package/skills/ui-design/claude_design.md +309 -0
- package/skills/ui-design/evals/evals.json +254 -0
- package/skills/ui-design/references/aesthetic-direction.md +83 -0
- package/skills/ui-design/references/claude-design-protocol.md +36 -0
- package/skills/ui-design/references/design-context.md +53 -0
- package/skills/ui-design/references/design-execution-playbook.md +82 -0
- package/skills/ui-design/references/export-pptx.md +124 -0
- package/skills/ui-design/references/layout-composition.md +654 -0
- package/skills/ui-design/references/preview-feedback.md +37 -0
- package/skills/ui-design/references/source-image-layout.md +189 -0
- package/skills/ui-design/references/starter-components.md +78 -0
- package/skills/ui-design/references/vi-aegis-vector.md +144 -0
- package/skills/ui-design/references/vi-amber-prism.md +133 -0
- package/skills/ui-design/references/vi-aqua-glass.md +200 -0
- package/skills/ui-design/references/vi-comfort-vision.md +147 -0
- package/skills/ui-design/references/vi-ember-prism.md +140 -0
- package/skills/ui-design/references/vi-nebula-console.md +151 -0
- package/skills/ui-design/references/vi-obsidian-optics.md +139 -0
- package/skills/ui-design/references/vi-obsidian-xui.md +143 -0
- package/skills/ui-design/references/vi-precision-horizon-dark.md +117 -0
- package/skills/ui-design/references/vi-precision-horizon.md +215 -0
- package/skills/ui-design/references/vi-solar-relay.md +130 -0
- package/skills/ui-design/references/vi-template-workflow.md +48 -0
- package/skills/ui-design/references/vi-verdant-grid.md +141 -0
- package/skills/ui-design/references/vi-violet-meridian.md +172 -0
- package/skills/ui-design/scripts/__pycache__/assemble_material.cpython-314.pyc +0 -0
- package/skills/ui-design/scripts/__pycache__/assemble_material_test.cpython-314.pyc +0 -0
- package/skills/ui-design/scripts/__pycache__/chart_sanity_check.cpython-314.pyc +0 -0
- package/skills/ui-design/scripts/__pycache__/check_language_policy.cpython-314.pyc +0 -0
- package/skills/ui-design/scripts/__pycache__/check_ui_artifact.cpython-314.pyc +0 -0
- package/skills/ui-design/scripts/__pycache__/check_ui_artifact_pptx_test.cpython-314.pyc +0 -0
- package/skills/ui-design/scripts/__pycache__/deck_pages_check.cpython-314.pyc +0 -0
- package/skills/ui-design/scripts/__pycache__/deck_pages_check_test.cpython-314.pyc +0 -0
- package/skills/ui-design/scripts/__pycache__/deck_visual_style_check.cpython-314.pyc +0 -0
- package/skills/ui-design/scripts/__pycache__/deck_visual_style_check_test.cpython-314.pyc +0 -0
- package/skills/ui-design/scripts/__pycache__/design_budget_check.cpython-314.pyc +0 -0
- package/skills/ui-design/scripts/__pycache__/design_budget_check_test.cpython-314.pyc +0 -0
- package/skills/ui-design/scripts/__pycache__/design_repair_hints.cpython-314.pyc +0 -0
- package/skills/ui-design/scripts/__pycache__/design_repair_hints_test.cpython-314.pyc +0 -0
- package/skills/ui-design/scripts/__pycache__/design_style_check.cpython-314.pyc +0 -0
- package/skills/ui-design/scripts/__pycache__/design_style_check_test.cpython-314.pyc +0 -0
- package/skills/ui-design/scripts/__pycache__/draft_coverage_check.cpython-314.pyc +0 -0
- package/skills/ui-design/scripts/__pycache__/extract_source_assets.cpython-314.pyc +0 -0
- package/skills/ui-design/scripts/__pycache__/extract_source_assets_test.cpython-314.pyc +0 -0
- package/skills/ui-design/scripts/__pycache__/generated_image_review_collect.cpython-314.pyc +0 -0
- package/skills/ui-design/scripts/__pycache__/generated_image_review_collect_test.cpython-314.pyc +0 -0
- package/skills/ui-design/scripts/__pycache__/image_plan_lint.cpython-314.pyc +0 -0
- package/skills/ui-design/scripts/__pycache__/image_plan_lint_test.cpython-314.pyc +0 -0
- package/skills/ui-design/scripts/__pycache__/image_prompt_rewrite.cpython-314.pyc +0 -0
- package/skills/ui-design/scripts/__pycache__/image_prompt_rewrite_test.cpython-314.pyc +0 -0
- package/skills/ui-design/scripts/__pycache__/layout_balance.cpython-314.pyc +0 -0
- package/skills/ui-design/scripts/__pycache__/layout_balance_test.cpython-314.pyc +0 -0
- package/skills/ui-design/scripts/__pycache__/normalize_design_json.cpython-314.pyc +0 -0
- package/skills/ui-design/scripts/__pycache__/normalize_design_json_test.cpython-314.pyc +0 -0
- package/skills/ui-design/scripts/__pycache__/plan_source_layout.cpython-314.pyc +0 -0
- package/skills/ui-design/scripts/__pycache__/plan_source_layout_test.cpython-314.pyc +0 -0
- package/skills/ui-design/scripts/__pycache__/resolve_source_hint.cpython-314.pyc +0 -0
- package/skills/ui-design/scripts/__pycache__/resolve_source_hint_test.cpython-314.pyc +0 -0
- package/skills/ui-design/scripts/__pycache__/resolve_source_input.cpython-314.pyc +0 -0
- package/skills/ui-design/scripts/__pycache__/resolve_source_input_test.cpython-314.pyc +0 -0
- package/skills/ui-design/scripts/__pycache__/scaffold_ui_artifact.cpython-314.pyc +0 -0
- package/skills/ui-design/scripts/__pycache__/source_usage_check.cpython-314.pyc +0 -0
- package/skills/ui-design/scripts/__pycache__/source_usage_check_test.cpython-314.pyc +0 -0
- package/skills/ui-design/scripts/__pycache__/text_readability_pixel.cpython-314.pyc +0 -0
- package/skills/ui-design/scripts/__pycache__/visual_quality_gate.cpython-314.pyc +0 -0
- package/skills/ui-design/scripts/__pycache__/visual_quality_gate_test.cpython-314.pyc +0 -0
- package/skills/ui-design/scripts/assemble_material.py +217 -0
- package/skills/ui-design/scripts/assemble_material_test.py +149 -0
- package/skills/ui-design/scripts/browser_check_ui_artifact.mjs +221 -0
- package/skills/ui-design/scripts/chart_sanity_check.py +261 -0
- package/skills/ui-design/scripts/chart_sanity_check_test.py +165 -0
- package/skills/ui-design/scripts/check_language_policy.py +351 -0
- package/skills/ui-design/scripts/check_ui_artifact.py +435 -0
- package/skills/ui-design/scripts/check_ui_artifact_pptx_test.py +251 -0
- package/skills/ui-design/scripts/deck_pages_check.py +158 -0
- package/skills/ui-design/scripts/deck_pages_check_test.py +134 -0
- package/skills/ui-design/scripts/deck_visual_style_check.py +767 -0
- package/skills/ui-design/scripts/deck_visual_style_check_test.py +713 -0
- package/skills/ui-design/scripts/design_budget_check.py +271 -0
- package/skills/ui-design/scripts/design_budget_check_test.py +183 -0
- package/skills/ui-design/scripts/design_repair_hints.py +162 -0
- package/skills/ui-design/scripts/design_repair_hints_test.py +54 -0
- package/skills/ui-design/scripts/design_style_check.py +397 -0
- package/skills/ui-design/scripts/design_style_check_test.py +233 -0
- package/skills/ui-design/scripts/draft_coverage_check.py +184 -0
- package/skills/ui-design/scripts/draft_coverage_check_test.py +131 -0
- package/skills/ui-design/scripts/export_pptx_from_html.mjs +2367 -0
- package/skills/ui-design/scripts/extract_source_assets.py +607 -0
- package/skills/ui-design/scripts/extract_source_assets_test.py +256 -0
- package/skills/ui-design/scripts/generated_image_review_collect.py +206 -0
- package/skills/ui-design/scripts/generated_image_review_collect_test.py +91 -0
- package/skills/ui-design/scripts/image_plan_lint.py +571 -0
- package/skills/ui-design/scripts/image_plan_lint_test.py +515 -0
- package/skills/ui-design/scripts/image_prompt_rewrite.py +713 -0
- package/skills/ui-design/scripts/image_prompt_rewrite_test.py +966 -0
- package/skills/ui-design/scripts/layout_balance.py +881 -0
- package/skills/ui-design/scripts/layout_balance_test.py +927 -0
- package/skills/ui-design/scripts/normalize_design_json.py +272 -0
- package/skills/ui-design/scripts/normalize_design_json_test.py +119 -0
- package/skills/ui-design/scripts/plan_source_layout.py +1450 -0
- package/skills/ui-design/scripts/plan_source_layout_test.py +1136 -0
- package/skills/ui-design/scripts/resolve_source_input.py +270 -0
- package/skills/ui-design/scripts/resolve_source_input_test.py +98 -0
- package/skills/ui-design/scripts/scaffold_ui_artifact.py +377 -0
- package/skills/ui-design/scripts/source_usage_check.py +581 -0
- package/skills/ui-design/scripts/source_usage_check_test.py +427 -0
- package/skills/ui-design/scripts/text_readability_pixel.py +340 -0
- package/skills/ui-design/scripts/text_readability_pixel_test.py +219 -0
- package/skills/ui-design/scripts/visual_quality_gate.py +301 -0
- package/skills/ui-design/scripts/visual_quality_gate_test.py +233 -0
- package/skills/ui-design/tests/e2e/prompts/deck.md +19 -0
- package/skills/ui-design/tests/e2e/prompts/webpage.md +17 -0
- package/skills/ui-design/tests/e2e/render_check.mjs +101 -0
- package/skills/ui-design/tests/e2e/rubric.json +54 -0
- package/skills/ui-design/tests/e2e/runs/aegis-vector-preview-1/checks/browser-check.json +49 -0
- package/skills/ui-design/tests/e2e/runs/aegis-vector-preview-1/checks/language-check.txt +12 -0
- package/skills/ui-design/tests/e2e/runs/aegis-vector-preview-1/checks/static-check.txt +15 -0
- package/skills/ui-design/tests/e2e/runs/aegis-vector-preview-1/outputs/index.html +837 -0
- package/skills/ui-design/tests/e2e/runs/aegis-vector-preview-1/prompt.md +12 -0
- package/skills/ui-design/tests/e2e/runs/aegis-vector-preview-1/review.md +21 -0
- package/skills/ui-design/tests/e2e/runs/aegis-vector-preview-1/screenshots/desktop.png +0 -0
- package/skills/ui-design/tests/e2e/runs/aegis-vector-preview-1/screenshots/mobile.png +0 -0
- package/skills/ui-design/tests/e2e/runs/amber-prism-screenshot-check-1/outputs/homepage.html +373 -0
- package/skills/ui-design/tests/e2e/runs/amber-prism-screenshot-check-1/outputs/platform.html +378 -0
- package/skills/ui-design/tests/e2e/runs/amber-prism-screenshot-check-1/prompt.md +13 -0
- package/skills/ui-design/tests/e2e/runs/amber-prism-screenshot-check-1/review.md +26 -0
- package/skills/ui-design/tests/e2e/runs/amber-prism-screenshot-check-1/screenshots/homepage/browser-check.json +49 -0
- package/skills/ui-design/tests/e2e/runs/amber-prism-screenshot-check-1/screenshots/homepage/desktop.png +0 -0
- package/skills/ui-design/tests/e2e/runs/amber-prism-screenshot-check-1/screenshots/homepage/mobile.png +0 -0
- package/skills/ui-design/tests/e2e/runs/amber-prism-screenshot-check-1/screenshots/platform/browser-check.json +49 -0
- package/skills/ui-design/tests/e2e/runs/amber-prism-screenshot-check-1/screenshots/platform/desktop.png +0 -0
- package/skills/ui-design/tests/e2e/runs/amber-prism-screenshot-check-1/screenshots/platform/mobile.png +0 -0
- package/skills/ui-design/tests/e2e/runs/aqua-glass-iteration-1/checks/static-check.txt +2 -0
- package/skills/ui-design/tests/e2e/runs/aqua-glass-iteration-1/outputs/index.html +656 -0
- package/skills/ui-design/tests/e2e/runs/aqua-glass-iteration-1/prompt.md +12 -0
- package/skills/ui-design/tests/e2e/runs/aqua-glass-iteration-1/render_check.mjs +67 -0
- package/skills/ui-design/tests/e2e/runs/aqua-glass-iteration-2/checks/static-check.txt +2 -0
- package/skills/ui-design/tests/e2e/runs/aqua-glass-iteration-2/outputs/index.html +587 -0
- package/skills/ui-design/tests/e2e/runs/aqua-glass-iteration-2/prompt.md +12 -0
- package/skills/ui-design/tests/e2e/runs/aqua-glass-iteration-2/review.md +36 -0
- package/skills/ui-design/tests/e2e/runs/aqua-glass-volcano-refresh-1/checks/browser-check.json +49 -0
- package/skills/ui-design/tests/e2e/runs/aqua-glass-volcano-refresh-1/checks/language-check.txt +8 -0
- package/skills/ui-design/tests/e2e/runs/aqua-glass-volcano-refresh-1/checks/static-check.txt +16 -0
- package/skills/ui-design/tests/e2e/runs/aqua-glass-volcano-refresh-1/outputs/index.html +739 -0
- package/skills/ui-design/tests/e2e/runs/aqua-glass-volcano-refresh-1/prompt.md +11 -0
- package/skills/ui-design/tests/e2e/runs/aqua-glass-volcano-refresh-1/review.md +22 -0
- package/skills/ui-design/tests/e2e/runs/aqua-glass-volcano-refresh-1/screenshots/desktop.png +0 -0
- package/skills/ui-design/tests/e2e/runs/aqua-glass-volcano-refresh-1/screenshots/mobile.png +0 -0
- package/skills/ui-design/tests/e2e/runs/comfort-vision-preview-1/checks/browser-check.json +52 -0
- package/skills/ui-design/tests/e2e/runs/comfort-vision-preview-1/outputs/index.html +641 -0
- package/skills/ui-design/tests/e2e/runs/comfort-vision-preview-1/screenshots/desktop.png +0 -0
- package/skills/ui-design/tests/e2e/runs/comfort-vision-preview-1/screenshots/mobile.png +0 -0
- package/skills/ui-design/tests/e2e/runs/ember-prism-red-preview-1/outputs/index.html +467 -0
- package/skills/ui-design/tests/e2e/runs/ember-prism-red-preview-1/screenshots/browser-check.json +49 -0
- package/skills/ui-design/tests/e2e/runs/ember-prism-red-preview-1/screenshots/desktop.png +0 -0
- package/skills/ui-design/tests/e2e/runs/ember-prism-red-preview-1/screenshots/mobile.png +0 -0
- package/skills/ui-design/tests/e2e/runs/ember-prism-screenshot-check-1/outputs/homepage.html +373 -0
- package/skills/ui-design/tests/e2e/runs/ember-prism-screenshot-check-1/outputs/platform.html +378 -0
- package/skills/ui-design/tests/e2e/runs/ember-prism-screenshot-check-1/prompt.md +13 -0
- package/skills/ui-design/tests/e2e/runs/ember-prism-screenshot-check-1/review.md +26 -0
- package/skills/ui-design/tests/e2e/runs/ember-prism-screenshot-check-1/screenshots/homepage/browser-check.json +49 -0
- package/skills/ui-design/tests/e2e/runs/ember-prism-screenshot-check-1/screenshots/homepage/desktop.png +0 -0
- package/skills/ui-design/tests/e2e/runs/ember-prism-screenshot-check-1/screenshots/homepage/mobile.png +0 -0
- package/skills/ui-design/tests/e2e/runs/ember-prism-screenshot-check-1/screenshots/platform/browser-check.json +49 -0
- package/skills/ui-design/tests/e2e/runs/ember-prism-screenshot-check-1/screenshots/platform/desktop.png +0 -0
- package/skills/ui-design/tests/e2e/runs/ember-prism-screenshot-check-1/screenshots/platform/mobile.png +0 -0
- package/skills/ui-design/tests/e2e/runs/empty-agent-protocol-check/checks/browser-check.json +49 -0
- package/skills/ui-design/tests/e2e/runs/empty-agent-protocol-check/checks/language-check.txt +4 -0
- package/skills/ui-design/tests/e2e/runs/empty-agent-protocol-check/checks/static-check.txt +2 -0
- package/skills/ui-design/tests/e2e/runs/empty-agent-protocol-check/execution_notes.md +10 -0
- package/skills/ui-design/tests/e2e/runs/empty-agent-protocol-check/outputs/index.html +587 -0
- package/skills/ui-design/tests/e2e/runs/empty-agent-protocol-check/prompt.md +14 -0
- package/skills/ui-design/tests/e2e/runs/empty-agent-protocol-check/review.md +13 -0
- package/skills/ui-design/tests/e2e/runs/empty-agent-protocol-check/screenshots/desktop.png +0 -0
- package/skills/ui-design/tests/e2e/runs/empty-agent-protocol-check/screenshots/mobile.png +0 -0
- package/skills/ui-design/tests/e2e/runs/iteration-1/deck/checks/browser-check.json +24 -0
- package/skills/ui-design/tests/e2e/runs/iteration-1/deck/checks/static-check.txt +2 -0
- package/skills/ui-design/tests/e2e/runs/iteration-1/deck/execution_notes.md +21 -0
- package/skills/ui-design/tests/e2e/runs/iteration-1/deck/outputs/deck.html +451 -0
- package/skills/ui-design/tests/e2e/runs/iteration-1/deck/screenshots/slide-01.png +0 -0
- package/skills/ui-design/tests/e2e/runs/iteration-1/deck/screenshots/slide-02.png +0 -0
- package/skills/ui-design/tests/e2e/runs/iteration-1/review.md +79 -0
- package/skills/ui-design/tests/e2e/runs/iteration-1/webpage/checks/browser-check.json +26 -0
- package/skills/ui-design/tests/e2e/runs/iteration-1/webpage/checks/static-check.txt +2 -0
- package/skills/ui-design/tests/e2e/runs/iteration-1/webpage/execution_notes.md +20 -0
- package/skills/ui-design/tests/e2e/runs/iteration-1/webpage/outputs/index.html +534 -0
- package/skills/ui-design/tests/e2e/runs/iteration-1/webpage/screenshots/desktop.png +0 -0
- package/skills/ui-design/tests/e2e/runs/iteration-1/webpage/screenshots/mobile.png +0 -0
- package/skills/ui-design/tests/e2e/runs/nebula-console-iteration-1/checks/browser-check.json +64 -0
- package/skills/ui-design/tests/e2e/runs/nebula-console-iteration-1/checks/language-check.txt +7 -0
- package/skills/ui-design/tests/e2e/runs/nebula-console-iteration-1/checks/quick-validate.txt +1 -0
- package/skills/ui-design/tests/e2e/runs/nebula-console-iteration-1/checks/static-console.txt +2 -0
- package/skills/ui-design/tests/e2e/runs/nebula-console-iteration-1/checks/static-homepage.txt +2 -0
- package/skills/ui-design/tests/e2e/runs/nebula-console-iteration-1/outputs/console.html +600 -0
- package/skills/ui-design/tests/e2e/runs/nebula-console-iteration-1/outputs/homepage.html +556 -0
- package/skills/ui-design/tests/e2e/runs/nebula-console-iteration-1/prompt.md +29 -0
- package/skills/ui-design/tests/e2e/runs/nebula-console-iteration-1/review.md +57 -0
- package/skills/ui-design/tests/e2e/runs/nebula-console-iteration-1/screenshots/console-desktop.png +0 -0
- package/skills/ui-design/tests/e2e/runs/nebula-console-iteration-1/screenshots/console-mobile.png +0 -0
- package/skills/ui-design/tests/e2e/runs/nebula-console-iteration-1/screenshots/homepage-desktop.png +0 -0
- package/skills/ui-design/tests/e2e/runs/nebula-console-iteration-1/screenshots/homepage-mobile.png +0 -0
- package/skills/ui-design/tests/e2e/runs/obsidian-optics-iteration-1/checks/browser-check.json +33 -0
- package/skills/ui-design/tests/e2e/runs/obsidian-optics-iteration-1/checks/language-check.txt +6 -0
- package/skills/ui-design/tests/e2e/runs/obsidian-optics-iteration-1/checks/quick-validate.txt +1 -0
- package/skills/ui-design/tests/e2e/runs/obsidian-optics-iteration-1/checks/static-check.txt +2 -0
- package/skills/ui-design/tests/e2e/runs/obsidian-optics-iteration-1/outputs/index.html +682 -0
- package/skills/ui-design/tests/e2e/runs/obsidian-optics-iteration-1/prompt.md +13 -0
- package/skills/ui-design/tests/e2e/runs/obsidian-optics-iteration-1/review.md +59 -0
- package/skills/ui-design/tests/e2e/runs/obsidian-optics-iteration-1/screenshots/desktop.png +0 -0
- package/skills/ui-design/tests/e2e/runs/obsidian-optics-iteration-1/screenshots/mobile.png +0 -0
- package/skills/ui-design/tests/e2e/runs/obsidian-xui-screenshot-check-1/outputs/page-01.html +466 -0
- package/skills/ui-design/tests/e2e/runs/obsidian-xui-screenshot-check-1/outputs/page-02.html +433 -0
- package/skills/ui-design/tests/e2e/runs/obsidian-xui-screenshot-check-1/prompt.md +13 -0
- package/skills/ui-design/tests/e2e/runs/obsidian-xui-screenshot-check-1/screenshots/page-01/browser-check.json +49 -0
- package/skills/ui-design/tests/e2e/runs/obsidian-xui-screenshot-check-1/screenshots/page-01/desktop.png +0 -0
- package/skills/ui-design/tests/e2e/runs/obsidian-xui-screenshot-check-1/screenshots/page-01/mobile.png +0 -0
- package/skills/ui-design/tests/e2e/runs/obsidian-xui-screenshot-check-1/screenshots/page-02/browser-check.json +49 -0
- package/skills/ui-design/tests/e2e/runs/obsidian-xui-screenshot-check-1/screenshots/page-02/desktop.png +0 -0
- package/skills/ui-design/tests/e2e/runs/obsidian-xui-screenshot-check-1/screenshots/page-02/mobile.png +0 -0
- package/skills/ui-design/tests/e2e/runs/precision-horizon-iteration-1/checks/browser-check.json +49 -0
- package/skills/ui-design/tests/e2e/runs/precision-horizon-iteration-1/checks/language-check.txt +3 -0
- package/skills/ui-design/tests/e2e/runs/precision-horizon-iteration-1/checks/static-check.txt +2 -0
- package/skills/ui-design/tests/e2e/runs/precision-horizon-iteration-1/execution_notes.md +24 -0
- package/skills/ui-design/tests/e2e/runs/precision-horizon-iteration-1/outputs/index.html +723 -0
- package/skills/ui-design/tests/e2e/runs/precision-horizon-iteration-1/prompt.md +15 -0
- package/skills/ui-design/tests/e2e/runs/precision-horizon-iteration-1/review.md +26 -0
- package/skills/ui-design/tests/e2e/runs/precision-horizon-iteration-1/screenshots/desktop.png +0 -0
- package/skills/ui-design/tests/e2e/runs/precision-horizon-iteration-1/screenshots/mobile.png +0 -0
- package/skills/ui-design/tests/e2e/runs/precision-horizon-iteration-2/checks/browser-dark.json +49 -0
- package/skills/ui-design/tests/e2e/runs/precision-horizon-iteration-2/checks/browser-light.json +49 -0
- package/skills/ui-design/tests/e2e/runs/precision-horizon-iteration-2/checks/language-check.txt +11 -0
- package/skills/ui-design/tests/e2e/runs/precision-horizon-iteration-2/checks/static-dark.txt +2 -0
- package/skills/ui-design/tests/e2e/runs/precision-horizon-iteration-2/checks/static-light.txt +3 -0
- package/skills/ui-design/tests/e2e/runs/precision-horizon-iteration-2/execution_notes.md +23 -0
- package/skills/ui-design/tests/e2e/runs/precision-horizon-iteration-2/outputs/dark.html +392 -0
- package/skills/ui-design/tests/e2e/runs/precision-horizon-iteration-2/outputs/light.html +476 -0
- package/skills/ui-design/tests/e2e/runs/precision-horizon-iteration-2/prompt.md +23 -0
- package/skills/ui-design/tests/e2e/runs/precision-horizon-iteration-2/review.md +41 -0
- package/skills/ui-design/tests/e2e/runs/precision-horizon-iteration-2/screenshots/dark/desktop.png +0 -0
- package/skills/ui-design/tests/e2e/runs/precision-horizon-iteration-2/screenshots/dark/mobile.png +0 -0
- package/skills/ui-design/tests/e2e/runs/precision-horizon-iteration-2/screenshots/light/desktop.png +0 -0
- package/skills/ui-design/tests/e2e/runs/precision-horizon-iteration-2/screenshots/light/mobile.png +0 -0
- package/skills/ui-design/tests/e2e/runs/solar-relay-iteration-1/checks/browser-check.json +54 -0
- package/skills/ui-design/tests/e2e/runs/solar-relay-iteration-1/checks/language-check.txt +5 -0
- package/skills/ui-design/tests/e2e/runs/solar-relay-iteration-1/checks/quick-validate.txt +1 -0
- package/skills/ui-design/tests/e2e/runs/solar-relay-iteration-1/checks/static-check.txt +2 -0
- package/skills/ui-design/tests/e2e/runs/solar-relay-iteration-1/outputs/index.html +765 -0
- package/skills/ui-design/tests/e2e/runs/solar-relay-iteration-1/prompt.md +15 -0
- package/skills/ui-design/tests/e2e/runs/solar-relay-iteration-1/review.md +59 -0
- package/skills/ui-design/tests/e2e/runs/solar-relay-iteration-1/screenshots/desktop.png +0 -0
- package/skills/ui-design/tests/e2e/runs/solar-relay-iteration-1/screenshots/mobile.png +0 -0
- package/skills/ui-design/tests/e2e/runs/verdant-grid-preview-1/outputs/index.html +508 -0
- package/skills/ui-design/tests/e2e/runs/verdant-grid-preview-1/screenshots/browser-check.json +49 -0
- package/skills/ui-design/tests/e2e/runs/verdant-grid-preview-1/screenshots/desktop.png +0 -0
- package/skills/ui-design/tests/e2e/runs/verdant-grid-preview-1/screenshots/mobile.png +0 -0
- package/skills/ui-design/tests/e2e/runs/violet-meridian-iteration-1/checks/browser-check.json +54 -0
- package/skills/ui-design/tests/e2e/runs/violet-meridian-iteration-1/checks/language-check.txt +6 -0
- package/skills/ui-design/tests/e2e/runs/violet-meridian-iteration-1/checks/quick-validate.txt +1 -0
- package/skills/ui-design/tests/e2e/runs/violet-meridian-iteration-1/checks/static-check.txt +2 -0
- package/skills/ui-design/tests/e2e/runs/violet-meridian-iteration-1/outputs/index.html +788 -0
- package/skills/ui-design/tests/e2e/runs/violet-meridian-iteration-1/prompt.md +14 -0
- package/skills/ui-design/tests/e2e/runs/violet-meridian-iteration-1/review.md +60 -0
- package/skills/ui-design/tests/e2e/runs/violet-meridian-iteration-1/screenshots/desktop.png +0 -0
- package/skills/ui-design/tests/e2e/runs/violet-meridian-iteration-1/screenshots/mobile.png +0 -0
- package/skills/video-compose/SKILL.md +8 -1
- package/skills/web-crawler/SKILL.md +70 -0
- package/skills/web-crawler/scripts/crawl.mjs +538 -0
- package/skills/web-crawler/scripts/crawl.test.mjs +204 -0
- package/skills/xlsx/SKILL.md +12 -0
- package/skills/xlsx/scripts/opc_check.py +253 -0
- package/src/advisorState.js +22 -0
- package/src/askBridge.js +97 -3
- package/src/bootstrap/workingDir.js +12 -1
- package/src/cli/args.js +17 -1
- package/src/cli/configMenu.js +236 -0
- package/src/cli/configWizard.js +7 -5
- package/src/cli/print.js +37 -4
- package/src/cli/streamJson.js +77 -24
- package/src/cli/wizards/advisorWizard.js +147 -0
- package/src/cli/wizards/fieldForm.js +149 -0
- package/src/cli/wizards/imageWizard.js +60 -0
- package/src/cli/wizards/openRouterWizard.js +23 -0
- package/src/cli/wizards/providerPresets.js +95 -0
- package/src/cli/wizards/providerWizard.js +219 -0
- package/src/cli/wizards/searchWizard.js +23 -0
- package/src/cli/wizards/ttsWizard.js +34 -0
- package/src/config/configFile.js +441 -83
- package/src/config/configService.js +446 -0
- package/src/config.js +24 -64
- package/src/context/agentHome.js +9 -0
- package/src/context/archive.js +7 -2
- package/src/context/compact.js +8 -5
- package/src/context/contextLock.js +81 -0
- package/src/context/persistContext.js +30 -11
- package/src/context/reactiveCompact.js +4 -2
- package/src/context/recentDirs.js +21 -61
- package/src/context/sessionPath.js +97 -23
- package/src/context/sessionRegistry.js +303 -24
- package/src/context/tokenCounter.js +18 -0
- package/src/context/workspaceIndex.js +731 -0
- package/src/infra/verification.js +28 -15
- package/src/llm/client.js +394 -159
- package/src/llm/providers/anthropicFormat.js +241 -0
- package/src/llm/providers/openaiFormat.js +190 -0
- package/src/loop.js +219 -32
- package/src/main.js +61 -11
- package/src/messageQueue.js +97 -0
- package/src/multimodal.js +203 -0
- package/src/plugin-sdk.js +15 -0
- package/src/plugins/commandRouter.js +3 -0
- package/src/plugins/hookEngine.js +5 -1
- package/src/plugins/pluginLifecycle.js +28 -0
- package/src/plugins/pluginLoader.js +2 -1
- package/src/plugins/pluginRunner.js +49 -21
- package/src/plugins/transcript.js +4 -3
- package/src/prompts/pluginList.js +5 -5
- package/src/prompts/projectInstructions.js +3 -3
- package/src/prompts/promptAssembly.js +133 -144
- package/src/prompts/skillList.js +12 -22
- package/src/prompts/system.js +0 -1
- package/src/session/runAgentTurn.js +70 -0
- package/src/session/runTurn.js +41 -6
- package/src/toolGate.js +17 -0
- package/src/tools/advisor/advisor.js +379 -0
- package/src/tools/agent/agent.js +555 -0
- package/src/tools/agent/agentTypes.js +59 -0
- package/src/tools/agent/coordinator.js +93 -0
- package/src/tools/agent/worktree.js +270 -0
- package/src/tools/ask/ask.js +7 -2
- package/src/tools/bash/bash.js +112 -18
- package/src/tools/download/download.js +144 -0
- package/src/tools/edit/edit.js +1 -0
- package/src/tools/edit/multi-edit.js +1 -0
- package/src/tools/genimage/genimage.js +242 -0
- package/src/tools/genspeech/genspeech.js +67 -0
- package/src/tools/glob/glob.js +1 -0
- package/src/tools/grep/grep.js +3 -0
- package/src/tools/grep/rgPath.js +2 -0
- package/src/tools/index.js +25 -2
- package/src/tools/read/read.js +1 -0
- package/src/tools/shared/killTree.js +52 -0
- package/src/tools/toolProgressBridge.js +48 -0
- package/src/tools/webbrowser/agentBrowserPath.js +258 -0
- package/src/tools/webbrowser/browser.js +59 -42
- package/src/tools/webbrowser/browserControl.js +118 -0
- package/src/tools/webbrowser/browserDaemon.js +97 -0
- package/src/tools/webbrowser/browserService.js +27 -0
- package/src/tools/webbrowser/browserStream.js +119 -0
- package/src/tools/webbrowser/webbrowser.js +699 -130
- package/src/tools/webfetch/webfetch.js +1 -0
- package/src/tools/websearch/websearch.js +134 -51
- package/src/tools/write/write.js +1 -0
- package/src/ui/App.js +249 -22
- package/src/ui/AskQuestion.js +29 -10
- package/src/ui/InputBox.js +104 -12
- package/src/ui/LiveArea.js +112 -19
- package/src/ui/MessageList.js +100 -14
- package/src/ui/ModelPicker.js +56 -0
- package/src/ui/QueuedMessagesBanner.js +14 -0
- package/src/ui/Root.js +18 -10
- package/src/ui/SessionPicker.js +102 -0
- package/src/ui/StatusLine.js +13 -4
- package/src/ui/WorkspacePicker.js +55 -0
- package/src/ui/figures.js +44 -0
- package/src/ui/hooks/askSlot.js +82 -0
- package/src/ui/hooks/useChat.js +358 -64
- package/src/ui/hooks/usePasteHandler.js +11 -1
- package/src/ui/hooks/useTextBuffer.js +1 -3
- package/src/ui/liveViewport.js +5 -1
- package/src/ui/markdown.js +206 -0
- package/src/ui/textBuffer.js +0 -7
- package/src/ui/theme.js +32 -0
- package/src/utils/debugLog.js +0 -4
- package/src/utils/resourcePaths.js +2 -2
- package/src/utils/stripThink.js +50 -0
- package/src/web/browserBridge.js +447 -0
- package/src/web/protocol.js +19 -0
- package/workflows/adaptive-research.yaml +13 -5
- package/workflows/book-review-short.yaml +36 -10
- package/workflows/e2e-write-greet.yaml +6 -2
- package/workflows/illustrate.yaml +227 -0
- package/workflows/plan.yaml +460 -179
- package/workflows/ppt.yaml +1659 -0
- package/workflows/ralph-loop.yaml +199 -0
- package/workflows/schema.json +81 -23
- package/workflows/webppt.yaml +496 -0
- package/workflows/word.yaml +710 -0
- package/workflows/youtube-shorts.yaml +46 -15
- package/MINIMAL-TRACE.md +0 -77
- package/plugins/HOW-TO-WRITE-A-PLUGIN.md +0 -186
- package/plugins/ralph-wiggum/.claude-plugin/plugin.json +0 -9
- package/plugins/ralph-wiggum/README.md +0 -197
- package/plugins/ralph-wiggum/commands/cancel-ralph.md +0 -18
- package/plugins/ralph-wiggum/commands/help.md +0 -137
- package/plugins/ralph-wiggum/commands/ralph-loop.md +0 -85
- package/plugins/ralph-wiggum/hooks/hooks.json +0 -15
- package/plugins/ralph-wiggum/hooks/stop-hook.sh +0 -191
- package/plugins/ralph-wiggum/plugin.js +0 -280
- package/plugins/ralph-wiggum/src/goalState.js +0 -258
- package/plugins/ralph-wiggum/src/sentinels.js +0 -76
- package/plugins/ralph-wiggum/src/stopHookRunner.js +0 -104
- package/plugins/ralph-wiggum/src/verificationGate.js +0 -202
- package/plugins/workflow-runner/src/miniReAct.js +0 -223
- package/plugins/workflow-runner/src/voteHelpers.js +0 -110
- package/skills/config/SKILL.md +0 -123
- package/skills/frontend-design/LICENSE.txt +0 -177
- package/skills/frontend-design/SKILL.md +0 -42
- package/src/ui/ProgressPanel.js +0 -54
- package/src/ui/StreamingBlock.js +0 -11
- package/src/ui/ToolStatus.js +0 -11
package/skills/pptx/SKILL.md
CHANGED
|
@@ -1,18 +1,60 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: pptx
|
|
3
|
-
description: "Use this skill any time a .pptx file is involved in any way — as input, output, or both. This includes: creating slide decks, pitch decks, or presentations; reading, parsing, or extracting text from any .pptx file (even if the extracted content will be used elsewhere, like in an email or summary); editing, modifying, or updating existing presentations; combining or splitting slide files; working with templates, layouts, speaker notes, or comments. Trigger whenever the user mentions \"deck,\" \"slides,\" \"presentation,\" or references a .pptx filename, regardless of what they plan to do with the content afterward. If a .pptx file needs to be opened, created, or touched, use this skill."
|
|
3
|
+
description: "Use this skill any time a .pptx file is involved in any way — as input, output, or both. This includes: creating slide decks, pitch decks, or presentations; reading, parsing, or extracting text from any .pptx file (even if the extracted content will be used elsewhere, like in an email or summary); editing, modifying, or updating existing presentations; combining or splitting slide files; working with templates, layouts, speaker notes, or comments. Trigger whenever the user mentions \"deck,\" \"slides,\" \"presentation,\" or references a .pptx filename, regardless of what they plan to do with the content afterward. If a .pptx file needs to be opened, created, or touched, use this skill. This skill is a four-stage navigator (design → graphics → file ops → QA): it establishes a design system by bridging the ui-design skill, draws editable graphics (native vector shapes for diagrams, embedded SVG with PNG fallback for art that ungroups in PowerPoint), and enforces OPC compliance — not just a PptxGenJS/OPC file-operation manual."
|
|
4
4
|
license: Proprietary. LICENSE.txt has complete terms
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
# PPTX Skill
|
|
8
8
|
|
|
9
|
-
##
|
|
9
|
+
## 这是什么 skill
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
11
|
+
做 PPT 的本质是「前端/平面设计 + 内容 + 文件操作」三件事,不是把 API 堆出来。本 skill 是一个**向导**:
|
|
12
|
+
按「设计 → 图形 → 落盘 → QA」四阶段牵着走 —— 既会用 PptxGenJS/OPC 操作文件,也会按设计系统排版、用矢量做可编辑配图。
|
|
13
|
+
|
|
14
|
+
> 📍 **寻址说明**:本 skill 内的 `[x](x)` / `scripts/x` 链接相对**本技能目录**(即系统提示「可用技能」列表里本卡片给出的 `技能目录:` 绝对路径),**不是相对当前工作目录(cwd)**——用该绝对目录拼成绝对路径再 Read/执行。引用同仓的 `ui-design` 技能时同理:用列表里 **ui-design 自己卡片**的绝对目录,别用 `../ui-design/`(详见 [design.md](design.md) 顶部)。
|
|
15
|
+
|
|
16
|
+
## 四阶段向导(按序走)
|
|
17
|
+
|
|
18
|
+
**阶段 0 · 路由** —— 先判断要干嘛:
|
|
19
|
+
- 读内容 / 抽文本 → `python -m markitdown x.pptx`(到此为止,不进后续阶段)。
|
|
20
|
+
- 拿已有 pptx 当模板改 → 读 [editing.md](editing.md)(unpack→改→pack);设计判断仍走阶段 1。
|
|
21
|
+
- 从零创建 → 往下走阶段 1–4。
|
|
22
|
+
|
|
23
|
+
**阶段 1 · 设计**(除非用户明确只要纯文本草稿/不要排版,否则**必做**)—— 先立设计系统,别直接画:
|
|
24
|
+
> ⛔ **最高优先级·强制**:**一切样式与设计**——配色 / VI / 字体配对 / 字阶 / 版式 / 视觉节奏 / 避免 AI 味——**必须借同仓 `ui-design` skill 来定**,不要自己拍脑袋,也不要靠本文里现成的零碎素材(已删,原因见「样式与设计」节)。页面好不好看由这一步决定。
|
|
25
|
+
|
|
26
|
+
读 [design.md](design.md):它会带你用 ui-design 卡片的**绝对目录**读 `ui-design/SKILL.md` 立设计系统,并把 web 设计翻译到 PPT 的英寸/pt 画布。PPT 落地的尺寸/间距/避坑等 **PPT 特有硬约束**也在 design.md(ui-design 是 web 语境给不了)。
|
|
27
|
+
|
|
28
|
+
**阶段 2 · 图形** —— 按下面「图形决策规则」选路线:结构图用 [pptxgenjs.md](pptxgenjs.md) + `scripts/deck_helpers.mjs`;美术配图用 SVG,读 [svg.md](svg.md)。
|
|
29
|
+
|
|
30
|
+
**阶段 3 · 落盘** —— PptxGenJS 生成(**Node 跑,不要 Bun**,见 pptxgenjs.md 文首铁律)。
|
|
31
|
+
**用了 SVG 就必跑** `node scripts/svg_fallback.mjs deck.pptx`(补真 PNG 兜底 + OPC 合规重打包)。
|
|
32
|
+
|
|
33
|
+
**阶段 4 · QA** —— `python scripts/opc_check.py deck.pptx`(硬门槛)→ markitdown 内容核对 → 视觉 QA(见下)。
|
|
34
|
+
|
|
35
|
+
### 图形决策规则(阶段 2 的核心)
|
|
36
|
+
|
|
37
|
+
| 内容 | 用什么 | 备注 |
|
|
38
|
+
|------|--------|------|
|
|
39
|
+
| 标题 / 正文 / 项目符号 / 表格 —— **任何文字** | 原生 `addText` | 可编辑可重排;**绝不**烤进图片 |
|
|
40
|
+
| 框图 / 流程图 / 时序 / 色块布局 | 原生 `addShape` | 原生对象,点选即改;复用 `scripts/deck_helpers.mjs`。**拿不准时的默认** |
|
|
41
|
+
| 背景 / 渐变 / 插画 / 图标 / 曲线 / Logo | **SVG** + `svg_fallback.mjs` | 矢量丰富,PowerPoint 365 可「转换为形状」编辑;见 [svg.md](svg.md) |
|
|
42
|
+
| 真实照片 / 已有位图 | `addImage(png/jpg)` | 封面/封底装饰 ≤2 张为宜 |
|
|
43
|
+
|
|
44
|
+
一句话:**文字 addText,结构 addShape,美术 SVG,照片 addImage。**
|
|
45
|
+
|
|
46
|
+
### 能力地图(要细节读哪份)
|
|
47
|
+
|
|
48
|
+
| 你要做 | 读这份 |
|
|
49
|
+
|--------|--------|
|
|
50
|
+
| 立设计系统(配色/VI/字阶/版式) | [design.md](design.md)(桥接 `ui-design`) |
|
|
51
|
+
| SVG 可编辑配图 + 兜底管线 | [svg.md](svg.md) |
|
|
52
|
+
| 复用矢量原语(卡片/节点/箭头/标题/页脚) | `scripts/deck_helpers.mjs` |
|
|
53
|
+
| PptxGenJS API(文字/形状/图表/表格) | [pptxgenjs.md](pptxgenjs.md) |
|
|
54
|
+
| 改模板(unpack/pack) | [editing.md](editing.md) |
|
|
55
|
+
| OPC 合规校验/重打包(硬门槛) | `scripts/opc_check.py` |
|
|
56
|
+
| SVG 兜底修复 + 合规重打包 | `scripts/svg_fallback.mjs` |
|
|
57
|
+
| 端到端范例(3 页混合) | `examples/hybrid_example.mjs` + `examples/README.md` |
|
|
16
58
|
|
|
17
59
|
---
|
|
18
60
|
|
|
@@ -46,95 +88,19 @@ python scripts/office/unpack.py presentation.pptx unpacked/
|
|
|
46
88
|
|
|
47
89
|
Use when no template or reference presentation is available.
|
|
48
90
|
|
|
91
|
+
先按「图形决策规则」分路:**结构图用原生 `addShape`**(复用 `scripts/deck_helpers.mjs` 的卡片/节点/箭头/标题/页脚,省得重踩 PptxGenJS 坑),**美术配图用 SVG**(读 [svg.md](svg.md),生成后必跑 `scripts/svg_fallback.mjs`),文字一律原生 `addText`。`examples/hybrid_example.mjs` 是 3 页混合的可临摹范例。
|
|
92
|
+
|
|
49
93
|
---
|
|
50
94
|
|
|
51
|
-
##
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
- **Commit to a visual motif**: Pick ONE distinctive element and repeat it — rounded image frames, icons in colored circles, thick single-side borders. Carry it across every slide.
|
|
61
|
-
|
|
62
|
-
### Color Palettes
|
|
63
|
-
|
|
64
|
-
Choose colors that match your topic — don't default to generic blue. Use these palettes as inspiration:
|
|
65
|
-
|
|
66
|
-
| Theme | Primary | Secondary | Accent |
|
|
67
|
-
|-------|---------|-----------|--------|
|
|
68
|
-
| **Midnight Executive** | `1E2761` (navy) | `CADCFC` (ice blue) | `FFFFFF` (white) |
|
|
69
|
-
| **Forest & Moss** | `2C5F2D` (forest) | `97BC62` (moss) | `F5F5F5` (cream) |
|
|
70
|
-
| **Coral Energy** | `F96167` (coral) | `F9E795` (gold) | `2F3C7E` (navy) |
|
|
71
|
-
| **Warm Terracotta** | `B85042` (terracotta) | `E7E8D1` (sand) | `A7BEAE` (sage) |
|
|
72
|
-
| **Ocean Gradient** | `065A82` (deep blue) | `1C7293` (teal) | `21295C` (midnight) |
|
|
73
|
-
| **Charcoal Minimal** | `36454F` (charcoal) | `F2F2F2` (off-white) | `212121` (black) |
|
|
74
|
-
| **Teal Trust** | `028090` (teal) | `00A896` (seafoam) | `02C39A` (mint) |
|
|
75
|
-
| **Berry & Cream** | `6D2E46` (berry) | `A26769` (dusty rose) | `ECE2D0` (cream) |
|
|
76
|
-
| **Sage Calm** | `84B59F` (sage) | `69A297` (eucalyptus) | `50808E` (slate) |
|
|
77
|
-
| **Cherry Bold** | `990011` (cherry) | `FCF6F5` (off-white) | `2F3C7E` (navy) |
|
|
78
|
-
|
|
79
|
-
### For Each Slide
|
|
80
|
-
|
|
81
|
-
**Every slide needs a visual element** — image, chart, icon, or shape. Text-only slides are forgettable.
|
|
82
|
-
|
|
83
|
-
**Layout options:**
|
|
84
|
-
- Two-column (text left, illustration on right)
|
|
85
|
-
- Icon + text rows (icon in colored circle, bold header, description below)
|
|
86
|
-
- 2x2 or 2x3 grid (image on one side, grid of content blocks on other)
|
|
87
|
-
- Half-bleed image (full left or right side) with content overlay
|
|
88
|
-
|
|
89
|
-
**Data display:**
|
|
90
|
-
- Large stat callouts (big numbers 60-72pt with small labels below)
|
|
91
|
-
- Comparison columns (before/after, pros/cons, side-by-side options)
|
|
92
|
-
- Timeline or process flow (numbered steps, arrows)
|
|
93
|
-
|
|
94
|
-
**Visual polish:**
|
|
95
|
-
- Icons in small colored circles next to section headers
|
|
96
|
-
- Italic accent text for key stats or taglines
|
|
97
|
-
|
|
98
|
-
### Typography
|
|
99
|
-
|
|
100
|
-
**Choose an interesting font pairing** — don't default to Arial. Pick a header font with personality and pair it with a clean body font.
|
|
101
|
-
|
|
102
|
-
| Header Font | Body Font |
|
|
103
|
-
|-------------|-----------|
|
|
104
|
-
| Georgia | Calibri |
|
|
105
|
-
| Arial Black | Arial |
|
|
106
|
-
| Calibri | Calibri Light |
|
|
107
|
-
| Cambria | Calibri |
|
|
108
|
-
| Trebuchet MS | Calibri |
|
|
109
|
-
| Impact | Arial |
|
|
110
|
-
| Palatino | Garamond |
|
|
111
|
-
| Consolas | Calibri |
|
|
112
|
-
|
|
113
|
-
| Element | Size |
|
|
114
|
-
|---------|------|
|
|
115
|
-
| Slide title | 36-44pt bold |
|
|
116
|
-
| Section header | 20-24pt bold |
|
|
117
|
-
| Body text | 14-16pt |
|
|
118
|
-
| Captions | 10-12pt muted |
|
|
119
|
-
|
|
120
|
-
### Spacing
|
|
121
|
-
|
|
122
|
-
- 0.5" minimum margins
|
|
123
|
-
- 0.3-0.5" between content blocks
|
|
124
|
-
- Leave breathing room—don't fill every inch
|
|
125
|
-
|
|
126
|
-
### Avoid (Common Mistakes)
|
|
127
|
-
|
|
128
|
-
- **Don't repeat the same layout** — vary columns, cards, and callouts across slides
|
|
129
|
-
- **Don't center body text** — left-align paragraphs and lists; center only titles
|
|
130
|
-
- **Don't skimp on size contrast** — titles need 36pt+ to stand out from 14-16pt body
|
|
131
|
-
- **Don't default to blue** — pick colors that reflect the specific topic
|
|
132
|
-
- **Don't mix spacing randomly** — choose 0.3" or 0.5" gaps and use consistently
|
|
133
|
-
- **Don't style one slide and leave the rest plain** — commit fully or keep it simple throughout
|
|
134
|
-
- **Don't create text-only slides** — add images, icons, charts, or visual elements; avoid plain title + bullets
|
|
135
|
-
- **Don't forget text box padding** — when aligning lines or shapes with text edges, set `margin: 0` on the text box or offset the shape to account for padding
|
|
136
|
-
- **Don't use low-contrast elements** — icons AND text need strong contrast against the background; avoid light text on light backgrounds or dark text on dark backgrounds
|
|
137
|
-
- **NEVER use accent lines under titles** — these are a hallmark of AI-generated slides; use whitespace or background color instead
|
|
95
|
+
## 样式与设计 = 一律走 ui-design(本节已删除内嵌设计素材)
|
|
96
|
+
|
|
97
|
+
> ⛔ **最高优先级·强制**:配色 / VI / 字体配对 / 字阶 / 版式 / 视觉节奏 / 避免 AI 味——这些**「样式与设计」决策一律去 `ui-design` skill 立**(见 [design.md](design.md) 第一步,用系统提示「可用技能」列表里 **ui-design 卡片给的绝对目录** 读它,**别用相对 `../ui-design/`**——Read 锚 cwd 会解析错)。
|
|
98
|
+
>
|
|
99
|
+
> 这里**曾内嵌过配色表 / 字体配对表 / 版式清单,现已全部删除**。删除原因:内嵌一份"看着够用"的设计素材,会诱导你**就地取材、自满、跳过 ui-design**,做出千篇一律的 AI 味页面。设计智能只有**一个真相源**(ui-design),pptx 只负责"引用它 + 把 web 设计翻译到 PPT 画布",不复制、不另存一份会漂移的副本。
|
|
100
|
+
>
|
|
101
|
+
> 兜底:万一在系统提示和 `Glob('**/ui-design/SKILL.md')` 里都定位不到 ui-design,**才**回退到通用设计常识自行决定(仅此一种例外)。
|
|
102
|
+
|
|
103
|
+
**PPT 特有的硬约束**——尺寸(pt)/ 间距(英寸)/ PptxGenJS 避坑(ui-design 是 web 1920×1080 px 语境,给不了英寸+pt 这套)——见 **[design.md](design.md) 第三步及其后的「PPT 落地硬约束 / 避坑」**。那是 pptx 不可替代的增量,照它执行。
|
|
138
104
|
|
|
139
105
|
---
|
|
140
106
|
|
|
@@ -144,6 +110,63 @@ Choose colors that match your topic — don't default to generic blue. Use these
|
|
|
144
110
|
|
|
145
111
|
Your first render is almost never correct. Approach QA as a bug hunt, not a confirmation step. If you found zero issues on first inspection, you weren't looking hard enough.
|
|
146
112
|
|
|
113
|
+
### Compliance QA (硬门槛,先做)
|
|
114
|
+
|
|
115
|
+
pptx 本质是 OPC zip 包。PowerPoint 打开时做**严格 OPC 校验**,包不合规会判「需要修复」、
|
|
116
|
+
修复后内容丢失。**「某个库能 load/import ≠ PowerPoint 能干净打开」**——python-pptx 很宽容,
|
|
117
|
+
会忽略目录条目等问题照样加载成功,**绝不要**拿「python-pptx 能否重新打开」当验证通过的判据
|
|
118
|
+
(这正是损坏包溜过验收闸门的根因)。忠实校验用:
|
|
119
|
+
|
|
120
|
+
```bash
|
|
121
|
+
python scripts/opc_check.py output.pptx
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
退出码非 0 即不合规,按提示一步修回:`python scripts/opc_check.py output.pptx --repack output.fixed.pptx`。
|
|
125
|
+
|
|
126
|
+
> 用 PptxGenJS「从零创建」时,**生成脚本必须用 Node 跑(`node x.mjs`),不要 `bun run`**——
|
|
127
|
+
> Bun 下 JSZip 会产出非合规包(详见 [pptxgenjs.md](pptxgenjs.md) 文首铁律)。
|
|
128
|
+
>
|
|
129
|
+
> **用了 SVG 配图的,合规校验前先跑 `node scripts/svg_fallback.mjs deck.pptx`**:PptxGenJS 在 Node 下
|
|
130
|
+
> 不栅格化 SVG 的 PNG 兜底(issue #401),不补的话下文 soffice 视觉 QA、旧版 PowerPoint、缩略图全破图。
|
|
131
|
+
> 该脚本顺带做合规重打包(等价 `--repack`)。详见 [svg.md](svg.md)。
|
|
132
|
+
>
|
|
133
|
+
> 内容/视觉 QA(下文)是合规之后的补充,不能替代合规校验。
|
|
134
|
+
|
|
135
|
+
### 第 6 项校验:Content_Types 孤儿 Override
|
|
136
|
+
|
|
137
|
+
`opc_check.py` 现包含 6 项校验。第 6 项专门捕获「`[Content_Types].xml` 声明了
|
|
138
|
+
zip 里不存在的 part」——OPC 规范允许这种「孤儿 Override」,python-pptx 也照常加载,
|
|
139
|
+
但 PowerPoint 严格对账「声明 vs 实物」时会把数量严重不符的包判损坏。
|
|
140
|
+
|
|
141
|
+
**典型症状**:PowerPoint 弹「找到无法读取的内容,是否要修复?」,
|
|
142
|
+
但 `python scripts/opc_check.py xxx.pptx` 报 PASSED(旧版 5 项会误判通过)。
|
|
143
|
+
|
|
144
|
+
**典型成因**:生成端把另一种 part 的数量当成这种 part 的数量,
|
|
145
|
+
例如 18 张 slide 却声明了 18 个 `slideMaster{n}.xml`,实际只有 1 个母版。
|
|
146
|
+
也见于「按模板复制后忘了同步删 Content_Types 行」。
|
|
147
|
+
|
|
148
|
+
**触发后修复**:直接运行 `python scripts/opc_check.py bad.pptx --repack fixed.pptx`。
|
|
149
|
+
`--repack` 会自动删除这些孤儿 `<Override>`,同时保留有效 Override、删除目录条目、
|
|
150
|
+
强制 DEFLATE 并把 `[Content_Types].xml` 放回 zip 首位。
|
|
151
|
+
|
|
152
|
+
### 布局/对比 确定性闸门(opc 之后、视觉 QA 之前)
|
|
153
|
+
|
|
154
|
+
```bash
|
|
155
|
+
python scripts/layout_lint.py deck.pptx
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
不依赖 soffice/截图,纯解析 slide XML,自动抓三类**可计算**的缺陷:
|
|
159
|
+
|
|
160
|
+
- **残桩/过短连线**(< 0.2")——无连接的短箭头是 AI 生成 PPT 的典型痕迹。
|
|
161
|
+
- **形状叠加**——非背景、非包含的形状包围盒显著相交(内容互相压住)。
|
|
162
|
+
- **低对比文字**——形状显式填充色 vs 其文字显式色,大字 < 3:1 / 正文 < 4.5:1(看不清)。
|
|
163
|
+
|
|
164
|
+
退出码非 0 即有缺陷,按提示修。这是给**其他 agent / 弱模型**的防呆硬门槛——**不读文档也会被它拦下**。
|
|
165
|
+
它**不替代**下面的视觉 QA(主题色继承、跨形状 z-order 层叠、文字截断等仍需眼睛),但先把可计算的挡掉。
|
|
166
|
+
|
|
167
|
+
> 双保险:用 `scripts/deck_helpers.mjs` 的 `inkFor(bg)` / `assertReadable` / `connect(from,to)` 在
|
|
168
|
+
> **生成期**就避开这三类缺陷(源头预防),本闸门在产物上兜底(模型无关、绕不过)。
|
|
169
|
+
|
|
147
170
|
### Content QA
|
|
148
171
|
|
|
149
172
|
```bash
|
|
@@ -227,6 +250,11 @@ pdftoppm -jpeg -r 150 -f N -l N output.pdf slide-fixed
|
|
|
227
250
|
|
|
228
251
|
- `pip install "markitdown[pptx]"` - text extraction
|
|
229
252
|
- `pip install Pillow` - thumbnail grids
|
|
230
|
-
- `npm install -g pptxgenjs` - creating from scratch
|
|
253
|
+
- `npm install -g pptxgenjs` - creating from scratch(**用 Node 运行,不要 `bun run`**)
|
|
254
|
+
- `npm install sharp` - SVG → PNG 兜底栅格化(`scripts/svg_fallback.mjs` 用;本仓库已装)
|
|
255
|
+
- `scripts/opc_check.py` - OPC 合规校验/重打包(仅依赖 Python 标准库,无需额外安装)
|
|
256
|
+
- `scripts/layout_lint.py` - 布局/对比 确定性闸门:残桩连线 / 形状叠加 / 低对比文字(仅依赖 Python 标准库)
|
|
257
|
+
- `scripts/svg_fallback.mjs` - SVG 配图兜底修复 + 合规重打包(Node + sharp + 调 opc_check.py)
|
|
258
|
+
- `scripts/deck_helpers.mjs` - 可复用原生 addShape 矢量原语(结构图路线)
|
|
231
259
|
- LibreOffice (`soffice`) - PDF conversion (auto-configured for sandboxed environments via `scripts/office/soffice.py`)
|
|
232
260
|
- Poppler (`pdftoppm`) - PDF to images
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
# 设计先行:借 ui-design 的设计智能(阶段 1)
|
|
2
|
+
|
|
3
|
+
做 PPT 的本质是**前端/平面设计 + 内容**,不是堆文字。动手画第一页之前,先立一套**设计系统**
|
|
4
|
+
(配色 / VI / 字阶 / 版式 / 节奏),后面所有页照着落。这套设计智能不自己凭空想,**借同仓的
|
|
5
|
+
`ui-design` skill**——它专门干「高质量视觉设计」。本文是「读它什么、提取什么、怎么翻译到 PPT、丢弃什么」的桥。
|
|
6
|
+
|
|
7
|
+
> ⛔ **最高优先级·强制**:PPT 的一切**样式与设计**(配色/VI/字体/字阶/版式/节奏/避免 AI 味)**必须**借 ui-design 来定——这是不可跳过的第一步,别自己拍脑袋。pptx 自身已删除全部内嵌设计素材,**设计智能只有 ui-design 这一个真相源**。
|
|
8
|
+
>
|
|
9
|
+
> 何时跳过:仅当用户明确只要「快速草稿/纯文本大纲、不要排版」时可略过本阶段;正式 deck 一律必做。
|
|
10
|
+
|
|
11
|
+
## 第一步:读 ui-design(只读,按需)
|
|
12
|
+
|
|
13
|
+
> 🧭 **怎么定位 ui-design(重要,别用相对路径)**:`ui-design` 是**独立的同级技能**,它的**绝对目录已经在系统提示的「可用技能」列表里**(每张技能卡片都带 `技能目录:` 绝对路径)。读它时**用列表里 ui-design 卡片给的那个绝对目录**拼出绝对路径再 Read,例如 `<ui-design绝对目录>/SKILL.md`、`<ui-design绝对目录>/references/vi-aqua-glass.md`。**不要写相对的 `../ui-design/...`**——Read 工具把相对路径锚到当前工作目录(cwd),cwd 通常不是 skills 的父目录,`../` 会解析到错误位置读不到。万一系统提示里拿不到该绝对目录,就用 `Glob('**/ui-design/SKILL.md')` 定位后再读。
|
|
14
|
+
|
|
15
|
+
在 ui-design 目录下按需读这些(路径 = `<ui-design绝对目录>/` + 下面的相对名):
|
|
16
|
+
|
|
17
|
+
- `SKILL.md` —— 任务分流、关键约束、避免 AI 味清单。**必读**(它顶部还会指你按需读下列各 reference)。
|
|
18
|
+
- `claude_design.md` —— 完整设计协议;看其中 **deck / 固定画布 / 字号尺度** 段落。
|
|
19
|
+
- `references/vi-*.md` —— **VI 模板,按主题选一个读**(不要全读):
|
|
20
|
+
- `references/vi-aqua-glass.md` —— 浅蓝白玻璃通透,**适合 AI 产品 / SaaS / 知识库 / PPT deck**(多数科技 deck 默认首选)。
|
|
21
|
+
- `references/vi-harbor-ledger.md` —— 克制运营型 VI,适合 B2B dashboard / 金融 / 物流 / 经营驾驶舱。
|
|
22
|
+
- `references/vi-obsidian-optics.md` —— 黑曜影像 VI,适合摄影器材 / 影像 / 创作者硬件。
|
|
23
|
+
- `references/vi-nebula-console.md` —— 深色科技半透明,适合科幻 UI / 云服务 / 开发者工具 / 安全。
|
|
24
|
+
- `references/vi-violet-meridian.md` —— 紫曜经线 VI,适合紫/蓝紫、AI 智能工作台 / 开发者工具的清爽方向。
|
|
25
|
+
- `references/vi-solar-relay.md` —— 日冕中继 VI,适合红橙多彩、网络加速 / 连接 / 移动端的活力科技方向。
|
|
26
|
+
- **缺品牌、需求空、或没把握时**:读 `references/design-execution-playbook.md`(按它写一份「设计执行声明」再动手)+ `references/aesthetic-direction.md`(从零定审美方向)。这正是"脑袋空空"时的兜底。
|
|
27
|
+
|
|
28
|
+
缺品牌上下文时,选一个匹配主题的 VI 取其「视觉 DNA」(不要照抄它的品牌名/示例内容)。
|
|
29
|
+
|
|
30
|
+
## 第二步:提取这些「可迁移的设计智能」
|
|
31
|
+
|
|
32
|
+
从 ui-design 提炼,落成本次 deck 的设计系统:
|
|
33
|
+
|
|
34
|
+
- **配色系统**:内容相关、有主张的调色板(别默认蓝);**主导 60–70% + 1–2 辅助 + 1 强调**,绝不等权。
|
|
35
|
+
深色用于封面/结论页、浅色用于内容页(三明治结构),或全程深色走高级感。
|
|
36
|
+
- **VI 视觉 DNA**:选定模板的气质(玻璃通透 / 运营克制 / 影像冷光 / 深色科技),贯穿每页一个重复母题。
|
|
37
|
+
- **字体配对 + 字阶**:标题字有个性、正文字干净;建立清晰的大小层级(见下「翻译」表)。
|
|
38
|
+
- **版式网格**:统一边距、栅格、对齐;卡片/列保持一致。
|
|
39
|
+
- **视觉节奏**:每页一个视觉主角,留白克制;变换版式(两栏 / 图标行 / 2×2 / 半幅图),别每页同一套。
|
|
40
|
+
- **避免 AI 味清单**:紫色渐变、重复圆角卡堆叠、无意义假数据、占位假文、**标题下双下划线**、过度表情符号、装饰性堆砌——全避开。
|
|
41
|
+
- ⚠️ ui-design 清单里的「纯 SVG 假图」是 **web 语境**(别拿装饰 SVG 冒充真实产品页),与本 skill 用 SVG 做**真实可编辑美术配图**不冲突——见 [svg.md](svg.md) 的图形决策规则。
|
|
42
|
+
|
|
43
|
+
## 第三步:翻译到 PPT 的固定画布(关键)
|
|
44
|
+
|
|
45
|
+
ui-design 的载体是 **HTML(1920×1080 px / rem)**;PPT 是**固定英寸画布 + EMU**。把设计**翻译**过来,别照搬 web 机制:
|
|
46
|
+
|
|
47
|
+
| ui-design(web) | PPT 落地 |
|
|
48
|
+
|---|---|
|
|
49
|
+
| 1920×1080 px 画布 | `LAYOUT_WIDE` 13.3"×7.5"(图多用它)或默认 10"×5.625" |
|
|
50
|
+
| px / rem | **英寸**(PptxGenJS 坐标);颜色 6 位 hex 不带 `#` |
|
|
51
|
+
| 正文 ≥24px@1080 | PPT 正文 **14–16pt**、章节头 20–24pt、标题 **28–44pt**、注脚 10–12pt |
|
|
52
|
+
| CSS 渐变 | SVG 配图承载(`addShape` 不支持渐变填充)——见 `svg.md` |
|
|
53
|
+
| flex/grid 布局 | 手算坐标摆 `addShape`/`addText`;用统一边距(≥0.5")与间距(0.3–0.5") |
|
|
54
|
+
|
|
55
|
+
**直接丢弃**(PPT 用不上、别引入):Tweaks / React+Babel / `deck_stage.js` / `scrollIntoView` 禁令 /
|
|
56
|
+
localStorage 持久化 / `check_ui_artifact.py` / 视口缩放 JS。这些是 HTML deck 的机制,PPT 由 PowerPoint 自己负责。
|
|
57
|
+
|
|
58
|
+
## PPT 落地硬约束 / 避坑(ui-design 给不了的 PPT 特有部分)
|
|
59
|
+
|
|
60
|
+
调色板 / VI / 字体**配对**的设计智能去 ui-design 取(上面第一步已说);**落到 PPT** 的字号/字阶按上表。
|
|
61
|
+
以下是 ui-design 顾不到的 PPT(英寸 + pt + PptxGenJS)机制硬约束,照此执行:
|
|
62
|
+
|
|
63
|
+
- 正文**左对齐**,只有标题可居中;正文别居中。
|
|
64
|
+
- 标题 36–44pt 与正文 14–16pt **拉开字号对比**,层级才立得住。
|
|
65
|
+
- 文本框与形状对齐时给文本框设 `margin: 0`(否则默认内边距让对齐错位)。
|
|
66
|
+
- **绝不在标题下加装饰下划线/强调线**——AI 生成 PPT 的典型标志,用留白或背景色区隔。
|
|
67
|
+
- **文字对比 ≥ 4.5:1(大字/标题 ≥ 3:1)**,杜绝「浅底浅字 / 深底深字」(最常见的看不清根因)。
|
|
68
|
+
深色页的标题别用近黑默认色:给 `deck_helpers` 的 `drawTitle(s, …, { bg })` 传背景色,标题色会**按背景自动取可读色**(`inkFor(bg)`);任何「文字配背景」都可用 `assertReadable(fg, bg)` 在生成期把关。
|
|
69
|
+
- **连线只用来连两个真实形状,且 ≥ 0.25"**——别留很短、没明确连到东西的残桩箭头(AI PPT 典型缺陷)。
|
|
70
|
+
用 `deck_helpers` 的 `connect(s, fromRect, toRect)` 由两个形状边框**自动算边到边端点**,别手填易飘/易残桩的坐标。
|
|
71
|
+
- **每页都要有视觉主角**(图 / 图标 / 图表 / 形状),别整页纯文字 + 项目符号。
|
|
72
|
+
- **逐页变换版式**(两栏 / 图标行 / 2×2 / 半幅图),别每页同一套。
|
|
73
|
+
- 间距统一选 0.3" 或 0.5",别随机混用;最小边距 0.5";**形状之间不要叠加**(卡内放文字 OK,部分压住不行)。
|
|
74
|
+
|
|
75
|
+
> ✅ 这三类(对比 / 残桩连线 / 叠加)落盘后用 `python scripts/opc_check.py deck.pptx` 之后再跑
|
|
76
|
+
> **`python scripts/layout_lint.py deck.pptx`** 做确定性兜底(详见 SKILL.md「布局/对比 确定性闸门」)——
|
|
77
|
+
> 弱模型不读这段也会被闸门拦下。
|
|
78
|
+
|
|
79
|
+
## 可选:复杂插画走「HTML 草稿 → 提取 SVG」
|
|
80
|
+
|
|
81
|
+
需要复杂插画/信息图时,可先用 ui-design 在 HTML 里出视觉草稿,再把其中的 `<svg>` lift 出来,
|
|
82
|
+
按 `svg.md` 的规则(分组、viewBox、文字回原生层)整理后走兜底管线嵌入 pptx。
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# pptx 范例
|
|
2
|
+
|
|
3
|
+
脑袋空空的 AI 临摹这一份就懂「分层混合」全套路。
|
|
4
|
+
|
|
5
|
+
## hybrid_example.mjs —— 3 页端到端范例
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
node skills/pptx/examples/hybrid_example.mjs
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
演示三条图形路线 + 原生文字,并在生成后自动跑 `svg_fallback.mjs`(补真 PNG 兜底 + OPC 合规重打包 + 自校验):
|
|
12
|
+
|
|
13
|
+
- **页1 封面**:真 SVG 满铺美术背景(`assets/cover-bg.svg`)+ pptx 原生文字标题。
|
|
14
|
+
- **页2 架构图**:纯原生 `addShape` 框图 + 箭头 + 活文字(复用 `../scripts/deck_helpers.mjs`)。
|
|
15
|
+
- **页3 内容**:原生项目符号文字 + SVG 图标(`assets/icon-spark.svg`)+ 原生 `addShape` 色块。
|
|
16
|
+
|
|
17
|
+
产物 `hybrid_example.pptx`:OPC 校验全绿,含 2 张可在 PowerPoint 365「转换为形状」取消组合编辑的 SVG。
|
|
18
|
+
|
|
19
|
+
## assets/
|
|
20
|
+
|
|
21
|
+
- `cover-bg.svg` —— 满铺背景(渐变 + 有机色块 + 流线);范例「美术配图用 SVG」。
|
|
22
|
+
- `icon-spark.svg` —— 小图标;范例「图标用 SVG」。
|
|
23
|
+
|
|
24
|
+
两份都遵守 `../svg.md`:一个语义元素一个 `<g>`、viewBox 对齐比例、文字不写进 SVG。
|
|
25
|
+
|
|
26
|
+
## 铁律对照
|
|
27
|
+
|
|
28
|
+
文字永远原生 `addText`(不烤进图片)· 结构图 `addShape` · 美术配图 SVG + `svg_fallback.mjs` · 真照片才 `addImage(png/jpg)`。
|
|
29
|
+
生成脚本用 **Node** 跑,不要 Bun(见 `../pptxgenjs.md` 文首铁律)。
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
// ============================================================================
|
|
4
|
+
// skills/pptx/examples/hybrid_example.mjs
|
|
5
|
+
// ----------------------------------------------------------------------------
|
|
6
|
+
// 「分层混合」端到端范例(脑袋空空的 AI 临摹这一份就懂全套路)。3 页演示三条图形路线:
|
|
7
|
+
// 页1 封面 —— 真 SVG 满铺美术背景(assets/cover-bg.svg)+ pptx 原生文字标题
|
|
8
|
+
// 页2 架构图 —— 纯原生 addShape 框图 + 箭头 + 活文字(deck_helpers)
|
|
9
|
+
// 页3 内容 —— 原生项目符号文字 + SVG 图标 + 原生 addShape 色块布局
|
|
10
|
+
// 铁律对照:文字永远原生 addText(不烤进图片);结构图 addShape;美术配图 SVG;真照片才 addImage(png/jpg)。
|
|
11
|
+
//
|
|
12
|
+
// 运行(Node,不要 Bun):
|
|
13
|
+
// node skills/pptx/examples/hybrid_example.mjs
|
|
14
|
+
// 产物:examples/hybrid_example.pptx(已自动跑 svg_fallback.mjs:补真 PNG 兜底 + OPC 合规重打包 + 自校验)
|
|
15
|
+
// ============================================================================
|
|
16
|
+
|
|
17
|
+
import { spawnSync } from 'node:child_process';
|
|
18
|
+
import path from 'node:path';
|
|
19
|
+
import { fileURLToPath } from 'node:url';
|
|
20
|
+
import PptxGenJS from 'pptxgenjs';
|
|
21
|
+
import { drawTitle, drawNode, connect, drawCard, drawRect, drawFooter } from '../scripts/deck_helpers.mjs';
|
|
22
|
+
|
|
23
|
+
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
24
|
+
const asset = (f) => path.join(__dirname, 'assets', f);
|
|
25
|
+
|
|
26
|
+
// 设计系统(阶段1 产物:本应来自 design.md 借 ui-design 定的 VI;此处直接给定)
|
|
27
|
+
// 注:teal 用更深的 00786A(而非常见的 00A896)——后者配白字仅 2.98:1,过不了对比闸门;
|
|
28
|
+
// 加深后白字 ≈5.4:1、teal 当强调文字落白底也 ≈5.4:1,均清晰可读(layout_lint 会把关)。
|
|
29
|
+
const C = { navy: '1E2761', deep: '0F172A', ice: 'CADCFC', white: 'FFFFFF', teal: '00786A', card: 'F8FAFC', grayL: 'E2E8F0', grayD: '475569' };
|
|
30
|
+
const F = { title: 'Consolas', body: 'Calibri' };
|
|
31
|
+
|
|
32
|
+
const pres = new PptxGenJS();
|
|
33
|
+
pres.layout = 'LAYOUT_WIDE'; // 13.3" × 7.5"
|
|
34
|
+
pres.author = 'minimal-agent pptx skill';
|
|
35
|
+
pres.title = '分层混合范例';
|
|
36
|
+
|
|
37
|
+
// ---- 页1 封面:SVG 满铺背景 + 原生文字 ------------------------------------
|
|
38
|
+
{
|
|
39
|
+
const s = pres.addSlide();
|
|
40
|
+
s.addImage({ path: asset('cover-bg.svg'), x: 0, y: 0, w: 13.3, h: 7.5 }); // 美术 → SVG
|
|
41
|
+
s.addText('分层混合 PPT', { x: 0.8, y: 2.7, w: 8, h: 1.0, fontFace: F.title, fontSize: 46, bold: true, color: C.white, margin: 0 });
|
|
42
|
+
s.addText('SVG 美术配图 · 原生矢量结构图 · 原生可编辑文字', { x: 0.82, y: 3.8, w: 9, h: 0.5, fontFace: F.body, fontSize: 16, color: C.ice, margin: 0 });
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
// ---- 页2 架构图:纯原生 addShape ------------------------------------------
|
|
46
|
+
{
|
|
47
|
+
const s = pres.addSlide();
|
|
48
|
+
s.background = { color: C.white };
|
|
49
|
+
drawTitle(s, '§1', '三条图形路线(纯原生矢量框图)', { titleSize: 26, bg: C.white });
|
|
50
|
+
const nodes = [
|
|
51
|
+
{ label: '原生文字\naddText', fill: C.navy },
|
|
52
|
+
{ label: '结构图\naddShape', fill: C.teal },
|
|
53
|
+
{ label: '美术配图\nSVG + 兜底', fill: C.ice, textColor: C.navy },
|
|
54
|
+
{ label: '真照片\naddImage', fill: C.grayD },
|
|
55
|
+
];
|
|
56
|
+
const w = 2.5, h = 1.5, gap = 0.6, y = 2.6;
|
|
57
|
+
const startX = (13.3 - (w * nodes.length + gap * (nodes.length - 1))) / 2;
|
|
58
|
+
nodes.forEach((n, i) => {
|
|
59
|
+
n.rect = { x: startX + i * (w + gap), y, w, h };
|
|
60
|
+
drawNode(s, n.rect.x, y, w, h, n.label, { fill: n.fill, textColor: n.textColor || C.white, fontFace: F.body, fontSize: 13 });
|
|
61
|
+
});
|
|
62
|
+
// 用 connect() 由两个节点矩形自动算边到边端点 —— 箭头永远贴住节点、绝不残桩/飘移。
|
|
63
|
+
for (let i = 0; i < nodes.length - 1; i++) {
|
|
64
|
+
connect(s, nodes[i].rect, nodes[i + 1].rect, { color: '94A3B8', width: 2 });
|
|
65
|
+
}
|
|
66
|
+
s.addText('每个方框都是 PowerPoint 原生对象:点一下就能选中、改色、移动、改字。', {
|
|
67
|
+
x: 0.5, y: 4.6, w: 12.3, h: 0.4, fontFace: F.body, fontSize: 13, italic: true, color: C.grayD, align: 'center', margin: 0,
|
|
68
|
+
});
|
|
69
|
+
drawFooter(s, '分层混合范例 · minimal-agent pptx skill', '2 / 3');
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
// ---- 页3 内容:原生文字 + SVG 图标 + 原生色块 -----------------------------
|
|
73
|
+
{
|
|
74
|
+
const s = pres.addSlide();
|
|
75
|
+
s.background = { color: C.white };
|
|
76
|
+
drawTitle(s, '§2', '一页里如何混用', { titleSize: 26, bg: C.white });
|
|
77
|
+
s.addImage({ path: asset('icon-spark.svg'), x: 0.6, y: 2.0, w: 0.8, h: 0.8 }); // 图标 → SVG
|
|
78
|
+
s.addText([
|
|
79
|
+
{ text: '文字', options: { bold: true, color: C.teal, breakLine: false } },
|
|
80
|
+
{ text: ' 用原生 addText —— 可编辑、可重排,永不烤进图片', options: { breakLine: true } },
|
|
81
|
+
{ text: '结构', options: { bold: true, color: C.teal, breakLine: false } },
|
|
82
|
+
{ text: ' 用 addShape —— 框、箭头、色块都是原生对象', options: { breakLine: true } },
|
|
83
|
+
{ text: '美术', options: { bold: true, color: C.teal, breakLine: false } },
|
|
84
|
+
{ text: ' 用 SVG(图标/背景/渐变/插画)+ svg_fallback 补兜底', options: { breakLine: true } },
|
|
85
|
+
], { x: 1.6, y: 1.95, w: 6.0, h: 2.2, fontFace: F.body, fontSize: 15, color: C.grayD, valign: 'top', margin: 0, paraSpaceAfter: 8 });
|
|
86
|
+
|
|
87
|
+
// 右侧三色块(原生 addShape 色块布局)
|
|
88
|
+
const blocks = [['设计', C.navy], ['图形', C.teal], ['落盘', C.deep]];
|
|
89
|
+
blocks.forEach(([t, color], i) => {
|
|
90
|
+
const x = 8.2 + i * 1.6;
|
|
91
|
+
drawCard(s, x, 2.0, 1.4, 2.4, { fill: color, border: color, radius: 0.08 });
|
|
92
|
+
s.addText(t, { x, y: 2.0, w: 1.4, h: 2.4, fontFace: F.title, fontSize: 18, bold: true, color: C.white, align: 'center', valign: 'middle', margin: 0 });
|
|
93
|
+
});
|
|
94
|
+
drawRect(s, 0.5, 5.2, 12.3, 0.04, { fill: C.grayL });
|
|
95
|
+
s.addText('SVG 区域在 PowerPoint 365 里右键「图形格式 → 转换为形状 → 取消组合」即可逐元素编辑。', {
|
|
96
|
+
x: 0.5, y: 5.4, w: 12.3, h: 0.5, fontFace: F.body, fontSize: 13, color: C.grayD, margin: 0,
|
|
97
|
+
});
|
|
98
|
+
drawFooter(s, '分层混合范例 · minimal-agent pptx skill', '3 / 3');
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
const out = path.join(__dirname, 'hybrid_example.pptx');
|
|
102
|
+
await pres.writeFile({ fileName: out });
|
|
103
|
+
console.log('[OK] wrote', out);
|
|
104
|
+
|
|
105
|
+
// 生成后强制:补真 PNG 兜底 + OPC 合规重打包 + 自校验(in-place,留 .bak)
|
|
106
|
+
const r = spawnSync('node', [path.join(__dirname, '..', 'scripts', 'svg_fallback.mjs'), out], { stdio: 'inherit' });
|
|
107
|
+
process.exit(r.status ?? 0);
|
|
Binary file
|
package/skills/pptx/pptxgenjs.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# PptxGenJS Tutorial
|
|
2
2
|
|
|
3
|
+
## ⚠️ 运行时铁律:必须用 Node 跑,不要用 Bun
|
|
4
|
+
|
|
5
|
+
PptxGenJS 底层用 JSZip 打包 pptx。**Bun 下的 JSZip 会产出不合规的 OPC 包**
|
|
6
|
+
(含 ZIP 目录条目 + STORE 无压缩 + `[Content_Types].xml` 不在首位),
|
|
7
|
+
PowerPoint 严格 OPC 校验会因此判「需要修复」、修复后内容丢失。Node 下的
|
|
8
|
+
JSZip 不会有这个问题。
|
|
9
|
+
|
|
10
|
+
- ✅ 生成脚本一律用 **Node** 运行:`node make_deck.mjs` 或 `npx tsx make_deck.ts`
|
|
11
|
+
- ❌ **不要用 `bun run`** 跑 PptxGenJS 生成脚本(即便项目主体是 Bun)
|
|
12
|
+
- 生成完成后,**必须跑一步 OPC 合规校验**(见本文末「生成后强制:OPC 合规校验」),
|
|
13
|
+
这是硬门槛——「能被 python-pptx 重新打开」不等于「PowerPoint 能干净打开」。
|
|
14
|
+
|
|
3
15
|
## Setup & Basic Structure
|
|
4
16
|
|
|
5
17
|
```javascript
|
|
@@ -16,6 +28,8 @@ slide.addText("Hello World!", { x: 0.5, y: 0.5, fontSize: 36, color: "363636" })
|
|
|
16
28
|
pres.writeFile({ fileName: "Presentation.pptx" });
|
|
17
29
|
```
|
|
18
30
|
|
|
31
|
+
> 跑这个脚本用 `node make_deck.mjs`,**不要** `bun run make_deck.mjs`(见文首铁律)。
|
|
32
|
+
|
|
19
33
|
## Layout Dimensions
|
|
20
34
|
|
|
21
35
|
Slide dimensions (coordinates in inches):
|
|
@@ -418,3 +432,30 @@ titleSlide.addText("My Title", { placeholder: "title" });
|
|
|
418
432
|
- **Layouts**: LAYOUT_16x9 (10"×5.625"), LAYOUT_16x10, LAYOUT_4x3, LAYOUT_WIDE
|
|
419
433
|
- **Alignment**: "left", "center", "right"
|
|
420
434
|
- **Chart data labels**: "outEnd", "inEnd", "center"
|
|
435
|
+
|
|
436
|
+
---
|
|
437
|
+
|
|
438
|
+
## 生成后强制:OPC 合规校验(硬门槛)
|
|
439
|
+
|
|
440
|
+
写出 pptx 后**必须**跑一次忠实的 OPC 合规校验。这才是「PowerPoint 能否干净打开」的真实
|
|
441
|
+
判据——**不要**只用 python-pptx 能否 load 来判断通过(python-pptx 很宽容,会忽略目录条目
|
|
442
|
+
等问题照样加载成功,导致损坏的包误报通过、溜过验收)。
|
|
443
|
+
|
|
444
|
+
```bash
|
|
445
|
+
python scripts/opc_check.py output.pptx
|
|
446
|
+
```
|
|
447
|
+
|
|
448
|
+
- 退出码 0 + 打印 PASSED → 合规,可交付。
|
|
449
|
+
- 退出码非 0 → 打印具体不合规项(目录条目 / Content_Types 不在首位 / 悬空关系 /
|
|
450
|
+
0 字节媒体 / 坏 XML)。**一步修回合规:**
|
|
451
|
+
|
|
452
|
+
```bash
|
|
453
|
+
python scripts/opc_check.py output.pptx --repack output.fixed.pptx
|
|
454
|
+
# 重打包后用合规的 output.fixed.pptx 交付
|
|
455
|
+
```
|
|
456
|
+
|
|
457
|
+
校验项见 `scripts/opc_check.py` 头注。它只依赖 Python 标准库,可对任意 pptx/docx/xlsx 直接
|
|
458
|
+
`python scripts/opc_check.py <file>` 跑。
|
|
459
|
+
|
|
460
|
+
> 内容/视觉 QA(markitdown 抽文本、转图片人工核对)仍要做(见 SKILL.md 的 QA 章节),
|
|
461
|
+
> 但**合规校验是先决硬门槛**:包不合规,内容再对也会被 PowerPoint 判损坏。
|