mikrotik-routeros-rsc
0
总安装量
3
周安装量
安装命令
npx skills add https://github.com/alexandre-machado/ai-stuffs --skill mikrotik-routeros-rsc
Agent 安装分布
amp
3
opencode
3
kimi-cli
3
github-copilot
3
antigravity
3
Skill 文档
Skill: RouterOS .rsc
This skill guides the creation, editing, and review of RouterOS (.rsc) scripts with safe and idempotent patterns, plus validation before import.
Quick workflow
- Define script objective and scope.
- Apply idempotent patterns (see References).
- Validate syntax and risks with the linter (scripts/lint_rsc.py).
- Test import with
dry-runandon-error. - Import in a controlled manner to production.
Essential practices
- Prefer
find where ...+ conditionals beforeadd/set. - Avoid broad policies in
/system script add policy=.... - Use
:onerrorand:jobnamefor robustness and single instance. - Never include destructive commands (
system reset-configuration, etc.). - Parameterize and isolate scopes (
:localvs:global).
Validation and testing
- Lint:
python scripts/lint_rsc.py path/to/script.rsc. - Safe import (RouterOS ⥠7.16.x):
import test.rsc verbose=yes dry-runto find multiple errors without applying changes.do { import test.rsc } on-error={ :put "Failure" }to capture error.onerror e in={ import test.rsc } do={ :put "Failure - $e" }for detailed message.
References (use as needed)
- Language and syntax: see references/LANGUAGE.md
- .rsc export/import,
dry-runandonerror: see references/RSC_GUIDE.md - Security and idempotency best practices: see references/SAFE_PRACTICES.md
- Common examples and patterns: see references/EXAMPLES.md
- Linter rules: see references/LINTER_RULES.md
Notes
- Scripts should be consistent with RouterOS v7 (preferred) and compatible with v6 where possible.
- Use
print as-value, arrays, andwherefilters for robust queries. - For scheduled execution, use Scheduler with appropriate permissions.