chuspeeism/dashi-ppt-skill / skills/dashi-ppt
dashi-ppt
Flagged制作 PPT、演示文稿、幻灯片、汇报材料时使用。Dashi PPT 基于预置视觉主题组合页面,生成可离线打开、可在浏览器编辑的 HTML 演示,支持导出 PPTX / PDF 文件。
project/scripts/ensure-registry.mjs
View on GitHub// 首装前的 npm registry 探测选源(安装版 skill 的 project/scripts/ 随包分发):
// 官方源可达 → 移除项目级 registry 锁定,走 npm 默认(尊重外网用户与其全局镜像配置);
// 官方源不可达且 npmmirror 可达 → 锁定 npmmirror(国内环境)。
// 结果持久化进 project/.npmrc 并打标,只探测一次;缺省 .npmrc 已是 npmmirror,
// 本脚本没跑到/没跑成时任何网络仍保底可装。约定:绝不抛错阻塞安装。
import { readFileSync, writeFileSync, existsSync } from 'node:fs';
import path from 'node:path';
import { fileURLToPath } from 'node:url';
const PROJECT_ROOT = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..');
const NPMRC = path.join(PROJECT_ROOT, '.npmrc');
const OFFICIAL = 'https://registry.npmjs.org';
const MIRROR = 'https://registry.npmmirror.com';
const PROBED_MARK = '# dashi-registry-probed';
async function reachable(base, timeoutMs = 3000) {
try {
const controller = new AbortController();
const timer = setTimeout(() => controller.abort(), timeoutMs);
const res = await fetch(`${base}/-/ping`, { signal: controller.signal, redirect: 'follow' });
clearTimeout(timer);
// 必须 2xx 才算可达:403/5xx(企业代理拦截页、镜像故障)下 npm install
// 实际会失败,不能据此选源。
return res.ok;
} catch {
return false;
}
}
async function main() {
const content = existsSync(NPMRC) ? readFileSync(NPMRC, 'utf8') : '';
if (content.includes(PROBED_MARK)) return;
const kept = content
.split('\n')
.filter((line) => line.trim() && !line.trim().startsWith('registry=') && !line.includes(PROBED_MARK));
if (await reachable(OFFICIAL)) {
// 官方可达:去掉项目级 registry 锁定(npm 走默认或用户全局配置)。
} else if (await reachable(MIRROR)) {
kept.push(`registry=${MIRROR}`);
} else {
// 两个源都探不到:保持现状不打标(下次安装再探),失败信息交给 npm 呈现。
return;
}
kept.push(PROBED_MARK);
writeFileSync(NPMRC, `${kept.join('\n')}\n`);
}
await main().catch(() => {});
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| 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: 198k | Updated | Claude CodeCodex | Verified | Install |
| 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: 198k | Updated | Claude CodeCodex | Verified | Install |
| 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: 198k | Updated | Claude CodeCodex | Verified | Install |
| 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: 198k | Updated | Claude CodeCodex | Verified | Install |