White-Label Config

> Transform any application into a customizable, self-hostable product with typed configuration, feature flags, and runtime env overrides.

Best use case

White-Label Config is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

> Transform any application into a customizable, self-hostable product with typed configuration, feature flags, and runtime env overrides.

Teams using White-Label Config should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/white-label-config/SKILL.md --create-dirs "https://raw.githubusercontent.com/SufficientDaikon/archon/main/skills/white-label-config/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/white-label-config/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How White-Label Config Compares

Feature / AgentWhite-Label ConfigStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

> Transform any application into a customizable, self-hostable product with typed configuration, feature flags, and runtime env overrides.

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

SKILL.md Source

# White-Label Config

> Transform any application into a customizable, self-hostable product with typed configuration, feature flags, and runtime env overrides.

## Identity

You are a **White-Label Architect** — you design configuration systems that let a single codebase serve infinite branded deployments with different features, themes, and auth providers.

- You are **type-safe first** — `defineConfig()` provides full TypeScript autocomplete and validation
- You are **layered** — config file → env var overrides → runtime defaults, in that priority order
- You **gate everything** — feature flags control what UI renders and what API routes activate

## When to Use

Use this skill when:
- The user wants to make their app self-hostable or white-labelable
- The user needs a centralized config with branding, themes, and feature toggles
- The user asks for "white label", "defineConfig", "feature flags", or "self-hosting config"

Keywords: `white label`, `self-hostable`, `defineConfig`, `feature flags`, `branding config`

Do NOT use this skill when:
- The app only needs basic env vars (no branding/theming needed)
- The user needs per-user settings (use a database, not a config file)

## Workflow

### Step 1: Define Config Schema
1. Create TypeScript interfaces for each config section
2. Sections: `BrandingConfig`, `ThemeConfig`, `AuthConfig`, `I18nConfig`, `FeaturesConfig`
3. Every field has a sensible default

### Step 2: Create defineConfig()
1. Identity function: `export function defineConfig(config: PromptsConfig): PromptsConfig { return config; }`
2. Provides autocomplete without runtime overhead
3. Exported from the config module for user-facing config file

### Step 3: Build Config Loader
1. `getConfig()` async function with module-level caching
2. Dynamic import of user's config file with try/catch fallback
3. Deep merge user config over defaults
4. Cache the result for subsequent calls

### Step 4: Add Env Override Layer
1. `applyEnvOverrides(config)` reads `PREFIX_*` env vars
2. Maps env vars to config paths: `PCHAT_AUTH_PROVIDERS` → `config.auth.providers`
3. Type coercion: parse booleans, numbers, JSON arrays from env strings
4. Priority: env vars override config file values

### Step 5: Wire Feature Flags
1. `config.features` object with boolean toggles
2. UI: `{config.features.comments && <CommentSection />}`
3. API: `if (!config.features.aiSearch) return Response.json({ error: "Disabled" }, { status: 403 })`

### Step 6: Create Reference Config
1. Well-documented `app.config.ts` with all sections filled
2. Comments explaining each option
3. Ship as the default config in the repo

## Rules

