nimonyplugins
Build and debug Nimony compile-time plugins for code generation and DSL rewrites.
Skill by Vyrnexis
Install
Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.
npx agentmarket install skill/vyrnexis-nimonyplugins
Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.
Get the weekly diff
The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.
About
Use cases: writing
Reviews
Write a reviewNo reviews yet. Installed it? Reviews come from verified installers only. How reviews work
Permissions
What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.
- Tools
- No tools found
- Secrets
- None asked for
- Install scripts
- None found
Network hosts it talks to 1
codeload.github.com· found in install command
Files it touches
~/.claude/skills/nimonyplugins
What's inside
- Skill name
nimonyplugins- Description
- Build and debug Nimony compile-time plugins for code generation and DSL rewrites. Use when replacing Nim macros with Nimony plugins, writing or reviewing template, for-loop, module, type, or import plugins, or diagnosing NIF traversal and generated output.
- License
- MIT
- Instructions
- 138 lines in SKILL.md · view on GitHub
Files (7)
- SKILL.md
- for_loop_plugin.md · references/
- generated_symbols.md · references/
- module_plugin.md · references/
- replacer_api.md · references/
- template_plugin.md · references/
- type_plugin.md · references/
SKILL.md (first lines)
# Nimony Plugins
## Rules
### Resolve the actual API
- Resolve `nimony` with `readlink -f "$(command -v nimony)"`.
- If the resolved path ends in `/bin/nimony`, open
`../src/nimony/lib/plugins.nim` relative to the executable directory.
Otherwise open `src/nimony/lib/plugins.nim` under the executable directory.
Treat that file as the source of truth.
- Plugin modules are compiled with Nimony itself. Each unique plugin path gets
a separate `nimony c` invocation and cached executable, even when two paths
contain identical source. Warm builds reuse those executables.
- A `{.plugin: "path".}` path is relative to the source file containing the
pragma, not the call site.
### Choose the plugin contract
There are five plugin kinds:
- Template: `template f(...) {.plugin: "p".}` receives
`(stmts <template-name> <args...>)`. Use `callArgs(root)` to read the
arguments. Its output is semantically checked again.
- For-loop: `iterator f(...) {.plugin: "p".}` receives
`(forcall <iterator-name> (callargs ...) (unpackflat|unpacktup ...) <body>)`.
Use `forLoopCallArgs`, `forLoopVars`, and `forLoopBody`. The body is already
typed; transformed output is semantically checked again.
- Module: `{.plugin: "p".}` receives the semantically checked full module and
must return the full module. Output is not checked again.
- Type: `type T {.plugin: "p".} = ...` receives the full module through
`loadPluginInput()` and triggering definitions through
`loadTypeDefinitions()`. It must return the full module; output is not
checked again.
- Import: `import (path/foo) {.plugin: "p".}` transforms an imported module.
When multiple templates or iterators name the same plugin path, use
`pluginName(root)` to dispatch them inside that one executable.
Use the named protocol helpers to access template and for-loop inputs.
### Ownership and identity
- `NifBuilder` is the move-only `nifcore.TokenBuf`.
- `NifCursor` is a copyable, reference-counted, bounded read cursor.
- `snapshot(tree)` borrows a non-empty builder. The cursor keeps its observed
storage alive; later builder mutation detaches storage as needed.
- `addTree` borrows its child builder, so the child remains usable afterward.
`saveTree` accepts its completed output as a `sink` parameter.
- `SymId` and `TagId` are numeric handles local to shared plugin pools. Resolve
their names with `symText` and `tagText`.
- Plugin inputs and builders use shared preseeded pools, so handles obtained
from plugin cursors can be reused by builder helpers.
### Build NIF
- Start a builder with `createTree()`.
- Add known Nimony enum tags with `withTree SomeEnum, info:`.
- Add textual or dynamic tags with balanced `openTree(tag, info)` /
`closeTree()`.
- Preserve `n.info` when deriving output from an input node. Use `NoLineInfo`
for synthetic output.
- Use `addTree(dest, child)` to append an entire child builder.
- Use `addSubtree(dest, cursor)` to copy without advancing and
`takeTree(dest, cursor)` to copy and advance.
- Use `copyInto(dest, cursor):` to copy a node head while transforming all
bounded children.
- Use `bindSym` for hygienic definition-scope symbol references.
- For each local introduced by a plugin, call `genSym()` once and pass that
`SymId` to `addSymDef` and every corresponding `addSymUse`.
### Traverse bounded cursors
- Compound nodes have kind `TagLit`; strings have kind `StrLit`.
- Cursors are bounded by a remaining-token count.
- `firstChild(n)` returns a cursor bounded to the current node's children.
- `skip(n)` advances over one atom or complete subtree.
- `into n:` and `loopInto n:` require their bodies to consume all children.
- `balancedTokens n:` visits descendant `TagLit` nodes, excludes the root, and
leaves `n` advanced past the root.
- Copy a cursor for lookahead and use `hasMore` to test its bounds.
### Prefer Replacer for selective rewrites
- `keep`, `drop`, and `replace` each consume one input child.
- Their kind argument asserts the current child's kind.
- `keepTag` and `replaceHead` bodies must consume every child.
- `loopKeepTag` preserves a node while iterating its children.
- `peek` restores the source cursor; writes to `r.dest` persist.
- Template replacers start at `(stmts <name> <args...>)`; consume or preserve
the leading name deliberately before processing arguments.
### Report errors and write output
- Return `errorTree(message, at)` when user input violates the plugin's
contract.
- Reserve assertions for plugin implementation contract violations.
- `renderNode(cursor)` and `renderTree(builder)` are debugging helpers that
omit line information.
- `saveTree` consumes a builder. `saveReplacer` writes the replacer output.
## Workflow
1. Resolve and inspect the exact `plugins.nim` used by the selected Nimony.
2. Select the plugin kind and write down its input/output contract.
3. Expose the pragma from a small user-facing module and keep transformation
logic in a separate plugin module.
4. Load input with `loadPluginInput`, `loadTypeDefinitions`, or `loadReplacer`.
5. Use protocol helpers before traversing arguments, variables, or bodies.
6. Preserve correct subtrees; synthesize only what changes.
7. Build one complete output. Return `errorTree` for invalid input, then write
the result with `saveTree` or `saveReplacer`.
8. Compile plugin integration tests with Nimony. A host-Nim test harness can
launch `nimony` when needed.
## Common Mistakes
| Mistake | Correction |
| --- | --- |From Vyrnexis/nim-agent-template, MIT.
More from Vyrnexis/nim-agent-template
- 0.574score
nim-fuzzing
Vyrnexis
Set up and run libFuzzer-based fuzz targets for Nim code, including harness wiring, compilation flags, corpus management, structure-aware mutators, and crash…
SkillBFreshness: B★ 4Claude Code +9 - 0.574score
atlas-package-cloner
Vyrnexis
Use Atlas to initialize Nim projects, install or update Atlas-managed dependencies, configure dependency directories, inspect Atlas-generated nim.cfg paths…
SkillBFreshness: B★ 4Claude Code +9 - 0.574score
nim-style-guide
Vyrnexis
Write clear, consistent Nim code in a simple stdlib-aligned style, covering imports, naming, proc vs func vs template choices, local variables, constructors…
SkillBFreshness: B★ 4Claude Code +9 - 0.574score
nim-ownership-hooks
Vyrnexis
Implement and review Nim ARC/ORC ownership hooks for types that manually manage resources, including move-only, deep-copy, refcounted, and copy-on-write…
SkillBFreshness: B★ 4Claude Code +9 - 0.574score
nim-api-design
Vyrnexis
Design clear public Nim APIs for libraries and modules, including exported types, constructors, parameter ownership, lookup functions, error contracts, and…
SkillBFreshness: B★ 4Claude Code +9 - 0.574score
nim-c-bindings
Vyrnexis
Bind C libraries to Nim and make them build reliably across Linux, macOS, and Windows, including headers, types, linking, shared-library loading, and…
SkillBFreshness: B★ 4Claude Code +9 - 0.574score
nim-c-wrappers
Vyrnexis
Turn low-level C FFI bindings into an idiomatic Nim API, with safer types, cleaner module boundaries, resource management, callbacks, enums, bitflags, and…
SkillBFreshness: B★ 4Claude Code +9 - 0.574score
nim-code-organization
Vyrnexis
Organize Nim modules and multi-step workflows with explicit state ownership, cohesive boundaries, narrow exports, and structured orchestration.
SkillBFreshness: B★ 4Claude Code +9 - 0.574score
nim-debugging
Vyrnexis
Debug Nim compile failures, crashes, wrong results, macro expansion, ownership behavior, and unsafe-memory defects using focused reproduction, stack traces…
SkillBFreshness: B★ 4Claude Code +9 - 0.574score
nim-testing
Vyrnexis
Write and run deterministic Nim tests, including isolated test files, expected-exception checks, multi-configuration builds, and sanitizer integration.
SkillBFreshness: B★ 4Claude Code +9 - 0.574score
nim-doc-comments
Vyrnexis
Document exported Nim modules and APIs with doc comments that `nim doc` actually picks up, including module docs, proc and type docs, field docs, and runnable…
SkillBFreshness: B★ 4Claude Code +9 - 0.574score
nim-error-handling
Vyrnexis
Design clear Nim error-handling flows; when to raise exceptions vs return `Option`/`bool`, how to enforce non-raising contracts, and where to translate or…
SkillBFreshness: B★ 4Claude Code +9
Signals
- Stars
- 4
- Forks
- 2
- Open issues
- 0
- Last commit (this folder)
- Aug 20, 2026 (2 months ago)
From GitHub (fetched Oct 24, 2026).
Details
- License
- MIT
- Repository
- github.com/Vyrnexis/nim-agent-template
- First seen
- Oct 24, 2026
- Last checked
- Oct 24, 2026
- Source
- GitHubgithub-graphql
More from Vyrnexis
- 0.574score
nim-c-wrappers
Vyrnexis
Turn low-level C FFI bindings into an idiomatic Nim API, with safer types, cleaner module boundaries, resource management, callbacks, enums, bitflags, and…
SkillBFreshness: B★ 4Claude Code +9 - 0.574score
nim-testing
Vyrnexis
Write and run deterministic Nim tests, including isolated test files, expected-exception checks, multi-configuration builds, and sanitizer integration.
SkillBFreshness: B★ 4Claude Code +9 - 0.574score
atlas-package-cloner
Vyrnexis
Use Atlas to initialize Nim projects, install or update Atlas-managed dependencies, configure dependency directories, inspect Atlas-generated nim.cfg paths…
SkillBFreshness: B★ 4Claude Code +9 - 0.574score
nim-api-design
Vyrnexis
Design clear public Nim APIs for libraries and modules, including exported types, constructors, parameter ownership, lookup functions, error contracts, and…
SkillBFreshness: B★ 4Claude Code +9 - 0.574score
nim-c-bindings
Vyrnexis
Bind C libraries to Nim and make them build reliably across Linux, macOS, and Windows, including headers, types, linking, shared-library loading, and…
SkillBFreshness: B★ 4Claude Code +9 - 0.574score
nim-code-organization
Vyrnexis
Organize Nim modules and multi-step workflows with explicit state ownership, cohesive boundaries, narrow exports, and structured orchestration.
SkillBFreshness: B★ 4Claude Code +9
Cite this page
nimonyplugins skill. Agent Mart. https://agentmart.dev/skills/vyrnexis-nimonyplugins (last updated 2026-10-24)