xinfer: Skill for Cursor

.cursor/skills/add-model/SKILL.md

add-model is a skill for Cursor from guoqingbao/xinfer. It costs 95 tokens per session (4,577 once invoked), scanned B, original, MIT.

A workflow for adding support for a new large language model architecture to the xinfer project. It covers model files such as safetensors and GGUF, along with dense, mixture-of-experts, and quantized models.

In plain words
What is it for?
Use it when porting models such as Llama, Gemma, Qwen, GPT-OSS, or DeepSeek from a local path, the Hugging Face Hub, or supplied configuration and tensor information.
Why use it?
It provides a structured way to gather the model's configuration and weight details before adapting the implementation. This helps avoid guessing how the model is built or how its tensors are stored.

Skill for Cursor

Written for Cursor: installed under .cursor/.

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

Needs its repository: it reads a path above its own folder, which exists only inside the repository. The line is attention-rs = { path = "../attention.rs", ... }.

Reuse

Borrowing it

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

Copy the file
curl -O https://raw.githubusercontent.com/guoqingbao/xinfer/main/.cursor/skills/add-model/SKILL.md
Clone the repo
git clone --depth 1 https://github.com/guoqingbao/xinfer

Made for: Cursor.

Wrote this? Show the measurements

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

agentmods badge for add-model

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

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

agentmods 80×15 button for add-model

Your own site · 80×15
<a href="https://agentmods.dev/skills/guoqingbao/xinfer/add-model"><img src="https://agentmods.dev/badge/skills/guoqingbao/xinfer/add-model.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 95 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 4,577 The whole file, excluding the scripts and references it only reads on demand.
Security scan B 2 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector warn 7 Sept 2026
SkillSpector: 5 findings, up to high

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

  • high Supply Chain · line 328
    Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.
    Fix: Avoid downloading and executing remote scripts. Use trusted packages from PyPI/npm. If remote fetch is required, verify checksums and use HTTPS.
  • medium Agent Snooping · line 272
    Skill enumerates or reads other installed skills. Access to other skills' SKILL.md files or the skills directory reveals prompt instructions, capabilities, and secrets that should be invisible to peer skills.
    Fix: Remove all code or instructions that list or read other skills' files or directories. Skills should operate independently; cross-skill access is a privilege escalation.
  • medium Privilege Escalation · line 319
    Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.
    Fix: Avoid sudo/root unless strictly required. Prefer least-privilege patterns. If elevation is needed, document the justification and scope.
  • medium Data Exfiltration · line 328
    Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
    Fix: Verify the destination URL is trusted and necessary. Remove or replace with documented APIs. Ensure no secrets, tokens, or PII are transmitted.
  • medium Data Exfiltration · line 338
    Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
    Fix: Verify the destination URL is trusted and necessary. Remove or replace with documented APIs. Ensure no secrets, tokens, or PII are transmitted.
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

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

ModelPer sessionOnce invoked
Fable 5.1 $0.00095 $0.04577
Opus 5 $0.00048 $0.02289
Sonnet 5 $0.00019 $0.00915
Haiku 4.5 $0.00010 $0.00458

Measured 9d ago against content hash 23e0a68ba78e, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

Grade B, and why

add-model scanned grade B with 2 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 9d ago.

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

Asks for rootmediumPrivilege escalation

A mod that escalates privileges can change anything on the machine, not only the project.

sudo powermetrics --samplers gpu_power -i 1000 -n 1 | grep 'GPU'

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

curl -s http://localhost:8000/v1/chat/completions \
.cursor/skills/add-model/SKILL.md · 385 lines

How it starts

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

Add Model — Adapt New LLM Architectures to xinfer

Phase 0: Gather Required Information

Before starting, the agent must collect the inputs below. If any are missing, ask the user explicitly.

Resolution order (try top to bottom, stop at the first that succeeds):

  1. Local model path (preferred) — If the user provides a local directory containing safetensors, read config.json and inspect weight tensors directly from disk. If the user provides a .gguf file, extract metadata and tensor info from the GGUF header (GGUF is self-contained; there is no separate config.json). No further input is needed in either case.
  2. HuggingFace model ID — Look for the model in the local HuggingFace Hub cache (~/.cache/huggingface/hub/). If not cached, fetch config.json from the HuggingFace model repo. If that also fails, fall back to step 3.
  3. Manual input — Ask the user to provide:
    • config.json contents (for safetensors models) or GGUF metadata (for GGUF models).
    • Weight tensor info (names, shapes, dtypes). The user can obtain this by clicking a weight file in the HuggingFace model repo.

Additionally, ask the user if they can provide the Python reference implementation (modeling_<arch>.py from HuggingFace Transformers). This is not strictly required, but significantly improves accuracy — it clarifies the exact forward pass, attention variants, MoE routing, activation functions, and normalization order that config fields alone cannot fully describe.

Input How to obtain
HuggingFace model ID (e.g. google/gemma-4-26B-A4B-it) User provides, or infer from context
Model config (config.json) Fetch from HF: https://huggingface.co/<id>/blob/main/config.json. Not needed if local model path is provided.
HF tensor info (weight names + shapes) User provides, or read from local safetensors with scripts/inspect_weights.py (create the script if it doesn't exist)
GGUF metadata + tensor info (if GGUF support needed) User provides, or extract from local .gguf with scripts/inspect_gguf.py (create the script if it doesn't exist)
Python reference implementation (optional but recommended) Fetch modeling_<arch>.py from the HuggingFace Transformers GitHub repo
Local model path (optional) User provides path containing config.json + *.safetensors or *.gguf

Read the full file on GitHub · 385 lines

Changes

What this file has done since we first saw it

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

  1. 9d ago First seen · 385 lines · 95 tokens per session scan B 23e0a68ba78e

Subscribe to this mod's changes

add-model is a skill published in the GitHub repository guoqingbao/xinfer (315 stars, last pushed yesterday), licensed MIT. It adds 95 tokens to every session and 4,577 once invoked, about $0.0005 per session on Opus 5. A static security scan graded it B with 2 findings (asks for root, makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.