Skip to content

chuspeeism/dashi-ppt-skill / skills/dashi-ppt

dashi-ppt

Flagged

制作 PPT、演示文稿、幻灯片、汇报材料时使用。Dashi PPT 基于预置视觉主题组合页面,生成可离线打开、可在浏览器编辑的 HTML 演示,支持导出 PPTX / PDF 文件。

FileKindSize
.gitignoreother173 B
README.mdmarkdown3.9 KB
SKILL.mdskill md25.4 KB
agents/openai.yamlconfig292 B
assets/skill/dashi-ppt-favicon.pngbinary2.0 KB
assets/skill/dashi-ppt-small.pngbinary895 B
assets/skill/dashi-ppt.pngbinary12.6 KB
assets/skill/theme-style-grid.pngbinary2.1 MB
project/.npmrcother40 B
project/assets/skill/dashi-ppt-favicon.pngbinary2.0 KB
project/assets/social-icons/bilibili.svgother7.9 KB
project/assets/social-icons/douyin.svgother4.7 KB
project/assets/social-icons/github.svgother1.3 KB
project/assets/social-icons/redbook.svgother3.5 KB
project/assets/template-swiss.htmlother465.5 KB
project/assets/ui-icons/sidebar.svgother1.3 KB
project/assets/unicorn/automations_remix_scene.jsonconfig42.9 KB
project/assets/unicorn/goey_balls_remix_scene.jsonconfig14.2 KB
project/assets/unicorn/media/blue_noise_med.pngbinary206.4 KB
project/assets/unicorn/media/font_atlas.pngbinary64.6 KB
project/assets/unicorn/moving_into_remix_scene.jsonconfig67.8 KB
project/assets/unicorn/tech_background_remix_scene.jsonconfig52.2 KB
project/distribution-source.jsonconfig517 B
project/i18n/zh-en.jsonconfig574.5 KB
project/layout-manifest.jsonconfig3.4 MB
project/npmrc.templateother40 B
project/package-lock.jsonmanifest21.8 KB
project/package.jsonmanifest1.2 KB
project/packages/html-deck-to-pptx/LICENSEother1.6 KB
project/packages/html-deck-to-pptx/README.mdmarkdown2.2 KB
project/packages/html-deck-to-pptx/index.mjsscript719 B
project/packages/html-deck-to-pptx/package.jsonmanifest840 B
project/packages/html-deck-to-pptx/src/editable.mjsscript143 B
project/packages/html-deck-to-pptx/src/screenshot.mjsscript147 B
project/scripts/chrome-path.mjsscript6.1 KB
project/scripts/command-paths.mjsscript334 B
project/scripts/ensure-registry.mjsscript2.1 KB
project/scripts/export-pptx.mjsscript6.4 KB
project/scripts/goal-scaffold.mjsscript31.3 KB
project/scripts/inspect-layout.mjsscript2.1 KB
project/scripts/layout-query.mjsscript3.4 KB
project/scripts/media-formats.mjsscript1.3 KB
project/scripts/openssl-path.mjsscript2.2 KB
project/scripts/persist-deck-state.mjsscript6.7 KB
project/scripts/preview-export-auth.mjsscript1.0 KB
project/scripts/preview-freshness.mjsscript6.2 KB
project/scripts/preview-path.mjsscript569 B
project/scripts/preview/ensure-tmpdir.mjsscript3.4 KB
project/scripts/preview/export-routes.mjsscript24.2 KB
project/scripts/preview/launch-export-browser.mjsscript2.5 KB
project/scripts/preview/mime.mjsscript671 B
project/scripts/preview/network.mjsscript799 B
project/scripts/preview/static-serve.mjsscript1.2 KB
project/scripts/preview/tls.mjsscript2.7 KB
project/scripts/render-goal-deck.jsxother2.5 KB
project/scripts/scrub-local-paths.mjsscript898 B
project/scripts/serve-preview-https.mjsscript10.7 KB
project/scripts/skill-workflow-utils.mjsscript1.4 KB
project/scripts/stage-media.mjsexecutablescript14.7 KB
project/scripts/start-preview-server.mjsscript16.1 KB
project/scripts/validate-goal-copy.mjsscript25.4 KB
project/scripts/validate-goal-spec.mjsscript80.7 KB
project/scripts/validate-swiss-deck.mjsscript34.1 KB
project/scripts/workflow-telemetry.mjsscript6.1 KB
project/scripts/workflow/copy-contract.mjsscript19.2 KB
project/scripts/workflow/inspect-fillplan.mjsscript70.6 KB
project/scripts/workflow/layout-allocation.mjsscript8.5 KB
project/scripts/workflow/layout-query.mjsscript64.4 KB
project/scripts/workflow/media-slots.mjsscript15.8 KB
project/scripts/workflow/theme-registry.mjsscript16.1 KB
project/scripts/write-safe-props.mjsscript17.7 KB
project/src/accepted-themes.mjsscript570 B
project/src/components/bespoke/BespokeSlide.jsxother32.0 KB
project/src/components/bespoke/theme-profiles.mjsscript11.5 KB
project/src/components/index.jsxother71 B
project/src/components/shell/SlideShell.jsxother1.5 KB
project/src/components/shell/index.jsxother47 B
project/src/components/themes/canonical-metadata.mjsscript4.6 KB
project/src/components/themes/chart-safety.mjsscript1.9 KB
project/src/components/themes/client-runtime.jsxother57.9 KB
project/src/components/themes/decorative-overrides.mjsscript859 B
project/src/components/themes/generated-metadata.jsscript4.4 MB
project/src/components/themes/index.jsxother2.8 KB
project/src/components/themes/runtime-build.mjsscript7.3 KB
project/src/components/themes/runtime-helpers.jsxother6.2 KB
project/src/components/themes/theme-registry-codegen.mjsscript7.2 KB
project/src/components/themes/theme01/metadata.jsscript363.9 KB
project/src/components/themes/theme01/source/slides/theme.jsscript5.6 KB
project/src/components/themes/theme02/metadata.jsscript384.6 KB
project/src/components/themes/theme02/overrides.jsscript114 B
project/src/components/themes/theme02/source/src/gxnTheme.jsscript19.6 KB
project/src/components/themes/theme03/metadata.jsscript512.5 KB
project/src/components/themes/theme03/overrides.jsscript1.2 KB
project/src/components/themes/theme03/source/assets/3d/01.pngbinary635.1 KB
project/src/components/themes/theme03/source/assets/3d/02.pngbinary865.2 KB
project/src/components/themes/theme03/source/assets/3d/03.pngbinary921.8 KB
project/src/components/themes/theme03/source/assets/3d/04.pngbinary1.1 MB
project/src/components/themes/theme03/source/assets/3d/05.pngbinary920.3 KB
project/src/components/themes/theme03/source/assets/3d/06.pngbinary1.2 MB
project/src/components/themes/theme03/source/assets/3d/07.pngbinary1.6 MB
project/src/components/themes/theme03/source/assets/3d/08.pngbinary1.4 MB
project/src/components/themes/theme03/source/assets/3d/09.pngbinary1.9 MB
project/src/components/themes/theme03/source/assets/3d/10.pngbinary1.4 MB
project/src/components/themes/theme03/source/assets/3d/11.pngbinary1.6 MB
project/src/components/themes/theme03/source/assets/3d/12.pngbinary1.8 MB
project/src/components/themes/theme03/source/src/icons.jsscript799 B
project/src/components/themes/theme03/source/src/preset3d.jsscript119 B
project/src/components/themes/theme03/source/src/presetBase.jsscript3.4 KB
project/src/components/themes/theme03/source/src/registry.jsscript22.3 KB
project/src/components/themes/theme03/source/src/slides/safeProps.jsscript504 B
project/src/components/themes/theme03/source/src/theme.cssother5.4 KB
project/src/components/themes/theme03/source/src/theme.jsscript3.0 KB
project/src/components/themes/theme04/TEXT_CONTROL_POLICY.mdmarkdown344 B
project/src/components/themes/theme04/metadata.jsscript324.4 KB
project/src/components/themes/theme04/overrides.jsscript118 B
project/src/components/themes/theme04/source/image-slot.jsscript41.0 KB
project/src/components/themes/theme05/metadata.jsscript492.0 KB
project/src/components/themes/theme05/source/styles/exc-covers.cssother9.6 KB
project/src/components/themes/theme05/source/styles/pulse-deck.cssother288.9 KB
project/src/components/themes/theme06/metadata.jsscript331.7 KB
project/src/components/themes/theme07/metadata.jsscript319.6 KB
project/src/components/themes/theme07/source/src/theme.jsscript2.9 KB
project/src/components/themes/theme08/metadata.jsscript366.7 KB
project/src/components/themes/theme08/source/image-slot.jsscript45 B
project/src/components/themes/theme09/metadata.jsscript378.4 KB
project/src/components/themes/theme10/metadata.jsscript294.2 KB
project/src/components/themes/theme11/metadata.jsscript399.9 KB
project/src/components/themes/theme12/metadata.jsscript311.7 KB
project/src/components/themes/theme12/source/src/index.jsscript23.1 KB
project/src/components/themes/theme12/source/src/swTheme.jsscript2.3 KB
project/src/components/themes/unicorn-background.jsxother2.0 KB
project/src/control-naming.mjsscript17.2 KB
project/src/deckComposer.jsxother18.8 KB
project/src/generated-metadata-writer.mjsscript722 B
project/src/i18n-core.mjsscript2.3 KB
project/src/i18n.mjsscript1.8 KB
project/src/metadata-serialize.mjsscript6.1 KB
project/src/options.jsxother1.5 KB
project/src/prop-contract-core.mjsscript70.1 KB
project/src/propContracts.jsxother658 B
project/src/react-shim.jsscript51 B
project/src/renderDeck.jsxother14.0 KB
project/src/runtime-assets.mjsscript1.7 KB
project/src/types.d.tsscript1.7 KB
project/src/variant-contract.mjsscript28.8 KB
project/src/variant-materializer.mjsscript9.0 KB
project/src/view-model/context.jsxother382 B
project/src/view-model/index.jsxother26.0 KB
project/src/view-model/schema-v2-canonical.mjsscript471 B
references/examples/annual-review.jsonconfig14.9 KB
references/examples/portfolio.jsonconfig13.1 KB
references/goal-spec.schema.jsonconfig9.9 KB
references/layout-roles.mdmarkdown1.7 KB
references/options.mdmarkdown7.5 KB
scripts/check_latest_version.mjsexecutablescript3.1 KB
scripts/render_goal_deck.ps1script4.5 KB
scripts/render_goal_deck.shexecutablescript2.3 KB

