j6-plugin-export

j6-plugin-export is a skill for Claude Code, Codex from HorizonRobotics/OE-Skills. It costs 55 tokens per session (3,102 once invoked), scanned A, original, Apache-2.0.

A procedure for creating a separate script that exports a Horizon QAT PyTorch model into HBIR, an intermediate format used for later compilation and deployment. QAT means quantization-aware training, where a model is trained to account for reduced-precision calculations.

In plain words
What is it for?
Loading and validating a QAT model, preparing example inputs, exporting it with Horizon tools, and saving the resulting HBIR module.
Why use it?
It keeps one-time model export separate from training and evaluation code. The checks help avoid exporting the wrong model type or producing an unusable deployment file.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Loading and validating a QAT model, preparing example inputs, exporting it with Horizon tools, and saving the resulting HBIR module.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/horizonrobotics/oe-skills/j6-plugin-export
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add HorizonRobotics/OE-Skills --skill j6-plugin-export
Clone the repo
git clone --depth 1 https://github.com/HorizonRobotics/OE-Skills

Made for: Claude Code, Codex.

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 j6-plugin-export

README.md
[![agentmods](https://agentmods.dev/badge/skills/horizonrobotics/oe-skills/j6-plugin-export/github.svg)](https://agentmods.dev/skills/horizonrobotics/oe-skills/j6-plugin-export)
Your own site
<a href="https://agentmods.dev/skills/horizonrobotics/oe-skills/j6-plugin-export"><img src="https://agentmods.dev/badge/skills/horizonrobotics/oe-skills/j6-plugin-export/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 j6-plugin-export

Your own site · 80×15
<a href="https://agentmods.dev/skills/horizonrobotics/oe-skills/j6-plugin-export"><img src="https://agentmods.dev/badge/skills/horizonrobotics/oe-skills/j6-plugin-export.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 55 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,102 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.00055 $0.03102
Opus 5 $0.00028 $0.01551
Sonnet 5 $0.00011 $0.00620
Haiku 4.5 $0.00006 $0.00310

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

Security

Grade A, and why

j6-plugin-export scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 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.

Nothing flagged

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

horizon/skills/plugin/j6-plugin-export/SKILL.md · 286 lines

How it starts

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

为 Horizon QAT 模型创建独立 HBIR 导出脚本(hbdk4.export)

目标

在使用 horizon_plugin_pytorch 的 QAT 工具链完成校准/训练后,创建一个独立的导出脚本,将 QAT 模型导出为 HBIR IR 模块,用于后续编译部署。

本 Skill 只做一件事:创建独立导出脚本,脚本中包含

from horizon_plugin_pytorch.quantization import hbdk4 as hb4
from hbdk4.compiler import save

model.eval()
set_fake_quantize(model, FakeQuantState.VALIDATION)
hbir_model = hb4.export(model, example_inputs, ...)
save(hbir_model, "output_path")

不引入任何其他改动(不改模型结构、不改 qconfig、不改 prepare/convert、不改训练/数据逻辑、不在训练或评测脚本中添加导出逻辑)。

强约束(必须遵守)

1) 必须以独立导出脚本的形式执行

导出逻辑必须放在独立脚本中,禁止在训练脚本、评测脚本或其他已有脚本中添加导出逻辑。

原因:

  • 导出是一次性动作,不应与训练/评测流程耦合
  • 独立脚本便于单独调试、复用和版本管理
  • 避免训练/评测脚本因导出逻辑变得臃肿

2) 独立导出脚本的标准结构

独立导出脚本必须包含以下步骤,按固定顺序执行

  1. set_march — 设置目标平台
  2. 构建/加载 QAT 模型 — 从 checkpoint 恢复
  3. model.eval() — 切换到推理模式
  4. set_fake_quantize(model, FakeQuantState.VALIDATION) — 切换到验证状态
  5. QAT 模型验证 — 检查模型包含 fake-quant 模块,确保是 QAT 模型
  6. 构造 example_inputs
  7. hb4.export(model, example_inputs, ...) — 执行导出
  8. save(hbir_model, output_path) — 保存 HBIR 模型到文件

3) 不在训练/评测脚本中添加导出逻辑

即使训练/评测脚本末尾是"导出的自然位置",也不应在其中插入导出代码。应创建独立脚本。

4) 导出前必须验证模型是 QAT 模型

