entity-generator

Generate tik4net O/R-mapper C# entity classes for MikroTik RouterOS API paths.

198|97|Updated Aug 16, 2015
One-click install
npx skills add https://github.com/danikf/tik4net --skill entity-generator-danikf
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: entity-generator
Source: https://github.com/danikf/tik4net/tree/main/.claude/skills/entity-generator
Command: npx skills add https://github.com/danikf/tik4net --skill entity-generator-danikf

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Writing a tik4net.objects entity for a MikroTik API path by hand requires reconciling live router field sets, wiki documentation, read-only splits, enum vocabularies, and subtle mapper conventions (nullable bools, DefaultValue rules, TikEntity attributes) — a slow, error-prone process that previously relied on two deleted WinForms generator tools. ## Core Features & Use Cases - Entity scaffolding from a path: Produces a complete C# class with [TikEntity]/[TikProperty] attributes, correct namespace and naming conventions, enums with [TikEnum] wire values, and a ToString override. - Multi-source field resolution: Combines live router queries over multiple transports (Api, WinboxNative, Rest, CLI), CLI Tab-completion for the writable field set, and MikroTik wiki/CLI-reference pages for types, defaults, and documentation. - Convention enforcement: Applies the add-path DefaultValue rules, bool? vs bool distinctions, read-only private setters, and WinBox GUI name documentation, then adds the standard List/Add integration tests. - Use Case: Ask for an entity for /ip/dhcp-server/lease and receive a finished, buildable FirewallFilter-style class plus its integration tests, validated against a live router. ## Quick Start Ask the assistant to generate a tik4net entity for the MikroTik API path /interface/vlan, including its standard integration tests.

Frequently Asked Questions about entity-generator

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

FAQPage Schema
How do I create a tik4net entity for a MikroTik API path?

Provide the API path such as /ip/firewall/filter and the generator derives the namespace and class name from convention, resolves fields from a live router and the MikroTik wiki, and writes the attributed C# class into the matching tik4net.objects folder.

How are tik4net entity field types and read-only flags determined?

The router is authoritative for field names and live values, while the wiki and CLI reference provide types, defaults, and the read-only split. CLI Tab-completion after 'add ' enumerates the writable field set, and fields appearing only in print output become read-only properties with private setters.

Why must writable boolean properties be bool? in tik4net entities?

A RouterOS flag has three states: yes, no, and unset. Only bool? can represent all three, since null is not sent on add and the router applies its own default. A plain bool collapses unset into false and force-sends the field on every add.

Can the entity generator work without a live MikroTik router?

A live router is strongly preferred because it is the source of truth for field names, values, and enum vocabularies. Without one, the wiki alone cannot reveal undocumented fields or verify which values a menu actually accepts.

What tests does a new tik4net entity need?

Each entity gets a List test that calls LoadAll after an EnsureCommandAvailable guard, and writable entities also get an Add test that creates a marked row, reloads it by id, asserts, and deletes it in a finally block. Read-only or singleton entities get only the List test.