Skip to content
moai-core-config-schema logo

Enterprise Configuration Schema Management

moai-core-config-schema

Enterprise configuration schema validation and management orchestrator

mattnigh/skills_collection0installs24stars

SKILL.md

Full skill instructions

Enterprise Configuration Schema Management

Skill Metadata

FieldValue
Skill Namemoai-core-config-schema
Version4.0.0 Enterprise (2025-11-18)
StandardsJSON Schema v2024-12, RFC 8174 keywords, TOML/​YAML best practices
AI Integration✅ Context7 MCP for official docs
Auto-loadWhen config validation or management needed
Environmentsdevelopment, staging, production + custom
Lines of Content900+ with 12+ production examples
Progressive Disclosure3-level (quick-start, patterns, advanced)

What It Does

Provides comprehensive guidance for managing project configuration with JSON Schema validation, environment-specific overrides, secrets management, semantic versioning compliance, and configuration-as-code best practices.


Configuration Hierarchy (3-Layer)

Layer 1: Base Configuration

File: .moai/​config/​config.json (checked into repo)

{
  "project": {
    "name": "moai-adk",
    "version": "0.22.5",
    "description": "SPEC-First TDD Development Kit"
  },
  "language": {
    "primary": "en",
    "conversation_language": "ko",
    "supported": ["en", "ko", "ja"]
  },
  "git_strategy": {
    "use_gitflow": true,
    "main_branch": "main",
    "develop_branch": "develop"
  },
  "document_management": {
    "enabled": true,
    "enforce_structure": true
  }
}

Key Points:

  • Checked into version control
  • No secrets, credentials, or API keys
  • Environment-agnostic defaults
  • Semantic versioning format

Layer 2: Environment Overrides

Files: .moai/​config/​.env.{environment} (NOT checked in)

# .moai/​config/​.env.production
DATABASE_URL=postgresql://prod-db.example.com/​production
API_KEY=sk-prod-xxxxxxxxxxxx
REDIS_URL=redis://prod-cache.example.com:6379
DEBUG=false
LOG_LEVEL=error

Key Points:

  • One file per environment
  • Contains secrets and env-specific values
  • MUST be in .gitignore
  • Loaded at runtime based on NODE_ENV/​ENVIRONMENT

Layer 3: Local Development Overrides

File: .moai/​config/​.env.local (NOT checked in)

# .moai/​config/​.env.local (developer-specific)
DATABASE_URL=postgresql://localhost/​mydb
API_KEY=sk-dev-xxxxxxxxxxxx
DEBUG=true
LOG_LEVEL=debug

Key Points:

  • Developer-specific settings
  • Takes precedence over everything
  • NEVER committed to repo
  • Used for local testing with real services

JSON Schema v2024-12 Validation

Base Schema Structure

{
  "$schema": "https://json-schema.org/​draft/​2024-12/​schema",
  "$id": "https://moai-adk.dev/​schemas/​config- .0.json",
  "title": "MoAI-ADK Configuration Schema",
  "description": "Configuration schema for MoAI Agentic Development Kit ",
  "type": "object",
  "required": ["project", "language", "git_strategy"],
  "properties": {
    "project": {
      "type": "object",
      "required": ["name", "version"],
      "properties": {
        "name": {
          "type": "string",
          "minLength": 1,
          "maxLength": 100,
          "pattern": "^[a-z0-9][a-z0-9-]*[a-z0-9]$",
          "description": "Project name (kebab-case)"
        },
        "version": {
          "type": "string",
          "pattern": "^\\d+\\.\\d+\\.\\d+(-[a-zA-Z0-9]+)*$",
          "description": "Semantic version (e.g., 0.22.5)"
        }
      }
    },
    "language": {
      "type": "object",
      "properties": {
        "conversation_language": {
          "type": "string",
          "enum": ["en", "ko", "ja", "es", "fr", "de", "zh", "pt", "ru"]
        }
      }
    }
  },
  "additionalProperties": false
}

Configuration Validation Checklist

Required Validations

CheckStandardTool
JSON Schema v2024-12 complianceJSON Schemaajv, jsonschema
No hardcoded secretsSecuritygrep, git-secrets
Semantic versioning formatRFC 8174regex, semver library
Environment variables definedBest practicedotenv-cli, envman
Type correctnessJSON typingJSON validator
Required fields presentSchemaJSON Schema validator

Security Validation

// ❌ Bad: Hardcoded secrets in config
{
  "database": {
    "password": "super_secret_123"
  },
  "api_key": "sk-1234567890"
}

// ✅ Good: Environment variables
{
  "database": {
    "password": "${DB_PASSWORD}"  // or env var
  },
  "api_key": "${API_KEY}"  // loaded at runtime
}

// ✅ Good: .gitignore protection
.env
.env.local
.env.*.local
.vercel/
config/​.env*

