Logo de Nimonyplugins

Nimonyplugins

Comunidade
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.

Visão geral

Publicado porplanetis-m
Repositórioskills
Nome da habilidadenimonyplugins
Estrelas
66
Forks
7
Arquivos incluídos
6
Links
  • Instruções em Markdown

    Um arquivo SKILL.md que o modelo carrega sob demanda, consumindo tokens apenas quando uma solicitação é realmente relevante para a habilidade.

  • Funciona com qualquer LLM

    Habilidades de IA são Markdown simples, não código específico de um provedor, por isso funcionam com GPT, Claude, Gemini, Grok ou um modelo local.

  • 6 arquivos incluídos

    Scripts, modelos de documentos e referências que o modelo pode ler enquanto trabalha. Os arquivos são somente leitura e nunca são executados.

  • Código aberto

    Publicada por planetis-m no GitHub. Leia o conteúdo-fonte antes de instalar.

Instalação

Instale a habilidade de IA Nimonyplugins no TypingMind para usá-la com qualquer LLM ou adicione-a a outro agente que leia SKILL.md.

1

Instalar no TypingMind

O TypingMind instala uma habilidade diretamente da pasta dela no GitHub — lê o arquivo SKILL.md, reúne os arquivos de recursos em um pacote e armazena o resultado localmente.

  1. Abra o app e vá para Plugins → Habilidades.
  2. Escolha "Instalar do GitHub".
  3. Cole a URL da pasta da habilidade exibida abaixo e confirme.
    https://github.com/planetis-m/skills/tree/master/nimonyplugins
  4. Ative a habilidade em cada chat em que quiser disponibilizá-la.
Plugins → Habilidades → Nova habilidade → Via URL GitHub, depois cole a URL da pasta e pressione Continuar.
2

Instalar em outro agente

Qualquer agente que leia o formato Agent Skills pode usar esta habilidade — copie a pasta para o diretório de habilidades desse agente.

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
Reinicie Claude Code após copiar para que a nova habilidade seja reconhecida.

Use no TypingMind

Ative Nimonyplugins em qualquer chat do TypingMind e o modelo cuida do resto. O nome e a descrição da habilidade ficam no prompt do sistema e, assim que uma solicitação relevante aparece, o modelo carrega as instruções completas automaticamente — sem precisar de acionamento manual e sem consumir tokens até que ela seja realmente usada.

O modelo carrega Nimonyplugins automaticamente assim que uma solicitação é relevante para essa habilidade.

Funciona com qualquer modelo de IA

Habilidades de IA são instruções em Markdown simples, não código específico de um provedor. Por isso, Nimonyplugins não fica vinculada ao modelo para o qual foi criada. Instale-a uma vez no TypingMind e use-a com GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama ou um modelo local executado por conta própria — tudo com suas próprias chaves de API.

  • Carregada apenas quando necessário

    O prompt do sistema contém apenas o nome e a descrição. As instruções são buscadas na primeira solicitação relevante, então uma habilidade sem uso não gera custo.

  • Troque de modelo durante a conversa

    Como a habilidade é composta de instruções, não de código, trocar de modelo não afeta seu funcionamento — o próximo modelo lê o mesmo arquivo SKILL.md.

Instruções da habilidade

Este é o conteúdo de SKILL.md que o modelo carrega. Leia antes de instalar — uma habilidade é um conjunto de instruções que seu modelo seguirá.

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.

Arquivos incluídos

O modelo lê esses arquivos sob demanda enquanto a habilidade está carregada. Eles são disponibilizados para leitura e nunca são executados.

Perguntas frequentes

O que a habilidade de IA Nimonyplugins faz?

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.

Por que usar Nimonyplugins no TypingMind?

Porque basta instalar uma vez para usar com qualquer modelo. Nimonyplugins é escrito em Markdown simples, e não em código específico de um provedor, então a mesma habilidade funciona com GPT-5, Claude, Gemini, Grok ou um modelo local — e é possível trocar de modelo no meio do chat sem que ela deixe de funcionar. O TypingMind usa suas próprias chaves de API, então o pagamento é feito diretamente aos provedores, em vez de uma assinatura por licença de usuário, e suas habilidades e chats permanecem no seu próprio armazenamento.

Como instalar Nimonyplugins no TypingMind?

Abra Plugins → Habilidades → Instalar do GitHub no TypingMind e cole https://github.com/planetis-m/skills/tree/master/nimonyplugins. O TypingMind lê o arquivo SKILL.md, reúne os arquivos da habilidade e a instala para que possa ser ativada em cada chat.

Quais modelos de IA podem usar Nimonyplugins?

Qualquer modelo conectado no TypingMind. As habilidades de IA são instruções em Markdown simples, e não código específico de um provedor. Assim, GPT, Claude, Gemini, Grok e modelos locais podem carregar esta habilidade quando uma solicitação corresponder a ela.

Quantos modelos de IA posso usar com Nimonyplugins?

Quantos quiser. Desde que o modelo ofereça suporte a habilidades, é possível usar Nimonyplugins com ele — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama e outros — tudo no TypingMind com suas próprias chaves de API.

A habilidade de IA Nimonyplugins é gratuita?

A habilidade é publicada no GitHub por planetis-m. Consulte os termos de licenciamento no repositório. O pagamento é feito apenas ao seu provedor de IA pelos tokens usados.

O que são habilidades de IA?

Uma habilidade de IA é um conjunto reutilizável de instruções que ensina um modelo de IA a realizar uma tarefa específica. Ela segue o formato aberto Agent Skills: um arquivo SKILL.md com nome e descrição, além de scripts, modelos de documento ou arquivos de referência de que o modelo possa precisar. O modelo lê as instruções apenas quando sua solicitação corresponde à habilidade, então uma habilidade instalada não gera custos até ser usada.

Qual é a diferença entre habilidades de IA e plugins ou servidores MCP?

Um plugin ou servidor MCP oferece ao modelo novas ferramentas para chamar — código que é executado em algum lugar e retorna um resultado. Já uma habilidade de IA fornece conhecimento e um processo ao modelo: como abordar uma tarefa, quais etapas seguir e como deve ser um bom resultado. As habilidades são escritas em Markdown simples, por isso não precisam de servidor, chave de API nem ambiente de execução, e funcionam com qualquer modelo.

Ver todos

Crie seu próprio espaço de IA agora

Inscreva-se na nossa newsletter para receber novidades sobre recursos e futuros sorteios 👇