hai-core

Initializes core Hai services for config, logging, i18n, and error handling.

3|7|Updated Jan 28, 2026
One-click install
npx skills add https://github.com/hai-series/hai-framework --skill hai-core
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: hai-core
Source: https://github.com/hai-series/hai-framework/tree/main/packages/cli/templates/skills/hai-core
Command: npx skills add https://github.com/hai-series/hai-framework --skill hai-core

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill provides the foundational core services for Hai Framework apps, including configuration loading, structured logging, internationalization (i18n), and HaiResult-based error handling and module lifecycle helpers, enabling consistent behavior across modules.

Core Features & Use Cases

  • Configuration loading: centralized, validated config retrieval with reload/watch capabilities.
  • Logging & observability: standardized log formats, levels, and child loggers for modules.
  • Internationalization: global locale management and message retrieval.
  • HaiResult error handling: unified success/error shapes with clear causes and suggestions.
  • Module lifecycle: standardized init/use/close pattern across modules.
  • Use Case: adopt core across services to ensure predictable startup, error handling, and messaging.

Quick Start

Initialize core by calling core.init with your project configuration directory, then use core.config, core.logger, and core.i18n to build and manage modules.

Frequently Asked Questions about hai-core

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

FAQPage Schema
How do I set up structured logging and configuration loading for application modules?

Structured logging and configuration loading are set up by initializing core services with your project's configuration directory, which enables centralized config retrieval and standardized log formats across modules.

What is the standardized module lifecycle pattern for consistent application startup?

The standardized module lifecycle pattern uses a consistent init/use/close sequence across modules to ensure predictable startup, stable initialization, and unified access to core utilities.

How does HaiResult-based error handling unify success and error workflows?

HaiResult-based error handling unifies success and error workflows by providing standardized ok/err shapes with clear causes and suggestions, ensuring consistent error management across modules.

Can I manage internationalization and global locale settings using core utilities?

Yes, core utilities manage internationalization by handling global locale configuration and providing message retrieval, allowing consistent multilingual support across application modules.

Do I need to call core.init before accessing config, logger, and i18n services?

Yes, you must call core.init with your project configuration directory first to establish stable initialization before accessing core.config, core.logger, and core.i18n services.

Best way to orchestrate core services for predictable startup and error handling?

The best way to orchestrate core services is adopting the framework's init pattern to configure loading, structured logging, internationalization, and HaiResult error handling for predictable startup across services.