hb4.export 不区分 QAT 模型和 float 模型,如果误传 float 模型,导出会静默成功但结果无意义。因此:

Agent 侧约束:创建导出脚本前,必须确认用户提供的 checkpoint 是 QAT checkpoint(已完成 prepare + 校准/训练),而非 float checkpoint。如果用户未明确说明,应主动询问确认。

运行时检查:导出脚本中必须在 export 之前加入 QAT 模型验证,检查模型是否包含 fake-quant 模块:

# 验证模型是 QAT 模型(包含 fake-quant 模块)
_has_fq = any(
    "FakeQuantize" in type(m).__name__
    for m in model.modules()
)
assert _has_fq, (
    "当前模型不包含 FakeQuantize 模块,不是 QAT 模型。"
    "请确认使用的是 QAT checkpoint 而非 float checkpoint。"
)

标准改法(通用模板)

1) 增加 import

import torch
import horizon_plugin_pytorch as horizon
from horizon_plugin_pytorch.quantization import hbdk4 as hb4
from horizon_plugin_pytorch.quantization import FakeQuantState, set_fake_quantize
from hbdk4.compiler import save

2) 独立导出脚本完整模板

import torch
import horizon_plugin_pytorch as horizon
from horizon_plugin_pytorch.quantization import hbdk4 as hb4
from horizon_plugin_pytorch.quantization import FakeQuantState, set_fake_quantize
from hbdk4.compiler import save

# 1. 设置 march
horizon.march.set_march(horizon.march.March.NASH_E)

# 2. 构建/加载 QAT 模型
model = build_model()
model.load_state_dict(torch.load("qat_checkpoint.pth"))

# 3. eval
model.eval()

# 4. 切换到 VALIDATION
set_fake_quantize(model, FakeQuantState.VALIDATION)

# 5. 验证是 QAT 模型
_has_fq = any("FakeQuantize" in type(m).__name__ for m in model.modules())
assert _has_fq, (
    "当前模型不包含 FakeQuantize 模块,不是 QAT 模型。"
    "请确认使用的是 QAT checkpoint 而非 float checkpoint。"
)

# 6. 构造 example_inputs
example_input = torch.randn(1, 3, 224, 224)

# 7. 导出
hbir_model = hb4.export(model, (example_input,))

# 8. 保存
save(hbir_model, "output.bc")

Read the full file on GitHub · 286 lines

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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 · 286 lines · 55 tokens per session scan A 88b38631bce0

Subscribe to this mod's changes

j6-plugin-export is a skill published in the GitHub repository HorizonRobotics/OE-Skills (19 stars, last pushed 2mo ago), licensed Apache-2.0. It adds 55 tokens to every session and 3,102 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

agent-platform-rag-engine-management

Manage and query Agent Platform RAG Engine Corpora and retrieve grounded contexts using the Google GenAI SDK. Use when listing RAG corpora or files, inspecting a corpus, retrieving contexts, or generating content grounded in a RAG corpus. Do not use for standard database queries (use SQL/Spanner skills), Google…

google/skills · 85 tokens

agent-platform-model-registry

Agent Platform Model Registry Management. Use when you need to upload, list, describe, update, or delete machine learning models (and their versions) in the Agent Platform Model Registry. Don't use for model training, model deployment to endpoints, or managing non-Agent Platform models.

google/skills · 60 tokens

foundry-config-setup

Resolve missing setup caused by a hardcoded Foundry project endpoint or model in a sample. Use when a sample fails because it uses a placeholder/hardcoded projectendpoint (for example "https://your-project.services.ai.azure.com") or a hardcoded model instead of reading them from the environment.

microsoft/agent-framework · 65 tokens

google-cloud-solution-agentic-analytics-spark-knowledge-catalog

Discovers requirements and generates guidance to design and deploy a governed, secure agentic-analytics solution for data that's distributed across Google Cloud, other cloud providers, or on-premises. Data that's outside Google Cloud (such as data from Databricks, Snowflake, Salesforce, SAP, or Oracle systems) is…

google/skills · 138 tokens

training-check

Interactively monitor training metrics from the current Codex session, periodically checking WandB or fallback logs for NaN, divergence, plateaus, and broken runs.

wanshuiyin/Auto-claude-code-research-in-sleep · 35 tokens

nemo-automodel-launcher-config

Configure NeMo AutoModel job launches for interactive runs, Slurm clusters, and SkyPilot cloud execution.

NVIDIA/skills · 30 tokens