Skip to content
Agentmart
Submit a tool

config-centralization

Type-safe, environment-aware configuration management for Next.js/TypeScript applications using a singleton pattern with runtime validation.

Skill by JimmyBlanquet

IndexedMIT
Write a review

Install

Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.

npx agentmarket install skill/jimmyblanquet-config-centralization

Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.

Get the weekly diff

The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.

We use your email only for this newsletter. Privacy

About

Type-safe, environment-aware configuration management for Next.js/TypeScript applications using a singleton pattern with runtime validation.

Use cases: frontend

No reviews yet. Installed it? Reviews come from verified installers only. How reviews work

Permissions

What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.

Tools
No tools found
Secrets
None asked for
Install scripts
None found
Runs as
Node.js package

Network hosts it talks to 1

  • codeload.github.com · found in install command

Files it touches

  • ~/.claude/skills/config-centralization

What's inside

Skill name
config-centralization
Description
Type-safe, environment-aware configuration management for Next.js/TypeScript applications using a singleton pattern with runtime validation.
License
MIT
Instructions
409 lines in SKILL.md · view on GitHub

Before installing

  • Ships executable scripts

Files (9)

  • README.md
  • SKILL.md
  • config-manager.ts · files/
  • index.ts · files/
  • types.ts · files/
  • install.sh
  • package-lock.json
  • package.json
  • config-centralization.test.ts · tests/

SKILL.md (first lines)

# Config Centralization - Complete Documentation

## Overview

The Config Centralization skill provides type-safe, environment-aware configuration management for Next.js/TypeScript applications using a singleton pattern with runtime validation.

## Features

- **Type-Safe Configuration**: Full TypeScript generics support for compile-time safety
- **Environment Management**: Development, staging, production, test environments
- **Runtime Validation**: Required field validation with clear error messages at startup
- **Singleton Pattern**: Consistent configuration access across your application
- **Default Values**: Sensible defaults with environment variable override support
- **Zero Dependencies**: Portable implementation with no external dependencies

## Installation

### Prerequisites

- TypeScript 5+
- Node.js 18+
- (Optional) Next.js 14+ or any TypeScript project

### Install Steps

1. Run the install script from the skill directory:
   ```bash
   bash install.sh
   ```

2. The script will copy files to your project:
   - `config-manager.ts` - Core ConfigManager class
   - `types.ts` - TypeScript type definitions
   - `index.ts` - Public API exports

## Usage

### Basic Usage

```typescript
import { ConfigManager } from '@/lib/config'

// Get singleton instance
const config = ConfigManager.getInstance()

// Access configuration values
const apiUrl = config.get('API_URL')
const dbUrl = config.get('DATABASE_URL')
const port = config.get('PORT')

// Check if key exists
if (config.has('API_KEY')) {
  const apiKey = config.get('API_KEY')
}

// Get current environment
const env = config.getEnv() // 'development' | 'production' | 'staging' | 'test'

// Get all configuration
const allConfig = config.getAll()
```

### Type-Safe Configuration

```typescript
import { ConfigManager, createConfigManager } from '@/lib/config'
import type { AppConfig } from '@/lib/config'

// Option 1: Use generic type parameter
const config = ConfigManager.getInstance<AppConfig>()
const apiUrl: string = config.get('API_URL')! // Type-safe access

// Option 2: Use createConfigManager helper
interface MyConfig {
  API_URL: string
  PORT: number
  DATABASE_URL: string
}

const schema: MyConfig = {
  API_URL: '',
  PORT: 0,
  DATABASE_URL: ''
}

const config = createConfigManager(schema)
const url = config.get('API_URL') // Fully typed
```

### Environment-Aware Configuration

```typescript
// Configuration loads from process.env automatically
// and detects environment from NODE_ENV

const config = ConfigManager.getInstance({
  env: 'production', // Override environment
  defaults: {
    PORT: 3000,
    LOG_LEVEL: 'info',
    API_TIMEOUT: 5000
  }
})

// Environment variables take precedence over defaults
// If PORT is set in process.env, it overrides the default
```

### Required Field Validation

```typescript
// Validate required fields at application startup
try {
  const config = ConfigManager.getInstance({
    required: ['DATABASE_URL', 'API_URL', 'API_KEY'],
    defaults: {
      PORT: 3000,
      LOG_LEVEL: 'info'
    }

From JimmyBlanquet/project-forge, MIT.

More from JimmyBlanquet/project-forge

Signals

Stars
0
Forks
0
Open issues
2
Last commit (this folder)
May 10, 2026 (5 months ago)

From GitHub (fetched Oct 24, 2026).

Details

License
MIT
First seen
Oct 24, 2026
Last checked
Oct 24, 2026

More from JimmyBlanquet

Cite this page

config-centralization skill. Agent Mart. https://agentmart.dev/skills/jimmyblanquet-config-centralization (last updated 2026-10-24)