Логотип Nimonyplugins

Nimonyplugins

Сообщество
planetis-m
nimonyplugins

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.

Обзор

Издательplanetis-m
Репозиторийskills
Название навыкаnimonyplugins
Звёзды
66
Форки
7
Встроенные файлы
6
Ссылки
  • Инструкции в формате Markdown

    Файл SKILL.md, который модель загружает по необходимости, поэтому токены расходуются только при подходящем запросе.

  • Работает с любой языковой моделью

    Навыки ИИ — это обычный Markdown, а не код для конкретного поставщика, поэтому они работают с GPT, Claude, Gemini, Grok и локальными моделями.

  • Файлы в комплекте: 6

    Скрипты, шаблоны и справочные материалы, которые модель может читать во время работы. Файлы доступны только для чтения и никогда не выполняются.

  • Открытый исходный код

    Опубликовано на GitHub: planetis-m. Перед установкой изучите исходные материалы.

Установка

Установите навык ИИ Nimonyplugins в TypingMind, чтобы использовать его с любой LLM, или добавьте его в другой агент, который умеет читать SKILL.md.

1

Установка в TypingMind

TypingMind устанавливает навык прямо из его папки на GitHub: читает SKILL.md, собирает файлы ресурсов и сохраняет результат локально.

  1. Откройте приложение и перейдите в раздел «Плагины → Навыки».
  2. Выберите «Установить из GitHub».
  3. Вставьте указанную ниже ссылку на папку навыка и подтвердите установку.
    https://github.com/planetis-m/skills/tree/master/nimonyplugins
  4. Включите навык в каждом чате, где хотите его использовать.
Плагины → Навыки → Новый навык → По ссылке GitHub, затем вставьте ссылку на папку и нажмите «Продолжить».
2

Установка в другом агенте

Любой агент с поддержкой формата Agent Skills может использовать этот навык — скопируйте папку в каталог навыков этого агента.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/planetis-m/skills.git /tmp/skills
mkdir -p .claude/skills
cp -r /tmp/skills/nimonyplugins .claude/skills/nimonyplugins
После копирования перезапустите Claude Code, чтобы загрузить новый навык.

Использование в TypingMind

Включите навык Nimonyplugins в любом чате TypingMind, и дальше модель всё сделает сама. Его название и описание хранятся в системном промпте, а при появлении подходящего запроса модель сама загружает полные инструкции. Вам не нужно вызывать навык вручную, и до фактического использования он не расходует токены.

Модель сама загружает навык Nimonyplugins, как только появляется подходящий для него запрос.

Работает с любой моделью ИИ

Навыки ИИ — это обычные инструкции в Markdown, а не код для конкретного поставщика, поэтому навык Nimonyplugins не привязан к модели, для которой он был создан. Установите его один раз в TypingMind и используйте с GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama или локальной моделью, которую запускаете самостоятельно, — со своими API-ключами.

  • Загружается только при необходимости

    Системный промпт содержит только название и описание. Инструкции загружаются при первом подходящем запросе, поэтому неиспользуемый навык не расходует токены.

  • Меняйте модели прямо в чате

    Навык состоит из инструкций, а не кода, поэтому смена модели не нарушает его работу: новая модель читает тот же файл SKILL.md.

Инструкции навыка

Это содержимое файла SKILL.md, которое загружает модель. Прочитайте его перед установкой: навык — это инструкции, которым будет следовать ваша модель.

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

MistakeCorrection
Compiling the plugin module with NimCompile plugin modules and integration tests with Nimony
Traversing a template root as though every child were an argumentUse callArgs(root); the root also contains the invoked template name
Confusing addSubtree with takeTreeUse addSubtree to preserve the cursor position and takeTree to advance it
Leaving children unconsumed in into, keepTag, or replaceHeadConsume every bounded child in the body
Returning a transformed fragment from a module or type pluginReturn the complete module
Reusing a textual name for a generated localCall genSym() once and use its SymId for the definition and every use
Writing output during peek while treating it as a dry runKeep peek read-only; it restores the source cursor but not r.dest

References

  • references/template_plugin.md — A template plugin that generates an expression from literal arguments.
  • references/replacer_api.md — A selective call rewrite that preserves most input children.
  • references/for_loop_plugin.md — A for-loop plugin that expands an already typed body.
  • references/module_plugin.md — A module plugin that rewrites an already typed module.
  • references/type_plugin.md — A type plugin for validation or rewrites driven by selected types.
  • references/generated_symbols.md — genSym definition and use for collision-free locals.

Встроенные файлы

Модель читает эти файлы по мере необходимости, пока навык загружен. Они доступны только для чтения и никогда не выполняются.

Часто задаваемые вопросы

Что делает навык ИИ Nimonyplugins?

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.

Зачем использовать Nimonyplugins в TypingMind?

Потому что вы устанавливаете навык один раз и используете его с любой моделью. Nimonyplugins — это обычный текст в формате Markdown, а не код для конкретного поставщика, поэтому один и тот же навык работает с GPT-5, Claude, Gemini, Grok или локальной моделью. Вы можете менять модель прямо во время чата, и навык продолжит работать. TypingMind использует ваши собственные ключи API, поэтому вы платите поставщикам напрямую, а не оформляете подписку с оплатой за каждое место. Ваши навыки и чаты остаются в вашем собственном хранилище.

Как установить Nimonyplugins в TypingMind?

В TypingMind откройте «Плагины → Навыки → Установить из GitHub» и вставьте https://github.com/planetis-m/skills/tree/master/nimonyplugins. TypingMind прочитает файл SKILL.md, включит сопутствующие файлы в пакет и установит навык, который можно включать отдельно для каждого чата.

Какие модели ИИ могут использовать Nimonyplugins?

Любая модель, которую вы подключите в TypingMind. Навыки ИИ — это обычные инструкции в формате Markdown, а не код для конкретного поставщика, поэтому GPT, Claude, Gemini, Grok и локальные модели могут загружать этот навык, когда запрос ему соответствует.

Со сколькими моделями ИИ можно использовать Nimonyplugins?

С любым количеством. Если модель поддерживает навыки, вы можете использовать с ней Nimonyplugins: GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama и другие — всё в TypingMind с вашими собственными ключами API.

Бесплатен ли навык ИИ Nimonyplugins?

Навык опубликован на GitHub автором planetis-m. Условия лицензии можно найти в репозитории. Вы платите только своему поставщику ИИ за использованные токены.

Что такое навыки ИИ?

Навык ИИ — это многоразовый набор инструкций, который объясняет модели ИИ, как выполнять конкретную задачу. Он соответствует открытому формату Agent Skills: файл SKILL.md с названием и описанием, а также любые скрипты, шаблоны или справочные файлы, которые могут понадобиться модели. Модель читает инструкции, только когда ваш запрос соответствует навыку, поэтому установленный навык ничего не стоит, пока не используется.

Чем навыки ИИ отличаются от плагинов и серверов MCP?

Плагин или сервер MCP даёт модели новые инструменты для вызова — код, который где-то выполняется и возвращает результат. Навык ИИ вместо этого даёт модели знания и порядок действий: как подойти к задаче, какие шаги выполнить и каким должен быть хороший результат. Навыки — это обычный текст в формате Markdown, поэтому им не нужны сервер, ключ API или среда выполнения, и они работают с любой моделью.

Все

Создайте свою рабочую ИИ-среду сейчас

Подпишитесь на нашу рассылку, чтобы узнавать о новых функциях и предстоящих розыгрышах 👇