Agent Skills: datum-macro

|-

UncategorizedID: elasticdotventures/_b00t_/datum-macro

Install this agent skill to your local

pnpm dlx add-skill https://github.com/elasticdotventures/_b00t_/tree/HEAD/skills/datum-macro

Skill Files

Browse the full folder contents for datum-macro.

Download Skill

Loading file tree…

skills/datum-macro/SKILL.md

Skill Metadata

Name
datum-macro
Description
|-

What

The datum-macro skill covers three tiers of using Rust macros as dynamic datums, all operating at compile time. Tier 1 uses macro_rules! to create BootDatum literals at compile time with zero new dependencies — useful for core datums baked into the binary. Tier 2 uses the inventory crate for distributed static collection where any crate registers a datum at link time and inventory::iter::<BootDatum> collects all registered datums without file I/O — this enables offline/airgap binaries with core datums baked in. Tier 3 uses a proc_macro attribute (#[b00t_datum(type = "cli", hint = "...")]) which is the most ergonomic but requires a new crate.

The Chalk Interner pattern connects here: a DatumStore trait would unify all three tiers, with implementations for TomlFileStore, InventoryStore, SqliteStore, and QdrantStore. Macros register into InventoryStore; the TOML scanner registers into TomlFileStore; get_all_datums() merges both with operator-added datums overriding builtins by key.

When to Use

Use Tier 1 (macro_rules!) when you need to define core datums inline without dependencies. Use Tier 2 (inventory) when building offline/airgap binaries with blessed tooling baked in. Use Tier 3 (proc_macro) when ergonomics matter more than dependency footprint.

How

  1. For Tier 1: define a macro_rules! datum { ... } that creates BootDatum literals. Use LazyLock since BootDatum uses String.
  2. For Tier 2: add inventory as an optional feature flag. Use inventory::submit! in any crate and inventory::iter::<BootDatum> in get_all_datums().
  3. For Tier 3: create a proc_macro crate with #[b00t_datum(...)] attribute that generates BootDatum construction + inventory::submit!.
  4. Note: macros are compile-time only. TOML scan remains canonical for operator-extensible datums.
<!-- b00t:map v1 summary: Rust macro datums — macro_rules!/inventory/proc_macro tiers; all compile-time; DatumStore trait bridges macro+TOML tags: rust, macro, datum, inventory, compile-time, chalk, datum-store tier: ch0nky cmds: b00t learn datum-macro complexity: 6 -->