core-dev

Standardize state management, configuration loading, and type exports across Rust core-library crates.

Updated Dec 10, 2025
One-click install
npx skills add https://github.com/novelsaga/NSaga --skill core-dev-novelsaga
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: core-dev
Source: https://github.com/novelsaga/NSaga/tree/main/.opencode/skills/core-dev
Command: npx skills add https://github.com/novelsaga/NSaga --skill core-dev-novelsaga

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Rust projects often face fragmentation in core-library concerns like state management, configuration loading, and type exports. This skill standardizes these patterns to reduce boilerplate and mistakes.

Core Features & Use Cases

  • Standardized initializers and configuration managers (e.g., OnceLock-based state, ConfigManager) across the core library.
  • Type exports via ts-rs for consistent TypeScript bindings and cross-language integration.
  • Use Case: When adding a new core feature, apply the same initialization and config discovery pattern to ensure predictable behavior.

Quick Start

Initialize the core with default feature flags and run a build to verify state and config wiring.

Frequently Asked Questions about core-dev

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

FAQPage Schema
How do I standardize Rust state management and configuration loading across multiple crates?

Standardize Rust state management and configuration loading by applying consistent initializers like OnceLock for global state and a ConfigManager for config discovery across crates. This reduces boilerplate and prevents fragmented core-library patterns.

What is the best way to generate TypeScript bindings from Rust core library types?

Generate TypeScript bindings from Rust types using ts-rs for cross-language integration. This approach exports type bindings directly from the core library, ensuring TypeScript definitions stay consistent with the Rust source.

How do I initialize global state in a Rust core library safely?

Initialize global state in a Rust core library safely using OnceLock-based initializers. This pattern ensures state is configured predictably once, supporting safe, dependency-aware behavior across multiple crates.

Why does my Rust core library have inconsistent configuration discovery patterns?

Inconsistent configuration discovery in a Rust core library happens when different crates implement their own loading logic. Standardizing with a central ConfigManager enforces a single config discovery pattern, ensuring predictable behavior when adding new core features.

Can I use ts-rs type exports without adding external dependencies to my Rust core library?

Yes, ts-rs type exports can operate within the core library's dependency-aware behavior. The skill requires safe, dependency-aware behavior and supports optional resources in scripts, references, and assets without forcing external crate dependencies.

How do I verify state and config wiring when adding a new Rust core feature?

Verify state and config wiring by initializing the core with default feature flags and running a build. This quick start approach confirms that state initialization and config discovery patterns are correctly applied before proceeding.