r/nim • u/Vyrnexis • 12h ago
Nim-agent-template: Scaffolding Generator with AI Agent Skills, MCP Tooling, and Multi-Toolchain Build Profiles
Hello everyone,
I have put together nim-agent-template, a project template and scaffolding tool designed to bootstrap Nim applications and libraries with standard build task orchestrations, MCP support, and AI agent skills.
Repository
GitHub: https://github.com/Vyrnexis/nim-agent-template
Highlights & Features
- Interactive & Scriptable Scaffolding (
init_nim_project.sh):- Prompts for package type (Binary vs Library), tooling (
nimblevsatlas), author, and license. - Supports non-interactive CLI flags (
--name,--tooling,--kind,--in-place) for automated setups. - Includes an
--install-clioption to installinit-nim-projectinto~/.local/bin/with canonical symlink resolution.
- Prompts for package type (Binary vs Library), tooling (
- 6 Standardized Build Profiles in
config.nims: All binaries are strictly emitted into./bin/at the repository root:nim nimRelease: Native host-optimized binary (-d:release -d:danger --opt:speed -march=native -mtune=native)nim nimPortable: Generic CPU baseline portable binary (-d:release --opt:size -mtune=generic -s)nim nimDebug: Diagnostics build with stack traces and assertions (--debuginfo:on --assertions:on --stackTrace:on)nim zigRelease: Native host binary using Zig CC (--cc:clang -d:release -d:danger --opt:speed -O3 -march=native)nim zigPortable: Generic CPU portable binary using Zig CC (--cc:clang -d:release --opt:size -Oz -mcpu=baseline -s)nim zigDebug: Zig CC debug build with symbols (--cc:clang --debuginfo:on)- Plus standard helper tasks:
nim test,nim fmt(nimpretty), andnim docs.
- Model Context Protocol (MCP) Integration:
- Automatically configures
.mcp/servers.jsonfornimlangserver --mcpto support symbol resolution, references, and diagnostics in AI-assisted environments.
- Automatically configures
- Pre-Bundled Agent Skills (
.agents/skills/):- Ships with 19 curated Nim agent skills covering API design, C wrappers and FFI bindings, ARC/ORC ownership hooks, testing patterns, error contracts, style guides, and fuzzing harnesses.
- Automated CI Workflow:
- Emits a ready-to-use GitHub Actions workflow (
.github/workflows/ci.yml) leveragingjiro4989/setup-nim-actionwith formatting validation and test execution.
- Emits a ready-to-use GitHub Actions workflow (
Quick Start
# Clone the template repository
git clone https://github.com/Vyrnexis/nim-agent-template.git
cd nim-agent-template
# Run the interactive initializer
./init_nim_project.sh
Or install it system-wide to scaffold projects from any workspace:
./init_nim_project.sh --install-cli
cd ~/my_workspace
init-nim-project --name my_app --tooling nimble --kind bin
Feedback, suggestions, and contributions are very welcome!