11-json-config-system-SUMMARY.md 3.6 KB

JSON Config System - Quick Summary

Document: 11-json-config-system.md
Date: 2026-02-15
Status: Ready for Implementation


๐ŸŽฏ The Big Idea

Transform from: Markdown agents (hard to parse, no validation, IDE-specific)
Transform to: JSON config + Markdown prompts (type-safe, validated, multi-IDE)


๐Ÿ—๏ธ Architecture

.opencode/                          โ† SINGLE SOURCE OF TRUTH
โ”œโ”€โ”€ agents/
โ”‚   โ”œโ”€โ”€ core/
โ”‚   โ”‚   โ””โ”€โ”€ openagent/
โ”‚   โ”‚       โ”œโ”€โ”€ agent.json          โ† Config (metadata, permissions, tools)
โ”‚   โ”‚       โ””โ”€โ”€ prompt.md           โ† Prompt (human-readable content)
โ”‚   โ””โ”€โ”€ manifest.json               โ† Registry

         โ†“ OAC CLI converts โ†“

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚ OpenCode   โ”‚ Claude Code โ”‚ Cursor   โ”‚ Windsurf  โ”‚
โ”‚ (native)   โ”‚ (convert)   โ”‚ (flatten)โ”‚ (flatten) โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

๐Ÿ“„ What's in agent.json?

{
  "id": "openagent",
  "name": "OpenAgent",
  "mode": "primary",
  "model": "anthropic/claude-sonnet-4-20250514",
  "prompt": { "file": "./prompt.md" },
  "permissions": {
    "bash": "approve",
    "write": "approve"
  },
  "tools": {
    "bash": true,
    "write": true
  },
  "compatibility": {
    "opencode": "full",
    "claude": "full",
    "cursor": "partial"
  }
}

๐Ÿš€ CLI Commands

# Convert agent to IDE format
oac convert openagent --to=opencode
oac convert openagent --to=claude
oac convert openagent --to=cursor

# Validate agent config
oac validate openagent

# Apply to IDE (auto-convert)
oac apply openagent --ide=opencode
oac apply --all --ide=claude

# Create new agent
oac create agent --template=subagent

โœ… Benefits

  1. Type-safe - Full TypeScript support
  2. Queryable - Easy to filter/search agents
  3. Validatable - JSON Schema validation
  4. Versionable - Semantic versioning
  5. Convertible - Transform to any IDE format
  6. Maintainable - Separation of config vs content
  7. Multi-IDE - One source, many targets

๐Ÿ“… Implementation Timeline

6 weeks total:

  • Week 1: Infrastructure (types, schema, loaders, converters)
  • Week 2: CLI commands (convert, validate, apply, info)
  • Week 3: Migration script (markdown โ†’ JSON)
  • Week 4: Testing (unit, integration, e2e)
  • Week 5: Documentation (user + dev guides)
  • Week 6: Deprecation (warnings, CI/CD updates)

๐ŸŽฏ Success Criteria

  • โœ… All agents converted to JSON config
  • โœ… All CLI commands working
  • โœ… OpenCode, Claude, Cursor converters working
  • โœ… Schema validation working
  • โœ… Migration script working
  • โœ… Documentation complete
  • โœ… Tests passing (>90% coverage)

๐Ÿ“Š Before vs After

Before (Markdown)

---
id: openagent
---
# OpenAgent
You are OpenAgent...
## Tools
- bash (approve)

โŒ Hard to parse
โŒ No validation
โŒ Manual conversion

After (JSON + Markdown)

agent.json:

{
  "id": "openagent",
  "permissions": { "bash": "approve" }
}

prompt.md:

You are OpenAgent...

โœ… Easy to parse
โœ… Schema validated
โœ… Auto-convert


๐Ÿ”— Related Documents

  • Full Plan: 11-json-config-system.md (85KB)
  • Main Plan: 01-main-plan.md
  • Context System: See session reports in .tmp/sessions/20250215-context-system-analysis/

Ready to implement! ๐Ÿš€