[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7FBDBRDTQT7AXE8VRS6PWCN":3,"skill-same:01M7FBDBRDTQT7AXE8VRS6PWCN":52},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":24,"commitSha":25,"skillDirectory":26,"forksCount":27,"repositoryHtmlUrl":28,"repositoryHomepageUrl":6,"ownerHtmlUrl":29,"ownerBlogUrl":6,"ownerDescription":30,"updatedAt":31,"install":32,"resources":45},"01M7FBDBRDTQT7AXE8VRS6PWCN","plugin-heavy-dep",null,"Use when adding a heavyweight browser dependency (diagram\u002Fchart renderers like mermaid, code editors, big wasm-adjacent libs) to a lightweight DSH Web plugin that must stay small, when wiring a lazy-loaded chunk through a host route, when the lazy import intermittently fails or falls back, or when rendering untrusted markup (SVG\u002FHTML) produced by such a dependency.","lza6\u002FArmor-piercing-system-prompts","lza6","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F128880206?v=4","01M7EB3K7WPX5T28EJ2NVHE6EG","Chinese-tingfeng","01M7EB3K97E1KQ16QWKJMFNGX8",11,"MIT","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F06-前端与设计\u002Fplugin-heavy-dep\u002FSKILL.md",[],[],"2026-11-16 10:05:34",false,"---\nname: plugin-heavy-dep\ndescription: Use when adding a heavyweight browser dependency (diagram\u002Fchart renderers like mermaid, code editors, big wasm-adjacent libs) to a lightweight DSH Web plugin that must stay small, when wiring a lazy-loaded chunk through a host route, when the lazy import intermittently fails or falls back, or when rendering untrusted markup (SVG\u002FHTML) produced by such a dependency.\n---\n\n# Add Heavy Dependencies to a Lightweight DSH Web Plugin\n\nA lightweight Web plugin (small client bundle, no build farm) can still ship a\nmulti-megabyte renderer — if the heavy code never loads until it is needed and\ndegrades gracefully when it cannot load. This skill is the integration\nchecklist; every item below was earned from a real mermaid integration.\n\n## 1. Decide lazy vs inline\n\nIf the dependency would multiply the client bundle several-fold and only one\nfeature needs it (a fence renderer, an editor opened on demand), do NOT inline\nit into the client bundle. Split it into a **separate chunk file** the client\nimports dynamically only when the feature actually renders.\n\n## 2. Bundle the chunk as ONE file\n\nBundle the dependency into a **single self-contained ESM file** with\ncode-splitting disabled. A general-purpose bundler left on default settings\nsplits the library's internal dynamic imports into sibling chunk files with\ncontent-hashed names — the browser then resolves them as relative imports\nagainst the chunk's URL, and every sibling must also be served, named exactly,\nand MIME-correct. One file, one import, no relative-resolution class of bugs.\n\n## 3. Serve it from a host route scoped to your own lib\n\nRegister a **prefix route** on `webServer` that serves files from the plugin's\nown lib directory only:\n\n- Resolve the lib directory from the host bundle itself (`import.meta.url`),\n  never from `process.cwd()`.\n- Restrict to a whitelist of extensions (your chunk is `.js`\u002F`.mjs` — nothing\n  else should ever be served).\n- Containment guard: verify the requested path stays inside the lib dir. Two\n  hard-won rules:\n  - **Compare with `path.relative`, not `startsWith`**: a prefix compare is\n    wrong the moment the filesystem normalizes differently than your base\n    string.\n  - **Windows drive letters change case**: `realpathSync` may return `e:\\…`\n    where your base says `E:\\…`; a case-sensitive compare then misjudges a\n    perfectly contained path as an escape and answers **403**. `path.relative`\n    (plus an `isAbsolute` check on the result for cross-drive) is robust.\n- Serve with a JavaScript MIME (`application\u002Fjavascript`) — a wrong MIME makes\n  the browser reject the dynamic import.\n\nRemember: the host route only exists after a **dsh restart**; a hard refresh\nalone does not register new host code. A 404 on a freshly added route almost\nalways means \"not restarted yet\" or \"the installed copy predates the route\".\n\n## 4. Import lazily, cache verdicts, fall back\n\n- `import()` the chunk URL on first render of the feature; **cache the\n  successful module** so repeated fences do not re-import.\n- **Do not cache failures** the same way — or a transient failure sticks for\n  the page lifetime; let the next attempt retry, but throttle (a failing\n  import in a loop is its own console spam).\n- Always render a **fallback** (e.g. the original code block) when the import\n  or the render throws; reading must never break because a diagram could not\n  load. Tag the fallback with a state attribute and log the failure reason to\n  the console — \"it fell back\" without a reason is undebuggable.\n\n## 5. Untrusted markup: sanitize before innerHTML\n\nA renderer fed untrusted text (markdown, model output) emits markup you must\ntreat as hostile before `dangerouslySetInnerHTML`:\n\n- Configure the renderer to its strict mode and to emit **real SVG text**\n  rather than HTML labels (HTML labels ride inside `\u003CforeignObject>` — the\n  one channel that carries raw HTML inside an SVG).\n- Suppress the library's global error side effects (some renderers dump a\n  giant error SVG into `document.body` before rejecting).\n- Then **re-sanitize the emitted SVG yourself** with a zero-dependency\n  whitelist pass: parse as XML (`image\u002Fsvg+xml`; a parse failure rejects the\n  whole string), accept only an `\u003Csvg>` root, strip `foreignObject`\u002F`script`\n  and foreign-HTML elements case-insensitively, strip `on*`\u002F`@*` attributes,\n  and strip **all** `href`\u002F`xlink:href` (static diagrams gain nothing from\n  links; a hostile href can navigate the GUI). Defense in depth, not\n  defense instead.\n\n## 6. Interaction ownership under a modal\n\nA fullscreen zoom\u002Fpan modal over the plugin's panels must own ALL wheel\nevents while open — including Ctrl+wheel, if the underlying pane already\nbinds Ctrl+wheel (font sizing). Guard the pane-level handler with a modal\npresence check; otherwise both behaviors fire on one gesture. Modal zoom:\nwheel anchored at the cursor, drag to pan, keyboard shortcuts, Esc\u002Foverlay\nclick to close.\n\n## 7. Ship it\n\n- Commit the built chunk to the package (the plugin ships `lib\u002F`); declare it\n  in `files` so published payloads stay closed.\n- Document the restart requirement (host route) vs refresh-only (client) in\n  the release notes — users hit 404s otherwise.\n- A regression test per pitfall: the fallback path (chunk import fails →\n  original rendering), the sanitizer (strips the hostile channels), and — for\n  the host route — a containment test that a case-differing but contained path\n  is served, not refused.\n","# Add Heavy Dependencies to a Lightweight DSH Web Plugin\n\nA lightweight Web plugin (small client bundle, no build farm) can still ship a\nmulti-megabyte renderer — if the heavy code never loads until it is needed and\ndegrades gracefully when it cannot load. This skill is the integration\nchecklist; every item below was earned from a real mermaid integration.\n\n## 1. Decide lazy vs inline\n\nIf the dependency would multiply the client bundle several-fold and only one\nfeature needs it (a fence renderer, an editor opened on demand), do NOT inline\nit into the client bundle. Split it into a **separate chunk file** the client\nimports dynamically only when the feature actually renders.\n\n## 2. Bundle the chunk as ONE file\n\nBundle the dependency into a **single self-contained ESM file** with\ncode-splitting disabled. A general-purpose bundler left on default settings\nsplits the library's internal dynamic imports into sibling chunk files with\ncontent-hashed names — the browser then resolves them as relative imports\nagainst the chunk's URL, and every sibling must also be served, named exactly,\nand MIME-correct. One file, one import, no relative-resolution class of bugs.\n\n## 3. Serve it from a host route scoped to your own lib\n\nRegister a **prefix route** on `webServer` that serves files from the plugin's\nown lib directory only:\n\n- Resolve the lib directory from the host bundle itself (`import.meta.url`),\n  never from `process.cwd()`.\n- Restrict to a whitelist of extensions (your chunk is `.js`\u002F`.mjs` — nothing\n  else should ever be served).\n- Containment guard: verify the requested path stays inside the lib dir. Two\n  hard-won rules:\n  - **Compare with `path.relative`, not `startsWith`**: a prefix compare is\n    wrong the moment the filesystem normalizes differently than your base\n    string.\n  - **Windows drive letters change case**: `realpathSync` may return `e:\\…`\n    where your base says `E:\\…`; a case-sensitive compare then misjudges a\n    perfectly contained path as an escape and answers **403**. `path.relative`\n    (plus an `isAbsolute` check on the result for cross-drive) is robust.\n- Serve with a JavaScript MIME (`application\u002Fjavascript`) — a wrong MIME makes\n  the browser reject the dynamic import.\n\nRemember: the host route only exists after a **dsh restart**; a hard refresh\nalone does not register new host code. A 404 on a freshly added route almost\nalways means \"not restarted yet\" or \"the installed copy predates the route\".\n\n## 4. Import lazily, cache verdicts, fall back\n\n- `import()` the chunk URL on first render of the feature; **cache the\n  successful module** so repeated fences do not re-import.\n- **Do not cache failures** the same way — or a transient failure sticks for\n  the page lifetime; let the next attempt retry, but throttle (a failing\n  import in a loop is its own console spam).\n- Always render a **fallback** (e.g. the original code block) when the import\n  or the render throws; reading must never break because a diagram could not\n  load. Tag the fallback with a state attribute and log the failure reason to\n  the console — \"it fell back\" without a reason is undebuggable.\n\n## 5. Untrusted markup: sanitize before innerHTML\n\nA renderer fed untrusted text (markdown, model output) emits markup you must\ntreat as hostile before `dangerouslySetInnerHTML`:\n\n- Configure the renderer to its strict mode and to emit **real SVG text**\n  rather than HTML labels (HTML labels ride inside `\u003CforeignObject>` — the\n  one channel that carries raw HTML inside an SVG).\n- Suppress the library's global error side effects (some renderers dump a\n  giant error SVG into `document.body` before rejecting).\n- Then **re-sanitize the emitted SVG yourself** with a zero-dependency\n  whitelist pass: parse as XML (`image\u002Fsvg+xml`; a parse failure rejects the\n  whole string), accept only an `\u003Csvg>` root, strip `foreignObject`\u002F`script`\n  and foreign-HTML elements case-insensitively, strip `on*`\u002F`@*` attributes,\n  and strip **all** `href`\u002F`xlink:href` (static diagrams gain nothing from\n  links; a hostile href can navigate the GUI). Defense in depth, not\n  defense instead.\n\n## 6. Interaction ownership under a modal\n\nA fullscreen zoom\u002Fpan modal over the plugin's panels must own ALL wheel\nevents while open — including Ctrl+wheel, if the underlying pane already\nbinds Ctrl+wheel (font sizing). Guard the pane-level handler with a modal\npresence check; otherwise both behaviors fire on one gesture. Modal zoom:\nwheel anchored at the cursor, drag to pan, keyboard shortcuts, Esc\u002Foverlay\nclick to close.\n\n## 7. Ship it\n\n- Commit the built chunk to the package (the plugin ships `lib\u002F`); declare it\n  in `files` so published payloads stay closed.\n- Document the restart requirement (host route) vs refresh-only (client) in\n  the release notes — users hit 404s otherwise.\n- A regression test per pitfall: the fallback path (chunk import fails →\n  original rendering), the sanitizer (strips the hostile channels), and — for\n  the host route — a containment test that a case-differing but contained path\n  is served, not refused.\n",{"name":5,"description":7},"main","d69096e239f2a89aabc2cd078c47664a9d3b1e11","06-前端与设计\u002Fplugin-heavy-dep",3,"https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts","https:\u002F\u002Fgithub.com\u002Flza6","个人vx：Tf00798\r\n个人✈：@TFGY999","2026-10-08 14:29:22",{"source":8,"skillName":5,"commands":33,"prompt":43,"zipAvailable":44},[34,37,40],{"tool":35,"command":36},"npx","npx skills add lza6\u002FArmor-piercing-system-prompts --skill plugin-heavy-dep",{"tool":38,"command":39},"bunx","bunx skills add lza6\u002FArmor-piercing-system-prompts --skill plugin-heavy-dep",{"tool":41,"command":42},"pnpm","pnpm dlx skills add lza6\u002FArmor-piercing-system-prompts --skill plugin-heavy-dep","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F06-前端与设计\u002Fplugin-heavy-dep\u002FSKILL.md",true,[46],{"path":47,"resourceType":48,"resourceTypeDesc":49,"sizeBytes":50,"sourceHtmlUrl":51},"README.md","REFERENCE","参考文档",817,"https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F06-前端与设计\u002Fplugin-heavy-dep\u002FREADME.md",[53,60,65,72,79,86],{"skillNo":54,"name":55,"nameZh":6,"description":56,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":57,"categories":58,"keywords":59,"publishedAt":19},"01M7FFG485KY83TD6HSC4YPCMC","obsidian-clipper-template-creator","Guide for creating templates for the Obsidian Web Clipper. Use when you want to create a new clipping template, understand available variables, or format clipped content.","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F07-后端与架构\u002Fobsidian-clipper-template-creator\u002FSKILL.md",[],[],{"skillNo":61,"name":55,"nameZh":6,"description":56,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":62,"categories":63,"keywords":64,"publishedAt":19},"01M7FFG0T6AZ0STEJPSB3CX84K","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F07-后端与架构\u002Fobsidian-clipper-template-creator-antigravity-awesome-skills-main\u002FSKILL.md",[],[],{"skillNo":66,"name":67,"nameZh":6,"description":68,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":69,"categories":70,"keywords":71,"publishedAt":19},"01M7FFFY0QEM14SKWPDYGMXM2P","python-api","Programmatic Object-Detection-Metrics API guidance for BoundingBox, BoundingBoxes, Evaluator, enums, coordinate conversion, AP\u002FmAP semantics, and source-style import diagnostics.","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F07-后端与架构\u002Fobject-detection-metrics\u002Fsub-skills\u002Fpython-api\u002FSKILL.md",[],[],{"skillNo":73,"name":74,"nameZh":6,"description":75,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":76,"categories":77,"keywords":78,"publishedAt":19},"01M7FFFVZQZ2GJ0C0TGP7JHD20","file-evaluation","Folder-based PASCAL VOC AP\u002FmAP evaluation from ground-truth and detection text files.","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F07-后端与架构\u002Fobject-detection-metrics\u002Fsub-skills\u002Ffile-evaluation\u002FSKILL.md",[],[],{"skillNo":80,"name":81,"nameZh":6,"description":82,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":83,"categories":84,"keywords":85,"publishedAt":19},"01M7FFFSFNYSE77SJ6PE1CK2DA","object-detection-metrics","Guides legacy Object-Detection-Metrics PASCAL VOC AP\u002FmAP evaluation from detection text folders and direct Python API classes.","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F07-后端与架构\u002Fobject-detection-metrics\u002FSKILL.md",[],[],{"skillNo":87,"name":88,"nameZh":6,"description":89,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":90,"categories":91,"keywords":92,"publishedAt":19},"01M7FFFP0GCK1RVXBCPQ8APBMT","nx-workspace-patterns","Configure and optimize Nx monorepo workspaces. Use when setting up Nx, configuring project boundaries, optimizing build caching, or implementing affected commands.","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F07-后端与架构\u002Fnx-workspace-patterns\u002FSKILL.md",[],[]]