diffusers: Skill for Claude Code

.ai/skills/custom-blocks/SKILL.md

custom-blocks is a skill for Claude Code from huggingface/diffusers. It costs 79 tokens per session (1,676 once invoked), scanned A, original, Apache-2.0.

A packaging tool for turning a local modular pipeline block, a reusable piece of pipeline logic, into a directory that can be uploaded to the Hugging Face Hub.

In plain words
What is it for?
Publishing an already-written Python pipeline block or creating the on-disk structure for a modular pipeline repository.
Why use it?
It prepares the required files and layout so other users can load the block from the Hub.

Skill for Claude Code ✓ vendor

Written for Claude Code: shipped in a Claude Code plugin.

This is huggingface/diffusers's own configuration. It tells Claude Code how to work on diffusers itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything diffusers configures →

Part of the diffusers plugin — 4 skills shipped together

About the project

Diffusers is a PyTorch library for running and building diffusion systems that generate images, audio, and 3D molecular structures. Developers use its pretrained models, generation pipelines, and interchangeable noise schedulers for inference or model training. The catalogue add-ons support workflows around the library.

huggingface/diffusers · 34,987 stars · on GitHub · huggingface.co

Reuse

Borrowing it

Nothing to install: this file belongs to huggingface/diffusers. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/huggingface/diffusers/main/.ai/skills/custom-blocks/SKILL.md
Clone the repo
git clone --depth 1 https://github.com/huggingface/diffusers

Made for: Claude Code.

Or install diffusers, the plugin that ships this one along with the rest of its 4 skills.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for custom-blocks

README.md
[![agentmods](https://agentmods.dev/badge/skills/huggingface/diffusers/custom-blocks/github.svg)](https://agentmods.dev/skills/huggingface/diffusers/custom-blocks)
Your own site
<a href="https://agentmods.dev/skills/huggingface/diffusers/custom-blocks"><img src="https://agentmods.dev/badge/skills/huggingface/diffusers/custom-blocks/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for custom-blocks

Your own site · 80×15
<a href="https://agentmods.dev/skills/huggingface/diffusers/custom-blocks"><img src="https://agentmods.dev/badge/skills/huggingface/diffusers/custom-blocks.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 79 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,676 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • Snyk pass 7 Sept 2026
  • NVIDIA SkillSpector warn 7 Sept 2026
SkillSpector: 1 finding, up to medium

These are SkillSpector’s own severities. On a checked sample its high-severity flags on skills were ~96% false positives — a documented command, a public API, a “never do X” rule — so we show them as a caution to read, not a verdict. Why →

  • medium Agent Snooping · line 152
    Skill enumerates or reads other installed skills. Access to other skills' SKILL.md files or the skills directory reveals prompt instructions, capabilities, and secrets that should be invisible to peer skills.
    Fix: Remove all code or instructions that list or read other skills' files or directories. Skills should operate independently; cross-skill access is a privilege escalation.
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00079 $0.01676
Opus 5.5 $0.00032 $0.00670
Sonnet 5.5 $0.00016 $0.00335
Haiku 4.5 $0.00008 $0.00168

Measured 1mo ago against content hash d71b5ddde113, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

custom-blocks scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.ai/skills/custom-blocks/SKILL.md · 161 lines

How it starts

The opening of the file, as written. The whole thing — 161 lines — stays where its author put it; the contents beside it link to each section on GitHub.

What this skill is for

A ModularPipelineBlocks subclass is a unit of pipeline logic — input/output spec plus a __call__ — that slots into diffusers' modular pipeline composition. Once you have one defined locally, you almost always want to publish it as a small Hub repo so others can from_pretrained it. diffusers-cli custom_blocks automates the packaging step: it parses your Python file, instantiates the chosen block class, and writes a save_pretrained-style directory in your cwd that's ready to push to the Hub.

Use this skill when:

  • The user is writing a custom modular block and asks "how do I publish this?" or "package this for the Hub".
  • The user has a block.py (or similar) file with one or more ModularPipelineBlocks subclasses.
  • You're scaffolding a new modular pipeline repo and need the on-disk layout that ModularPipelineBlocks.from_pretrained expects.

Don't use this skill for: running an existing modular pipeline (diffusers-cli run), introspecting one (diffusers-cli schema), or writing the block class itself — this skill packages an already-written block.

The end-to-end workflow

[you: write block.py] → diffusers-cli custom_blocks → [packaged dir in cwd]
                                                            ↓
                                            hf upload <repo> .
                                                            ↓
                                consumers: ModularPipeline.from_pretrained(<repo>, trust_remote_code=True)
                                           diffusers-cli schema --model <repo> --trust-remote-code
                                           diffusers-cli run --model <repo> --trust-remote-code ...

The skill covers the middle box. The bookends (writing the block and uploading) are out of scope.

Command surface

diffusers-cli custom_blocks [--block_module_name <file.py>] [--block_class_name <ClassName>]

Flags

  • --block_module_name <file> — Python file containing the block class. Defaults to block.py in the cwd.
  • --block_class_name <name> — Which class in the file to package. Optional: if omitted, the CLI parses the file with ast, finds every class that inherits from ModularPipelineBlocks, and uses the first one (with an info log naming the others). Specify explicitly when the file defines more than one block and you want a specific one.

Read the full file on GitHub · 161 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 1mo ago Changed · +1 lines d71b5ddde113
  2. 3mo ago First seen · 160 lines · 79 tokens per session scan A becb119c4b27

Subscribe to this mod's changes

custom-blocks is a skill published in the GitHub repository huggingface/diffusers (34,987 stars, last pushed yesterday), licensed Apache-2.0. It adds 79 tokens to every session and 1,676 once invoked, about $0.0003 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

custom-blocks compared with skills from other repositories

custom-blocks next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
custom-blockshuggingface/diffusersSkill35kyesterdayApache-2.0A79Claude Code
physicsnemo-shard-tensorNVIDIA/physicsnemoSkill3.5k2d agoApache-2.0A152Claude Code, Codex
physicsnemo-discoverNVIDIA/physicsnemoSkill3.5k2d agoApache-2.0A124Claude Code, Codex
ml-training-recipesOrchestra-Research/AI-Research-SKILLsSkill15k1mo agoMITA88Claude Code
deep-learningericrisco/rsc-harnessSkill6825d agoMITA102Claude Code, Codex
single-cell-multi-omics-analysis-scviPharMolix/OpenBioMedSkill1.1k4mo agoMITA94Claude Code, Codex
graphsignal-profilergraphsignal/graphsignal-profilerSkill2454mo agoApache-2.0A74Claude Code, Codex