project/scripts/workflow/layout-allocation.mjs

View on GitHub
import { hashSeed, layoutFamily } from './layout-query.mjs';

const CANDIDATE_LIMIT = 18;
const CHOICE_LIMIT = 96;
const FIT_BAND = 16;
const FIT_WEIGHT = 150;

export function allocateDeckLayouts(candidateMatrix, seed = 'layout-allocation') {
  const choices = candidateMatrix.map((candidates, pageIndex) => {
    const unique = dedupeCandidates(candidates);
    if (unique.length < 3) {
      throw new Error(`Layout allocation page ${pageIndex + 1} has only ${unique.length} compatible layouts; required 3`);
    }
    const pageChoices = boundedChoices(unique, `${seed}:page-${pageIndex + 1}`);
    if (!pageChoices.length) {
      throw new Error(`Layout allocation page ${pageIndex + 1} cannot form 3 structurally distinct template variants`);
    }
    return pageChoices;
  });
  const selected = choices.map(items => items[0]);

  for (let pass = 0; pass < 3; pass += 1) {
    let changed = false;
    for (let pageIndex = 0; pageIndex < selected.length; pageIndex += 1) {
      let best = selected[pageIndex];
      let bestScore = allocationScore(selected);
      let bestTie = assignmentTie(selected, seed);
      for (const choice of choices[pageIndex]) {
        const trial = selected.map((item, index) => (index === pageIndex ? choice : item));
        const score = allocationScore(trial);
        const tie = assignmentTie(trial, seed);
        if (score < bestScore || (score === bestScore && tie < bestTie)) {
          best = choice;
          bestScore = score;
          bestTie = tie;
        }
      }
      if (layoutCombinationKey(best.items) !== layoutCombinationKey(selected[pageIndex].items)) {
        selected[pageIndex] = best;
        changed = true;
      }
    }
    if (!changed) break;
  }

  const assignments = selected.map(item => item.items);
  const orderState = { positionFamilyUsage: [new Map(), new Map(), new Map()], previousFamilies: [] };
  assignments.forEach((items, pageIndex) => {
    assignments[pageIndex] = orderVariants(items, orderState, `${seed}:page-${pageIndex + 1}`);
    recordVariantOrder(assignments[pageIndex], orderState);
  });
  return { assignments, diagnostics: allocationDiagnostics(assignments, selected) };
}

