nim-mcp-tools
Skill4 starsChanged 3 months agoMITView on GitHub
Use for Nim symbol navigation, diagnostics, and type resolution. MANDATORY: Use specialized MCP tools (nimFindSymbols, nimFindReferences, nimListSymbols, nimCheckFile, nimCheckProject, nimFindTypeDefinition) first; fall back to grep only on error or user confirmation.
In this repository18 other files it gives its agents.
- atlas-package-clonerSkill
- buildSkill
- docs-genSkill
- format-codeSkill
- nim-api-designSkill
- nim-c-bindingsSkill
- nim-code-organizationSkill
- nim-c-wrappersSkill
- nim-debuggingSkill
- nim-defect-analysisSkill
- nim-doc-commentsSkill
- nim-error-handlingSkill
- nim-fuzzingSkill
- nimonypluginsSkill
- nim-ownership-hooksSkill
- nim-style-guideSkill
- nim-testingSkill
- run-testsSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
50 rules. About 0 are common, 28 are distinctive, and 22 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈28
Distinctive · estimate
This author's own choices. Worth a look.
22
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 17
If the user asks to find, rename, remove, audit, update, standardize naming, or fix issues/project of a Nim symbol or its usages, this …
- Very specific: line 19
If the user asks to check a single Nim file for errors, warnings, hints, diagnostics, issues, problems, or compiler feedback, this skill …
- Very specific: line 21
If the user asks to check a Nim project for errors, warnings, hints, diagnostics, issues, problems, compiler feedback, or to "fix" it, this …
- Very specific: line 23
If the user asks to determine where a symbol comes from, what type it is, what its fields are (including private ones), or resolve a …
- Distinctive: line 48
Treat user wording such as project, workspace, repository, repo, package, codebase, checkout, and module tree as referring to the current …
- Very specific: line 50
Treat user wording such as file, module (when a concrete Nim file is identified), source file, and explicit *.nim paths as referring to …
- Very specific: line 52
Do not pair nimFindSymbols, nimCheckFile, or nimCheckProject with grep, ripgrep, or shell search "just to double-check".
- Distinctive: line 60
Use these terminology mappings when interpreting user requests:
- Very specific: line 88
Debugging Type Mismatches: When a diagnostic reveals a type mismatch, use nimFindTypeDefinition on both sides to understand what types are …
- Distinctive: line 89
Code Generation / Refactoring: Before generating code that interacts with a type, find its definition to understand its structure and field …
- Distinctive: line 95
Do NOT grep for the name.
- Very specific: line 97
Call nimFindSymbols(query: "SymbolName") to get exact path, line, and column.
- Distinctive: line 101
Use this workflow for "usages", "references", "call sites", and cleanup requests such as removing all definitions of and references to a …
- Distinctive: line 105
Do NOT read the whole file to find definitions.
- Very specific: line 108
If the user asked for a symbol category, filter by the MCP kind values that correspond to the user's terminology.
- Distinctive: line 109
Use the returned list to navigate or analyze the file structure.
- Distinctive: line 117
Use this when asked where a symbol comes from, what its type is, or to inspect its definition (fields, kind, etc.).
- Very specific: line 119
Call nimFindTypeDefinition(path, line, column) with the cursor positioned on the symbol of interest.
- Distinctive: line 121
If the user needs to see the full definition (e.g., object fields), read the source at the returned path/line.
- Distinctive: line 122
Use this for requests like "what type is this variable?", "what module does this type come from?", "what fields does this object have?".
- Distinctive: line 126
Use this when fixing a diagnostic that involves a type mismatch.
- Very specific: line 128
Call nimCheckFile(path) to get the diagnostic with the exact error location.
- Distinctive: line 134
Use this when asked to describe or document a type's shape.
- Very specific: line 136
Call nimFindSymbols(query: "TypeName") to locate the type definition.
- Very specific: line 137
Call nimFindTypeDefinition(path, line, column) on the type name to confirm the definition location.
- Distinctive: line 138
Read the source at the definition location to enumerate all fields (including private ones) and their types.
- Distinctive: line 143
Do NOT approximate file diagnostics by reading the file manually or by running a project-wide diagnostic request when the user asked about …
- Distinctive: line 146
Treat the result as the answer unless the user explicitly asked for broader validation such as project-wide diagnostics, tests, or builds.
- Distinctive: line 147
Use the returned diagnostics to report errors, warnings, and hints for that file.
- Distinctive: line 148
If the user asked for only a subset (for example, only errors or only warnings), filter the returned diagnostics by severity before …
- Very specific: line 150
Use this workflow for requests phrased as checking a specific file, source file, module, or explicit *.nim path for Nim issues.
- Distinctive: line 154
Do NOT approximate project diagnostics by grepping build logs or manually scanning files.
- Distinctive: line 157
Use the returned diagnostics to report errors, warnings, and hints for the current Nim project context.
- Distinctive: line 160
Use this workflow for requests phrased as checking the current project, workspace, repository, repo, package, codebase, checkout, or module …
- Very specific: line 164
Use this when asked to fix casing, follow a style guide, or rename symbols to the standard camelCase (as per standard Nim convention).
- Very specific: line 170
After a file has been processed, call nimCheckFile(path: "path/to/file.nim") to verify that the changes are correct and no errors were …
- Distinctive: line 174
Use this when asked to "fix issues", "fix project", or "fix the repo".
- Very specific: line 176
Call nimCheckProject() to find all diagnostics in the project.
- Distinctive: line 179
Limit: If issues remain after 3 iterations, you MUST stop and prompt the user, asking if they would like you to continue.
- Very specific: line 181
Consistency Check: If the user agrees, use nimFindSymbols and nimFindReferences to find all variations of symbol usage in the project.
- Very specific: line 188
On Error: If an MCP tool fails due to a technical error (e.g., tool crash, timeout, connection issue), you MUST fall back to grep_search or …
- Distinctive: line 190
Use the narrowest fallback necessary.
- Distinctive: line 191
On Empty Results: If an MCP tool returns no results (empty list), do NOT automatically fall back to grep.
- Distinctive: line 192
Availability: If MCP tools are unavailable in the environment, use general-purpose tools but inform the user.
- Distinctive: line 196
Do not present the fallback results as equivalent in precision to MCP tool results.
- Very specific: line 200
NO GREP BY DEFAULT: Never use grep, ripgrep, or grep_search to find Nim symbols or references unless the MCP tools have explicitly errored …
- Distinctive: line 201
PROMPT ON EMPTY: If MCP tools return nothing, you MUST ask the user before falling back to grep.
- Very specific: line 202
NO MANUAL PARSING: Do not read large Nim files just to extract symbol locations.
- Very specific: line 203
NO DIY FILE CHECKS: Do not substitute manual inspection, ad-hoc compiler invocations, or nimCheckProject when nimCheckFile can return …
- Very specific: line 204
NO DIY PROJECT CHECKS: Do not substitute shelling out to ad-hoc Nim commands, parsing compiler output, or manually inspecting many files …
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Nim MCP Tools
Core Mandate
AI agents MUST prefer specialized MCP tools over general-purpose instruments (grep, shell commands, read_file with manual parsing) for all Nim symbol-related and Nim diagnostics tasks. This is critical for:
- Token Efficiency: MCP tools return structured, relevant data, avoiding large file reads or noisy grep outputs.
- Precision: These tools understand Nim semantics (scopes, imports, overloads) which string-based search cannot.
Activation Rule
If the user asks to find, rename, remove, audit, update, standardize naming, or fix issues/project of a Nim symbol or its usages, this skill MUST be used first and the workflow must start with the Nim MCP symbol tools.
If the user asks to check a single Nim file for errors, warnings, hints, diagnostics, issues, problems, or compiler feedback, this skill MUST be used first and the workflow must start with nimCheckFile.
If the user asks to check a Nim project for errors, warnings, hints, diagnostics, issues, problems, compiler feedback, or to "fix" it, this skill MUST be used first and the workflow must start with nimCheckProject.
If the user asks to determine where a symbol comes from, what type it is, what its fields are (including private ones), or resolve a symbol's type definition, this skill MUST be used first and the workflow must start with nimFindTypeDefinition.
This applies to requests phrased as:
- "find all usages/references of
Foo" - "remove all definitions of and references to
Foo" - "rename
Fooeverywhere" - "standardize naming for
Foo" - "fix casing for all variables"
- "where is
Foodefined?" - "list the symbols in this Nim file/module"
- "check this file/module for errors"
- "show diagnostics for
foo.nim" - "check this project/workspace/repository/package for errors"
- "fix issues in this project"
- "fix the repo"
- "find Nim diagnostics in the current codebase"
- "show warnings and hints for this repo"
- "scan the current module tree for Nim issues"
- "what is the type of this symbol?"
- "what module/package does this type come from?"
- "what fields does this type have?"
- "is this a type alias or a concrete type?"
- "where is this type defined?"
Treat user wording such as project, workspace, repository, repo, package, codebase, checkout, and module tree as referring to the current Nim project context when they are asking for project-wide diagnostics.
Treat user wording such as file, module (when a concrete Nim file is identified), source file, and explicit *.nim paths as referring to single-file diagnostics when they are asking for diagnostics for one file.
Do not pair nimFindSymbols, nimCheckFile, or nimCheckProject with grep, ripgrep, or shell search "just to double-check". If the task is about a Nim symbol or Nim diagnostics, MCP tools own the search unless they have already failed.
User Terminology vs MCP kind
Users may ask for symbol categories using looser or non-strict terminology. AI agents MUST map that wording to the exact Nim MCP kind values before filtering results from nimListSymbols(...) or nimFindSymbols(...).
The MCP server returns Nim-oriented kind names derived from nimsuggest symbol kinds with the leading sk removed, such as Const, EnumField, Field, Iterator, Converter, Let, Macro, Method, Proc, Template, Type, Var, and Func.
Use these terminology mappings when interpreting user requests:
- function / functions: usually match
FuncandProc - pure function / pure functions: match
Func - callable / routine: may include
Func,Proc,Method,Iterator,Converter,Macro, andTemplate - class / classes: match
Type - variable / variables: match
VarandLet - property / properties: match
Field - enum member / enum members: match
EnumField - constant / constants: match
Const
Interpret user wording semantically, not literally. For example:
- "list all classes in this module" -> filter for
kind == Type - "list all variables" -> filter for
kind in {Var, Let} - "list all functions" -> filter for
kind in {Func, Proc}unless the surrounding context clearly asks for all callables - "list all pure functions" -> filter for
kind == Func
When to Use
- Finding References: To rename a symbol, update a signature, or find usages.
- Symbol Discovery: To find where a symbol is defined by name.
- Type Resolution: To determine where a local symbol comes from (which module), what its type is, and what fields it has (including private ones). Uses
nimFindTypeDefinition(path, line, column)on the symbol's cursor position. - Naming Standardization: To fix casing or follow style guides (e.g., standardizing to
camelCase) across the project. - Fixing Project Issues: To iteratively find and resolve all diagnostics in the project.
- File Analysis: To get an overview of all symbols in a file.
- File Diagnostics: To check one specific Nim file for errors, warnings, and hints.
- Project Diagnostics: To check the current Nim project/workspace/repository/package for errors, warnings, and hints.
- Debugging Type Mismatches: When a diagnostic reveals a type mismatch, use
nimFindTypeDefinitionon both sides to understand what types are expected vs provided. - Code Generation / Refactoring: Before generating code that interacts with a type, find its definition to understand its structure and field layout.
Workflows
1. Find All References or Usages of a Symbol Name
Do NOT grep for the name.
- Call
nimFindSymbols(query: "SymbolName")to get exactpath,line, andcolumn. - For each relevant result, call
nimFindReferences(path, line, column). - Aggregate the results.
Use this workflow for "usages", "references", "call sites", and cleanup requests such as removing all definitions of and references to a symbol.
2. List All Symbols in a File
Do NOT read the whole file to find definitions.
- Call
nimListSymbols(path: "path/to/file.nim"). - If the user asked for a symbol category, filter by the MCP
kindvalues that correspond to the user's terminology. - Use the returned list to navigate or analyze the file structure.
3. Find Definitions
- Call
nimFindSymbols(query: "query").
4. Resolve Type / Determine Origin of a Symbol
Use this when asked where a symbol comes from, what its type is, or to inspect its definition (fields, kind, etc.).
- Call
nimFindTypeDefinition(path, line, column)with the cursor positioned on the symbol of interest. - The result contains the definition
path,line,column,name,type, andkind. - If the user needs to see the full definition (e.g., object fields), read the source at the returned path/line.
- Use this for requests like "what type is this variable?", "what module does this type come from?", "what fields does this object have?".
5. Debug Type Mismatch (Check + Type Definition)
Use this when fixing a diagnostic that involves a type mismatch.
- Call
nimCheckFile(path)to get the diagnostic with the exact error location. - For the reported location, call
nimFindTypeDefinition(path, line, column)on the involved symbols to understand what types are expected vs provided. - Resolve the mismatch with the correct type or conversion.
6. Explore Object Structure (List Symbols + Type Definition)
Use this when asked to describe or document a type's shape.
- Call
nimFindSymbols(query: "TypeName")to locate the type definition. - Call
nimFindTypeDefinition(path, line, column)on the type name to confirm the definition location. - Read the source at the definition location to enumerate all fields (including private ones) and their types.
- Optionally, call
nimFindTypeDefinitionon each field type to recursively resolve nested types.
7. Check a Single Nim File for Diagnostics
Do NOT approximate file diagnostics by reading the file manually or by running a project-wide diagnostic request when the user asked about one file.
- Call
nimCheckFile(path: "path/to/file.nim"). - Treat the result as the answer unless the user explicitly asked for broader validation such as project-wide diagnostics, tests, or builds.
- Use the returned diagnostics to report errors, warnings, and hints for that file.
- If the user asked for only a subset (for example, only errors or only warnings), filter the returned diagnostics by severity before presenting them.
Use this workflow for requests phrased as checking a specific file, source file, module, or explicit *.nim path for Nim issues.
8. Check the Current Nim Project for Diagnostics
Do NOT approximate project diagnostics by grepping build logs or manually scanning files.
- Call
nimCheckProject(). - Use the returned diagnostics to report errors, warnings, and hints for the current Nim project context.
- If the user asked for only a subset (for example, only errors or only warnings), filter the returned diagnostics by severity before presenting them.
Use this workflow for requests phrased as checking the current project, workspace, repository, repo, package, codebase, checkout, or module tree for Nim issues.
9. Standardize Naming
Use this when asked to fix casing, follow a style guide, or rename symbols to the standard camelCase (as per standard Nim convention).
- Iterate through the project files one by one.
- For each file, call
nimListSymbols(path: "path/to/file.nim")to retrieve the symbols that need to be standardized. - For each symbol found, call
nimFindReferences(path, line, column)to identify all of its usages and call sites across the project. - Standardize the definition and all identified reference sites to
camelCaseto ensure consistency and adherence to Nim's standard style. - After a file has been processed, call
nimCheckFile(path: "path/to/file.nim")to verify that the changes are correct and no errors were introduced.
10. Fix Project Issues
Use this when asked to "fix issues", "fix project", or "fix the repo".
- Call
nimCheckProject()to find all diagnostics in the project. - Analyze the diagnostics and resolve the identified issues.
- Repeat steps 1 and 2 until
nimCheckProject()returns no more issues. - Limit: If issues remain after 3 iterations, you MUST stop and prompt the user, asking if they would like you to continue.
- Post-Fix Step: Once all issues are resolved (or the user stops the process), ask the user if they would like you to check for naming consistency.
- Consistency Check: If the user agrees, use
nimFindSymbolsandnimFindReferencesto find all variations of symbol usage in the project. - Standardization Prompt: Prompt the user if they would like to standardize naming based on the findings.
Fallback Policy
Specialized Nim MCP tools are the primary instrument. General-purpose tools (grep, ripgrep, shell commands) are secondary and their use is governed by the following rules:
- On Error: If an MCP tool fails due to a technical error (e.g., tool crash, timeout, connection issue), you MUST fall back to
grep_searchor other general-purpose tools to fulfill the request.- State clearly that the MCP tool failed.
- Use the narrowest fallback necessary.
- On Empty Results: If an MCP tool returns no results (empty list), do NOT automatically fall back to grep. Instead, you MUST prompt the user, asking if they would like you to attempt a plain text search using general-purpose tools.
- Availability: If MCP tools are unavailable in the environment, use general-purpose tools but inform the user.
When falling back:
- Do not present the fallback results as equivalent in precision to MCP tool results.
Critical Constraints
- NO GREP BY DEFAULT: Never use
grep,ripgrep, orgrep_searchto find Nim symbols or references unless the MCP tools have explicitly errored out. - PROMPT ON EMPTY: If MCP tools return nothing, you MUST ask the user before falling back to grep.
- NO MANUAL PARSING: Do not read large Nim files just to extract symbol locations; use
nimListSymbolsinstead. - NO DIY FILE CHECKS: Do not substitute manual inspection, ad-hoc compiler invocations, or
nimCheckProjectwhennimCheckFilecan return structured diagnostics for the specific file the user asked about. - NO DIY PROJECT CHECKS: Do not substitute shelling out to ad-hoc Nim commands, parsing compiler output, or manually inspecting many files when
nimCheckProjectcan return structured project diagnostics. - TOKEN CONSERVATION: Minimize turns and context by using the most precise tool available.
Anti-Patterns
- Calling
nimFindSymbols("Foo")and then runningrg "Foo"anyway. - Using
rgfor "find all usages" whennimFindReferencesis available. - Reading multiple Nim files to manually enumerate definitions that
nimListSymbolscan return directly. - Reading a Nim file to manually search for a type definition when
nimFindTypeDefinitioncan resolve it precisely from the symbol's cursor position. - Grepping for
type Foo* =to find where a type is defined instead of usingnimFindTypeDefinitionornimFindSymbols. - Manually scanning imports and cross-referencing to determine which module a symbol comes from, when
nimFindTypeDefinitioncan give the exact module path. - Running
nimCheckProject()when the user asked to check one specific Nim file andnimCheckFileis available. - Manually reading or building a single Nim file first when
nimCheckFilecan return structured diagnostics for it. - Running a manual project build or grep-based log scan first when the user asked for project/workspace/repository/package diagnostics and
nimCheckProjectis available.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