Environment Management

Standard Environments

development  → Local development with mock services
staging      → Pre-production testing
production   → Live production environment
test         → Automated testing with fixtures

Loading Strategy

function loadConfig(environment: string) {
  // 1. Load base config
  const baseConfig = require('.moai/​config/​config.json');
  
  // 2. Load environment-specific config (.moai/​config/​.env.{environment})
  const envConfig = loadEnvFile(`.moai/​config/​.env.${environment}`);
  
  // 3. Load local overrides (.moai/​config/​.env.local)
  const localConfig = loadEnvFile('.moai/​config/​.env.local');
  
  // 4. Merge with precedence: local > env > base
  return {
    ...baseConfig,
    ...envConfig,
    ...localConfig
  };
}

Secrets Management Best Practices

DO

  • ✅ Store secrets in .env.{environment} files
  • ✅ Load at runtime via environment variables
  • ✅ Use secret management tools (AWS Secrets Manager, Vault, etc.)
  • ✅ Rotate secrets regularly
  • ✅ Use strong, random values
  • ✅ Document secret naming conventions
  • ✅ Audit access to secrets
  • ✅ Enable secret scanning in CI/​CD

DON'T

  • ❌ Commit .env files to repo
  • ❌ Hardcode API keys, passwords, tokens
  • ❌ Share secrets in Slack, email, or tickets
  • ❌ Use weak or predictable values
  • ❌ Leave old secrets in git history
  • ❌ Print secrets in logs
  • ❌ Commit credentials to .gitignore
  • ❌ Use same secret across environments

Git Safety for Configuration

.gitignore Configuration

# Configuration secrets
.env
.env.local
.env.*.local
.moai/​config/​.env*

# Deployment platform secrets
.vercel/
.netlify/
.firebase/
.aws/​credentials

# IDE secrets
.vscode/​settings.json
.idea/​workspace.xml

# OS secrets
.DS_Store

# Never commit these patterns
**/​secrets.*
**/​credentials.*
**/​api[_-]?key*
**/​password*
**/​token*

Pre-Commit Verification

#!/​bin/​bash
# Verify no secrets in staged files

echo "Checking for committed secrets..."

# Check for common secret patterns
git diff --cached | grep -i \
  -e "api[_-]?key" \
  -e "secret" \
  -e "password" \
  -e "token" \
  -e ".env" \
  -e "credentials"

if [ $? -eq 0 ]; then
  echo "ERROR: Secrets detected in staged files!"
  exit 1
fi

exit 0

Semantic Versioning in Config

Format: MAJOR.MINOR.PATCH[-PRERELEASE][+BUILD]

0.22.5              → Stable release
0.22.5-alpha        → Alpha pre-release
0.22.5-beta.1       → Beta release #1
0.22.5+build.123    → Build metadata
0.22.5-rc.1+build.2 → Release candidate with build info

Upgrade Rules:

  • MAJOR (0→1): Breaking changes, major rewrites
  • MINOR (22→23): New features, backward compatible
  • PATCH (5→6): Bug fixes only
  • Pre-release: Experimental, not production-ready
  • Build metadata: Informational only, doesn't affect version precedence

Configuration-as-Code Best Practices

Pattern 1: Type-Safe Configuration

// Type-safe config with validation
interface AppConfig {
  project: {
    name: string;
    version: string;
  };
  language: {
    conversation_language: 'en' | 'ko' | 'ja';
  };
  git_strategy: {
    use_gitflow: boolean;
    main_branch: string;
  };
}

function validateConfig(config: unknown): AppConfig {
  // Validate against schema
  const schema = require('./​schemas/​config- .0.json');
  const valid = ajv.validate(schema, config);
  
  if (!valid) {
    throw new Error(`Config validation failed: ${ajv.errorsText()}`);
  }
  
  return config as AppConfig;
}

Pattern 2: Environment-Specific Defaults

function getConfig(environment: string): AppConfig {
  const baseConfig = readConfigFile('config.json');
  const envConfig = readEnvFile(`.env.${environment}`);
  const localConfig = readEnvFile('.env.local');
  
  // Merge with environment-specific defaults
  const defaults = {
    development: { debug: true, logLevel: 'debug' },
    staging: { debug: false, logLevel: 'info' },
    production: { debug: false, logLevel: 'error' }
  };
  
  return {
    ...baseConfig,
    ...defaults[environment],
    ...envConfig,
    ...localConfig
  };
}

Pattern 3: Secrets Validation

function validateSecrets(config: AppConfig): void {
  const requiredSecrets = [
    'DATABASE_URL',
    'API_KEY',
    'JWT_SECRET'
  ];
  
  for (const secret of requiredSecrets) {
    if (!process.env[secret]) {
      throw new Error(`Missing required secret: ${secret}`);
    }
    
    // Validate secret format
    if (secret === 'API_KEY' && !process.env[secret].startsWith('sk-')) {
      throw new Error(`Invalid API_KEY format`);
    }
  }
}