export function layoutCombinationKey(candidates) {
  return candidates.map(item => item.layout).sort().join('|');
}

function boundedChoices(candidates, seed) {
  const pool = structurallyDiversePool(candidates, CANDIDATE_LIMIT);
  const combinations = [];
  let maxFit = -Infinity;
  for (let left = 0; left < pool.length - 2; left += 1) {
    for (let middle = left + 1; middle < pool.length - 1; middle += 1) {
      for (let right = middle + 1; right < pool.length; right += 1) {
        const items = [pool[left], pool[middle], pool[right]];
        if (new Set(items.map(structureComposition)).size !== 3) continue;
        const fit = pageFit(items);
        maxFit = Math.max(maxFit, fit);
        combinations.push({ items, fit });
      }
    }
  }
  return combinations
    .filter(item => item.fit >= maxFit - FIT_BAND)
    .map(item => ({ ...item, maxFit }))
    .sort((left, right) => (
      right.fit - left.fit
      || intraPagePenalty(left.items) - intraPagePenalty(right.items)
      || combinationTie(left.items, seed) - combinationTie(right.items, seed)
    ))
    .slice(0, CHOICE_LIMIT);
}

function structurallyDiversePool(candidates, limit) {
  const representatives = new Map();
  for (const candidate of candidates) {
    const composition = structureComposition(candidate);
    if (!representatives.has(composition)) representatives.set(composition, candidate);
  }
  const selected = [...representatives.values()].slice(0, limit);
  for (const candidate of candidates) {
    if (selected.length >= limit) break;
    if (!selected.includes(candidate)) selected.push(candidate);
  }
  return selected;
}