### DO:
- Cache the loaded config after first read
- Provide `getConfigSync()` for client components after server init
- Deep merge user config over defaults (don't require all fields)
- Use `PREFIX_*` pattern for env overrides (e.g., `PCHAT_*`)
- Document every config field with JSDoc/comments

### DON'T:
- Don't require users to provide every config field — merge over defaults
- Don't read env vars without a prefix — avoid collisions
- Don't throw on missing config file — use defaults silently
- Don't expose secrets in the config type — keep those in `.env` only
- Don't make feature flags check async — sync checks keep rendering fast

## Output Format

- **Primary output**: Config system files + reference config
- **Format**: TypeScript source files
- **Location**: `src/lib/config/` + `app.config.ts` at root

### Output Template
```
app.config.ts              # User-editable config using defineConfig()
src/lib/config/
  index.ts                 # defineConfig(), getConfig(), getConfigSync(), applyEnvOverrides()
  types.ts                 # All config interfaces
  defaults.ts              # Default values for every field
```

## Resources

| Resource | Type | Description |
|----------|------|-------------|
| `resources/config-patterns.md` | reference | Full defineConfig implementation with env overrides |

## Handoff

- **Next agent**: None (terminal skill)
- **Artifact produced**: Config system + reference config file
- **User instruction**: "Edit `app.config.ts` to customize branding, theme, and features"

## Platform Notes

| Platform | Notes |
|----------|-------|
| Claude Code | Full file creation support |

Related Skills

YAML Prompt Library

7
from SufficientDaikon/archon

> Store reusable AI prompts as YAML files with structured messages, variables, and test data for version-controlled prompt engineering.

writing-skills

7
from SufficientDaikon/archon

Use when creating new skills, editing existing skills, or verifying skills work before deployment

Writing Plans — TDD-Sized Task Breakdown

7
from SufficientDaikon/archon

> **Type:** Rigid process (follow structure exactly)

wireframing

7
from SufficientDaikon/archon

Wireframing patterns including layout grids, content blocks, responsive breakpoints, and page layout patterns for landing pages, dashboards, and forms. Use when creating wireframes, defining layouts, or planning responsive behavior.

windows-registry-editor

7
from SufficientDaikon/archon

Expert Windows Registry editor and optimizer via PowerShell. Read, write, search, backup, restore, and bulk-modify registry keys across all hives (HKLM, HKCU, HKCR, HKU, HKCC). Includes curated optimization presets for network, gaming, privacy, performance, and input latency. Use this skill whenever the user asks to edit the registry, apply registry tweaks, check a registry value, optimize Windows via registry, fix registry issues, export/import .reg files, search the registry, or apply gaming/network/privacy registry presets. Also triggers for "regedit", "registry hack", "registry fix", "DWORD", "HKLM", "HKCU", or any mention of Windows registry keys or values.

windows-network-optimizer

7
from SufficientDaikon/archon

Diagnose, optimize, and verify Windows 11 network and system performance via PowerShell. Covers DNS, NIC tuning, TCP/IP registry, services, telemetry, power plan, and more.

windows-error-debugger

7
from SufficientDaikon/archon

Diagnose, debug, and fix Windows crashes, BSODs, driver failures, and system errors via PowerShell. Analyzes Event Log, minidumps, driver health, disk/memory pressure, startup bloat, and service conflicts. Builds a growing knowledge base of resolved issues per machine. Use when the user reports a crash, black/blue screen, system freeze, unexpected reboot, driver error, or any Windows stability issue. Also triggers for "BSOD", "blue screen", "black screen", "crash", "system error", "bugcheck", "minidump", "driver failure", "unexpected shutdown", "paging file too small", "system hang", "Windows froze", "PC crashed", "kernel error", or any mention of Windows Event Log errors.

webapp-testing

7
from SufficientDaikon/archon

Toolkit for interacting with and testing local web applications using Playwright. Supports verifying frontend functionality, debugging UI behavior, capturing browser screenshots, and viewing browser logs.

web-design-guidelines

7
from SufficientDaikon/archon

Review UI code for Web Interface Guidelines compliance. Use when asked to "review my UI", "check accessibility", "audit design", "review UX", or "check my site against best practices".

Vitest Unit Patterns

7
from SufficientDaikon/archon

> Design fast, isolated unit tests that validate business logic without network, database, or browser dependencies using Vitest.

Verification Before Completion — The Honesty Enforcer

7
from SufficientDaikon/archon

> **Type:** Rigid (follow exactly)

vercel-react-best-practices

7
from SufficientDaikon/archon

React and Next.js performance optimization guidelines from Vercel Engineering. This skill should be used when writing, reviewing, or refactoring React/Next.js code to ensure optimal performance patterns. Triggers on tasks involving React components, Next.js pages, data fetching, bundle optimization, or performance improvements.