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.
npx agentmods add skills/aws-neuron/neuron-agentic-development/neuron-nki-writingnpx skills add aws-neuron/neuron-agentic-development --skill neuron-nki-writinggit clone --depth 1 https://github.com/aws-neuron/neuron-agentic-developmentWrote 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.
[](https://agentmods.dev/skills/aws-neuron/neuron-agentic-development/neuron-nki-writing)<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="Measured on agentmods" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.00172 | $0.06038 |
| Opus 5 | $0.00086 | $0.03019 |
| Sonnet 5 | $0.00034 | $0.01208 |
| Haiku 4.5 | $0.00017 | $0.00604 |
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 5d 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.
How it starts
The opening of the file, as written. The whole thing — 468 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 covering Beta 1 → Beta 2, Beta 2 → NKI 0.3.0, and NKI 0.3.0 → NKI 0.4.0 migration rules. 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
float32dst, 8192 for abfloat16dst(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
What ships with it
49 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.
- examples/associative_scan.py 2.7 KB runs code
- examples/elementwise_exp.py 5.5 KB runs code
- examples/simple_matmul.py 10 KB runs code
- references/api-translation.md 5.2 KB
- references/common-patterns.md 14 KB
- references/indexing-patterns.md 25 KB
- references/kernel-template.md 7.3 KB
- references/memory-patterns.md 5.9 KB
- references/nki-language-constraint.md 15 KB
- references/nkilib/core/allocator.md 9.5 KB
- references/nkilib/core/kernel-helpers.md 8.4 KB
- references/nkilib/core/subkernels/__init__.py 615 B runs code
- references/nkilib/core/subkernels/find_nonzero_indices.py 15 KB runs code
- references/nkilib/core/subkernels/indexed_flatten_torch.py 2.4 KB runs code
- references/nkilib/core/subkernels/indexed_flatten.py 9.3 KB runs code
- references/nkilib/core/subkernels/layernorm_tkg.py 18 KB runs code
- references/nkilib/core/subkernels/layernorm_torch.py 1.4 KB runs code
- references/nkilib/core/subkernels/norm_tkg_utils.py 15 KB runs code
- references/nkilib/core/subkernels/rmsnorm_mx_quantize_tkg.py 17 KB runs code
- references/nkilib/core/subkernels/rmsnorm_tkg.py 15 KB runs code
- references/nkilib/core/subkernels/rmsnorm_torch.py 5.6 KB runs code
- references/nkilib/core/tensor-view.md 13 KB
- references/nkilib/core/tile-info.md 8.8 KB
- references/nkilib/core/tiled-range.md 5.3 KB
- references/nkilib/core/utils/__init__.py 615 B runs code
- references/nkilib/core/utils/allocator.py 19 KB runs code
- references/nkilib/core/utils/common_types.py 1.4 KB runs code
- references/nkilib/core/utils/interleave_copy.py 4.9 KB runs code
- references/nkilib/core/utils/kernel_assert.py 1.2 KB runs code
- references/nkilib/core/utils/kernel_helpers.py 15 KB runs code
- references/nkilib/core/utils/lnc_subscriptable.py 5.8 KB runs code
- references/nkilib/core/utils/logging.py 6.1 KB runs code
- references/nkilib/core/utils/modular_allocator.py 9.1 KB runs code
- references/nkilib/core/utils/stream_shuffle_broadcast.py 1.5 KB runs code
- references/nkilib/core/utils/tensor_view.py 42 KB runs code
- references/nkilib/core/utils/tile_info.py 4.6 KB runs code
- references/nkilib/core/utils/tiled_range.py 4.0 KB runs code
- references/nkilib/core/utils/tp_broadcast.py 2.2 KB runs code
- references/nkilib/core/utils/tree_logger.py 3.3 KB runs code
- references/nkilib/ops/stream-shuffle-broadcast.md 3.9 KB
- references/nkilib/ops/tp-broadcast.md 4.2 KB
- references/nkilib/patterns/layout-conversion.md 15 KB
- references/nkilib/patterns/moe-patterns.md 19 KB
- references/nkilib/patterns/normalization-patterns.md 7.9 KB
- references/nkilib/patterns/quantization-helpers.md 6.5 KB
- references/nkilib/types/common-types.md 6.3 KB
- references/nkilib/types/logging.md 8.0 KB
- references/performance-basics.md 5.3 KB
- references/transpose-and-layout.md 36 KB
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.
- 5d ago First seen · 468 lines · 172 tokens per session scan A 5140d6d68fae
neuron-nki-writing is a skill published in the GitHub repository aws-neuron/neuron-agentic-development (56 stars, last pushed 16d ago), licensed Apache-2.0. It adds 172 tokens to every session and 6,038 once invoked, about $0.0009 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.
Other skills, from other repositories
integrated-browser
Use this when working on the VS Code integrated browser ("browserView") to understand its architecture and mental model. Covers the embedded Chromium browser, its editor tab, navigation, overlay/layout, sessions, and agent browser tools under src/vs/platform/browserView and src/vs/workbench/contrib/browserView.
gke-compute-classes
Configures, optimizes, and troubleshoots GKE ComputeClasses. Use when configuring Spot VMs with on-demand fallback, targeting specific accelerators (GPUs/TPUs) or machine families, restricting ComputeClass access, or debugging pending pods related to node pool auto-creation. Do not use for cluster-level Node Auto…
jetson-diagnostic
Read-only Jetson health snapshot for identity, memory, GPU, thermal, power, storage, services, and top processes.
doca-socket-relay
Use this skill when the operator is driving the DOCA Socket Relay to bridge a socket-oriented host application onto a BlueField DPU peer without rewriting it — picking the deployment shape (in-process, sidecar, or BlueField service container), configuring the host-side socket and the DPU-side forwarding endpoint…
offensive-z-wave
Z-Wave attack methodology — sniffing with Z-Force / EZ-Wave / RTL-SDR + ZniffMobile, S0 (legacy) network-key derivation flaw and key reuse, S2 (modern) ECDH commissioning analysis, replay/injection on unauthenticated nodes, default-key brute-force on test deployments, and home-automation hub pivots. Use when targeting…
hsb-flash
Flash the FPGA on an HSB board connected to an NVIDIA devkit. Supports HSB Lattice boards (FPGA versions 2407, 2412, 2507, 2510) and Leopard Imaging VB1940 "all-in-one" cameras (FPGA versions 2507, 2510). Uses release-specific YAML manifests and board-type-specific program commands. Lattice and VB1940 commands must…