appconfig-system

Load and validate runtime configuration for SquareOne apps with AppConfig.

2|1|Updated Jan 7, 2021
One-click install
npx skills add https://github.com/lsst-sqre/squareone --skill appconfig-system
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: appconfig-system
Source: https://github.com/lsst-sqre/squareone/tree/main/.claude/skills/appconfig-system
Command: npx skills add https://github.com/lsst-sqre/squareone --skill appconfig-system

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires react, next.js, ajv, js-yaml, and includes references (resource) and templates (resource) components.

What problem does it solve?

Managing application configuration, especially in a Next.js app deployed to Kubernetes, can lead to hydration issues, lack of type safety, and complex deployment workflows. This skill provides expert guidance on the AppConfig system, offering a robust, type-safe, and Kubernetes-friendly solution for runtime configuration.

Core Features & Use Cases

  • Unified Config Management: Explains server-side loadAppConfig(), client-side useAppConfig(), and MDX content loading, ensuring consistent configuration access.
  • Kubernetes & Sentry Integration: Details how to use ConfigMaps for deployment and inject Sentry configuration, simplifying operations and error tracking.
  • Type-Safe & Validated: Emphasizes JSON schema validation and full TypeScript support, preventing configuration errors.
  • Use Case: When deploying a new feature that requires environment-specific URLs and feature flags, use this skill to define them in squareone.config.yaml, load them via getServerSideProps, and access them in components using useAppConfig().

Quick Start

Load the application configuration on the server-side for a Next.js page. import { loadAppConfig } from '../lib/config/loader'; const appConfig = await loadAppConfig();

Frequently Asked Questions about appconfig-system

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

FAQPage Schema
How do I manage runtime configuration in a Next.js app deployed to Kubernetes?

Runtime configuration in Next.js can be managed through the AppConfig system, which loads YAML configuration files via `loadAppConfig()` on the server and `useAppConfig()` on the client. This approach eliminates hydration issues, provides type-safe access through JSON schema validation, and integrates seamlessly with Kubernetes ConfigMaps for deployment.

Can I use YAML configuration with type safety and validation in Next.js?

Yes. The AppConfig system uses Ajv-based JSON schema validation on YAML configuration files, providing full TypeScript support and automatic property validation with defaults. Unknown properties are removed and environment variable overrides are applied, ensuring type-safe configuration access across server and client code.

How do I load configuration in getServerSideProps and access it in Next.js components?

Use `loadAppConfig()` in `getServerSideProps` to load server-side configuration, then pass it to components. On the client, access configuration through `useAppConfig()`. For MDX content, use `loadConfigAndMdx()` to load both configuration and content together, ensuring consistent access patterns.

Does the AppConfig system support Sentry integration and ConfigMap deployment?

Yes. The AppConfig system supports Sentry configuration injection and Kubernetes ConfigMap patterns, simplifying operations and error tracking in containerized environments. Configuration caching and environment variable overrides ensure flexible deployment across different environments.

What are the limitations of using YAML configuration files for Next.js apps?

YAML configuration requires valid schema definition and JSON schema setup. The AppConfig system mitigates complexity through Ajv validation and automatic unknown property removal, but schema design and environment variable override logic must be properly configured to avoid misconfiguration.