Agent skill

libnx Rules for Switch Homebrew

by i3sey in i3sey/pipensx

Repo rules for editing libnx and Nintendo Switch homebrew code in pipensx: read the real headers first and keep shared code building for both Switch and PC.

GPL-3.0Auto-check passedDevelopment

Install libnx Rules for Switch Homebrew

skills CLI
$ npx skills add i3sey/pipensx --skill libnx -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install i3sey/pipensx libnx --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/i3sey/pipensx.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/libnx .claude/skills/libnx && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
libnx
GitHub stars
220
Token cost
~1.3k tokens
SKILL.md length
532 words
Files
1
Skills in repo
3
Repo updated
First seen
Licence
GPL-3.0

At a glance

Repo rules for editing libnx and Nintendo Switch homebrew code in pipensx: read the real headers first and keep shared code building for both Switch and PC.

  • Works in 5 steps: The header on disk is the API, your… → Most sources compile twice, and the… → House idioms → …
  • Adding or changing a libnx service call such as fs, ns, ncm, es or nifm
  • SKILL.md covers 1. The header on disk is the…, 2. Most sources compile twice,…, 3. House idioms and 4. Verify with both builds, plus 1 more section
  • Calls make

What it does

Two rules carry the skill. Before writing any libnx call, the agent reads the declaration in the installed devkitPro headers instead of recalling a signature, and it checks the vendored extensions under vendor/libnx-ext before adding anything new. For what a call means, such as firmware gates, service ownership and error semantics, or the NCA, CNMT and ticket formats behind the package stream, it points to the switchbrew wiki.

The second rule is that most sources compile twice: once into the Switch build with real libnx, and once into PC unit tests that use a stand-in header and a PC install backend. A libnx call in shared code must follow an existing pattern, such as an `#ifdef __SWITCH__` guard with a PC fallback or an unconditional include resolved by the PC stand-in, and the agent is told not to invent another. Applet-mode and sysmodule constraints and toolchain issues fall under the same rules.

When your agent uses it

  • Adding or changing a libnx service call such as fs, ns, ncm, es or nifm
  • Fixing a PC unit-test build that breaks after shared code gains a libnx symbol
  • Working on NRO, NSP, NCA, CNMT or ticket handling in the install backend
  • Checking applet-mode or sysmodule limits before using a service

Example prompts

  • “Add a call that reports free space on the SD card, and read the real libnx header before writing it.”
  • “The PC test build fails on a missing libnx symbol after my change to update_service.cpp. Fix it.”
  • “Which firmware version does ncmContentStorageRevertToPlaceHolder need?”

Requirements

  • devkitPro with devkitA64 and libnx installed
  • The pipensx repository layout and CMake build

Workflow steps

5 steps, taken from the step headings in SKILL.md.

  1. The header on disk is the API, your memory is not
  2. Most sources compile twice, and the second build is easy to forget
  3. House idioms
  4. Verify with both builds
  5. Constraints that live in prose, not headers

What it can do on your machine

Read from SKILL.md and the folder at commit 21cb83d. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • make

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

libnx Rules for Switch Homebrew loads about 1.3k tokens when it runs. Until then it costs about 129 tokens; SKILL.md has 532 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~129
When it runs · the whole SKILL.md, loaded when a task matches
~1.3k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from i3sey/pipensx at commit 21cb83d, republished under its GPL-3.0 licence (© i3sey). 532 words, ~1,269 tokens.

