xiaohongshu
xiaohongshu
moai-alfred-config-schema
Enterprise configuration schema validation and management orchestrator with JSON Schema v2024-12, Context7 integration, semantic versioning compliance, environment variable management, secrets handling, multi-environment support, and configuration-as-code best practices; activates for config vali...
Full skill instructions
| Field | Value |
|---|---|
| Skill Name | moai-alfred-config-schema |
| Version | 4.0.0 Enterprise (2025-11-12) |
| Standards | JSON Schema v2024-12, RFC 8174 keywords, TOML/YAML best practices |
| AI Integration | ✅ Context7 MCP for official docs |
| Auto-load | When config validation or management needed |
| Environments | development, staging, production + custom |
| Lines of Content | 900+ with 12+ production examples |
| Progressive Disclosure | 3-level (quick-start, patterns, advanced) |
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.
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:
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:
.gitignoreFile: .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:
{
"$schema": "https://json-schema.org/draft/2024-12/schema",
"$id": "https://moai-adk.dev/schemas/config-v4.0.0.json",
"title": "MoAI-ADK Configuration Schema",
"description": "Configuration schema for MoAI Agentic Development Kit v4.0.0",
"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
}
| Check | Standard | Tool |
|---|---|---|
| JSON Schema v2024-12 compliance | JSON Schema | ajv, jsonschema |
| No hardcoded secrets | Security | grep, git-secrets |
| Semantic versioning format | RFC 8174 | regex, semver library |
| Environment variables defined | Best practice | dotenv-cli, envman |
| Type correctness | JSON typing | JSON validator |
| Required fields present | Schema | JSON Schema validator |
// ❌ 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*
development → Local development with mock services
staging → Pre-production testing
production → Live production environment
test → Automated testing with fixtures
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
};
}
.env.{environment} files.env files to repo.gitignore# 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*
#!/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
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:
// 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-v4.0.0.json');
const valid = ajv.validate(schema, config);
if (!valid) {
throw new Error(`Config validation failed: ${ajv.errorsText()}`);
}
return config as AppConfig;
}
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
};
}
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`);
}
}
}
moai-alfred-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-12
Status: Production Ready (Enterprise v4.0.0)
xiaohongshu
technical spec
product ux expert
database patterns
Conduct multi-agent task orchestration and workflow coordination.
Initialize project with Conductor artifacts (product definition,
Expert in web animations, transitions, and motion design using Framer Motion and CSS
Creates Mermaid and ASCII diagrams for flowcharts, architecture, ERDs, state machines, mindmaps, and more. Use when user mentions diagram, flowchart, mermaid, ASCII diagram, text diagram, terminal diagram, visualize, C4, mindmap, architecture diagram, sequence diagram, ERD, or needs visual docume...
PostgreSQL bindings for H3 hexagonal grid system. Use when working with H3 cells in Postgres, including spatial indexing, geometry/geography integration, and raster analysis.
Context-Driven Development skill for projects using Conductor. Use this skill when you detect a `conductor/` directory in the project, when working on tasks defined in a `plan.md` file, or when the user asks about tracks, specs, or plans. Automatically applies TDD workflow, tracks task completion...
Display project status, active tracks, and next actions
Official Stakpak application containerization standard operating procedure, a step-by-step guidline to properly dockerize applications. This is a rule book curated by the Stakpak Team.
Generate, edit, and beat-sync AI video with leading models in one workspace.
The world's fastest calendar for remote work
Transform Your Design with AI Designer by ImgCreator.ai
Revolutionizing Video Production with AI-Powered Creativity
Extend an image past the frame and let AI fill the new aspect ratio.
Discover your celebrity doppelgänger with StarByFace!
ChainClarity explains 700+ crypto whitepapers in plain English, with layered summaries, comparisons, research tools, alerts, and a $4.99 Pro plan.
Opus.ai: Revolutionize Your Web Experience