Back to Prompts
Machine Learning and AI Engineering

OpenCode Agent JSON Config Generator

Community January 30, 2026
0 copies 0 likes

This expert prompt generates fully valid, customized opencode.json files for OpenCode AI agents, supporting custom prompts, model overrides, additional agents, and extra settings with precise structure from official docs.

Prompt
You are an expert OpenCode configuration engineer. Your task is to generate a complete, valid JSON file for the opencode.json config based on the following specifications.

Key guidelines:
- Use the exact structure shown in OpenCode docs: root object with 'agent' key containing sub-objects for each agent.
- For prompts, use the '{file:./prompts/[FILENAME].txt}' format with relative paths.
- Paths are relative to the config file location.
- Include model overrides if specified.
- Ensure JSON is valid, properly indented, and ready to save as opencode.json.
- Support global and project-specific configs.

Specifications:
- Agent name: [AGENT_NAME] (e.g., 'review', 'plan', 'implement')
- Custom system prompt file: [PROMPT_FILE_PATH] (e.g., './prompts/code-review.txt')
- Model override: [MODEL_NAME] (e.g., 'claude-3-5-sonnet-20240620' or leave empty for default)
- Additional agents: [ADDITIONAL_AGENTS] (JSON-like list of other agents, e.g., {'plan': {'model': 'gpt-4o-mini'}} or 'none')
- Other config options: [EXTRA_CONFIG] (e.g., custom settings or 'none')

Output ONLY the complete JSON config in a code block, no explanations.

Example output structure:
{
  "agent": {
    "[AGENT_NAME]": {
      "prompt": "{file:[PROMPT_FILE_PATH]}",
      "model": "[MODEL_NAME]"
    }
  }
}

How to Use

Copy the entire Content into an AI chat. Replace placeholders like [AGENT_NAME] (e.g., 'review'), [PROMPT_FILE_PATH] (e.g., './prompts/code-review.txt'), [MODEL_NAME] (e.g., 'claude-3-5-sonnet-20240620' or empty), [ADDITIONAL_AGENTS] (JSON object or 'none'), and [EXTRA_CONFIG] (custom options or 'none'). Submit to generate the JSON—copy the output code block directly to save as opencode.json.

Comments

More Prompts

View all
Software Engineering

Step-by-Step Agentic CLI Coding Tool Development Plan Generator

This prompt generates a comprehensive Markdown roadmap for building professional, interactive, agentic CLI coding tools with stunning TUIs, inspired by Claude Code and Aider. Customize placeholders and feed to an AI for an executable build plan.

C
Claude Directory
Art and Design

Accurate Simpsons Character Portrait Generator

Generate ultra-detailed, canonical image prompts for Simpsons characters like Ralph Wiggum, optimized for AI generators like Midjourney or DALL-E, ensuring faithful 2D cel-shaded portraits with no background.

C
Community
Software Engineering

Flask 3-Layer Clean Architecture Tutorial Generator

Generate a comprehensive, step-by-step Markdown tutorial for building a production-ready Flask web app using a strict 3-layer architecture (presentation, business logic, data), fully customizable for any app functionality.

C
Community
Writing

AI Skill Description Improver: Polished Documentation Prompt Template

This reusable prompt template enhances raw AI skill descriptions into clear, structured, markdown-formatted documentation with actionable instructions, examples, and SEO optimization for maximum usability.

C
Claude Directory
Writing

AI Skill Description Improver: Professional Prompt Template

Transform vague AI skill descriptions into clear, structured, and professional documentation with this expert prompt template designed for technical writers and prompt engineers.

C
Community
Software Engineering

Expert Code Quality Analyzer: Structured Review & Refactoring Template

A professional prompt template for thorough AI-powered code reviews, assessing readability, performance, security, best practices, bugs, and design with scored feedback, detailed breakdowns, refactored code, and prioritized fixes.

C
Community