derive-usage

Generate Rust DDD boilerplate with genies_derive procedural macros.

1|Updated Mar 16, 2024
One-click install
npx skills add https://github.com/tdcare/genies --skill derive-usage
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: derive-usage
Source: https://github.com/tdcare/genies/tree/main/.qoder/skills/derive-usage
Command: npx skills add https://github.com/tdcare/genies --skill derive-usage

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Genies_derive reduces boilerplate in Rust DDD projects by providing a suite of procedural macros that derive common infrastructure like aggregates, domain events, configuration loaders, and access control utilities.

Core Features & Use Cases

  • Derive Aggregate for DDD aggregates with auto-generated type metadata and ID access
  • Derive DomainEvent for events with customizable type/version/source metadata
  • Derive Config and ConfigCore for YAML + ENV based configuration loading
  • #[topic] for Dapr topic consumption with idempotent handling
  • #[wrapper] for HTTP request wrapping with automatic token refresh
  • #[casbin] for nested field-level permission checks

Quick Start

Install and enable genies_derive, then annotate your Rust structs/enums with the appropriate derives to generate boilerplate.

Frequently Asked Questions about derive-usage

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

FAQPage Schema
How do I reduce boilerplate when building Rust DDD aggregates and domain events?

You reduce Rust DDD boilerplate by applying procedural macros like Aggregate and DomainEvent to your structs, which auto-generate type metadata, ID access, and customizable event versioning without manual infrastructure code.

Does genies_derive support loading YAML and environment variables for Rust configuration?

Yes, genies_derive supports YAML and environment variable configuration loading. By using the Config and ConfigCore derives, you automatically generate configuration loaders that merge environment variables with YAML files.

How do I handle Dapr topic consumption and idempotency in a Rust service?

You handle Dapr topic consumption by annotating functions with the #[topic] macro, which provides idempotent handling for topic consumers within your Rust services, ensuring duplicate messages do not cause inconsistent state.

Can I enforce nested field-level permission checks using Casbin in Rust?

Yes, you can enforce nested field-level permission checks using the #[casbin] macro in Rust. It automatically integrates Casbin permission validation directly into your structs to restrict access to specific nested fields.

What do I need to set up before using genies_derive macros in my Rust project?

Before using genies_derive macros, you need to install and enable the genies_derive crate alongside the genies runtime in your Rust project, ensuring full functionality for DDD pattern integration and infrastructure generation.