neuron-nki-writing

neuron-nki-writing is a skill for Claude Code from aws-neuron/neuron-agentic-development. It costs 172 tokens per session (8,106 once invoked), scanned A, original, Apache-2.0.

A guide for creating and changing NKI kernels, programs that run computations on AWS Trainium or Inferentia hardware. It covers translating operations from PyTorch or NumPy, adding shape and data-type support, and changing tiling strategies.

In plain words
What is it for?
It is used to write a new NKI kernel, convert an existing PyTorch or NumPy operation, add supported shapes or data types, refactor tiling, or implement a kernel feature.
Why use it?
It provides rules for writing code that matches NKI's language and hardware constraints, including constraints that can otherwise cause compilation failures.

Skill for Claude Code

Written for Claude Code: argument-hint in frontmatter.

Good fit It is used to write a new NKI kernel, convert an existing PyTorch or NumPy operation, add supported shapes or data types, refactor tiling, or implement a kernel feature.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/aws-neuron/neuron-agentic-development/neuron-nki-writing
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 aws-neuron/neuron-agentic-development --skill neuron-nki-writing
Clone the repo
git clone --depth 1 https://github.com/aws-neuron/neuron-agentic-development

Made for: Claude Code.

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 neuron-nki-writing

README.md
[![agentmods](https://agentmods.dev/badge/skills/aws-neuron/neuron-agentic-development/neuron-nki-writing/github.svg)](https://agentmods.dev/skills/aws-neuron/neuron-agentic-development/neuron-nki-writing)
Your own site
<a href="https://agentmods.dev/skills/aws-neuron/neuron-agentic-development/neuron-nki-writing"><img src="https://agentmods.dev/badge/skills/aws-neuron/neuron-agentic-development/neuron-nki-writing/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 neuron-nki-writing

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

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

  • medium Memory Poisoning · line 335
    Skill attempts to fill the context window with filler content, displacing legitimate instructions and safety constraints. This can degrade agent performance or bypass safety boundaries.
    Fix: Implement context-window management that detects and rejects padding or stuffing attempts. Prioritize system instructions over user-injected content.
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.00172 $0.08106
Opus 5.5 $0.00069 $0.03242
Sonnet 5.5 $0.00034 $0.01621
Haiku 4.5 $0.00017 $0.00811

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

Security

Grade A, and why

neuron-nki-writing 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 today.

The scan reads SKILL.md. This mod also ships 28 executable files (examples/associative_scan.py, examples/elementwise_exp.py, examples/simple_matmul.py, …), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

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.

skills/neuron-nki-writing/SKILL.md · 553 lines

How it starts

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

Writing NKI Kernels

This skill guides writing and modifying NKI (Neuron Kernel Interface) kernels — from new kernel creation (PyTorch/NumPy/natural language translation) to editing existing kernels (adding shape/dtype support, refactoring tiling, implementing new features). Focus on correctness using documented APIs.

Critical: NKI Language Constraints

BEFORE writing any NKI code, read references/nki-language-constraint.md for the complete list of required and forbidden API patterns. Each rule is labelled with the release that made it a breaking change (0.x.0+), so the file covers every current release rather than one migration step. Violating ANY rule is a compilation failure.

Hardware limits: don't hardcode the PSUM free dim

The PSUM free-dimension limit is generation- and dtype-gated and has changed across releases. Current values:

  • gen2 / gen3: 512 (one PSUM bank)
  • gen4: 4096 for a float32 dst, 8192 for a bfloat16 dst (entire PSUM)

This is not a queryable tile_size field — nl.tile_size.psum_bank_fmax is a fixed 512 (fp32 elements per bank) and is neither dtype- nor generation-aware, so do not use it as the free-dim limit. Authoritative source: the nc_matmul, nc_matmul_mx, and dma_transpose API blocks via /neuron-nki-docs. Treat any PSUM free-dim number inlined in this skill's reference files as illustrative; confirm against those API blocks.

tile_size does authoritatively report other limits — use it for those: nl.tile_size.pmax (128), nl.tile_size.psum_num_banks (bank cycling), nl.tile_size.gemm_moving_fmax (matmul moving-operand SBUF free dim), and nl.tile_size.sbuf_fmax / sbuf_fmax_bytes (SBUF capacity).

Quick Start

Minimal working kernel structure:

import nki
import nki.isa as nisa
import nki.language as nl

@nki.jit
def my_kernel(input_hbm: nl.ndarray) -> nl.ndarray:
    """One-line description of kernel operation."""
    # 1. Allocate SBUF tile
    tile = nl.ndarray(input_hbm.shape, dtype=input_hbm.dtype, buffer=nl.sbuf)

    # 2. Load from HBM to SBUF
    nisa.dma_copy(dst=tile, src=input_hbm[0:input_hbm.shape[0], 0:input_hbm.shape[1]])

    # 3. Compute (example: element-wise exp)
    result = nl.ndarray(tile.shape, dtype=tile.dtype, buffer=nl.sbuf)
    nisa.activation(dst=result, data=tile, op=nl.exp)

    # 4. Allocate and store to HBM
    output = nl.ndarray(input_hbm.shape, dtype=input_hbm.dtype, buffer=nl.shared_hbm)
    nisa.dma_copy(dst=output, src=result)

    return output

Read the full file on GitHub · 553 lines

Files

What ships with it

50 files 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. today Changed · +52 lines fc99b1f35666
  2. 1mo ago Changed · +33 lines fc6287c0ced7
  3. 3mo ago First seen · 468 lines · 172 tokens per session scan A 5140d6d68fae

Subscribe to this mod's changes

neuron-nki-writing is a skill published in the GitHub repository aws-neuron/neuron-agentic-development (72 stars, last pushed yesterday), licensed Apache-2.0. It adds 172 tokens to every session and 8,106 once invoked, about $0.0007 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

neuron-nki-writing compared with skills from other repositories

neuron-nki-writing next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
neuron-nki-writingaws-neuron/neuron-agentic-developmentSkill72yesterdayApache-2.0A172Claude Code
gke-compute-classesgoogle/skillsSkill25kyesterdayApache-2.0A83Claude Code, Codex
jetson-diagnosticNVIDIA/skillsSkill4.2ktodayApache-2.0A30Claude Code, Codex
holoscan-install-wheelNVIDIA/skillsSkill4.2ktodayApache-2.0A34Claude Code, Codex
offensive-z-waveSnailSploit/Claude-RedSkill12k14d agoMITA113Claude Code, Codex
hsb-flashNVIDIA/skillsSkill4.2ktodayApache-2.0B94Claude Code
jetson-validate-imageNVIDIA/skillsSkill4.2ktodayApache-2.0B50Claude Code, Codex