Buckets:

download
raw
62.1 kB
<meta charset="utf-8" /><meta name="hf:doc:metadata" content="{&quot;title&quot;:&quot;The SKILL.md Format&quot;,&quot;local&quot;:&quot;the-skillmd-format&quot;,&quot;sections&quot;:[{&quot;title&quot;:&quot;Directory Structure&quot;,&quot;local&quot;:&quot;directory-structure&quot;,&quot;sections&quot;:[],&quot;depth&quot;:2},{&quot;title&quot;:&quot;Frontmatter Fields&quot;,&quot;local&quot;:&quot;frontmatter-fields&quot;,&quot;sections&quot;:[{&quot;title&quot;:&quot;Required Fields&quot;,&quot;local&quot;:&quot;required-fields&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3},{&quot;title&quot;:&quot;Optional Fields&quot;,&quot;local&quot;:&quot;optional-fields&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3}],&quot;depth&quot;:2},{&quot;title&quot;:&quot;Body Content&quot;,&quot;local&quot;:&quot;body-content&quot;,&quot;sections&quot;:[{&quot;title&quot;:&quot;Content Guidelines&quot;,&quot;local&quot;:&quot;content-guidelines&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3}],&quot;depth&quot;:2},{&quot;title&quot;:&quot;File References in Skills&quot;,&quot;local&quot;:&quot;file-references-in-skills&quot;,&quot;sections&quot;:[],&quot;depth&quot;:2},{&quot;title&quot;:&quot;Helper Scripts Structure&quot;,&quot;local&quot;:&quot;helper-scripts-structure&quot;,&quot;sections&quot;:[],&quot;depth&quot;:2},{&quot;title&quot;:&quot;References Directory&quot;,&quot;local&quot;:&quot;references-directory&quot;,&quot;sections&quot;:[],&quot;depth&quot;:2},{&quot;title&quot;:&quot;Assets Directory&quot;,&quot;local&quot;:&quot;assets-directory&quot;,&quot;sections&quot;:[{&quot;title&quot;:&quot;Frontmatter Metadata&quot;,&quot;local&quot;:&quot;frontmatter-metadata&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3}],&quot;depth&quot;:2},{&quot;title&quot;:&quot;Next Steps&quot;,&quot;local&quot;:&quot;next-steps&quot;,&quot;sections&quot;:[],&quot;depth&quot;:2}],&quot;depth&quot;:1}">
<link href="/docs/context-course/pr_7/en/_app/immutable/assets/0.e3b0c442.css" rel="modulepreload">
<link rel="modulepreload" href="/docs/context-course/pr_7/en/_app/immutable/entry/start.55c3acaa.js">
<link rel="modulepreload" href="/docs/context-course/pr_7/en/_app/immutable/chunks/scheduler.4048030c.js">
<link rel="modulepreload" href="/docs/context-course/pr_7/en/_app/immutable/chunks/singletons.42509544.js">
<link rel="modulepreload" href="/docs/context-course/pr_7/en/_app/immutable/chunks/index.dd3f5310.js">
<link rel="modulepreload" href="/docs/context-course/pr_7/en/_app/immutable/chunks/paths.f6762227.js">
<link rel="modulepreload" href="/docs/context-course/pr_7/en/_app/immutable/entry/app.10ec5479.js">
<link rel="modulepreload" href="/docs/context-course/pr_7/en/_app/immutable/chunks/preload-helper.665302cf.js">
<link rel="modulepreload" href="/docs/context-course/pr_7/en/_app/immutable/chunks/index.5d0b9360.js">
<link rel="modulepreload" href="/docs/context-course/pr_7/en/_app/immutable/nodes/0.b63aa764.js">
<link rel="modulepreload" href="/docs/context-course/pr_7/en/_app/immutable/chunks/each.e59479a4.js">
<link rel="modulepreload" href="/docs/context-course/pr_7/en/_app/immutable/nodes/7.85e741bc.js">
<link rel="modulepreload" href="/docs/context-course/pr_7/en/_app/immutable/chunks/MermaidChart.svelte_svelte_type_style_lang.99c2e6c8.js">
<link rel="modulepreload" href="/docs/context-course/pr_7/en/_app/immutable/chunks/CodeBlock.ff2a3276.js"><!-- HEAD_svelte-u9bgzb_START --><meta name="hf:doc:metadata" content="{&quot;title&quot;:&quot;The SKILL.md Format&quot;,&quot;local&quot;:&quot;the-skillmd-format&quot;,&quot;sections&quot;:[{&quot;title&quot;:&quot;Directory Structure&quot;,&quot;local&quot;:&quot;directory-structure&quot;,&quot;sections&quot;:[],&quot;depth&quot;:2},{&quot;title&quot;:&quot;Frontmatter Fields&quot;,&quot;local&quot;:&quot;frontmatter-fields&quot;,&quot;sections&quot;:[{&quot;title&quot;:&quot;Required Fields&quot;,&quot;local&quot;:&quot;required-fields&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3},{&quot;title&quot;:&quot;Optional Fields&quot;,&quot;local&quot;:&quot;optional-fields&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3}],&quot;depth&quot;:2},{&quot;title&quot;:&quot;Body Content&quot;,&quot;local&quot;:&quot;body-content&quot;,&quot;sections&quot;:[{&quot;title&quot;:&quot;Content Guidelines&quot;,&quot;local&quot;:&quot;content-guidelines&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3}],&quot;depth&quot;:2},{&quot;title&quot;:&quot;File References in Skills&quot;,&quot;local&quot;:&quot;file-references-in-skills&quot;,&quot;sections&quot;:[],&quot;depth&quot;:2},{&quot;title&quot;:&quot;Helper Scripts Structure&quot;,&quot;local&quot;:&quot;helper-scripts-structure&quot;,&quot;sections&quot;:[],&quot;depth&quot;:2},{&quot;title&quot;:&quot;References Directory&quot;,&quot;local&quot;:&quot;references-directory&quot;,&quot;sections&quot;:[],&quot;depth&quot;:2},{&quot;title&quot;:&quot;Assets Directory&quot;,&quot;local&quot;:&quot;assets-directory&quot;,&quot;sections&quot;:[{&quot;title&quot;:&quot;Frontmatter Metadata&quot;,&quot;local&quot;:&quot;frontmatter-metadata&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3}],&quot;depth&quot;:2},{&quot;title&quot;:&quot;Next Steps&quot;,&quot;local&quot;:&quot;next-steps&quot;,&quot;sections&quot;:[],&quot;depth&quot;:2}],&quot;depth&quot;:1}"><!-- HEAD_svelte-u9bgzb_END --> <p></p> <div class="items-center shrink-0 min-w-[100px] max-sm:min-w-[50px] justify-end ml-auto flex" style="float: right; margin-left: 10px; display: inline-flex; position: relative; z-index: 10;"><div class="inline-flex rounded-md max-sm:rounded-sm"><button class="inline-flex items-center gap-1 h-7 max-sm:h-7 px-2 max-sm:px-1.5 text-sm font-medium text-gray-800 border border-r-0 rounded-l-md max-sm:rounded-l-sm border-gray-200 bg-white hover:shadow-inner dark:border-gray-850 dark:bg-gray-950 dark:text-gray-200 dark:hover:bg-gray-800" aria-live="polite"><span class="inline-flex items-center justify-center rounded-md p-0.5 max-sm:p-0 hover:text-gray-800 dark:hover:text-gray-200"><svg class="sm:size-3.5 size-3" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" fill="currentColor" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path d="M28,10V28H10V10H28m0-2H10a2,2,0,0,0-2,2V28a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V10a2,2,0,0,0-2-2Z" transform="translate(0)"></path><path d="M4,18H2V4A2,2,0,0,1,4,2H18V4H4Z" transform="translate(0)"></path><rect fill="none" width="32" height="32"></rect></svg></span> <span>Copy page</span></button> <button class="inline-flex items-center justify-center w-6 max-sm:w-5 h-7 max-sm:h-7 disabled:pointer-events-none text-sm text-gray-500 hover:text-gray-700 dark:hover:text-white rounded-r-md max-sm:rounded-r-sm border border-l transition border-gray-200 bg-white hover:shadow-inner dark:border-gray-850 dark:bg-gray-950 dark:text-gray-200 dark:hover:bg-gray-800" aria-haspopup="menu" aria-expanded="false" aria-label="Open copy menu"><svg class="transition-transform text-gray-400 overflow-visible sm:size-3.5 size-3 rotate-0" width="1em" height="1em" viewBox="0 0 12 7" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M1 1L6 6L11 1" stroke="currentColor"></path></svg></button></div> </div> <h1 class="relative group"><a id="the-skillmd-format" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#the-skillmd-format"><span><svg class="" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg></span></a> <span>The SKILL.md Format</span></h1> <p data-svelte-h="svelte-1q0aph7">The Agent Skills Specification describes skills as a <code>SKILL.md</code> file with YAML frontmatter and Markdown instructions, optionally accompanied by <code>scripts/</code>, <code>references/</code>, and <code>assets/</code> directories. This lesson walks through each piece and how to write them well.</p> <iframe src="https://context-course-skill-anatomy.static.hf.space" frameborder="0" width="850" height="450"></iframe> <h2 class="relative group"><a id="directory-structure" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#directory-structure"><span><svg class="" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg></span></a> <span>Directory Structure</span></h2> <p data-svelte-h="svelte-vkg911">Skills follow a consistent directory structure defined by the Agent Skills Specification:</p> <div class="code-block relative "><div class="absolute top-2.5 right-4"><button class="inline-flex items-center relative text-sm focus:text-green-500 cursor-pointer focus:outline-none transition duration-200 ease-in-out opacity-0 mx-0.5 text-gray-600 " title="code excerpt" type="button"><svg class="" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" fill="currentColor" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path d="M28,10V28H10V10H28m0-2H10a2,2,0,0,0-2,2V28a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V10a2,2,0,0,0-2-2Z" transform="translate(0)"></path><path d="M4,18H2V4A2,2,0,0,1,4,2H18V4H4Z" transform="translate(0)"></path><rect fill="none" width="32" height="32"></rect></svg> <div class="absolute pointer-events-none transition-opacity bg-black text-white py-1 px-2 leading-tight rounded font-normal shadow left-1/2 top-full transform -translate-x-1/2 translate-y-2 opacity-0"><div class="absolute bottom-full left-1/2 transform -translate-x-1/2 w-0 h-0 border-black border-4 border-t-0" style="border-left-color: transparent; border-right-color: transparent; "></div> Copied</div></button></div> <pre class=""><!-- HTML_TAG_START -->skill-<span class="hljs-built_in">name</span>/
├── SKILL.md <span class="hljs-comment"># Required: metadata + instructions</span>
├── scripts/ <span class="hljs-comment"># Optional: executable code</span>
│ ├── validate.py
│ ├── deploy.sh
│ └── README.md
├── references/ <span class="hljs-comment"># Optional: documentation links</span>
│ ├── api-<span class="hljs-keyword">reference</span>.md
│ └── examples.md
└── assets/ <span class="hljs-comment"># Optional: templates, data</span>
├── template.yaml
└── config-example.json<!-- HTML_TAG_END --></pre></div> <p data-svelte-h="svelte-1sb7zhg"><strong>Rules:</strong></p> <ul data-svelte-h="svelte-mpuxdz"><li>Directory name must be lowercase with hyphens (skill-name, not SkillName)</li> <li>Consecutive hyphens are NOT allowed (my—skill is invalid)</li> <li>SKILL.md is required and must be in the root</li> <li>Optional directories: scripts/, references/, assets/</li> <li>All relative file paths are resolved from the skill root</li></ul> <h2 class="relative group"><a id="frontmatter-fields" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#frontmatter-fields"><span><svg class="" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg></span></a> <span>Frontmatter Fields</span></h2> <p data-svelte-h="svelte-16i5b65">Every SKILL.md starts with YAML frontmatter that describes the skill. Here’s the complete specification:</p> <div class="code-block relative "><div class="absolute top-2.5 right-4"><button class="inline-flex items-center relative text-sm focus:text-green-500 cursor-pointer focus:outline-none transition duration-200 ease-in-out opacity-0 mx-0.5 text-gray-600 " title="code excerpt" type="button"><svg class="" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" fill="currentColor" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path d="M28,10V28H10V10H28m0-2H10a2,2,0,0,0-2,2V28a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V10a2,2,0,0,0-2-2Z" transform="translate(0)"></path><path d="M4,18H2V4A2,2,0,0,1,4,2H18V4H4Z" transform="translate(0)"></path><rect fill="none" width="32" height="32"></rect></svg> <div class="absolute pointer-events-none transition-opacity bg-black text-white py-1 px-2 leading-tight rounded font-normal shadow left-1/2 top-full transform -translate-x-1/2 translate-y-2 opacity-0"><div class="absolute bottom-full left-1/2 transform -translate-x-1/2 w-0 h-0 border-black border-4 border-t-0" style="border-left-color: transparent; border-right-color: transparent; "></div> Copied</div></button></div> <pre class=""><!-- HTML_TAG_START --><span class="hljs-meta">---</span>
<span class="hljs-attr">name:</span> <span class="hljs-string">&quot;dataset-publishing&quot;</span>
<span class="hljs-attr">description:</span> <span class="hljs-string">&quot;Publish datasets to Hugging Face Hub. Use when uploading datasets, creating dataset cards, or managing dataset versions.&quot;</span>
<span class="hljs-attr">license:</span> <span class="hljs-string">&quot;Apache-2.0&quot;</span>
<span class="hljs-attr">compatibility:</span> <span class="hljs-string">&quot;Tested with Python 3.8+ and huggingface_hub 0.16+&quot;</span>
<span class="hljs-attr">metadata:</span>
<span class="hljs-attr">author:</span> <span class="hljs-string">&quot;ml-team&quot;</span>
<span class="hljs-attr">version:</span> <span class="hljs-string">&quot;1.0.0&quot;</span>
<span class="hljs-attr">allowed-tools:</span> <span class="hljs-string">&quot;Bash(hf:*) Python(huggingface_hub:*)&quot;</span>
<span class="hljs-meta">---</span><!-- HTML_TAG_END --></pre></div> <h3 class="relative group"><a id="required-fields" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#required-fields"><span><svg class="" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg></span></a> <span>Required Fields</span></h3> <p data-svelte-h="svelte-16m9n09"><strong><code>name</code></strong> (string)</p> <ul data-svelte-h="svelte-ko8vmz"><li>Human-readable identifier for the skill</li> <li>Constraints: lowercase letters, digits, and hyphens; 1-64 characters; no consecutive hyphens</li> <li>Must match the directory name exactly</li> <li>Examples: <code>&quot;text-classification&quot;</code>, <code>&quot;model-evaluation&quot;</code>, <code>&quot;dataset-publishing&quot;</code></li></ul> <p data-svelte-h="svelte-nvp2xu"><strong><code>description</code></strong> (string)</p> <ul data-svelte-h="svelte-1peig8v"><li>Concise description of what the skill does</li> <li>Constraints: max 1024 characters</li> <li>Should include: what task the skill accomplishes, when to use it</li> <li>Format: Start with verb (e.g., “Publish datasets…”, “Train models…“)</li></ul> <h3 class="relative group"><a id="optional-fields" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#optional-fields"><span><svg class="" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg></span></a> <span>Optional Fields</span></h3> <p data-svelte-h="svelte-8vqh33"><strong><code>license</code></strong> (string)</p> <ul data-svelte-h="svelte-1laq7ll"><li>Software license for the skill</li> <li>Common values: “MIT”, “Apache-2.0”, “CC-BY-4.0”, “GPL-3.0”</li> <li>Indicates how others can use and modify the skill</li></ul> <p data-svelte-h="svelte-1kusrb8"><strong><code>compatibility</code></strong> (string)</p> <ul data-svelte-h="svelte-1scupfo"><li>Environment requirements and tested configurations</li> <li>Constraints: max 500 characters</li> <li>Examples:
<ul><li>“Tested with Python 3.8+ and huggingface_hub 0.16+”</li> <li>“Requires PyTorch 2.0+, transformers 4.30+, and CUDA 11.8”</li> <li>“Works with Claude Code, Codex, and open source agents”</li></ul></li></ul> <p data-svelte-h="svelte-ak4l25"><strong><code>metadata</code></strong> (object)</p> <ul data-svelte-h="svelte-1msfm15"><li>Arbitrary key-value pairs for custom data</li> <li>Common keys: <code>author</code>, <code>version</code>, <code>created</code>, <code>updated</code>, <code>maintainer</code>, <code>contact</code></li></ul> <p data-svelte-h="svelte-1gkqha7">For example:</p> <div class="code-block relative "><div class="absolute top-2.5 right-4"><button class="inline-flex items-center relative text-sm focus:text-green-500 cursor-pointer focus:outline-none transition duration-200 ease-in-out opacity-0 mx-0.5 text-gray-600 " title="code excerpt" type="button"><svg class="" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" fill="currentColor" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path d="M28,10V28H10V10H28m0-2H10a2,2,0,0,0-2,2V28a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V10a2,2,0,0,0-2-2Z" transform="translate(0)"></path><path d="M4,18H2V4A2,2,0,0,1,4,2H18V4H4Z" transform="translate(0)"></path><rect fill="none" width="32" height="32"></rect></svg> <div class="absolute pointer-events-none transition-opacity bg-black text-white py-1 px-2 leading-tight rounded font-normal shadow left-1/2 top-full transform -translate-x-1/2 translate-y-2 opacity-0"><div class="absolute bottom-full left-1/2 transform -translate-x-1/2 w-0 h-0 border-black border-4 border-t-0" style="border-left-color: transparent; border-right-color: transparent; "></div> Copied</div></button></div> <pre class=""><!-- HTML_TAG_START --><span class="hljs-attr">metadata:</span>
<span class="hljs-attr">author:</span> <span class="hljs-string">&quot;john-doe&quot;</span>
<span class="hljs-attr">version:</span> <span class="hljs-string">&quot;1.2.0&quot;</span>
<span class="hljs-attr">created:</span> <span class="hljs-string">&quot;2024-01-15&quot;</span>
<span class="hljs-attr">updated:</span> <span class="hljs-string">&quot;2026-04-13&quot;</span>
<span class="hljs-attr">maintainer:</span> <span class="hljs-string">&quot;john-doe&quot;</span><!-- HTML_TAG_END --></pre></div> <p data-svelte-h="svelte-1p8uk8c"><strong><code>allowed-tools</code></strong> (string, experimental)</p> <ul data-svelte-h="svelte-k8saaj"><li>Glob patterns specifying which tools the skill uses</li> <li>Used by agents to restrict skill execution to specific tools</li> <li>Format: <code>ToolName(pattern:*)</code> separated by spaces</li> <li>Examples: <code>&quot;Bash(git:*) Bash(jq:*) Read&quot;</code> or <code>&quot;Bash(hf:*) Python(huggingface_hub:*)&quot;</code></li> <li>Currently experimental; not all agents support this field</li></ul> <h2 class="relative group"><a id="body-content" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#body-content"><span><svg class="" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg></span></a> <span>Body Content</span></h2> <p data-svelte-h="svelte-xasfzp">After frontmatter, the skill should contain detailed instructions organized in Markdown:</p> <div class="code-block relative "><div class="absolute top-2.5 right-4"><button class="inline-flex items-center relative text-sm focus:text-green-500 cursor-pointer focus:outline-none transition duration-200 ease-in-out opacity-0 mx-0.5 text-gray-600 " title="code excerpt" type="button"><svg class="" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" fill="currentColor" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path d="M28,10V28H10V10H28m0-2H10a2,2,0,0,0-2,2V28a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V10a2,2,0,0,0-2-2Z" transform="translate(0)"></path><path d="M4,18H2V4A2,2,0,0,1,4,2H18V4H4Z" transform="translate(0)"></path><rect fill="none" width="32" height="32"></rect></svg> <div class="absolute pointer-events-none transition-opacity bg-black text-white py-1 px-2 leading-tight rounded font-normal shadow left-1/2 top-full transform -translate-x-1/2 translate-y-2 opacity-0"><div class="absolute bottom-full left-1/2 transform -translate-x-1/2 w-0 h-0 border-black border-4 border-t-0" style="border-left-color: transparent; border-right-color: transparent; "></div> Copied</div></button></div> <pre class=""><!-- HTML_TAG_START --><span class="hljs-section"># Dataset Publishing Skill</span>
<span class="hljs-section">## Overview</span>
Brief description of what the skill teaches and typical use cases.
<span class="hljs-section">## Prerequisites Checklist</span>
<span class="hljs-bullet">-</span> [ ] Python 3.8 or higher installed
<span class="hljs-bullet">-</span> [ ] huggingface<span class="hljs-emphasis">_hub package installed
- [ ] Valid Hugging Face account
- [ ] HF_</span>TOKEN environment variable set
<span class="hljs-section">## Step-by-Step Guide</span>
<span class="hljs-section">### 1. Authentication</span>
...<!-- HTML_TAG_END --></pre></div> <h3 class="relative group"><a id="content-guidelines" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#content-guidelines"><span><svg class="" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg></span></a> <span>Content Guidelines</span></h3> <p data-svelte-h="svelte-1aitlbd">Keep your SKILL.md focused: aim for 400–800 lines maximum, move detailed reference material to the <code>references/</code> directory, move code examples to <code>scripts/</code>, and use internal links to reference other files like <code>[validation script](scripts/validate.py)</code>.</p> <p data-svelte-h="svelte-13ycbac">Write for clarity by using <code>## Section</code> and <code>### Subsection</code> formatting, including copy-paste-ready code examples in fenced code blocks, numbering steps for procedures, and using checklists for prerequisites. Reference external resources with links to documentation, API guides, and example code.</p> <h2 class="relative group"><a id="file-references-in-skills" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#file-references-in-skills"><span><svg class="" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg></span></a> <span>File References in Skills</span></h2> <p data-svelte-h="svelte-p8lcmf">When referencing helper scripts and assets, use relative paths from the skill root:</p> <p data-svelte-h="svelte-1owsgji"><strong>In SKILL.md:</strong></p> <div class="code-block relative "><div class="absolute top-2.5 right-4"><button class="inline-flex items-center relative text-sm focus:text-green-500 cursor-pointer focus:outline-none transition duration-200 ease-in-out opacity-0 mx-0.5 text-gray-600 " title="code excerpt" type="button"><svg class="" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" fill="currentColor" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path d="M28,10V28H10V10H28m0-2H10a2,2,0,0,0-2,2V28a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V10a2,2,0,0,0-2-2Z" transform="translate(0)"></path><path d="M4,18H2V4A2,2,0,0,1,4,2H18V4H4Z" transform="translate(0)"></path><rect fill="none" width="32" height="32"></rect></svg> <div class="absolute pointer-events-none transition-opacity bg-black text-white py-1 px-2 leading-tight rounded font-normal shadow left-1/2 top-full transform -translate-x-1/2 translate-y-2 opacity-0"><div class="absolute bottom-full left-1/2 transform -translate-x-1/2 w-0 h-0 border-black border-4 border-t-0" style="border-left-color: transparent; border-right-color: transparent; "></div> Copied</div></button></div> <pre class=""><!-- HTML_TAG_START --><span class="hljs-section">## Validation</span>
Run the validation script:
<span class="hljs-code">```bash
python scripts/validate_dataset.py data/my_dataset.csv
```</span>
Generate model card:
<span class="hljs-code">```bash
python scripts/create_model_card.py --name &quot;My Model&quot; --metrics metrics.json</span><!-- HTML_TAG_END --></pre></div> <h2 class="relative group"><a id="helper-scripts-structure" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#helper-scripts-structure"><span><svg class="" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg></span></a> <span>Helper Scripts Structure</span></h2> <p data-svelte-h="svelte-1j0dhwy">Scripts are stored in the <code>scripts/</code> directory and can be in any programming language:</p> <p data-svelte-h="svelte-exgg5w"><strong>scripts/validate_dataset.py</strong></p> <div class="code-block relative "><div class="absolute top-2.5 right-4"><button class="inline-flex items-center relative text-sm focus:text-green-500 cursor-pointer focus:outline-none transition duration-200 ease-in-out opacity-0 mx-0.5 text-gray-600 " title="code excerpt" type="button"><svg class="" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" fill="currentColor" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path d="M28,10V28H10V10H28m0-2H10a2,2,0,0,0-2,2V28a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V10a2,2,0,0,0-2-2Z" transform="translate(0)"></path><path d="M4,18H2V4A2,2,0,0,1,4,2H18V4H4Z" transform="translate(0)"></path><rect fill="none" width="32" height="32"></rect></svg> <div class="absolute pointer-events-none transition-opacity bg-black text-white py-1 px-2 leading-tight rounded font-normal shadow left-1/2 top-full transform -translate-x-1/2 translate-y-2 opacity-0"><div class="absolute bottom-full left-1/2 transform -translate-x-1/2 w-0 h-0 border-black border-4 border-t-0" style="border-left-color: transparent; border-right-color: transparent; "></div> Copied</div></button></div> <pre class=""><!-- HTML_TAG_START --><span class="hljs-keyword">import</span> pandas <span class="hljs-keyword">as</span> pd
<span class="hljs-keyword">from</span> pathlib <span class="hljs-keyword">import</span> Path
<span class="hljs-keyword">def</span> <span class="hljs-title function_">validate_dataset</span>(<span class="hljs-params">dataset_path</span>):
<span class="hljs-string">&quot;&quot;&quot;Validate dataset meets requirements.&quot;&quot;&quot;</span>
<span class="hljs-keyword">if</span> <span class="hljs-keyword">not</span> Path(dataset_path).exists():
<span class="hljs-keyword">raise</span> FileNotFoundError(<span class="hljs-string">f&quot;Dataset not found: <span class="hljs-subst">{dataset_path}</span>&quot;</span>)
df = pd.read_csv(dataset_path)
<span class="hljs-comment"># Validate required columns</span>
required = {<span class="hljs-string">&#x27;text&#x27;</span>, <span class="hljs-string">&#x27;label&#x27;</span>}
missing = required - <span class="hljs-built_in">set</span>(df.columns)
<span class="hljs-keyword">if</span> missing:
<span class="hljs-keyword">raise</span> ValueError(<span class="hljs-string">f&quot;Missing columns: <span class="hljs-subst">{missing}</span>&quot;</span>)
<span class="hljs-comment"># Validate no nulls</span>
<span class="hljs-keyword">if</span> df.isnull().<span class="hljs-built_in">any</span>().<span class="hljs-built_in">any</span>():
<span class="hljs-keyword">raise</span> ValueError(<span class="hljs-string">&quot;Dataset contains null values&quot;</span>)
<span class="hljs-keyword">return</span> <span class="hljs-literal">True</span>
<span class="hljs-keyword">if</span> __name__ == <span class="hljs-string">&quot;__main__&quot;</span>:
<span class="hljs-keyword">import</span> sys
<span class="hljs-keyword">try</span>:
validate_dataset(sys.argv[<span class="hljs-number">1</span>])
<span class="hljs-built_in">print</span>(<span class="hljs-string">&quot;Validation passed!&quot;</span>)
<span class="hljs-keyword">except</span> Exception <span class="hljs-keyword">as</span> e:
<span class="hljs-built_in">print</span>(<span class="hljs-string">f&quot;Validation failed: <span class="hljs-subst">{e}</span>&quot;</span>)
sys.exit(<span class="hljs-number">1</span>)<!-- HTML_TAG_END --></pre></div> <blockquote class="tip" data-svelte-h="svelte-zigwza"><p>Scripts do not require an excessive amount of parameters. In most cases, the agent will regenerate the script with the appropriate parameters. Starting off with the core variables is usually enough to focus the agent on the core functionality.</p></blockquote> <h2 class="relative group"><a id="references-directory" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#references-directory"><span><svg class="" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg></span></a> <span>References Directory</span></h2> <p data-svelte-h="svelte-1sxlv5f">The <code>references/</code> directory contains documentation referenced in SKILL.md:</p> <p data-svelte-h="svelte-10qkj1t"><strong>references/api-reference.md</strong></p> <div class="code-block relative "><div class="absolute top-2.5 right-4"><button class="inline-flex items-center relative text-sm focus:text-green-500 cursor-pointer focus:outline-none transition duration-200 ease-in-out opacity-0 mx-0.5 text-gray-600 " title="code excerpt" type="button"><svg class="" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" fill="currentColor" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path d="M28,10V28H10V10H28m0-2H10a2,2,0,0,0-2,2V28a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V10a2,2,0,0,0-2-2Z" transform="translate(0)"></path><path d="M4,18H2V4A2,2,0,0,1,4,2H18V4H4Z" transform="translate(0)"></path><rect fill="none" width="32" height="32"></rect></svg> <div class="absolute pointer-events-none transition-opacity bg-black text-white py-1 px-2 leading-tight rounded font-normal shadow left-1/2 top-full transform -translate-x-1/2 translate-y-2 opacity-0"><div class="absolute bottom-full left-1/2 transform -translate-x-1/2 w-0 h-0 border-black border-4 border-t-0" style="border-left-color: transparent; border-right-color: transparent; "></div> Copied</div></button></div> <pre class=""><!-- HTML_TAG_START --><span class="hljs-section"># Hugging Face Hub API Reference</span>
<span class="hljs-section">## Dataset API</span>
<span class="hljs-section">### Create Dataset</span><!-- HTML_TAG_END --></pre></div> <p data-svelte-h="svelte-7c993o"><strong>references/examples.md</strong></p> <div class="code-block relative "><div class="absolute top-2.5 right-4"><button class="inline-flex items-center relative text-sm focus:text-green-500 cursor-pointer focus:outline-none transition duration-200 ease-in-out opacity-0 mx-0.5 text-gray-600 " title="code excerpt" type="button"><svg class="" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" fill="currentColor" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path d="M28,10V28H10V10H28m0-2H10a2,2,0,0,0-2,2V28a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V10a2,2,0,0,0-2-2Z" transform="translate(0)"></path><path d="M4,18H2V4A2,2,0,0,1,4,2H18V4H4Z" transform="translate(0)"></path><rect fill="none" width="32" height="32"></rect></svg> <div class="absolute pointer-events-none transition-opacity bg-black text-white py-1 px-2 leading-tight rounded font-normal shadow left-1/2 top-full transform -translate-x-1/2 translate-y-2 opacity-0"><div class="absolute bottom-full left-1/2 transform -translate-x-1/2 w-0 h-0 border-black border-4 border-t-0" style="border-left-color: transparent; border-right-color: transparent; "></div> Copied</div></button></div> <pre class=""><!-- HTML_TAG_START --><span class="hljs-section"># Example Datasets</span>
<span class="hljs-section">## Simple CSV Dataset</span>
<span class="hljs-bullet">-</span> Name: mnist-subset
<span class="hljs-bullet">-</span> Format: CSV
<span class="hljs-bullet">-</span> Columns: image<span class="hljs-emphasis">_data, label
- Size: ~10MB</span><!-- HTML_TAG_END --></pre></div> <h2 class="relative group"><a id="assets-directory" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#assets-directory"><span><svg class="" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg></span></a> <span>Assets Directory</span></h2> <p data-svelte-h="svelte-1h8qbhh">The <code>assets/</code> directory contains templates and configuration files:</p> <p data-svelte-h="svelte-1bswu5q"><strong>assets/dataset-card-template.md</strong></p> <div class="code-block relative "><div class="absolute top-2.5 right-4"><button class="inline-flex items-center relative text-sm focus:text-green-500 cursor-pointer focus:outline-none transition duration-200 ease-in-out opacity-0 mx-0.5 text-gray-600 " title="code excerpt" type="button"><svg class="" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" fill="currentColor" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path d="M28,10V28H10V10H28m0-2H10a2,2,0,0,0-2,2V28a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V10a2,2,0,0,0-2-2Z" transform="translate(0)"></path><path d="M4,18H2V4A2,2,0,0,1,4,2H18V4H4Z" transform="translate(0)"></path><rect fill="none" width="32" height="32"></rect></svg> <div class="absolute pointer-events-none transition-opacity bg-black text-white py-1 px-2 leading-tight rounded font-normal shadow left-1/2 top-full transform -translate-x-1/2 translate-y-2 opacity-0"><div class="absolute bottom-full left-1/2 transform -translate-x-1/2 w-0 h-0 border-black border-4 border-t-0" style="border-left-color: transparent; border-right-color: transparent; "></div> Copied</div></button></div> <pre class=""><!-- HTML_TAG_START -->---
<span class="hljs-section">license: cc-by-4.0
---</span>
<span class="hljs-section"># {DATASET<span class="hljs-emphasis">_NAME}
## Dataset Summary
{Brief description}
## Dataset Structure
### Data Splits
{List splits: train, validation, test}
```
<span class="hljs-strong">**assets/config-example.yaml**</span>
````yaml
dataset:
name: my-dataset
version: 1.0
format: csv</span></span><!-- HTML_TAG_END --></pre></div> <details><summary data-svelte-h="svelte-htxy9u">Here&#39;s a small but complete skill following the specification</summary> <p data-svelte-h="svelte-38s6jh"><strong>skill-name/SKILL.md</strong></p> <div class="code-block relative "><div class="absolute top-2.5 right-4"><button class="inline-flex items-center relative text-sm focus:text-green-500 cursor-pointer focus:outline-none transition duration-200 ease-in-out opacity-0 mx-0.5 text-gray-600 " title="code excerpt" type="button"><svg class="" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" fill="currentColor" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path d="M28,10V28H10V10H28m0-2H10a2,2,0,0,0-2,2V28a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V10a2,2,0,0,0-2-2Z" transform="translate(0)"></path><path d="M4,18H2V4A2,2,0,0,1,4,2H18V4H4Z" transform="translate(0)"></path><rect fill="none" width="32" height="32"></rect></svg> <div class="absolute pointer-events-none transition-opacity bg-black text-white py-1 px-2 leading-tight rounded font-normal shadow left-1/2 top-full transform -translate-x-1/2 translate-y-2 opacity-0"><div class="absolute bottom-full left-1/2 transform -translate-x-1/2 w-0 h-0 border-black border-4 border-t-0" style="border-left-color: transparent; border-right-color: transparent; "></div> Copied</div></button></div> <pre class=""><!-- HTML_TAG_START -->---
name: &quot;model-card-generator&quot;
description: &quot;Generate model cards for Hugging Face Hub. Use when documenting models, adding metadata, or creating README files.&quot;
license: &quot;MIT&quot;
compatibility: &quot;Python 3.8+, requires jinja2&quot;
metadata:
author: &quot;context-course&quot;
version: &quot;1.0.0&quot;
<span class="hljs-section"> created: &quot;2026-04-13&quot;
---</span>
<span class="hljs-section"># Model Card Generator Skill</span>
<span class="hljs-section">## Overview</span>
This skill helps create professional model cards and README files for models published to Hugging Face Hub. Model cards document:
<span class="hljs-bullet">-</span> Model architecture and training data
<span class="hljs-bullet">-</span> Intended use and limitations
<span class="hljs-bullet">-</span> Performance metrics
<span class="hljs-bullet">-</span> Ethical considerations
<span class="hljs-bullet">-</span> License information
<span class="hljs-section">## Prerequisites Checklist</span>
<span class="hljs-bullet">-</span> [ ] Python 3.8+ installed
<span class="hljs-bullet">-</span> [ ] jinja2 package installed
<span class="hljs-bullet">-</span> [ ] Model information available (name, description, metrics)
<span class="hljs-section">## Step-by-Step Guide</span>
<span class="hljs-section">### 1. Gather Model Information</span>
Collect the following about your model:
<span class="hljs-bullet">-</span> Model name and description
<span class="hljs-bullet">-</span> Training data description
<span class="hljs-bullet">-</span> Performance metrics (accuracy, F1, BLEU, etc.)
<span class="hljs-bullet">-</span> Intended use cases
<span class="hljs-bullet">-</span> Limitations
<span class="hljs-bullet">-</span> License (MIT, Apache-2.0, CC-BY-4.0, etc.)
<span class="hljs-section">### 2. Generate Card</span>
<span class="hljs-code">```python
from generate_card import create_model_card
metrics = {
&quot;accuracy&quot;: 0.92,
&quot;f1_score&quot;: 0.89,
&quot;precision&quot;: 0.91
}
card = create_model_card(
model_name=&quot;My Classifier&quot;,
description=&quot;A transformer-based text classifier&quot;,
metrics=metrics
)
with open(&quot;README.md&quot;, &quot;w&quot;) as f:
f.write(card)
```</span>
See [<span class="hljs-string">the generation script</span>](<span class="hljs-link">scripts/generate_card.py</span>) for more options.
<span class="hljs-section">### 3. Customize</span>
Open README.md and add:
<span class="hljs-bullet">-</span> Detailed description
<span class="hljs-bullet">-</span> Training procedure
<span class="hljs-bullet">-</span> Example usage
<span class="hljs-bullet">-</span> Citation information
<span class="hljs-section">## Helper Scripts</span>
<span class="hljs-bullet">-</span> [<span class="hljs-string">Model card generator</span>](<span class="hljs-link">scripts/generate_card.py</span>)
<span class="hljs-bullet">-</span> [<span class="hljs-string">Validation tool</span>](<span class="hljs-link">scripts/validate_card.py</span>)
<span class="hljs-section">## References</span>
<span class="hljs-bullet">-</span> [<span class="hljs-string">Model Cards Paper</span>](<span class="hljs-link">https://arxiv.org/abs/1810.03993</span>)
<span class="hljs-bullet">-</span> [<span class="hljs-string">HF Model Card Template</span>](<span class="hljs-link">../references/hf-template</span>)
<span class="hljs-bullet">-</span> [<span class="hljs-string">Best Practices</span>](<span class="hljs-link">../references/best-practices</span>)
<span class="hljs-section">## Troubleshooting</span>
<span class="hljs-section">### Issue: Frontmatter not rendering</span>
<span class="hljs-strong">**Solution**</span>: Ensure dashes are on their own lines in the YAML section:
<span class="hljs-section">```yaml
---</span>
<span class="hljs-section">license: mit
---</span>
<span class="hljs-code">```
### Issue: Characters not displaying
**Solution**: Save file as UTF-8 encoding:
```</span>bash
file README.md
<span class="hljs-code">```</span><!-- HTML_TAG_END --></pre></div> <p data-svelte-h="svelte-11c7nmj"><strong>skill-name/scripts/generate_card.py</strong></p> <div class="code-block relative "><div class="absolute top-2.5 right-4"><button class="inline-flex items-center relative text-sm focus:text-green-500 cursor-pointer focus:outline-none transition duration-200 ease-in-out opacity-0 mx-0.5 text-gray-600 " title="code excerpt" type="button"><svg class="" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" fill="currentColor" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path d="M28,10V28H10V10H28m0-2H10a2,2,0,0,0-2,2V28a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V10a2,2,0,0,0-2-2Z" transform="translate(0)"></path><path d="M4,18H2V4A2,2,0,0,1,4,2H18V4H4Z" transform="translate(0)"></path><rect fill="none" width="32" height="32"></rect></svg> <div class="absolute pointer-events-none transition-opacity bg-black text-white py-1 px-2 leading-tight rounded font-normal shadow left-1/2 top-full transform -translate-x-1/2 translate-y-2 opacity-0"><div class="absolute bottom-full left-1/2 transform -translate-x-1/2 w-0 h-0 border-black border-4 border-t-0" style="border-left-color: transparent; border-right-color: transparent; "></div> Copied</div></button></div> <pre class=""><!-- HTML_TAG_START --><span class="hljs-keyword">from</span> datetime <span class="hljs-keyword">import</span> datetime
<span class="hljs-keyword">from</span> jinja2 <span class="hljs-keyword">import</span> Template
TEMPLATE = <span class="hljs-string">&quot;&quot;&quot;---
license: {{ license }}
---
# {{ name }}
{{ description }}
## Performance
| Metric | Value |
|--------|-------|
{% for metric, value in metrics.items() %}
| {{ metric }} | {{ &quot;%.4f&quot; | format(value) }} |
{% endfor %}
## Model Details
- Created: {{ created_date }}
- Framework: PyTorch
## Uses
This model is suitable for {{ use_cases }}.
## Limitations
- Trained on specific domain data
- May not generalize to other domains
&quot;&quot;&quot;</span>
<span class="hljs-keyword">def</span> <span class="hljs-title function_">create_model_card</span>(<span class="hljs-params">model_name, description, metrics, license=<span class="hljs-string">&quot;mit&quot;</span>, use_cases=<span class="hljs-string">&quot;classification&quot;</span></span>):
<span class="hljs-string">&quot;&quot;&quot;Generate a model card.&quot;&quot;&quot;</span>
template = Template(TEMPLATE)
<span class="hljs-keyword">return</span> template.render(
name=model_name,
description=description,
metrics=metrics,
license=license,
use_cases=use_cases,
created_date=datetime.now().isoformat()
)<!-- HTML_TAG_END --></pre></div> <p data-svelte-h="svelte-4e03f4"><strong>skill-name/references/best-practices.md</strong></p> <div class="code-block relative "><div class="absolute top-2.5 right-4"><button class="inline-flex items-center relative text-sm focus:text-green-500 cursor-pointer focus:outline-none transition duration-200 ease-in-out opacity-0 mx-0.5 text-gray-600 " title="code excerpt" type="button"><svg class="" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" fill="currentColor" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path d="M28,10V28H10V10H28m0-2H10a2,2,0,0,0-2,2V28a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V10a2,2,0,0,0-2-2Z" transform="translate(0)"></path><path d="M4,18H2V4A2,2,0,0,1,4,2H18V4H4Z" transform="translate(0)"></path><rect fill="none" width="32" height="32"></rect></svg> <div class="absolute pointer-events-none transition-opacity bg-black text-white py-1 px-2 leading-tight rounded font-normal shadow left-1/2 top-full transform -translate-x-1/2 translate-y-2 opacity-0"><div class="absolute bottom-full left-1/2 transform -translate-x-1/2 w-0 h-0 border-black border-4 border-t-0" style="border-left-color: transparent; border-right-color: transparent; "></div> Copied</div></button></div> <pre class=""><!-- HTML_TAG_START --><span class="hljs-section"># Model Card Best Practices</span>
<span class="hljs-section">## Writing Clear Descriptions</span>
<span class="hljs-bullet">-</span> Describe what the model does in one sentence
<span class="hljs-bullet">-</span> Explain the training data source
<span class="hljs-bullet">-</span> Mention the model architecture
<span class="hljs-bullet">-</span> List performance metrics
<span class="hljs-section">## Performance Documentation</span>
<span class="hljs-bullet">-</span> Always include actual metrics, not just claims
<span class="hljs-bullet">-</span> Use standard benchmarks where possible
<span class="hljs-bullet">-</span> Document evaluation methodology
<span class="hljs-bullet">-</span> Show limitations honestly
<span class="hljs-section">## License Selection</span>
<span class="hljs-bullet">-</span> Choose a permissive license (MIT, Apache-2.0)
<span class="hljs-bullet">-</span> CC-BY-4.0 for non-software content
<span class="hljs-bullet">-</span> CC0 for datasets
<span class="hljs-bullet">-</span> Be clear about dependencies&#x27; licenses<!-- HTML_TAG_END --></pre></div></details> <p data-svelte-h="svelte-1vrgsir">## Validation with skills-ref</p> <p data-svelte-h="svelte-1ivegcb">The Agent Skills Specification includes a validation tool called <code>skills-ref</code> (available at <a href="https://agentskills.io" rel="nofollow">agentskills.io</a>):</p> <div class="code-block relative "><div class="absolute top-2.5 right-4"><button class="inline-flex items-center relative text-sm focus:text-green-500 cursor-pointer focus:outline-none transition duration-200 ease-in-out opacity-0 mx-0.5 text-gray-600 " title="code excerpt" type="button"><svg class="" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" fill="currentColor" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path d="M28,10V28H10V10H28m0-2H10a2,2,0,0,0-2,2V28a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V10a2,2,0,0,0-2-2Z" transform="translate(0)"></path><path d="M4,18H2V4A2,2,0,0,1,4,2H18V4H4Z" transform="translate(0)"></path><rect fill="none" width="32" height="32"></rect></svg> <div class="absolute pointer-events-none transition-opacity bg-black text-white py-1 px-2 leading-tight rounded font-normal shadow left-1/2 top-full transform -translate-x-1/2 translate-y-2 opacity-0"><div class="absolute bottom-full left-1/2 transform -translate-x-1/2 w-0 h-0 border-black border-4 border-t-0" style="border-left-color: transparent; border-right-color: transparent; "></div> Copied</div></button></div> <pre class=""><!-- HTML_TAG_START --><span class="hljs-comment"># Validate a skill directory</span>
skills-ref validate skill-name/
<span class="hljs-comment"># Output:</span>
<span class="hljs-comment"># ✓ SKILL.md found</span>
<span class="hljs-comment"># ✓ name field valid: model-card-generator</span>
<span class="hljs-comment"># ✓ description valid (max 1024 chars)</span>
<span class="hljs-comment"># ✓ required fields present</span>
<span class="hljs-comment"># ⚠ warning: script references use absolute paths (should be relative)</span><!-- HTML_TAG_END --></pre></div> <p data-svelte-h="svelte-zn8km0">## File Size Guidelines</p> <p data-svelte-h="svelte-use428">Keep skills efficient:</p> <table data-svelte-h="svelte-yqsko2"><thead><tr><th>Component</th> <th>Recommendation</th> <th>Rationale</th></tr></thead> <tbody><tr><td>SKILL.md</td> <td>400-800 lines</td> <td>Lightweight discovery and loading</td></tr> <tr><td>scripts/</td> <td>Individual scripts &lt; 500 lines</td> <td>Easy to understand and modify</td></tr> <tr><td>Total skill</td> <td>&lt; 2 MB</td> <td>Quick download and indexing</td></tr></tbody></table> <p data-svelte-h="svelte-jb6gw6">Move large reference materials to external repositories if needed. This keeps the total skill itself small and lightweight, allowing the agent to perform quick downloading and indexing, only pulling heavy reference materials from external sources when needed.</p> <p data-svelte-h="svelte-1nkykzo">## Writing Tips</p> <p data-svelte-h="svelte-qhw1v2">### Instructions</p> <blockquote class="tip" data-svelte-h="svelte-z0iwmz"><p>Write instructions for someone who <em>doesn’t</em> know the task. Assume the agent (and users reading it) need clear, step-by-step guidance.</p></blockquote> <p data-svelte-h="svelte-3xx08s"><strong>Good</strong>: “First, authenticate by running <code>hf auth login</code>. This stores your token locally for subsequent commands.”</p> <p data-svelte-h="svelte-ilczwr"><strong>Not good</strong>: “Authenticate with HF.”</p> <p data-svelte-h="svelte-1khoakp">### Code Examples</p> <blockquote class="tip" data-svelte-h="svelte-16pboke"><p>Always provide copy-paste ready code. Test it yourself before including.</p></blockquote> <p data-svelte-h="svelte-twbvbs"><strong>Good</strong>:</p> <div class="code-block relative "><div class="absolute top-2.5 right-4"><button class="inline-flex items-center relative text-sm focus:text-green-500 cursor-pointer focus:outline-none transition duration-200 ease-in-out opacity-0 mx-0.5 text-gray-600 " title="code excerpt" type="button"><svg class="" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" fill="currentColor" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path d="M28,10V28H10V10H28m0-2H10a2,2,0,0,0-2,2V28a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V10a2,2,0,0,0-2-2Z" transform="translate(0)"></path><path d="M4,18H2V4A2,2,0,0,1,4,2H18V4H4Z" transform="translate(0)"></path><rect fill="none" width="32" height="32"></rect></svg> <div class="absolute pointer-events-none transition-opacity bg-black text-white py-1 px-2 leading-tight rounded font-normal shadow left-1/2 top-full transform -translate-x-1/2 translate-y-2 opacity-0"><div class="absolute bottom-full left-1/2 transform -translate-x-1/2 w-0 h-0 border-black border-4 border-t-0" style="border-left-color: transparent; border-right-color: transparent; "></div> Copied</div></button></div> <pre class=""><!-- HTML_TAG_START -->pip install huggingface_hub
hf auth login<!-- HTML_TAG_END --></pre></div> <p data-svelte-h="svelte-1pcu1xt"><strong>Not good</strong>: “Install huggingface_hub and log in”</p> <h3 class="relative group"><a id="frontmatter-metadata" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#frontmatter-metadata"><span><svg class="" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg></span></a> <span>Frontmatter Metadata</span></h3> <blockquote class="warning" data-svelte-h="svelte-tl5g1k"><p>Make sure descriptions are realistic and specific. Vague descriptions won’t help agents or users discover your skill.</p></blockquote> <p data-svelte-h="svelte-j0s884"><strong>Good</strong>: “Publish datasets to Hugging Face Hub. Use when uploading datasets, creating dataset cards, or managing dataset versions.”</p> <p data-svelte-h="svelte-1m9e496"><strong>Not good</strong>: “A dataset skill”</p> <h2 class="relative group"><a id="next-steps" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#next-steps"><span><svg class="" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg></span></a> <span>Next Steps</span></h2> <p data-svelte-h="svelte-aucz8i">Next, we’ll look at how different agents load skills, then build one from scratch.</p> <a class="!text-gray-400 !no-underline text-sm flex items-center not-prose mt-4" href="https://github.com/huggingface/context-course/blob/main/units/en/unit1/skill-format.mdx" target="_blank"><svg class="mr-1" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" fill="currentColor" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path d="M31,16l-7,7l-1.41-1.41L28.17,16l-5.58-5.59L24,9l7,7z"></path><path d="M1,16l7-7l1.41,1.41L3.83,16l5.58,5.59L8,23l-7-7z"></path><path d="M12.419,25.484L17.639,6.552l1.932,0.518L14.351,26.002z"></path></svg> <span data-svelte-h="svelte-zjs2n5"><span class="underline">Update</span> on GitHub</span></a> <p></p>
<script>
{
__sveltekit_ck2jc = {
assets: "/docs/context-course/pr_7/en",
base: "/docs/context-course/pr_7/en",
env: {}
};
const element = document.currentScript.parentElement;
const data = [null,null];
Promise.all([
import("/docs/context-course/pr_7/en/_app/immutable/entry/start.55c3acaa.js"),
import("/docs/context-course/pr_7/en/_app/immutable/entry/app.10ec5479.js")
]).then(([kit, app]) => {
kit.start(app, element, {
node_ids: [0, 7],
data,
form: null,
error: null
});
});
}
</script>

Xet Storage Details

Size:
62.1 kB
·
Xet hash:
ed50512f9fe1ec2df548906ad2c7b37fa8922a87a4af6224554e1421278a12b0

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.