Related Skills

  • moai-core-practices (Best practices patterns)
  • moai-foundation-specs (Specification management)

For detailed schema reference: reference.md
For real-world examples: examples.md
Last Updated: 2025-11-18
Status: Production Ready (Enterprise )

More skills from mattnigh

spring-framework-patterns logo
mattnigh/skills_collection

spring-framework-patterns

Comprehensive Spring Framework and Spring Boot best practices including dependency injection patterns, bean lifecycle and scopes, REST API development, Spring Data JPA, service layer design, Spring Security, testing strategies, caching, AOP, async processing, error handling, and common anti-patte...

24 0
View

TypeScript厳格モードによる型安全性設計を専門とするスキル。 📖 参照書籍: - 『Effective TypeScript』(Dan Vanderkam): 型設計 📚 リソース参照: - `resources/Level1_basics.md`: レベル1の基礎ガイド - `resources/Level2_intermediate.md`: レベル2の実務ガイド - `resources/Level3_advanced.md`: レベル3の応用ガイド - `resources/Level4_expert.md`: レベル4の専門ガイド - `resources/di...

24 0
View
deploying-cloud-k8s logo
mattnigh/skills_collection

deploying-cloud-k8s

Deploys applications to cloud Kubernetes (AKS/GKE/DOKS) with CI/CD pipelines. Use when deploying to production, setting up GitHub Actions, troubleshooting deployments. Covers build-time vs runtime vars, architecture matching, and battle-tested debugging.

24 0
View
moai-alfred-agent-guide logo
mattnigh/skills_collection

moai-alfred-agent-guide

19-agent team structure, decision trees for agent selection, Haiku vs Sonnet model selection, and agent collaboration principles. Use when deciding which sub-agent to invoke, understanding team responsibilities, or learning multi-agent orchestration.

24 0
View
mermaid-diagram-generator logo
mattnigh/skills_collection

mermaid-diagram-generator

Converts architecture descriptions, module specs, or workflow docs into Mermaid diagrams. Use when visualizing brick module relationships, workflows (DDD, investigation), or system architecture. Supports: flowcharts, sequence diagrams, class diagrams, state machines, entity relationship diagrams,...

24 0
View
pre-flight-check logo
mattnigh/skills_collection

pre-flight-check

INVOKE FIRST before any code work. Validates git workflow (branch, issue, worklog) and checks approach. Use at START of every task and END before completing. Prevents skipped steps.

24 0
View
browser-dev-tools logo
mattnigh/skills_collection

browser-dev-tools

This skill should be used when working with browser-rendered artifacts (i.e. Bun, React/React Native) to proactively validate that development work on localhost is being built appropriately and to support debugging browser-rendered content. Use this skill after making frontend changes to verify t...

24 0
View
lead-dev logo
mattnigh/skills_collection

lead-dev

Lead Développeur - Coordination technique opérationnelle, code review, mentoring et livraison. Pair de web-dev-process au niveau OPÉRATIONS.

24 0
View
worker-monitor logo
mattnigh/skills_collection

worker-monitor

Monitor Docker workers, RQ queue health, and auto-scale workers (max 4). Use when: checking job progress, monitoring queue depth, scaling workers up/down, diagnosing slow processing, or waiting for jobs to complete. Referenced by data-quality skill during reprocessing.

24 0
View
quality-advisor logo
mattnigh/skills_collection

quality-advisor

Proactive quality guidance system that monitors artifact creation and provides real-time feedback on documentation quality

24 0
View
bump-version logo
mattnigh/skills_collection

bump-version

This skill should be used when the user wants to bump the version number in the workspace. It updates versions across all pyproject.toml files (root, tde, and tda packages) and the CHANGELOG.md to keep them synchronized.

24 0
View

Popular AI tools

Kaiber logo
Video

Kaiber

Generate, edit, and beat-sync AI video with leading models in one workspace.

Paid
View
Vimcal logo
Productivity

Vimcal

The world's fastest calendar for remote work

Free
View

Transform Your Design with AI Designer by ImgCreator.ai

Freemium
View
Akool AI logo
Content & writing

Akool AI

Revolutionizing Video Production with AI-Powered Creativity

Paid
View

Extend an image past the frame and let AI fill the new aspect ratio.

Freemium
View
StarByFace logo
Security

StarByFace

Discover your celebrity doppelgänger with StarByFace!

Free
View
C

ChainClarity explains 700+ crypto whitepapers in plain English, with layered summaries, comparisons, research tools, alerts, and a $4.99 Pro plan.

Freemium
View
Opus Clip logo
Coding & apps

Opus Clip

Opus.ai: Revolutionize Your Web Experience

Free
View