function allocationScore(selected) {
  const assignments = selected.map(item => item.items);
  const fitLoss = selected.reduce((sum, item) => sum + item.maxFit - item.fit, 0);
  return fitLoss * FIT_WEIGHT + diversityPenalty(assignments);
}

function intraPagePenalty(items) {
  const families = items.map(layoutFamily);
  const compositions = items.map(item => item?.structureFingerprint?.composition || layoutFamily(item));
  return (items.length - new Set(families).size) * 300
    + (items.length - new Set(compositions).size) * 450;
}

function diversityPenalty(assignments) {
  let penalty = assignments.reduce((sum, items) => sum + intraPagePenalty(items), 0);
  for (let pageIndex = 1; pageIndex < assignments.length; pageIndex += 1) {
    const previousFamilies = new Set(assignments[pageIndex - 1].map(layoutFamily));
    penalty += assignments[pageIndex].filter(item => previousFamilies.has(layoutFamily(item))).length * 90;
  }
  penalty += repeatPenalty(assignments.flat().map(item => item.layout), 600);
  penalty += repeatPenalty(assignments.map(layoutCombinationKey), 1400);
  penalty += repeatPenalty(assignments.flat().map(layoutFamily), 14);
  return penalty;
}

function repeatPenalty(values, weight) {
  const counts = new Map();
  values.forEach(value => increment(counts, value));
  return [...counts.values()].reduce((sum, count) => sum + (count * (count - 1) / 2) * weight, 0);
}

function combinationTie(items, seed) {
  return hashSeed(`${seed}:${layoutCombinationKey(items)}`);
}

function assignmentTie(selected, seed) {
  return hashSeed(`${seed}:${selected.map(item => layoutCombinationKey(item.items)).join('::')}`);
}

function orderVariants(items, state, seed) {
  const permutations = [
    [items[0], items[1], items[2]], [items[0], items[2], items[1]],
    [items[1], items[0], items[2]], [items[1], items[2], items[0]],
    [items[2], items[0], items[1]], [items[2], items[1], items[0]],
  ];
  return permutations.sort((left, right) => (
    variantOrderPenalty(left, state) - variantOrderPenalty(right, state)
    || combinationTie(left, seed) - combinationTie(right, seed)
  ))[0];
}

function variantOrderPenalty(items, state) {
  return items.reduce((sum, item, index) => (
    sum + (state.positionFamilyUsage[index].get(layoutFamily(item)) || 0) * 20
    + Number(state.previousFamilies[index] === layoutFamily(item)) * 30
  ), 0);
}

function recordVariantOrder(items, state) {
  state.previousFamilies = items.map(layoutFamily);
  items.forEach((item, index) => increment(state.positionFamilyUsage[index], layoutFamily(item)));
}

