{
	"$schema": "https://opencode.ai/config.json",

	// Default this repo to GPT-5.4 with high reasoning effort.
	"model": "openai/gpt-5.4",
	"small_model": "anthropic/claude-haiku-4-5",
	"default_agent": "build",

	"provider": {
		"openai": {
			"models": {
				"gpt-5.4": {
					"options": {
						"reasoningEffort": "high"
					}
				}
			}
		}
	},

	// OpenCode merges this with the global config. This file narrows the repo to
	// the Coffee Project instruction stack and MCP roster.
	"instructions": [
		"./.opencode/merged-instructions.md",
		"./AGENTS.md",
		"./.codex/agent-team.md",
		"./.codex/agent-skills.md",
		"./CLAUDE.md",
		"./cofee_frontend/AGENTS.md",
		"./cofee_frontend/CLAUDE.md",
		"./cofee_backend/AGENTS.md",
		"./cofee_backend/CLAUDE.md",
		"./remotion_service/AGENTS.md",
		"./remotion_service/CLAUDE.md"
	],

	// Re-enable delegation and docs lookup for this repo, while keeping the MCP
	// surface intentionally small and explicit.
	"permission": {
		"task": "allow",
		"context7_*": "allow",
		"web-search_*": "ask",
		"exa_*": "deny",
		"gh_grep_*": "deny",
		"postgres_*": "ask",
		"redis_*": "ask",
		"lighthouse_*": "ask",
		"docker_*": "ask",
		"chrome-devtools_*": "ask"
	},

	"mcp": {
		"context7": {
			"type": "remote",
			"url": "https://mcp.context7.com/mcp",
			"enabled": true
		},
		"web-search": {
			"type": "local",
			"command": [
				"node",
				"{env:HOME}/.config/opencode/vendor/web-search-mcp/dist/index.js"
			],
			"enabled": true
		},
		"exa": {
			"type": "remote",
			"url": "https://mcp.exa.ai/mcp",
			"enabled": false
		},
		"gh_grep": {
			"type": "remote",
			"url": "https://mcp.grep.app",
			"enabled": false
		},
		"postgres": {
			"type": "local",
			"command": ["uvx", "postgres-mcp", "--access-mode=unrestricted"],
			"enabled": true,
			"environment": {
				"DATABASE_URI": "postgresql://postgres:postgres@localhost:5332/coffee_project_db"
			}
		},
		"redis": {
			"type": "local",
			"command": [
				"uvx",
				"--from",
				"redis-mcp-server@latest",
				"redis-mcp-server",
				"--url",
				"redis://localhost:6379/0"
			],
			"enabled": true
		},
		"lighthouse": {
			"type": "local",
			"command": ["bunx", "@danielsogl/lighthouse-mcp@latest"],
			"enabled": true
		},
		"docker": {
			"type": "local",
			"command": ["uvx", "mcp-server-docker"],
			"enabled": true
		},
		"chrome-devtools": {
			"type": "local",
			"command": ["npx", "-y", "chrome-devtools-mcp@latest"],
			"enabled": true
		}
	},

	// The global build agent in ~/.config/opencode/opencode.jsonc is more
	// delegation-heavy than this repo expects. Override just enough to match the
	// repo's team-first but still hands-on workflow.
	"agent": {
		"build": {
			"model": "openai/gpt-5.4",
			"prompt": "You are OpenCode working in the Coffee Project monorepo. Follow `./.opencode/merged-instructions.md` first. Use `AGENTS.md` as the primary workflow source. Use `.codex/agent-team.md` and `.codex/agent-skills.md` for team topology and skill selection. Use `CLAUDE.md` files only for architecture, commands, and coding conventions. Keep team-first behavior for non-trivial work, but use the minimum viable delegation instead of delegating every task. Purely mechanical or clearly bounded changes may be handled directly. Ignore stale references to `.claude/` or wording that assumes you are Claude Code itself.",
			"permission": {
				"edit": "allow",
				"write": "allow",
				"bash": "allow",
				"task": "allow"
			}
		}
	}
}
