mikrotik-routeros-rsc

Create, review, and validate idempotent RouterOS .rsc configuration scripts for MikroTik routers.

1|Updated Mar 5, 2026
One-click install
npx skills add https://github.com/Alwahdi/mikrotik-whisperer --skill mikrotik-routeros-rsc-alwahdi
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: mikrotik-routeros-rsc
Source: https://github.com/Alwahdi/mikrotik-whisperer/tree/main/.agents/skills/mikrotik-routeros-rsc
Command: npx skills add https://github.com/Alwahdi/mikrotik-whisperer --skill mikrotik-routeros-rsc-alwahdi

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve? Writing MikroTik RouterOS scripts by hand often leads to non-idempotent configurations, destructive commands, and failed imports that are hard to debug. This Skill guides the creation, editing, and review of .rsc scripts with safe patterns and static linting before anything touches a production router. ## Core Features & Use Cases - Idempotent Script Authoring: Generates .rsc scripts that check state with find where ... before add/set, avoiding duplicate firewall rules, IP addresses, and DHCP clients. - Static Linting: Runs scripts/lint_rsc.py to flag destructive commands, excessive script policies, fixed-ID references, credential leaks in logs, and unguarded add operations. - Safe Import Validation: Uses RouterOS 7.16.x import verbose=yes dry-run and onerror blocks to catch multiple errors without applying changes. - Use Case: You need to add a firewall rule and an IP address to a fleet of routers. The Skill generates an idempotent .rsc script, lints it for risky patterns, and gives you the dry-run import commands to verify it before production rollout. ## Quick Start Ask the assistant to create an idempotent RouterOS script that adds a specific firewall rule or IP address, then lint the resulting .rsc file and show the dry-run import commands.

Frequently Asked Questions about mikrotik-routeros-rsc

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I write an idempotent RouterOS script?

Check for existing state with `find where ...` and wrap `add` or `set` in an `:if` conditional so the script only creates resources that do not already exist. Select items by name, address, or comment instead of fixed numeric IDs.

How to test a MikroTik .rsc script before importing?

On RouterOS 7.16.x or later, run `import test.rsc verbose=yes dry-run` to find multiple errors without applying changes. You can also capture failures with `onerror e in={ import test.rsc } do={ :put "Failure - $e" }`.

What does the .rsc linter check for?

The lint_rsc.py script flags destructive commands like system reset-configuration, unguarded `add` operations, fixed-ID set/remove, excessive script policies, :delay in loops, :global inside local scopes, and credentials logged via :log.

Does this work with RouterOS v6 or only v7?

Scripts are written for RouterOS v7 as the preferred target while remaining compatible with v6 where possible. Note that `import dry-run` and `onerror` import capture require RouterOS 7.16.x or newer.

Why should I avoid fixed IDs in RouterOS set and remove commands?

Fixed numeric IDs change whenever the configuration is modified, so scripts referencing them break or alter the wrong items. Use `find where` with stable keys like comment, name, or address to target items reliably.