[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7DM2BAQGJBV5RJ0M3SXMVKJ":3,"skill-same:01M7DM2BAQGJBV5RJ0M3SXMVKJ":81},{"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":30,"commitSha":31,"skillDirectory":32,"forksCount":33,"repositoryHtmlUrl":34,"repositoryHomepageUrl":6,"ownerHtmlUrl":35,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":36,"install":37,"resources":50},"01M7DM2BAQGJBV5RJ0M3SXMVKJ","huggingface-lora-space-builder",null,"Build and publish a Gradio demo on Hugging Face Spaces for a user-provided LoRA. Use when someone asks to create, generate, ship, or publish a Space, demo, Gradio app, or playground for a LoRA — including LoRAs for Qwen-Image, Qwen-Image-Edit, LTX-Video, Wan, FLUX, SDXL, or other...","Hazek-dc\u002FPresensiGuru_FaceNet_EMAR","Hazek-dc","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F75208960?v=4","01M7DEQV5B4YGS86A81DYH81DR","Hazek","01M7DEQV5XP4TM0C6NTHXCXCHR",1,"Apache-2.0","https:\u002F\u002Fgithub.com\u002FHazek-dc\u002FPresensiGuru_FaceNet_EMAR\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fhuggingface-lora-space-builder\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: huggingface-lora-space-builder\ndescription: Build and publish a Gradio demo on Hugging Face Spaces for a user-provided LoRA. Use when someone asks to create, generate, ship, or publish a Space, demo, Gradio app, or playground for a LoRA — including LoRAs for Qwen-Image, Qwen-Image-Edit, LTX-Video, Wan, FLUX, SDXL, or other...\nrisk: unknown\nsource: https:\u002F\u002Fgithub.com\u002Fhuggingface\u002Fskills\u002Ftree\u002Fmain\u002Fskills\u002Fhuggingface-lora-space-builder\nsource_repo: huggingface\u002Fskills\nsource_type: official\ndate_added: 2026-07-01\nlicense: Apache-2.0\nlicense_source: https:\u002F\u002Fgithub.com\u002Fhuggingface\u002Fskills\u002Fblob\u002Fmain\u002FLICENSE\n---\n\n# Gradio LoRA Space Builder\n## When to Use\n\nUse this skill when you need build and publish a Gradio demo on Hugging Face Spaces for a user-provided LoRA. Use when someone asks to create, generate, ship, or publish a Space, demo, Gradio app, or playground for a LoRA — including LoRAs for Qwen-Image, Qwen-Image-Edit, LTX-Video, Wan, FLUX, SDXL, or other...\n\n\nBuild and publish a Gradio demo on Hugging Face Spaces that runs inference with a user-provided LoRA. Use whenever someone asks to create, generate, ship, or publish \"a Space\", \"a demo\", \"a Gradio app\", or \"a playground\" for a LoRA — whether the base model is Qwen-Image, Qwen-Image-Edit, LTX, or another diffusion model. Also use when someone describes a LoRA they trained or hosts on the Hub and wants to share it. The default target is ZeroGPU hardware and the default inference library is `diffusers` when the base model supports it.\n\nThe output is a real, published Space (private by default) that the user can try in the browser, not a local script.\n\n## What \"good\" looks like for these demos\n\nThe demo should feel handcrafted for this specific LoRA, not a generic template with the LoRA bolted on. Two LoRAs that share a task can still need different demos: a pose-control video LoRA and an outpainting video LoRA both take video in and produce video out, but the inputs the user provides, the preprocessing, and the controls are completely different. Recognizing that is the central job here.\n\nConcretely, a good demo:\n\n- Loads fast and runs fast — minimal model loading, sensible step count, no wasted computation per call.\n- Has a UI with exactly the controls this LoRA needs and nothing else. Excess sliders are a cost, not a feature.\n- Shows the user what's happening — progress, intermediate outputs where useful, the seed used, a clear error when input is missing.\n- Honors the LoRA's own recommendations from its model card: trigger words, recommended step count, recommended guidance scale, recommended LoRA scale, example inputs.\n- Is creative where creativity helps — interactive canvases, before\u002Fafter sliders, side-by-side previews of intermediate processing — and plain where plainness is right.\n\n## Workflow\n\nWork through these phases in order. Information gathered in one phase decides the next.\n\n1. Gather the LoRA info needed to pick a pipeline and design a UI.\n2. Pick the base pipeline and inference recipe.\n3. Design the UI for this specific LoRA's task and inputs.\n4. Write `app.py`, `requirements.txt`, and `README.md` together; show all three to the user for one batched approval.\n5. Publish the Space (private).\n\nDon't drip-feed questions across multiple turns. Batch them.\n\n---\n\n## Phase 1 — Gather LoRA info\n\nRequired: a LoRA repo on the Hub (e.g. `username\u002Fmy-lora`).\n\n**First, try to read the repo without a token.** If it succeeds, the repo is public — proceed. If it fails with 401\u002F403, the repo is private\u002Fgated and you need an authenticated session to read it. **Don't immediately ask for a token.** Check first whether the user is already authenticated.\n\n```python\nfrom huggingface_hub import HfApi, get_token\n\ncached_token = get_token()  # picks up HF_TOKEN env var or cached CLI login\nif cached_token:\n    try:\n        info = HfApi().whoami(token=cached_token)\n        username = info[\"name\"]\n        # info also has fine-grained token scope info if applicable\n    except Exception:\n        cached_token = None  # token exists but is invalid\u002Fexpired\n```\n\nThen:\n\n- If a valid cached token exists *and* it can read the repo, use it. No prompt needed.\n- If no cached token, or the cached token can't read this private repo, ask the user for a token — once, with the explanation below.\n\nWhen asking for a token (and only when you actually need to ask):\n\n> I need a Hugging Face access token with **write** scope (to read the LoRA if it's private\u002Fgated, and to publish the Space). Create one at https:\u002F\u002Fhuggingface.co\u002Fsettings\u002Ftokens. Paste it here.\n\nThe same token will be reused for publishing in the final phase, so this is a one-time ask.\n\n**Then read what's in the repo:**\n\n- List the repo files (`huggingface_hub.HfApi().list_repo_files(repo_id)`). Look for `.safetensors`, `README.md`, example images\u002Fvideos, multiple checkpoints.\n- Fetch the model card (`huggingface_hub.ModelCard.load(repo_id)`). The `data` dict has structured fields; the `text` has the README body.\n- If multiple `.safetensors` files exist, pick the right one — see \"Picking the LoRA weights file\" in `references\u002Fzerogpu-and-publishing.md`. Briefly: README-recommended file wins, then `pytorch_lora_weights.safetensors`, then latest training checkpoint, otherwise ask.\n\n**From the model card, try to determine:**\n\n- **Base model** — the `base_model` field, or text mentions in the README. Usually present. Use it to pick the pipeline reference file (see Phase 2).\n- **Task** — `pipeline_tag` if set, otherwise inferred from the base model and README text. The five tasks this skill handles: `text-to-image`, `image-to-image`, `text-to-video`, `image-to-video`, `video-to-video`.\n- **Trigger words** — often called \"trigger word\", \"instance prompt\", \"activation word\"; sometimes embedded in example prompts.\n- **Recommended inference recipe** — step count, guidance scale, true CFG scale, LoRA scale, resolution. Many LoRA cards include a Python snippet; trust its *parameters* (steps, guidance, CFG, LoRA scale, dtype). For *loading mechanics*, see `adapting-to-the-lora.md` — prefer `pipe.load_lora_weights(...)` over whatever loading approach the snippet uses.\n- **Example prompts and example media** — use these as Gradio examples in the UI.\n- **Sub-task \u002F specific use case** — for image edits and video LoRAs, \"what does this LoRA actually do\" matters as much as the task category. A relighting LoRA, a face-swap LoRA, and a style LoRA all might be image-to-image, but the UI for each is different.\n\n**When something can't be inferred, ask the user — once, in a single batched message.** Format the question to make answering trivial. For task category, list the five options as a numbered choice. For sub-task, give a one-line description (\"what does this LoRA do? e.g. 'relight portraits', 'apply manga style', 'extend videos to wider aspect ratios'\"). Don't ask if you can already infer it confidently from the base model or README.\n\nIf the model card has nothing helpful at all — no base model, no task, no example — surface that clearly: \"The model card has no usable info. I'll need you to tell me: (1) base model, (2) what this LoRA does, (3) recommended step count and guidance scale if you know them.\"\n\n---\n\n## Phase 2 — Pick the base pipeline\n\nTwo things to decide here: which reference file to load, and which pipeline class to use. They're not the same question — a base-model family file (e.g. `qwen-image.md`) covers multiple variants, and variants in the same family don't always share a pipeline class. Get this wrong and the Space loads but produces wrong output, or fails at startup.\n\n**Step 1 — Load the reference file for this base model family.**\n\n- `references\u002Fbase-models\u002Fqwen-image.md` — covers Qwen-Image and Qwen-Image-Edit family (text-to-image and image-to-image).\n- `references\u002Fbase-models\u002Fltx.md` — covers LTX family (text-to-video, image-to-video, video-to-video, including IC-LoRAs).\n- `references\u002Fbase-models\u002Fkrea-2.md` — covers Krea 2 (K2), text-to-image (train on RAW, run inference\u002FLoRAs on the Turbo distilled checkpoint).\n\nIf the base model isn't in one of these files, this skill doesn't have first-class support yet. Tell the user, and ask whether they want to proceed by analogy (use the closest model's recipe and adjust) or stop. Don't guess silently.\n\n**Step 2 — Verify the pipeline class against the base model's own card. This step is mandatory, not optional.**\n\nA new base model variant might use the same pipeline class with a different repo path, or a new pipeline class entirely. Don't trust the reference file's table alone — it's best-effort and can lag a recent release. Verify before committing:\n\n```python\nfrom huggingface_hub import ModelCard\nbase_card = ModelCard.load(base_model_id)\n# Read base_card.text — find the diffusers inference snippet, note the pipeline class it imports.\n```\n\nThe class imported in the base model card's diffusers snippet is the source of truth. Real examples where this matters:\n\n- `Qwen-Image-Edit` uses `QwenImageEditPipeline`. `Qwen-Image-Edit-2509` and `Qwen-Image-Edit-2511` use `QwenImageEditPlusPipeline` — different class, different default parameters, takes a list of images instead of one. A LoRA targeting 2511 loaded onto `QwenImageEditPipeline` produces broken output.\n- LTX-Video uses `LTXPipeline`\u002F`LTXImageToVideoPipeline`\u002F`LTXConditionPipeline`. LTX-2 uses `LTX2Pipeline` from a different module path. LTX-2.3 sometimes needs a native pipeline outside diffusers.\n\nIf the base model card has no diffusers snippet at all, fall back to the reference file's table — and tell the user you're falling back, in case they know something the table doesn't.\n\nThe cost of this verification is one Hub fetch and a few seconds of reading. The cost of skipping it is the failure mode the previous bullet describes — a \"working\" Space that's quietly using the wrong class.\n\n**Step 3 — Diffusers vs native pipeline.** Default to `diffusers` when the base model has a diffusers pipeline class. That's the case for Qwen-Image and Qwen-Image-Edit and most of LTX. Some LTX variants (notably LTX-2.3 with certain IC-LoRAs) need a native pipeline; the LTX reference says when. Diffusers gives standard `load_lora_weights` \u002F `set_adapters` semantics; the native path needs LoRA-specific glue.\n\n---\n\n## Phase 3 — Design the UI for this LoRA\n\nDon't reach for a template. Reason from the LoRA's task and inputs to a UI.\n\nRead `references\u002Ftasks.md` for the per-task baseline UI patterns (what the standard inputs\u002Foutputs look like for T2I, I2I, T2V, I2V, V2V).\n\nThen read `references\u002Fadapting-to-the-lora.md`, which is about *thinking through what this specific LoRA needs* — beyond the task category. That file is the most important one in this skill. The same task can need very different UIs: a pose-control LTX LoRA needs a video input and a pose-extraction preview; an outpaint LTX LoRA needs an aspect-ratio picker and a black-margin preview; a relighting Flux LoRA needs an image and a brush canvas for indicating where to add light. None of those reduce to \"the V2V template\" or \"the I2I template\".\n\n**Self-check before writing the UI.** Write one sentence describing what a user does with this Space in 10 seconds. If that sentence doesn't distinguish this LoRA from any other LoRA of the same task, the UI isn't shaped enough yet.\n\nExamples that pass the self-check:\n\n- \"Upload a video, pick a target aspect ratio, click Generate; the model fills the empty margins.\"\n- \"Draw colored brush strokes where you want light, pick an illumination style, click Generate; the model relights the photo.\"\n- \"Upload a video of someone moving and an image of a different character; the model produces a video of the character doing the motion.\"\n\nExamples that fail:\n\n- \"Type a prompt and click generate.\" (Generic T2I — say more.)\n- \"Upload an image and an instruction.\" (Generic edit — what kind of edit?)\n\n**Gradio component freshness.** Gradio's component set evolves. Before defaulting to plain components, consider whether something newer fits better — for example `gr.ImageSlider` for before\u002Fafter on edit LoRAs, `gr.BrowserState` for persistent prefs, `@gr.render` for UIs that change based on input. If you're unsure whether a component exists or what its signature is, web-fetch the current Gradio docs at https:\u002F\u002Fwww.gradio.app\u002Fdocs rather than guessing.\n\n**When stock and Hub custom components aren't enough — creative mode.** If the LoRA's natural input is a shape no Gradio component (built-in or on the Hub) expresses well — point sets, strokes, trajectories, multi-region annotations with metadata, 3D rotation gizmos, timeline scrubbers, anything where the user manipulates a thing on top of media — drop down to custom HTML\u002FJS via `gr.HTML`. See `references\u002Fcreative-mode.md` for the Gradio primitives (`gr.HTML`, `head=` injection, `elem_id` addressing, the two JS↔Python state-sync approaches), the discipline around defining a JSON wire format, and the pitfalls. Don't reach for creative mode just because it would be cool — reach for it when the LoRA's input shape demands it. And don't skip the Hub custom components rung above (e.g. `gradio_image_annotation`) before going fully bespoke.\n\n**`gr.Examples` for media-input Spaces.** When no fitting example media is available from the model's own repo, pull from the shared input pools — split by modality so the HF dataset viewer can render proper thumbnails: images at [`linoyts\u002Frepo-to-space-example-inputs`](https:\u002F\u002Fhuggingface.co\u002Fdatasets\u002Flinoyts\u002Frepo-to-space-example-inputs), videos at [`linoyts\u002Frepo-to-space-example-videos`](https:\u002F\u002Fhuggingface.co\u002Fdatasets\u002Flinoyts\u002Frepo-to-space-example-videos). Both are CC0 with `categories` + natural-language `caption` metadata and the same filter\u002Frank recipe in each dataset README. Pick 2–3 that fit the task, preprocess to the shapes the model expects, and bake the copies into the Space. Set `cache_examples=True, cache_mode=\"lazy\"` so the first click caches without running examples at build time (see `references\u002Fzerogpu-and-publishing.md`).\n\n---\n\n## Phase 4 — Write the Space files\n\nBefore writing, tell the user concretely what's about to happen — name the actual files. Not \"I'll write the three files\" but something like:\n\n> \"Now I'll write the three files needed to publish a Space: **`app.py`** (the Gradio demo and inference code), **`requirements.txt`** (Python dependencies), and **`README.md`** (Space configuration including ZeroGPU hardware setting). Then I'll show all three for your review before publishing.\"\n\nThis anchors the user in what's being produced. Don't say \"three files\" without naming them — it's vague and signals lack of commitment to the deliverable.\n\nThe three files are tightly coupled: `requirements.txt` is determined by what `app.py` imports, and the `README.md` YAML frontmatter sets the SDK version, hardware, and Space title that have to match. Write them together, then show all three to the user for approval in **one batched message** before publishing.\n\nRead `references\u002Fzerogpu-and-publishing.md` for the ZeroGPU rules. The non-obvious ones:\n\n- Models go on `cuda` at module level (not lazy-loaded inside the GPU function). ZeroGPU has a CUDA emulation that makes this work pre-allocation, and module-level placement is significantly faster than deferred placement.\n- The function that runs inference is decorated with `@spaces.GPU(duration=...)`. Pick a duration appropriate for the task — short for image generation, longer for video.\n- Don't use `torch.compile` — it's incompatible with ZeroGPU's process model.\n\n### `app.py`\n\nCompose from the pieces decided in Phases 1–3. Don't paste from a template. Each section should be there because it's needed:\n\n- Imports — `gradio as gr`, `torch`, `spaces`, the pipeline class, anything the preprocessing needs.\n- Constants — `LORA_REPO`, `BASE_MODEL`, recommended step count, guidance, LoRA scale, trigger word.\n- Module-level model load — pipeline `from_pretrained`, `.to(\"cuda\")`, `load_lora_weights`. If the LoRA repo is private, pass `token=os.environ[\"HF_TOKEN\"]`.\n- Preprocessing functions (if any) — pose extraction, padding, mask building, etc. CPU code can run at module level; GPU code needs to be inside a `@spaces.GPU` function.\n- The inference function — decorated with `@spaces.GPU(duration=...)`. Validates inputs, applies trigger word, builds the pipeline kwargs, returns outputs.\n- The Gradio Blocks — the UI from Phase 3, wired to the inference function.\n\nCommon things to get right:\n\n- Return the actually-used seed alongside the result so the user can reproduce.\n- `gr.Progress(track_tqdm=True)` on the inference function surfaces diffusers' internal progress bar.\n- Validate inputs — raise `gr.Error(\"Please upload an image first.\")` when a required input is missing, rather than letting the pipeline fail with a cryptic error.\n- On `gr.Examples`, use `cache_examples=True, cache_mode=\"lazy\"` — plain `cache_examples=True` runs examples at build time and fails on ZeroGPU; lazy mode defers caching to the first user click.\n\n### `requirements.txt`\n\nDon't ship a fixed minimal list and hope for the best. The \"minimal\" list works for plain T2I LoRAs and breaks the moment the base model has a vision-language text encoder, video output, or any non-trivial preprocessing. **Derive `requirements.txt` from what the Space actually needs**, in this order:\n\n1. **Every top-level non-stdlib import in `app.py`.** If `app.py` does `import cv2`, `requirements.txt` has `opencv-python`. If it does `from controlnet_aux import OpenposeDetector`, `requirements.txt` has `controlnet-aux`. Walk the imports mechanically. (Note the exclusions in the next paragraph — some imports are runtime built-ins and don't need to be listed.)\n2. **What the base-model reference's \"Required dependencies\" subsection says.** Each base-model file lists the non-obvious extras the pipeline pulls in — `torchvision` for Qwen-Image (Qwen 2.5-VL text encoder), `imageio[ffmpeg]` for LTX (video export), etc. Include all of them. These are the deps that aren't picked up from imports because the pipeline's components import them transitively at load time.\n3. **What the LoRA's own model card explicitly mentions installing.** If the LoRA README has its own `pip install` block, lift the deps from there.\n4. **The diffusers\u002FML stack:** `diffusers`, `transformers`, `accelerate`, `peft`, `safetensors`. Default to plain (unpinned). Switch `diffusers` to `git+https:\u002F\u002Fgithub.com\u002Fhuggingface\u002Fdiffusers` if the base-model reference says the model needs it (recent releases often do — Qwen-Image-Edit-2511 is a current example).\n\n**What *not* to list in `requirements.txt`:**\n\n- **`gradio`** — controlled by the `sdk_version:` field in `README.md`'s YAML frontmatter, not by `requirements.txt`. Listing it in requirements is at best ignored, at worst causes a version conflict with the SDK. Set the version in the README only.\n- **`torch`** — provided by the Space runtime. Only add if you need a specific version pinned (rare, and usually a sign something else is wrong).\n- **`spaces`** — provided by the Space runtime. Only add if you need a specific version pinned.\n- **`huggingface_hub`** — provided by the Space runtime. Only add if you need a specific version pinned.\n\nThese four come pre-installed in the ZeroGPU container. Listing them anyway is the kind of \"include rather than skip\" instinct that's right for non-baseline deps but wrong for baseline ones, because pinning conflicts with the runtime's managed versions.\n\n**Bias for everything else: include rather than skip when uncertain.** A package the Space doesn't actually use causes a slightly slower build. A missing required package causes a startup-time crash that's much harder for the user to diagnose. These costs aren't symmetric — the test failure that prompted this rule was exactly the second kind.\n\n**But two specific deps are *not* safe to add reflexively** because they routinely cause more problems than they solve on ZeroGPU:\n\n- `xformers` — pinned to specific torch versions, frequent source of conflicts. The ZeroGPU runtime ships torch 2.8+, so any pinned `xformers` version must support that. Additional gotcha on Blackwell: xformers' FA3 dispatch mis-gates the hardware (FA3 kernels are Hopper-only at `sm_90a`, but the dispatcher gates on `device_capability >= (9, 0)`, which also matches Blackwell) and crashes at kernel launch with `CUDA invalid argument`. If a Space using xformers attention hits this, disable FA3 dispatch at module load:\n\n  ```python\n  try:\n      from xformers.ops.fmha import _set_use_fa3\n      _set_use_fa3(False)\n  except Exception:\n      pass\n  ```\n\n  Only include `xformers` if `app.py` actually uses it.\n- `flash-attn` — needs a build step, often fails to install. Same torch 2.8+ alignment caveat as `xformers`. Only include if `app.py` actually uses it.\n\n**Pin other versions only when you have a reason** (e.g. a known incompatibility, or matching a recipe from the model card).\n\n### `README.md`\n\nSpaces are configured by the YAML frontmatter at the top of `README.md`. This frontmatter is what selects ZeroGPU.\n\n```\n---\ntitle: \u003Chuman-readable title>\nemoji: 🎨\ncolorFrom: pink\ncolorTo: purple\nsdk: gradio\nsdk_version: \u003Ccurrent Gradio version>\napp_file: app.py\npinned: false\nhardware: zero-a10g\nshort_description: \u003Cone short line for the Space tile, ~60 chars max>\nmodels:\n  - \u003Cbase model repo>\n  - \u003Clora repo>\n---\n\n# \u003Ctitle>\n\nA short description with links to the LoRA and base model.\n```\n\nKey fields:\n\n- `sdk: gradio` — required for ZeroGPU.\n- `sdk_version` — match the Gradio version you wrote against. Look up the current version (`pip index versions gradio`, or check https:\u002F\u002Fwww.gradio.app) rather than guessing.\n- `hardware: zero-a10g` — the legacy string for ZeroGPU. The actual hardware is NVIDIA RTX Pro 6000 Blackwell, but the identifier is `zero-a10g`. ZeroGPU is available to PRO, Team, and Enterprise accounts; if the user isn't subscribed, the Space will fall back to CPU. Mention this if you suspect they aren't on PRO.\n- `models:` — list base and LoRA repos. This enables Hub caching and discovery.\n- `short_description` — appears on the Space tile. **Keep it short (~60 characters or less).** The Hub's YAML validator rejects long values with a 400 from `https:\u002F\u002Fhuggingface.co\u002Fapi\u002Fvalidate-yaml`, which surfaces as an `HfHubHTTPError` during `create_repo` or `upload_file`. The exact server-side limit isn't documented and may change, so target the visible-tile-length range rather than pushing right up to a cap. If you do hit the 400, the fix is almost always to shorten this field. One sentence describing what the Space does is plenty — the README body below the YAML is where you put longer prose.\n\n### Single batched approval — order of operations matters\n\nThe discipline here is **write all three files first, then show them all together in one message**. Not \"write app.py → talk about it → write requirements → talk about it → write README → talk about it.\" That rhythm produces three approval moments even if you don't explicitly ask for approval, because the user is being asked to react after each file.\n\nConcretely:\n\n1. **Write `app.py`, `requirements.txt`, and `README.md` in succession with no intervening prose.** No commentary between files. No \"Now I'll write the next one.\" No description of what each file does as you produce it. Just the three files, back to back.\n2. **Then, in a single message, ask for approval covering all three at once.** Something like: \"Here's the Space — `app.py` (N lines), `requirements.txt`, and `README.md`. Review and confirm to publish, or tell me what to change.\"\n3. The user responds once, covering whatever they want changed across any of the three files.\n\nWhat to avoid:\n\n- Walking through `app.py`'s structure or design choices after writing it but before writing the others. Save commentary for either the pre-writing announcement (Phase 4 opening) or the single approval message after all three exist.\n- Asking \"ready for the next one?\" or \"want me to continue with requirements?\" — those are implicit per-file approvals.\n- Showing one file inline and offering to \"show the next when you're ready\" — same trap.\n- Treating any of the three files as optional or as a follow-up. They are produced together as one deliverable.\n\nIf the user interrupts after seeing the first file with feedback or a question, that's fine — engage with it — but the rule still applies: the next time you produce code, produce all remaining files together, not one at a time.\n\n---\n\n## Phase 5 — Publish the Space\n\nUse the authenticated session from Phase 1. Default to **private**, so the user can vet the Space before flipping it public. Confirm the target username with the user before creating: \"I'll publish to `{username}\u002F{space_name}` — confirm?\"\n\n```python\nfrom huggingface_hub import HfApi, SpaceHardware\n\napi = HfApi(token=hf_token)\nusername = api.whoami()[\"name\"]\nrepo_id = f\"{username}\u002F{space_name}\"\n\napi.create_repo(\n    repo_id=repo_id,\n    repo_type=\"space\",\n    space_sdk=\"gradio\",\n    space_hardware=SpaceHardware.ZERO_A10G,\n    private=True,\n    exist_ok=True,\n)\n\n# Upload files\nfor path in [\"app.py\", \"requirements.txt\", \"README.md\"]:\n    api.upload_file(path_or_fileobj=path, path_in_repo=path,\n                    repo_id=repo_id, repo_type=\"space\")\n```\n\nIf the LoRA repo itself is private\u002Fgated, the Space needs the token at runtime to download the LoRA. Set it as a Space secret:\n\n```python\napi.add_space_secret(repo_id=repo_id, key=\"HF_TOKEN\", value=HF_TOKEN)\n```\n\n…and in `app.py`, load the LoRA with `token=os.environ[\"HF_TOKEN\"]`.\n\n**After upload**, run the smoke-test below before sharing — the build runs asynchronously and silent failures (wrong `weight_name`, missing dep, wrong pipeline class) only surface at first inference. **Once the smoke-test passes**, share the Space URL (`https:\u002F\u002Fhuggingface.co\u002Fspaces\u002F{repo_id}`) and tell the user the Space is private — they'll need to be logged in to view it. Note that the build takes a few minutes; the logs are at `https:\u002F\u002Fhuggingface.co\u002Fspaces\u002F{repo_id}\u002Flogs\u002Fcontainer` if anything fails.\n\n**Publish-time failures (before the build starts):**\n\n- **`HfHubHTTPError: 400 Bad Request` from `https:\u002F\u002Fhuggingface.co\u002Fapi\u002Fvalidate-yaml`** during `create_repo` or `upload_file`. The README YAML failed server-side validation. By far the most common cause is a `short_description` that's too long; sometimes a stray field or malformed value. Fix: shorten `short_description` to ~60 characters and retry. If shortening doesn't fix it, look for typos in field names or invalid values (e.g. unsupported colors in `colorFrom`\u002F`colorTo`, an invalid `hardware` string).\n- **403 on `create_repo`** with `space_hardware=\"zero-a10g\"`: user isn't on PRO\u002FTeam\u002FEnterprise, so they can't request ZeroGPU at creation time. Fix: retry `create_repo` without `space_hardware`, leave `hardware: zero-a10g` in the README YAML — the Space gets created on CPU. The user can then either upgrade to PRO (auto-promotes to ZeroGPU) or apply for a [community GPU grant](https:\u002F\u002Fhuggingface.co\u002Fdocs\u002Fhub\u002Fspaces-gpus#community-gpu-grants) (request via the Space's hardware settings).\n- **401\u002F403 on `upload_file`**: token doesn't have write scope. Fix: ask the user for a write-scoped token.\n\n**Common build failures (after the build starts):**\n\n- LoRA `weight_name` mismatch in `load_lora_weights` → check the actual filename via `list_repo_files`.\n- Base model is gated and the token wasn't set as a Space secret.\n- ZeroGPU not allocated (user not on PRO) → Space falls back to CPU and is unusably slow.\n- Diffusers version doesn't recognize the pipeline class → pin to git diffusers in `requirements.txt`.\n- Missing dependency at module load → see `requirements.txt` derivation rules above; the most common case is a transitive dep like `torchvision` for Qwen-Image's text encoder.\n\nIf a build fails, offer to read the logs and propose a fix.\n\n---\n\n## Phase 6 — Smoke-test the Space\n\nBefore declaring the Space done and handing the URL to the user, exercise it once end-to-end. Several failure modes (wrong `weight_name`, wrong pipeline class, missing transitive dep, gated-base-model token issue) build cleanly and only surface at first inference. The `gradio` Python package ships a CLI that does exactly this — `gradio info` returns the endpoint signature, `gradio predict` runs an actual inference. Both ship with the `gradio` pip dependency the Space already needs, so they're available in any environment where this skill ran.\n\n**Step 1 — Wait for the build.** `create_repo` returns immediately, but the container image is still building. Poll `HfApi().get_space_runtime(repo_id).stage` until it reaches `RUNNING`:\n\n```python\nimport time\nfrom huggingface_hub import HfApi\napi = HfApi(token=hf_token)\nwhile True:\n    stage = api.get_space_runtime(repo_id).stage\n    if stage == \"RUNNING\": break\n    if stage in {\"BUILD_ERROR\", \"RUNTIME_ERROR\", \"CONFIG_ERROR\"}:\n        raise RuntimeError(f\"Build failed: {stage}. Logs: https:\u002F\u002Fhuggingface.co\u002Fspaces\u002F{repo_id}\u002Flogs\u002Fcontainer\")\n    time.sleep(15)\n```\n\nIf the build fails, fetch the container logs (`https:\u002F\u002Fhuggingface.co\u002Fspaces\u002F{repo_id}\u002Flogs\u002Fcontainer`), read the traceback, and propose a fix. Don't run `gradio info` against a Space that isn't running — it'll hang or 503.\n\n**Step 2 — Verify the endpoint signature.** `gradio info {repo_id} --token {hf_token}` returns the exposed endpoints and their parameter types. Read the output and confirm: (a) the endpoint exists (default is `\u002Fpredict`, but Blocks Spaces often have a custom name from the Python function name), (b) the parameters in order match what `app.py` declares, (c) file-typed params show `\"type\": \"filepath\"` as expected. If any of this is off, the user-facing UI may still appear correct but API calls will fail — fix and re-upload.\n\n**Step 3 — Run one real inference.** Pick the lightest viable input — the simplest example from the LoRA card, or one of the `gr.Examples` entries. Pass `--token` for private Spaces. For file inputs, the payload uses `{\"path\": \"...\", \"meta\": {\"_type\": \"gradio.FileData\"}}`.\n\n```bash\n# Text-to-image:\ngradio predict {repo_id} \u002Fpredict '{\"prompt\": \"...\", \"aspect_ratio\": \"1:1\", ...}' --token $HF_TOKEN\n\n# Image-to-image (file input):\ngradio predict {repo_id} \u002Fpredict '{\"input_image\": {\"path\": \"\u002Ftmp\u002Fsample.jpg\", \"meta\": {\"_type\": \"gradio.FileData\"}}, \"prompt\": \"...\"}' --token $HF_TOKEN\n```\n\nIf you don't have a local sample image for I2I, lift one from the LoRA repo (`hf_hub_download(repo_id, filename=\"example.png\")`) or the base model card.\n\n**Caveat for creative-mode Spaces.** `gradio info` and `gradio predict` only exercise the Python endpoint — they tell you nothing about whether custom JS in a `gr.HTML` widget works. If the Space uses creative mode (see `references\u002Fcreative-mode.md`), after the API smoke-test passes, **open the Space URL in a browser and verify the interaction once** before sharing. Server-side green plus broken JS is the most common failure mode for these.\n\n**Step 4 — Interpret the result.**\n\n- **Returns successfully and the output looks plausible** → done. Share the URL.\n- **HTTPError 503 \u002F \"Space is sleeping\"** → the Space spun down between steps 1 and 3. Wake it (`api.restart_space(repo_id)`) and retry.\n- **Inference error mentioning `weight_name` \u002F `safetensors`** → the LoRA filename in `app.py` doesn't match the actual file in the LoRA repo. Re-check `list_repo_files`, fix `weight_name=`, re-upload `app.py`.\n- **Inference error mentioning a missing pipeline class or attribute** → diffusers version too old. Switch `requirements.txt` to `git+https:\u002F\u002Fgithub.com\u002Fhuggingface\u002Fdiffusers` and re-upload.\n- **`ImportError` at module load** → missing dep. Add it to `requirements.txt` and re-upload. The runtime logs (`\u002Flogs\u002Frun`) name the missing package.\n- **OOM** → reduce default resolution or step count, or pick a smaller base variant.\n- **Timeout \u002F hangs** → bump `@spaces.GPU(duration=...)` and re-upload.\n\nThe smoke-test exists to convert these from \"user discovers it and reports back\" to \"you discover it and fix it before sharing.\" Don't skip it because the build went green — green-build-broken-inference is the most common failure mode for Spaces with a non-trivial pipeline.\n\n---\n\n## What to avoid\n\n- A generic \"one demo for all LoRAs\" template. The whole point of this skill is to tailor.\n- Lazy-loading the model inside the GPU function. Slow on ZeroGPU, and hides startup errors until first request.\n- `torch.compile`. Not supported on ZeroGPU.\n- `cache_examples=True` without `cache_mode=\"lazy\"` on ZeroGPU.\n- Uploading the LoRA weights into the Space repo. Pull from the LoRA's own Hub repo at runtime.\n- Asking for the HF token only at the end, then discovering the LoRA was private all along and you couldn't read the model card.\n- Exposing every diffusers knob. Pick the 1–3 controls that matter for this LoRA.\n- Long preambles in the chat reply once the Space is published. The Space URL is the deliverable; keep the wrap-up brief.\n\n## Limitations\n\n- Use this skill only when the task clearly matches its upstream product or API scope.\n- Verify commands, API behavior, pricing, quotas, credentials, and deployment effects against current official documentation before making changes.\n- Do not treat generated examples as a substitute for environment-specific tests, security review, or user approval for destructive or costly actions.\n","# Gradio LoRA Space Builder\n## When to Use\n\nUse this skill when you need build and publish a Gradio demo on Hugging Face Spaces for a user-provided LoRA. Use when someone asks to create, generate, ship, or publish a Space, demo, Gradio app, or playground for a LoRA — including LoRAs for Qwen-Image, Qwen-Image-Edit, LTX-Video, Wan, FLUX, SDXL, or other...\n\n\nBuild and publish a Gradio demo on Hugging Face Spaces that runs inference with a user-provided LoRA. Use whenever someone asks to create, generate, ship, or publish \"a Space\", \"a demo\", \"a Gradio app\", or \"a playground\" for a LoRA — whether the base model is Qwen-Image, Qwen-Image-Edit, LTX, or another diffusion model. Also use when someone describes a LoRA they trained or hosts on the Hub and wants to share it. The default target is ZeroGPU hardware and the default inference library is `diffusers` when the base model supports it.\n\nThe output is a real, published Space (private by default) that the user can try in the browser, not a local script.\n\n## What \"good\" looks like for these demos\n\nThe demo should feel handcrafted for this specific LoRA, not a generic template with the LoRA bolted on. Two LoRAs that share a task can still need different demos: a pose-control video LoRA and an outpainting video LoRA both take video in and produce video out, but the inputs the user provides, the preprocessing, and the controls are completely different. Recognizing that is the central job here.\n\nConcretely, a good demo:\n\n- Loads fast and runs fast — minimal model loading, sensible step count, no wasted computation per call.\n- Has a UI with exactly the controls this LoRA needs and nothing else. Excess sliders are a cost, not a feature.\n- Shows the user what's happening — progress, intermediate outputs where useful, the seed used, a clear error when input is missing.\n- Honors the LoRA's own recommendations from its model card: trigger words, recommended step count, recommended guidance scale, recommended LoRA scale, example inputs.\n- Is creative where creativity helps — interactive canvases, before\u002Fafter sliders, side-by-side previews of intermediate processing — and plain where plainness is right.\n\n## Workflow\n\nWork through these phases in order. Information gathered in one phase decides the next.\n\n1. Gather the LoRA info needed to pick a pipeline and design a UI.\n2. Pick the base pipeline and inference recipe.\n3. Design the UI for this specific LoRA's task and inputs.\n4. Write `app.py`, `requirements.txt`, and `README.md` together; show all three to the user for one batched approval.\n5. Publish the Space (private).\n\nDon't drip-feed questions across multiple turns. Batch them.\n\n---\n\n## Phase 1 — Gather LoRA info\n\nRequired: a LoRA repo on the Hub (e.g. `username\u002Fmy-lora`).\n\n**First, try to read the repo without a token.** If it succeeds, the repo is public — proceed. If it fails with 401\u002F403, the repo is private\u002Fgated and you need an authenticated session to read it. **Don't immediately ask for a token.** Check first whether the user is already authenticated.\n\n```python\nfrom huggingface_hub import HfApi, get_token\n\ncached_token = get_token()  # picks up HF_TOKEN env var or cached CLI login\nif cached_token:\n    try:\n        info = HfApi().whoami(token=cached_token)\n        username = info[\"name\"]\n        # info also has fine-grained token scope info if applicable\n    except Exception:\n        cached_token = None  # token exists but is invalid\u002Fexpired\n```\n\nThen:\n\n- If a valid cached token exists *and* it can read the repo, use it. No prompt needed.\n- If no cached token, or the cached token can't read this private repo, ask the user for a token — once, with the explanation below.\n\nWhen asking for a token (and only when you actually need to ask):\n\n> I need a Hugging Face access token with **write** scope (to read the LoRA if it's private\u002Fgated, and to publish the Space). Create one at https:\u002F\u002Fhuggingface.co\u002Fsettings\u002Ftokens. Paste it here.\n\nThe same token will be reused for publishing in the final phase, so this is a one-time ask.\n\n**Then read what's in the repo:**\n\n- List the repo files (`huggingface_hub.HfApi().list_repo_files(repo_id)`). Look for `.safetensors`, `README.md`, example images\u002Fvideos, multiple checkpoints.\n- Fetch the model card (`huggingface_hub.ModelCard.load(repo_id)`). The `data` dict has structured fields; the `text` has the README body.\n- If multiple `.safetensors` files exist, pick the right one — see \"Picking the LoRA weights file\" in `references\u002Fzerogpu-and-publishing.md`. Briefly: README-recommended file wins, then `pytorch_lora_weights.safetensors`, then latest training checkpoint, otherwise ask.\n\n**From the model card, try to determine:**\n\n- **Base model** — the `base_model` field, or text mentions in the README. Usually present. Use it to pick the pipeline reference file (see Phase 2).\n- **Task** — `pipeline_tag` if set, otherwise inferred from the base model and README text. The five tasks this skill handles: `text-to-image`, `image-to-image`, `text-to-video`, `image-to-video`, `video-to-video`.\n- **Trigger words** — often called \"trigger word\", \"instance prompt\", \"activation word\"; sometimes embedded in example prompts.\n- **Recommended inference recipe** — step count, guidance scale, true CFG scale, LoRA scale, resolution. Many LoRA cards include a Python snippet; trust its *parameters* (steps, guidance, CFG, LoRA scale, dtype). For *loading mechanics*, see `adapting-to-the-lora.md` — prefer `pipe.load_lora_weights(...)` over whatever loading approach the snippet uses.\n- **Example prompts and example media** — use these as Gradio examples in the UI.\n- **Sub-task \u002F specific use case** — for image edits and video LoRAs, \"what does this LoRA actually do\" matters as much as the task category. A relighting LoRA, a face-swap LoRA, and a style LoRA all might be image-to-image, but the UI for each is different.\n\n**When something can't be inferred, ask the user — once, in a single batched message.** Format the question to make answering trivial. For task category, list the five options as a numbered choice. For sub-task, give a one-line description (\"what does this LoRA do? e.g. 'relight portraits', 'apply manga style', 'extend videos to wider aspect ratios'\"). Don't ask if you can already infer it confidently from the base model or README.\n\nIf the model card has nothing helpful at all — no base model, no task, no example — surface that clearly: \"The model card has no usable info. I'll need you to tell me: (1) base model, (2) what this LoRA does, (3) recommended step count and guidance scale if you know them.\"\n\n---\n\n## Phase 2 — Pick the base pipeline\n\nTwo things to decide here: which reference file to load, and which pipeline class to use. They're not the same question — a base-model family file (e.g. `qwen-image.md`) covers multiple variants, and variants in the same family don't always share a pipeline class. Get this wrong and the Space loads but produces wrong output, or fails at startup.\n\n**Step 1 — Load the reference file for this base model family.**\n\n- `references\u002Fbase-models\u002Fqwen-image.md` — covers Qwen-Image and Qwen-Image-Edit family (text-to-image and image-to-image).\n- `references\u002Fbase-models\u002Fltx.md` — covers LTX family (text-to-video, image-to-video, video-to-video, including IC-LoRAs).\n- `references\u002Fbase-models\u002Fkrea-2.md` — covers Krea 2 (K2), text-to-image (train on RAW, run inference\u002FLoRAs on the Turbo distilled checkpoint).\n\nIf the base model isn't in one of these files, this skill doesn't have first-class support yet. Tell the user, and ask whether they want to proceed by analogy (use the closest model's recipe and adjust) or stop. Don't guess silently.\n\n**Step 2 — Verify the pipeline class against the base model's own card. This step is mandatory, not optional.**\n\nA new base model variant might use the same pipeline class with a different repo path, or a new pipeline class entirely. Don't trust the reference file's table alone — it's best-effort and can lag a recent release. Verify before committing:\n\n```python\nfrom huggingface_hub import ModelCard\nbase_card = ModelCard.load(base_model_id)\n# Read base_card.text — find the diffusers inference snippet, note the pipeline class it imports.\n```\n\nThe class imported in the base model card's diffusers snippet is the source of truth. Real examples where this matters:\n\n- `Qwen-Image-Edit` uses `QwenImageEditPipeline`. `Qwen-Image-Edit-2509` and `Qwen-Image-Edit-2511` use `QwenImageEditPlusPipeline` — different class, different default parameters, takes a list of images instead of one. A LoRA targeting 2511 loaded onto `QwenImageEditPipeline` produces broken output.\n- LTX-Video uses `LTXPipeline`\u002F`LTXImageToVideoPipeline`\u002F`LTXConditionPipeline`. LTX-2 uses `LTX2Pipeline` from a different module path. LTX-2.3 sometimes needs a native pipeline outside diffusers.\n\nIf the base model card has no diffusers snippet at all, fall back to the reference file's table — and tell the user you're falling back, in case they know something the table doesn't.\n\nThe cost of this verification is one Hub fetch and a few seconds of reading. The cost of skipping it is the failure mode the previous bullet describes — a \"working\" Space that's quietly using the wrong class.\n\n**Step 3 — Diffusers vs native pipeline.** Default to `diffusers` when the base model has a diffusers pipeline class. That's the case for Qwen-Image and Qwen-Image-Edit and most of LTX. Some LTX variants (notably LTX-2.3 with certain IC-LoRAs) need a native pipeline; the LTX reference says when. Diffusers gives standard `load_lora_weights` \u002F `set_adapters` semantics; the native path needs LoRA-specific glue.\n\n---\n\n## Phase 3 — Design the UI for this LoRA\n\nDon't reach for a template. Reason from the LoRA's task and inputs to a UI.\n\nRead `references\u002Ftasks.md` for the per-task baseline UI patterns (what the standard inputs\u002Foutputs look like for T2I, I2I, T2V, I2V, V2V).\n\nThen read `references\u002Fadapting-to-the-lora.md`, which is about *thinking through what this specific LoRA needs* — beyond the task category. That file is the most important one in this skill. The same task can need very different UIs: a pose-control LTX LoRA needs a video input and a pose-extraction preview; an outpaint LTX LoRA needs an aspect-ratio picker and a black-margin preview; a relighting Flux LoRA needs an image and a brush canvas for indicating where to add light. None of those reduce to \"the V2V template\" or \"the I2I template\".\n\n**Self-check before writing the UI.** Write one sentence describing what a user does with this Space in 10 seconds. If that sentence doesn't distinguish this LoRA from any other LoRA of the same task, the UI isn't shaped enough yet.\n\nExamples that pass the self-check:\n\n- \"Upload a video, pick a target aspect ratio, click Generate; the model fills the empty margins.\"\n- \"Draw colored brush strokes where you want light, pick an illumination style, click Generate; the model relights the photo.\"\n- \"Upload a video of someone moving and an image of a different character; the model produces a video of the character doing the motion.\"\n\nExamples that fail:\n\n- \"Type a prompt and click generate.\" (Generic T2I — say more.)\n- \"Upload an image and an instruction.\" (Generic edit — what kind of edit?)\n\n**Gradio component freshness.** Gradio's component set evolves. Before defaulting to plain components, consider whether something newer fits better — for example `gr.ImageSlider` for before\u002Fafter on edit LoRAs, `gr.BrowserState` for persistent prefs, `@gr.render` for UIs that change based on input. If you're unsure whether a component exists or what its signature is, web-fetch the current Gradio docs at https:\u002F\u002Fwww.gradio.app\u002Fdocs rather than guessing.\n\n**When stock and Hub custom components aren't enough — creative mode.** If the LoRA's natural input is a shape no Gradio component (built-in or on the Hub) expresses well — point sets, strokes, trajectories, multi-region annotations with metadata, 3D rotation gizmos, timeline scrubbers, anything where the user manipulates a thing on top of media — drop down to custom HTML\u002FJS via `gr.HTML`. See `references\u002Fcreative-mode.md` for the Gradio primitives (`gr.HTML`, `head=` injection, `elem_id` addressing, the two JS↔Python state-sync approaches), the discipline around defining a JSON wire format, and the pitfalls. Don't reach for creative mode just because it would be cool — reach for it when the LoRA's input shape demands it. And don't skip the Hub custom components rung above (e.g. `gradio_image_annotation`) before going fully bespoke.\n\n**`gr.Examples` for media-input Spaces.** When no fitting example media is available from the model's own repo, pull from the shared input pools — split by modality so the HF dataset viewer can render proper thumbnails: images at [`linoyts\u002Frepo-to-space-example-inputs`](https:\u002F\u002Fhuggingface.co\u002Fdatasets\u002Flinoyts\u002Frepo-to-space-example-inputs), videos at [`linoyts\u002Frepo-to-space-example-videos`](https:\u002F\u002Fhuggingface.co\u002Fdatasets\u002Flinoyts\u002Frepo-to-space-example-videos). Both are CC0 with `categories` + natural-language `caption` metadata and the same filter\u002Frank recipe in each dataset README. Pick 2–3 that fit the task, preprocess to the shapes the model expects, and bake the copies into the Space. Set `cache_examples=True, cache_mode=\"lazy\"` so the first click caches without running examples at build time (see `references\u002Fzerogpu-and-publishing.md`).\n\n---\n\n## Phase 4 — Write the Space files\n\nBefore writing, tell the user concretely what's about to happen — name the actual files. Not \"I'll write the three files\" but something like:\n\n> \"Now I'll write the three files needed to publish a Space: **`app.py`** (the Gradio demo and inference code), **`requirements.txt`** (Python dependencies), and **`README.md`** (Space configuration including ZeroGPU hardware setting). Then I'll show all three for your review before publishing.\"\n\nThis anchors the user in what's being produced. Don't say \"three files\" without naming them — it's vague and signals lack of commitment to the deliverable.\n\nThe three files are tightly coupled: `requirements.txt` is determined by what `app.py` imports, and the `README.md` YAML frontmatter sets the SDK version, hardware, and Space title that have to match. Write them together, then show all three to the user for approval in **one batched message** before publishing.\n\nRead `references\u002Fzerogpu-and-publishing.md` for the ZeroGPU rules. The non-obvious ones:\n\n- Models go on `cuda` at module level (not lazy-loaded inside the GPU function). ZeroGPU has a CUDA emulation that makes this work pre-allocation, and module-level placement is significantly faster than deferred placement.\n- The function that runs inference is decorated with `@spaces.GPU(duration=...)`. Pick a duration appropriate for the task — short for image generation, longer for video.\n- Don't use `torch.compile` — it's incompatible with ZeroGPU's process model.\n\n### `app.py`\n\nCompose from the pieces decided in Phases 1–3. Don't paste from a template. Each section should be there because it's needed:\n\n- Imports — `gradio as gr`, `torch`, `spaces`, the pipeline class, anything the preprocessing needs.\n- Constants — `LORA_REPO`, `BASE_MODEL`, recommended step count, guidance, LoRA scale, trigger word.\n- Module-level model load — pipeline `from_pretrained`, `.to(\"cuda\")`, `load_lora_weights`. If the LoRA repo is private, pass `token=os.environ[\"HF_TOKEN\"]`.\n- Preprocessing functions (if any) — pose extraction, padding, mask building, etc. CPU code can run at module level; GPU code needs to be inside a `@spaces.GPU` function.\n- The inference function — decorated with `@spaces.GPU(duration=...)`. Validates inputs, applies trigger word, builds the pipeline kwargs, returns outputs.\n- The Gradio Blocks — the UI from Phase 3, wired to the inference function.\n\nCommon things to get right:\n\n- Return the actually-used seed alongside the result so the user can reproduce.\n- `gr.Progress(track_tqdm=True)` on the inference function surfaces diffusers' internal progress bar.\n- Validate inputs — raise `gr.Error(\"Please upload an image first.\")` when a required input is missing, rather than letting the pipeline fail with a cryptic error.\n- On `gr.Examples`, use `cache_examples=True, cache_mode=\"lazy\"` — plain `cache_examples=True` runs examples at build time and fails on ZeroGPU; lazy mode defers caching to the first user click.\n\n### `requirements.txt`\n\nDon't ship a fixed minimal list and hope for the best. The \"minimal\" list works for plain T2I LoRAs and breaks the moment the base model has a vision-language text encoder, video output, or any non-trivial preprocessing. **Derive `requirements.txt` from what the Space actually needs**, in this order:\n\n1. **Every top-level non-stdlib import in `app.py`.** If `app.py` does `import cv2`, `requirements.txt` has `opencv-python`. If it does `from controlnet_aux import OpenposeDetector`, `requirements.txt` has `controlnet-aux`. Walk the imports mechanically. (Note the exclusions in the next paragraph — some imports are runtime built-ins and don't need to be listed.)\n2. **What the base-model reference's \"Required dependencies\" subsection says.** Each base-model file lists the non-obvious extras the pipeline pulls in — `torchvision` for Qwen-Image (Qwen 2.5-VL text encoder), `imageio[ffmpeg]` for LTX (video export), etc. Include all of them. These are the deps that aren't picked up from imports because the pipeline's components import them transitively at load time.\n3. **What the LoRA's own model card explicitly mentions installing.** If the LoRA README has its own `pip install` block, lift the deps from there.\n4. **The diffusers\u002FML stack:** `diffusers`, `transformers`, `accelerate`, `peft`, `safetensors`. Default to plain (unpinned). Switch `diffusers` to `git+https:\u002F\u002Fgithub.com\u002Fhuggingface\u002Fdiffusers` if the base-model reference says the model needs it (recent releases often do — Qwen-Image-Edit-2511 is a current example).\n\n**What *not* to list in `requirements.txt`:**\n\n- **`gradio`** — controlled by the `sdk_version:` field in `README.md`'s YAML frontmatter, not by `requirements.txt`. Listing it in requirements is at best ignored, at worst causes a version conflict with the SDK. Set the version in the README only.\n- **`torch`** — provided by the Space runtime. Only add if you need a specific version pinned (rare, and usually a sign something else is wrong).\n- **`spaces`** — provided by the Space runtime. Only add if you need a specific version pinned.\n- **`huggingface_hub`** — provided by the Space runtime. Only add if you need a specific version pinned.\n\nThese four come pre-installed in the ZeroGPU container. Listing them anyway is the kind of \"include rather than skip\" instinct that's right for non-baseline deps but wrong for baseline ones, because pinning conflicts with the runtime's managed versions.\n\n**Bias for everything else: include rather than skip when uncertain.** A package the Space doesn't actually use causes a slightly slower build. A missing required package causes a startup-time crash that's much harder for the user to diagnose. These costs aren't symmetric — the test failure that prompted this rule was exactly the second kind.\n\n**But two specific deps are *not* safe to add reflexively** because they routinely cause more problems than they solve on ZeroGPU:\n\n- `xformers` — pinned to specific torch versions, frequent source of conflicts. The ZeroGPU runtime ships torch 2.8+, so any pinned `xformers` version must support that. Additional gotcha on Blackwell: xformers' FA3 dispatch mis-gates the hardware (FA3 kernels are Hopper-only at `sm_90a`, but the dispatcher gates on `device_capability >= (9, 0)`, which also matches Blackwell) and crashes at kernel launch with `CUDA invalid argument`. If a Space using xformers attention hits this, disable FA3 dispatch at module load:\n\n  ```python\n  try:\n      from xformers.ops.fmha import _set_use_fa3\n      _set_use_fa3(False)\n  except Exception:\n      pass\n  ```\n\n  Only include `xformers` if `app.py` actually uses it.\n- `flash-attn` — needs a build step, often fails to install. Same torch 2.8+ alignment caveat as `xformers`. Only include if `app.py` actually uses it.\n\n**Pin other versions only when you have a reason** (e.g. a known incompatibility, or matching a recipe from the model card).\n\n### `README.md`\n\nSpaces are configured by the YAML frontmatter at the top of `README.md`. This frontmatter is what selects ZeroGPU.\n\n```\n---\ntitle: \u003Chuman-readable title>\nemoji: 🎨\ncolorFrom: pink\ncolorTo: purple\nsdk: gradio\nsdk_version: \u003Ccurrent Gradio version>\napp_file: app.py\npinned: false\nhardware: zero-a10g\nshort_description: \u003Cone short line for the Space tile, ~60 chars max>\nmodels:\n  - \u003Cbase model repo>\n  - \u003Clora repo>\n---\n\n# \u003Ctitle>\n\nA short description with links to the LoRA and base model.\n```\n\nKey fields:\n\n- `sdk: gradio` — required for ZeroGPU.\n- `sdk_version` — match the Gradio version you wrote against. Look up the current version (`pip index versions gradio`, or check https:\u002F\u002Fwww.gradio.app) rather than guessing.\n- `hardware: zero-a10g` — the legacy string for ZeroGPU. The actual hardware is NVIDIA RTX Pro 6000 Blackwell, but the identifier is `zero-a10g`. ZeroGPU is available to PRO, Team, and Enterprise accounts; if the user isn't subscribed, the Space will fall back to CPU. Mention this if you suspect they aren't on PRO.\n- `models:` — list base and LoRA repos. This enables Hub caching and discovery.\n- `short_description` — appears on the Space tile. **Keep it short (~60 characters or less).** The Hub's YAML validator rejects long values with a 400 from `https:\u002F\u002Fhuggingface.co\u002Fapi\u002Fvalidate-yaml`, which surfaces as an `HfHubHTTPError` during `create_repo` or `upload_file`. The exact server-side limit isn't documented and may change, so target the visible-tile-length range rather than pushing right up to a cap. If you do hit the 400, the fix is almost always to shorten this field. One sentence describing what the Space does is plenty — the README body below the YAML is where you put longer prose.\n\n### Single batched approval — order of operations matters\n\nThe discipline here is **write all three files first, then show them all together in one message**. Not \"write app.py → talk about it → write requirements → talk about it → write README → talk about it.\" That rhythm produces three approval moments even if you don't explicitly ask for approval, because the user is being asked to react after each file.\n\nConcretely:\n\n1. **Write `app.py`, `requirements.txt`, and `README.md` in succession with no intervening prose.** No commentary between files. No \"Now I'll write the next one.\" No description of what each file does as you produce it. Just the three files, back to back.\n2. **Then, in a single message, ask for approval covering all three at once.** Something like: \"Here's the Space — `app.py` (N lines), `requirements.txt`, and `README.md`. Review and confirm to publish, or tell me what to change.\"\n3. The user responds once, covering whatever they want changed across any of the three files.\n\nWhat to avoid:\n\n- Walking through `app.py`'s structure or design choices after writing it but before writing the others. Save commentary for either the pre-writing announcement (Phase 4 opening) or the single approval message after all three exist.\n- Asking \"ready for the next one?\" or \"want me to continue with requirements?\" — those are implicit per-file approvals.\n- Showing one file inline and offering to \"show the next when you're ready\" — same trap.\n- Treating any of the three files as optional or as a follow-up. They are produced together as one deliverable.\n\nIf the user interrupts after seeing the first file with feedback or a question, that's fine — engage with it — but the rule still applies: the next time you produce code, produce all remaining files together, not one at a time.\n\n---\n\n## Phase 5 — Publish the Space\n\nUse the authenticated session from Phase 1. Default to **private**, so the user can vet the Space before flipping it public. Confirm the target username with the user before creating: \"I'll publish to `{username}\u002F{space_name}` — confirm?\"\n\n```python\nfrom huggingface_hub import HfApi, SpaceHardware\n\napi = HfApi(token=hf_token)\nusername = api.whoami()[\"name\"]\nrepo_id = f\"{username}\u002F{space_name}\"\n\napi.create_repo(\n    repo_id=repo_id,\n    repo_type=\"space\",\n    space_sdk=\"gradio\",\n    space_hardware=SpaceHardware.ZERO_A10G,\n    private=True,\n    exist_ok=True,\n)\n\n# Upload files\nfor path in [\"app.py\", \"requirements.txt\", \"README.md\"]:\n    api.upload_file(path_or_fileobj=path, path_in_repo=path,\n                    repo_id=repo_id, repo_type=\"space\")\n```\n\nIf the LoRA repo itself is private\u002Fgated, the Space needs the token at runtime to download the LoRA. Set it as a Space secret:\n\n```python\napi.add_space_secret(repo_id=repo_id, key=\"HF_TOKEN\", value=HF_TOKEN)\n```\n\n…and in `app.py`, load the LoRA with `token=os.environ[\"HF_TOKEN\"]`.\n\n**After upload**, run the smoke-test below before sharing — the build runs asynchronously and silent failures (wrong `weight_name`, missing dep, wrong pipeline class) only surface at first inference. **Once the smoke-test passes**, share the Space URL (`https:\u002F\u002Fhuggingface.co\u002Fspaces\u002F{repo_id}`) and tell the user the Space is private — they'll need to be logged in to view it. Note that the build takes a few minutes; the logs are at `https:\u002F\u002Fhuggingface.co\u002Fspaces\u002F{repo_id}\u002Flogs\u002Fcontainer` if anything fails.\n\n**Publish-time failures (before the build starts):**\n\n- **`HfHubHTTPError: 400 Bad Request` from `https:\u002F\u002Fhuggingface.co\u002Fapi\u002Fvalidate-yaml`** during `create_repo` or `upload_file`. The README YAML failed server-side validation. By far the most common cause is a `short_description` that's too long; sometimes a stray field or malformed value. Fix: shorten `short_description` to ~60 characters and retry. If shortening doesn't fix it, look for typos in field names or invalid values (e.g. unsupported colors in `colorFrom`\u002F`colorTo`, an invalid `hardware` string).\n- **403 on `create_repo`** with `space_hardware=\"zero-a10g\"`: user isn't on PRO\u002FTeam\u002FEnterprise, so they can't request ZeroGPU at creation time. Fix: retry `create_repo` without `space_hardware`, leave `hardware: zero-a10g` in the README YAML — the Space gets created on CPU. The user can then either upgrade to PRO (auto-promotes to ZeroGPU) or apply for a [community GPU grant](https:\u002F\u002Fhuggingface.co\u002Fdocs\u002Fhub\u002Fspaces-gpus#community-gpu-grants) (request via the Space's hardware settings).\n- **401\u002F403 on `upload_file`**: token doesn't have write scope. Fix: ask the user for a write-scoped token.\n\n**Common build failures (after the build starts):**\n\n- LoRA `weight_name` mismatch in `load_lora_weights` → check the actual filename via `list_repo_files`.\n- Base model is gated and the token wasn't set as a Space secret.\n- ZeroGPU not allocated (user not on PRO) → Space falls back to CPU and is unusably slow.\n- Diffusers version doesn't recognize the pipeline class → pin to git diffusers in `requirements.txt`.\n- Missing dependency at module load → see `requirements.txt` derivation rules above; the most common case is a transitive dep like `torchvision` for Qwen-Image's text encoder.\n\nIf a build fails, offer to read the logs and propose a fix.\n\n---\n\n## Phase 6 — Smoke-test the Space\n\nBefore declaring the Space done and handing the URL to the user, exercise it once end-to-end. Several failure modes (wrong `weight_name`, wrong pipeline class, missing transitive dep, gated-base-model token issue) build cleanly and only surface at first inference. The `gradio` Python package ships a CLI that does exactly this — `gradio info` returns the endpoint signature, `gradio predict` runs an actual inference. Both ship with the `gradio` pip dependency the Space already needs, so they're available in any environment where this skill ran.\n\n**Step 1 — Wait for the build.** `create_repo` returns immediately, but the container image is still building. Poll `HfApi().get_space_runtime(repo_id).stage` until it reaches `RUNNING`:\n\n```python\nimport time\nfrom huggingface_hub import HfApi\napi = HfApi(token=hf_token)\nwhile True:\n    stage = api.get_space_runtime(repo_id).stage\n    if stage == \"RUNNING\": break\n    if stage in {\"BUILD_ERROR\", \"RUNTIME_ERROR\", \"CONFIG_ERROR\"}:\n        raise RuntimeError(f\"Build failed: {stage}. Logs: https:\u002F\u002Fhuggingface.co\u002Fspaces\u002F{repo_id}\u002Flogs\u002Fcontainer\")\n    time.sleep(15)\n```\n\nIf the build fails, fetch the container logs (`https:\u002F\u002Fhuggingface.co\u002Fspaces\u002F{repo_id}\u002Flogs\u002Fcontainer`), read the traceback, and propose a fix. Don't run `gradio info` against a Space that isn't running — it'll hang or 503.\n\n**Step 2 — Verify the endpoint signature.** `gradio info {repo_id} --token {hf_token}` returns the exposed endpoints and their parameter types. Read the output and confirm: (a) the endpoint exists (default is `\u002Fpredict`, but Blocks Spaces often have a custom name from the Python function name), (b) the parameters in order match what `app.py` declares, (c) file-typed params show `\"type\": \"filepath\"` as expected. If any of this is off, the user-facing UI may still appear correct but API calls will fail — fix and re-upload.\n\n**Step 3 — Run one real inference.** Pick the lightest viable input — the simplest example from the LoRA card, or one of the `gr.Examples` entries. Pass `--token` for private Spaces. For file inputs, the payload uses `{\"path\": \"...\", \"meta\": {\"_type\": \"gradio.FileData\"}}`.\n\n```bash\n# Text-to-image:\ngradio predict {repo_id} \u002Fpredict '{\"prompt\": \"...\", \"aspect_ratio\": \"1:1\", ...}' --token $HF_TOKEN\n\n# Image-to-image (file input):\ngradio predict {repo_id} \u002Fpredict '{\"input_image\": {\"path\": \"\u002Ftmp\u002Fsample.jpg\", \"meta\": {\"_type\": \"gradio.FileData\"}}, \"prompt\": \"...\"}' --token $HF_TOKEN\n```\n\nIf you don't have a local sample image for I2I, lift one from the LoRA repo (`hf_hub_download(repo_id, filename=\"example.png\")`) or the base model card.\n\n**Caveat for creative-mode Spaces.** `gradio info` and `gradio predict` only exercise the Python endpoint — they tell you nothing about whether custom JS in a `gr.HTML` widget works. If the Space uses creative mode (see `references\u002Fcreative-mode.md`), after the API smoke-test passes, **open the Space URL in a browser and verify the interaction once** before sharing. Server-side green plus broken JS is the most common failure mode for these.\n\n**Step 4 — Interpret the result.**\n\n- **Returns successfully and the output looks plausible** → done. Share the URL.\n- **HTTPError 503 \u002F \"Space is sleeping\"** → the Space spun down between steps 1 and 3. Wake it (`api.restart_space(repo_id)`) and retry.\n- **Inference error mentioning `weight_name` \u002F `safetensors`** → the LoRA filename in `app.py` doesn't match the actual file in the LoRA repo. Re-check `list_repo_files`, fix `weight_name=`, re-upload `app.py`.\n- **Inference error mentioning a missing pipeline class or attribute** → diffusers version too old. Switch `requirements.txt` to `git+https:\u002F\u002Fgithub.com\u002Fhuggingface\u002Fdiffusers` and re-upload.\n- **`ImportError` at module load** → missing dep. Add it to `requirements.txt` and re-upload. The runtime logs (`\u002Flogs\u002Frun`) name the missing package.\n- **OOM** → reduce default resolution or step count, or pick a smaller base variant.\n- **Timeout \u002F hangs** → bump `@spaces.GPU(duration=...)` and re-upload.\n\nThe smoke-test exists to convert these from \"user discovers it and reports back\" to \"you discover it and fix it before sharing.\" Don't skip it because the build went green — green-build-broken-inference is the most common failure mode for Spaces with a non-trivial pipeline.\n\n---\n\n## What to avoid\n\n- A generic \"one demo for all LoRAs\" template. The whole point of this skill is to tailor.\n- Lazy-loading the model inside the GPU function. Slow on ZeroGPU, and hides startup errors until first request.\n- `torch.compile`. Not supported on ZeroGPU.\n- `cache_examples=True` without `cache_mode=\"lazy\"` on ZeroGPU.\n- Uploading the LoRA weights into the Space repo. Pull from the LoRA's own Hub repo at runtime.\n- Asking for the HF token only at the end, then discovering the LoRA was private all along and you couldn't read the model card.\n- Exposing every diffusers knob. Pick the 1–3 controls that matter for this LoRA.\n- Long preambles in the chat reply once the Space is published. The Space URL is the deliverable; keep the wrap-up brief.\n\n## Limitations\n\n- Use this skill only when the task clearly matches its upstream product or API scope.\n- Verify commands, API behavior, pricing, quotas, credentials, and deployment effects against current official documentation before making changes.\n- Do not treat generated examples as a substitute for environment-specific tests, security review, or user approval for destructive or costly actions.\n",{"name":5,"risk":24,"source":25,"license":15,"date_added":26,"description":7,"source_repo":27,"source_type":28,"license_source":29},"unknown","https:\u002F\u002Fgithub.com\u002Fhuggingface\u002Fskills\u002Ftree\u002Fmain\u002Fskills\u002Fhuggingface-lora-space-builder",1782864000000,"huggingface\u002Fskills","official","https:\u002F\u002Fgithub.com\u002Fhuggingface\u002Fskills\u002Fblob\u002Fmain\u002FLICENSE","main","b1e4ffadb4f933bbbcaa03a83f8b9929171ac28b",".agents\u002Fskills\u002Fhuggingface-lora-space-builder",0,"https:\u002F\u002Fgithub.com\u002FHazek-dc\u002FPresensiGuru_FaceNet_EMAR","https:\u002F\u002Fgithub.com\u002FHazek-dc","2026-10-22 08:36:44",{"source":8,"skillName":5,"commands":38,"prompt":48,"zipAvailable":49},[39,42,45],{"tool":40,"command":41},"npx","npx skills add Hazek-dc\u002FPresensiGuru_FaceNet_EMAR --skill huggingface-lora-space-builder",{"tool":43,"command":44},"bunx","bunx skills add Hazek-dc\u002FPresensiGuru_FaceNet_EMAR --skill huggingface-lora-space-builder",{"tool":46,"command":47},"pnpm","pnpm dlx skills add Hazek-dc\u002FPresensiGuru_FaceNet_EMAR --skill huggingface-lora-space-builder","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FHazek-dc\u002FPresensiGuru_FaceNet_EMAR\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fhuggingface-lora-space-builder\u002FSKILL.md",true,[51,57,61,65,69,73,77],{"path":52,"resourceType":53,"resourceTypeDesc":54,"sizeBytes":55,"sourceHtmlUrl":56},"references\u002Fadapting-to-the-lora.md","REFERENCE","参考文档",13826,"https:\u002F\u002Fgithub.com\u002FHazek-dc\u002FPresensiGuru_FaceNet_EMAR\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fhuggingface-lora-space-builder\u002Freferences\u002Fadapting-to-the-lora.md",{"path":58,"resourceType":53,"resourceTypeDesc":54,"sizeBytes":59,"sourceHtmlUrl":60},"references\u002Fbase-models\u002Fkrea-2.md",4086,"https:\u002F\u002Fgithub.com\u002FHazek-dc\u002FPresensiGuru_FaceNet_EMAR\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fhuggingface-lora-space-builder\u002Freferences\u002Fbase-models\u002Fkrea-2.md",{"path":62,"resourceType":53,"resourceTypeDesc":54,"sizeBytes":63,"sourceHtmlUrl":64},"references\u002Fbase-models\u002Fltx.md",15390,"https:\u002F\u002Fgithub.com\u002FHazek-dc\u002FPresensiGuru_FaceNet_EMAR\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fhuggingface-lora-space-builder\u002Freferences\u002Fbase-models\u002Fltx.md",{"path":66,"resourceType":53,"resourceTypeDesc":54,"sizeBytes":67,"sourceHtmlUrl":68},"references\u002Fbase-models\u002Fqwen-image.md",7467,"https:\u002F\u002Fgithub.com\u002FHazek-dc\u002FPresensiGuru_FaceNet_EMAR\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fhuggingface-lora-space-builder\u002Freferences\u002Fbase-models\u002Fqwen-image.md",{"path":70,"resourceType":53,"resourceTypeDesc":54,"sizeBytes":71,"sourceHtmlUrl":72},"references\u002Fcreative-mode.md",19151,"https:\u002F\u002Fgithub.com\u002FHazek-dc\u002FPresensiGuru_FaceNet_EMAR\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fhuggingface-lora-space-builder\u002Freferences\u002Fcreative-mode.md",{"path":74,"resourceType":53,"resourceTypeDesc":54,"sizeBytes":75,"sourceHtmlUrl":76},"references\u002Ftasks.md",10312,"https:\u002F\u002Fgithub.com\u002FHazek-dc\u002FPresensiGuru_FaceNet_EMAR\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fhuggingface-lora-space-builder\u002Freferences\u002Ftasks.md",{"path":78,"resourceType":53,"resourceTypeDesc":54,"sizeBytes":79,"sourceHtmlUrl":80},"references\u002Fzerogpu-and-publishing.md",14164,"https:\u002F\u002Fgithub.com\u002FHazek-dc\u002FPresensiGuru_FaceNet_EMAR\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fhuggingface-lora-space-builder\u002Freferences\u002Fzerogpu-and-publishing.md",[82,90,97,104,111,118],{"skillNo":83,"name":84,"nameZh":6,"description":85,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":86,"licenseFileUrl":6,"sourceHtmlUrl":87,"categories":88,"keywords":89,"publishedAt":19},"01M7DS6GGYRZAYD33PFPS8Z2T3","testing-best-practices","Laravel test design and review. Use when selecting coverage, naming or structuring tests, choosing assertions or test data, isolating dependencies, testing HTTP or security boundaries, improving suite performance, or reviewing test value. Use framework guidance or search-docs for Pest and PHPUnit syntax.","MIT","https:\u002F\u002Fgithub.com\u002FHazek-dc\u002FPresensiGuru_FaceNet_EMAR\u002Fblob\u002Fmain\u002Fattendance-web\u002F.claude\u002Fskills\u002Ftesting-best-practices\u002FSKILL.md",[],[],{"skillNo":91,"name":92,"nameZh":6,"description":93,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":86,"licenseFileUrl":6,"sourceHtmlUrl":94,"categories":95,"keywords":96,"publishedAt":19},"01M7DS6BC3AW7HTPRHE2TTVKWM","tailwindcss-development","Always invoke when the user's message includes 'tailwind' in any form. Also invoke for: building responsive grid layouts (multi-column card grids, product grids), flex\u002Fgrid page structures (dashboards with sidebars, fixed topbars, mobile-toggle navs), styling UI components (cards, tables, navbars, pricing sections, forms, inputs, badges), adding dark mode variants, fixing spacing or typography, and Tailwind v3\u002Fv4 work. The core use case: writing or fixing Tailwind utility classes in HTML templates (Blade, JSX, Vue). Skip for backend PHP logic, database queries, API routes, JavaScript with no HTML\u002FCSS component, CSS file audits, build tool configuration, and vanilla CSS.","https:\u002F\u002Fgithub.com\u002FHazek-dc\u002FPresensiGuru_FaceNet_EMAR\u002Fblob\u002Fmain\u002Fattendance-web\u002F.claude\u002Fskills\u002Ftailwindcss-development\u002FSKILL.md",[],[],{"skillNo":98,"name":99,"nameZh":6,"description":100,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":86,"licenseFileUrl":6,"sourceHtmlUrl":101,"categories":102,"keywords":103,"publishedAt":19},"01M7DS66GE6B11MYJDVC74HXM4","laravel-best-practices","Apply this skill whenever writing, reviewing, or refactoring Laravel PHP code. This includes creating or modifying controllers, models, migrations, form requests, policies, jobs, scheduled commands, service classes, and Eloquent queries. Triggers for N+1 and query performance issues, caching strategies, authorization and security patterns, validation, error handling, queue and job configuration, route definitions, and architectural decisions. Also use for Laravel code reviews and refactoring existing Laravel code to follow best practices. Covers any task involving Laravel backend PHP code patterns.","https:\u002F\u002Fgithub.com\u002FHazek-dc\u002FPresensiGuru_FaceNet_EMAR\u002Fblob\u002Fmain\u002Fattendance-web\u002F.claude\u002Fskills\u002Flaravel-best-practices\u002FSKILL.md",[],[],{"skillNo":105,"name":106,"nameZh":6,"description":107,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":86,"licenseFileUrl":6,"sourceHtmlUrl":108,"categories":109,"keywords":110,"publishedAt":19},"01M7DS5ZW717DMS6P1E90AQCKV","infer-conventions","Use this skill to analyze how a Laravel application is actually written and record its conventions as shared rules. Trigger when the user wants to detect, infer, document, or standardize project conventions or coding style, set up or grow `.ai\u002Frules`, resolve mixed or conflicting patterns (e.g. \"are we using Form Requests or inline validation?\"), or onboard agents and teammates to \"how we do things here\". Covers: a systematic sweep of ~49 Laravel convention dimensions (validation, models, architecture, testing, frontend, database, console), open-ended house-pattern discovery, conflict reporting, and recording rules scoped to the right paths via the Boost `record-rule` MCP tool. Only run this skill when the user explicitly asks for it; never start a sweep as part of another task. Do not use for one-off code review, enforcing formatting a linter already handles, or editing `.ai\u002Frules` files by hand.","https:\u002F\u002Fgithub.com\u002FHazek-dc\u002FPresensiGuru_FaceNet_EMAR\u002Fblob\u002Fmain\u002Fattendance-web\u002F.claude\u002Fskills\u002Finfer-conventions\u002FSKILL.md",[],[],{"skillNo":112,"name":113,"nameZh":6,"description":114,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":86,"licenseFileUrl":6,"sourceHtmlUrl":115,"categories":116,"keywords":117,"publishedAt":19},"01M7DS5W12RGCVJTFQJ1N0GB8E","inertia-react-development","Develops Inertia.js v2 React client-side applications. Activates when creating React pages, forms, or navigation; using \u003CLink>, \u003CForm>, useForm, or router; working with deferred props, prefetching, or polling; or when user mentions React with Inertia, React pages, React forms, or React navigation.","https:\u002F\u002Fgithub.com\u002FHazek-dc\u002FPresensiGuru_FaceNet_EMAR\u002Fblob\u002Fmain\u002Fattendance-web\u002F.claude\u002Fskills\u002Finertia-react-development\u002FSKILL.md",[],[],{"skillNo":119,"name":120,"nameZh":6,"description":121,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":86,"licenseFileUrl":6,"sourceHtmlUrl":122,"categories":123,"keywords":124,"publishedAt":19},"01M7DS5PVDPMPCWSK2RXPDC9BB","deploying-to-cloud","Deploys and manages Laravel applications on Laravel Cloud using the `cloud` CLI. Use when the user wants to deploy an app, ship to Cloud, create or manage applications, environments, databases, caches, object storage, queues, domains, instances, background processes, secrets, compute, scheduled tasks, or Laravel Cloud infrastructure; or check billing, usage, or spend. Triggers on deployment, shipping, Cloud management, environment setup, database provisioning, billing or usage queries, the `cloud` CLI, and Laravel Cloud deployment troubleshooting.","https:\u002F\u002Fgithub.com\u002FHazek-dc\u002FPresensiGuru_FaceNet_EMAR\u002Fblob\u002Fmain\u002Fattendance-web\u002F.claude\u002Fskills\u002Fdeploying-to-cloud\u002FSKILL.md",[],[]]