config-usage

Load and validate YAML-based application configuration for Genies projects.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Genies projects often require consistent configuration management across multiple crates. This skill provides a YAML-driven approach to loading application configuration, applying environment variable overrides, defaults, and validation, reducing boilerplate and configuration errors.

Core Features & Use Cases

  • YAML-based configuration loading for Genies applications via ApplicationConfig and ConfigCore.
  • Environment variable overrides with snake_case to SCREAMING_SNAKE_CASE mapping and default values support.
  • Validation and defaults via #[config(...)] attributes and the ConfigCore macro to ensure safe startup.
  • Easy integration with logging setup through init_log() and centralized configuration.

Quick Start

Create an application.yml with your settings and load it at startup using ApplicationConfig::from_sources.

Frequently Asked Questions about config-usage

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

FAQPage Schema
How do I load YAML configuration for Genies application projects?▼

You can load YAML configuration for Genies projects by creating an application.yml file and loading it at startup using ApplicationConfig::from_sources. This approach centralizes settings management across related crates.

Can I override YAML application config with environment variables?▼

Yes, environment variables can override YAML application config values. The system automatically maps snake_case configuration fields to SCREAMING_SNAKE_CASE environment variables, allowing seamless deployment environment overrides.

How does the ConfigCore derive macro validate application configuration?▼

The ConfigCore derive macro validates application configuration through #[config(...)] attributes. It enforces default values and validation rules at startup, ensuring your Genies application fails fast on invalid configuration.

What is the best way to set up logging from a YAML config file in Genies?▼

The best way to set up logging from a YAML config file is by using the init_log() function. It reads centralized configuration values loaded via ApplicationConfig to initialize and configure your application's logging output.

Do I need to manually map environment variables to my YAML config fields?▼

No, manual mapping is not needed. The configuration system automatically converts snake_case YAML fields to SCREAMING_SNAKE_CASE environment variables, applying overrides and default values automatically during the loading process.

Why does my Genies application fail to start after loading YAML config?▼

Your Genies application may fail to start because the ConfigCore macro enforces strict validation rules via #[config(...)] attributes. If your YAML configuration values violate these defined constraints or defaults, startup is intentionally aborted.