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

  // Layer 1: Formatters - silent auto-fix after every edit/write
  // Output (stdout/stderr) is discarded. Only files modified in place reach the agent.
  // Docs: https://opencode.ai/docs/formatters/
  "formatter": {
    "prettier": {
      "command": ["npx", "prettier", "--write", "$FILE"],
      "extensions": [".js", ".jsx", ".ts", ".tsx", ".css", ".json", ".md"],
    },
    // Add more formatters for your stack:
    // "dotnet-format": {
    //   "command": ["dotnet", "format", "whitespace", "--include", "$FILE"],
    //   "extensions": [".cs"]
    // },
    // "ruff": {
    //   "command": ["ruff", "format", "$FILE"],
    //   "extensions": [".py"]
    // },
    // "gofmt": {
    //   "command": ["gofmt", "-w", "$FILE"],
    //   "extensions": [".go"]
    // }
  },

  // Layer 2: LSP diagnostics - inline validation feedback after every edit/write
  // Diagnostics with severity: 1 (Error) appear inline in the tool result.
  // Filtered to max 20 per file. Warnings, info, and hints are dropped.
  // Docs: https://opencode.ai/docs/lsp/
  "lsp": {
    "my-validator": {
      "command": ["node", "example-validator.mjs"],
      "extensions": [".md", ".mdx"],
    },
  },
}