Download SKILL.mdSave it as .claude/skills/libnx/SKILL.md (or your agent's skills folder).
name
libnx
description
Rules for touching libnx / Switch-homebrew code in this repo. Use when the task involves a libnx call or service (applet, hid/pad, fs, ns, ncm, es, set, nifm, psm, spl, svc*, hosversion, romfs), an nx type (Result, Service, Handle, NacpStruct, FsFileSystem, NcmContentStorage), the install backend or package stream, NRO/NSP/NCA/CNMT/ticket handling, applet-mode or sysmodule constraints, devkitPro/devkitA64 toolchain issues, or anything under src/install, src/platform, src/main_switch.cpp, vendor/libnx-ext.

libnx in pipensx

Two rules carry almost all the weight: read the header instead of recalling the signature, and know which of the two builds will see your call.

1. The header on disk is the API, your memory is not

libnx moves, and a plausible-looking fooInitialize() that does not exist costs a full Switch build to discover. Before writing any libnx call, read the declaration:

/opt/devkitpro/libnx/include/switch/services/*.h    # 92 service headers
/opt/devkitpro/libnx/include/switch/kernel/svc.h    # svc*, and kernel/ for threads/events
/opt/devkitpro/libnx/include/switch/{nacp,nro,result,types}.h
grep -rn "ncmContentStorageWritePlaceHolder" /opt/devkitpro/libnx/include/

What stock libnx lacks is vendored, not reinvented — check there before adding anything: vendor/libnx-ext/libnx-ipcext/ (es, ns-ext, account-ext) and vendor/libnx-ext/libnx-ext/. Both are on the Switch target's include path only.

For what a call means rather than what it takes, consult switchbrew.org/wiki/: per-command firmware gates, service ownership, error semantics, and the NCA/CNMT/ticket formats behind package_stream.cpp. The header will not tell you that ncmContentStorageRevertToPlaceHolder needs 2.0.0+ — the wiki will.

2. Most sources compile twice, and the second build is easy to forget

CORE_SOURCES, APP_SERVICE_SOURCES and UI_SOURCES in CMakeLists.txt are linked into Switch pipensx (aarch64, real libnx). Only src/main_switch.cpp, src/install/install_backend_switch.cpp, src/platform/switch_* and the vendored ipcext are Switch-only. PC unit tests via Makefile.pc compile shared app/core code with install_backend_pc.cpp and the PC shim under src/platform/pc/.

So a libnx call in shared code has to pick one of three existing patterns — do not invent a fourth:

a. #ifdef __SWITCH__ with a PC fallback. The default; 14 shared files already do it (src/app/install_space.cpp, src/app/stream_ram_budget.cpp, src/app/update_service.cpp, src/ui/settings/settings_view.hpp, src/core/util.c, src/install/package_stream.cpp, …). __SWITCH__ is set by target_compile_definitions(pipensx PRIVATE __SWITCH__) and is absent for PC test builds.

b. Unconditional #include <switch.h>, resolved by the PC shim. Only src/app/installed_title_service.cpp and src/ui/common/ui_helpers.hpp do this. src/platform/pc/switch.h (a hand-written 182-line stand-in) is first on the PC test include path and supplies stubs. Adding a libnx symbol to one of these two files without adding a stub there leaves the Switch build green and breaks make test. Stub behaviour is chosen for deterministic PC tests, not realism — read the header comment before adding to it.

c. Behind src/install/install_backend.hpp. The heavy content-install surface (ncm, es, fs placeholders, CNMT) lives here, with install_backend_switch.cpp and install_backend_pc.cpp implementing both sides. New install-path work goes through this seam; both implementations get written, not just the console one.

Makefile.pc builds core/app C only and never sees the shim — it relies purely on pattern (a).

Show full SKILL.md (165 more words)Show less

3. House idioms

  • Result rc = ...; if (R_FAILED(rc)) { ...close what you opened...; return; } Every early return closes its own handles by hand — there is no RAII wrapper in this codebase, and adding one is a separate decision, not a drive-by.
  • Surface a failure as 0x%08x, never as a bare decimal: diagnostic_error("installed", "list", "result=0x%08x", rc) (src/core/util.h:41), or the user-facing "Unable to query SD storage (0x%08x)." form.
  • Never assert/abort on a bad Result. This is homebrew running on someone's console — degrade and report. (Same reason pipensx_utp is built NDEBUG.)

4. Verify with both builds

make switch    # Switch: build-switch/pipensx.nro
make test      # PC: compiles shared sources against the shim and install backend

A missing shim stub only shows up in the second. Run both before calling a libnx change done.

5. Constraints that live in prose, not headers

Applet RAM budget, tile override, sysmodule tradeoffs — written up in docs/plans/ESHOP_APPLET_PLAN.md, docs/plans/SYSMODULE_PLAN.md and docs/plans/PERF_PLAN.md. Read them for the reasoning instead of re-deriving it, but treat them as historical (see docs/plans/README.md): they may describe code that has since changed. Confirm anything load-bearing against the source before acting on it.

© i3sey, GPL-3.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in .agents/skills/libnx of i3sey/pipensx.

Open the folder on GitHubat commit 21cb83d

Compare with similar skills

libnx Rules for Switch Homebrew next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

libnx Rules for Switch Homebrew compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
libnx Rules for Switch Homebrew this skilli3sey/pipensx220—~1.3kAutomated safety check: PassGPL-3.0
Esp32 Firmware Engineeralxv2016/folloup-sticky1161 repos~3.8kAutomated safety check: PassGPL-3.0
ExecuTorch Binary Size Reductionpytorch/executorch5.1k—~793Automated safety check: PassCustom licence
Auto EmbeddedDunCanYounG-1/MICU-auto-embedded253—~1.6kAutomated safety check: PassCC-BY-NC-4.0
Embedded Cpp14 MisraBlueAndi/Pixelix443—~2kAutomated safety check: PassMIT
Embedded Cpp14 MisraBlueAndi/Pixelix443—~2.2kAutomated safety check: PassMIT

Similar skills

  • Esp32 Firmware Engineer

    alxv2016/folloup-sticky

    ESP32 firmware engineering for ESP-IDF projects. An agent skill from alxv2016/folloup-sticky.

    116 GitHub starsUsed in 1 repo~3.8k tokens
    DevelopmentAuto-check passed
  • Measures and shrinks the ExecuTorch runtime binary by building a size test, analyzing it with bloaty and landing each reduction as its own pull request.

    5.1k GitHub stars~793 tokensUpdated today
    DevelopmentAuto-check passed
  • Auto Embedded

    DunCanYounG-1/MICU-auto-embedded

    全平台嵌入式 AI 开发框架(对标 Trellis):把 RIPER-5 五阶段协议 + 四文件记忆 + 分层架构门禁 + Scout/Builder/Verifier 多 Agent + 24 个工具调用技能(build/flash/debug/serial/can/modbus/visa/static/memory/rtos/scons),做成『装进工程、项目级 hook…

    253 GitHub stars~1.6k tokensUpdated yesterday
    DevelopmentAuto-check passed
  • Embedded Cpp14 Misra

    BlueAndi/Pixelix

    A skill your agent uses when writing, reviewing, or refactoring C/C++ firmware code in this repository (src/, lib/, test/) — creating or editing .h/.hpp/.cpp files, applying MISRA-oriented and…

    443 GitHub stars~2k tokensUpdated today
    DevelopmentAuto-check passed
  • Embedded Cpp14 Misra

    BlueAndi/Pixelix

    Write, review and refactor embedded C/C++14 firmware code in this repository (src/, lib/, test/) with MISRA-oriented rules, defensive programming, Yoda conditions, single-exit/pathfinder control…

    443 GitHub stars~2.2k tokensUpdated today
    DevelopmentAuto-check passed
  • Ss Cpp Modern

    Serial-Studio/Serial-Studio

    Modern C++20 authoring guidance for Serial Studio (Qt 6.11, C++20): concepts, ranges, move/RAII, std smart pointers, constexpr, lock-free SPSC atomics.

    7.2k GitHub stars~1.6k tokensUpdated yesterday
    DevelopmentAuto-check passed

More from i3sey/pipensx

  • Decodes QR-code bug report photos and screenshots from the pipensx app into a log, then triages crashes and update, download or install failures.

    220 GitHub stars~1.5k tokensUpdated 6 days ago
    Auto-check: notes
  • Explains how debrid download providers are structured in the pipensx C++ app and what to touch when adding or changing one.

    220 GitHub stars~900 tokensUpdated 6 days ago
    Auto-check passed

Works with

Categories

Questions about libnx Rules for Switch Homebrew

What does libnx Rules for Switch Homebrew do?

Repo rules for editing libnx and Nintendo Switch homebrew code in pipensx: read the real headers first and keep shared code building for both Switch and PC. Two rules carry the skill. Before writing any libnx call, the agent reads the declaration in the installed devkitPro headers instead of recalling a signature, and it checks the vendored extensions under vendor/libnx-ext before adding anything new.

When should I use libnx Rules for Switch Homebrew?

libnx Rules for Switch Homebrew fits situations like: adding or changing a libnx service call such as fs, ns, ncm, es or nifm; fixing a PC unit-test build that breaks after shared code gains a libnx symbol; working on NRO, NSP, NCA, CNMT or ticket handling in the install backend; checking applet-mode or sysmodule limits before using a service.

How do I install libnx Rules for Switch Homebrew in Claude Code?

Run `npx skills add i3sey/pipensx --skill libnx -a claude-code`. Or copy the skill folder (.agents/skills/libnx in i3sey/pipensx) into .claude/skills/libnx in your project. Claude Code loads it when a task matches its description.

How do I install libnx Rules for Switch Homebrew in Codex?

Run `npx skills add i3sey/pipensx --skill libnx -a codex`. Or copy the skill folder (.agents/skills/libnx in i3sey/pipensx) into .agents/skills/libnx in your project. Codex loads it when a task matches its description.

Can I use libnx Rules for Switch Homebrew in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add i3sey/pipensx --skill libnx -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/libnx, .gemini/skills/libnx, .github/skills/libnx and .opencode/skills/libnx in your project.

What does libnx Rules for Switch Homebrew need to run?

Going by SKILL.md and its folder, libnx Rules for Switch Homebrew needs the command-line tools its instructions call (make). Our summary lists: devkitPro with devkitA64 and libnx installed; The pipensx repository layout and CMake build.

Does libnx Rules for Switch Homebrew access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is libnx Rules for Switch Homebrew safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does libnx Rules for Switch Homebrew use?

libnx Rules for Switch Homebrew is published under the GPL-3.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does libnx Rules for Switch Homebrew use?

About 1.3k tokens (SKILL.md is roughly 5.1k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to libnx Rules for Switch Homebrew?

Skills that share tags, products or a category with libnx Rules for Switch Homebrew: Esp32 Firmware Engineer (alxv2016/folloup-sticky, 116 stars), ExecuTorch Binary Size Reduction (pytorch/executorch, 5.1k stars), Auto Embedded (DunCanYounG-1/MICU-auto-embedded, 253 stars) and Embedded Cpp14 Misra (BlueAndi/Pixelix, 443 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains libnx Rules for Switch Homebrew?

i3sey (a GitHub user) maintains it in i3sey/pipensx, which has 220 GitHub stars. The repository holds 3 skills in this directory. The repository was last updated on October 2, 2026.

Source: i3sey/pipensx on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.