function allocationDiagnostics(assignments, selected) {
  const layouts = assignments.flat().map(item => item.layout);
  const families = assignments.flat().map(layoutFamily);
  const combinations = assignments.map(layoutCombinationKey);
  const pageFits = assignments.map(pageFit);
  const maxFits = selected.map(item => item.maxFit);
  return {
    pages: assignments.map((items, index) => ({
      page: index + 1,
      layouts: items.map(item => item.layout),
      families: items.map(layoutFamily),
      compositions: items.map(structureComposition),
      queryScores: items.map(candidateFit),
      fitTotal: pageFit(items),
      fitMax: maxFits[index],
      fitLoss: maxFits[index] - pageFit(items),
      combination: layoutCombinationKey(items),
    })),
    fit: {
      total: pageFits.reduce((sum, value) => sum + value, 0),
      maxTotal: maxFits.reduce((sum, value) => sum + value, 0),
      loss: maxFits.reduce((sum, value) => sum + value, 0) - pageFits.reduce((sum, value) => sum + value, 0),
      min: Math.min(...pageFits),
      max: Math.max(...pageFits),
    },
    layout: repeatStats(layouts),
    family: repeatStats(families),
    combination: repeatStats(combinations),
  };
}

function dedupeCandidates(candidates) {
  const seen = new Set();
  return (candidates || []).filter(candidate => {
    if (!candidate?.layout || seen.has(candidate.layout)) return false;
    seen.add(candidate.layout);
    return true;
  });
}

function structureComposition(candidate) {
  return candidate?.structureFingerprint?.composition
    || candidate?.projectionPlan?.structureFingerprint?.composition
    || layoutFamily(candidate);
}

function candidateFit(candidate) {
  return Math.round(Number(candidate?.queryScore || 0));
}

function pageFit(items) {
  return items.reduce((sum, item) => sum + candidateFit(item), 0);
}

function repeatStats(values) {
  const counts = new Map();
  values.forEach(value => increment(counts, value));
  return {
    total: values.length,
    unique: counts.size,
    repeated: [...counts.entries()].filter(([, count]) => count > 1).map(([value, count]) => ({ value, count })),
    maxUse: counts.size ? Math.max(...counts.values()) : 0,
  };
}

function increment(map, key) {
  map.set(key, (map.get(key) || 0) + 1);
}
canvas-designanthropics/skillsCreate beautiful visual art in .png and .pdf documents using design philosophy. You should use this skill when the user asks to create a poster, piece of art, design, or other static piece. Create original visual designs, never copying existing artists' work to avoid copyright violations.Stars: 198kUpdated Claude CodeCodexVerifiedInstall
docxanthropics/skillsUse this skill whenever the user wants to create, read, edit, or manipulate Word documents (.docx files) or Word templates (.dotx files). Triggers include: any mention of 'Word doc', 'word document', '.docx', '.dotx', or requests to produce professional documents with formatting like tables of contents, headings, page numbers, or letterheads. Also use when extracting or reorganizing content from .docx or .dotx files, inserting or replacing images in documents, performing find-and-replace in Word files, working with tracked changes or comments, or converting content into a polished Word document. If the user asks for a 'report', 'memo', 'letter', 'template', or similar deliverable as a Word or .docx file, use this skill. Do NOT use for PDFs, spreadsheets, Google Docs, or general coding tasks unrelated to document generation.Stars: 198kUpdated Claude CodeCodexVerifiedInstall
pdfanthropics/skillsUse this skill whenever the user wants to do anything with PDF files. This includes reading or extracting text/tables from PDFs, combining or merging multiple PDFs into one, splitting PDFs apart, rotating pages, adding watermarks, creating new PDFs, filling PDF forms, encrypting/decrypting PDFs, extracting images, and OCR on scanned PDFs to make them searchable. If the user mentions a .pdf file or asks to produce one, use this skill.Stars: 198kUpdated Claude CodeCodexVerifiedInstall
pptxanthropics/skillsUse this skill any time a .pptx or .potx 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 or .potx 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 (.potx), layouts, speaker notes, or comments. Trigger whenever the user mentions "deck," "slides," "presentation," or references a .pptx or .potx filename, regardless of what they plan to do with the content afterward. If a .pptx or .potx file needs to be opened, created, or touched, use this skill.Stars: 198kUpdated Claude CodeCodexVerifiedInstall