mdpact

Configuration

mdpact.config.ts accepts the following shape. Every field is optional; defaults are shown.

import { defineConfig } from "@mdpact/config";

export default defineConfig({
  specs: [
    { path: "CLAUDE.md", binding: "primary" },
    { path: "AGENTS.md", binding: "secondary" },
  ],
  rules: {
    // "<rule-id>": "error" | "warning" | "info" | "off"
    "conflict/*": "error",
  },
  ruleOptions: {
    "tokens/budget": { max: 10_000 },
  },
  budgets: {
    tokens: 10_000,
    behaviorTestUsdMax: 5,
  },
  models: [
    // shorthand
    "anthropic:claude-sonnet-4-6",
    // or full form
    { provider: "openai", modelId: "gpt-4o-mini" },
  ],
  behaviorTests: {
    path: "mdpact/tests/",
    runsPerTask: 3,
  },
  score: {
    failBelow: 70,
  },
});

File formats

mdpact.config.ts is preferred (full TypeScript autocomplete). YAML and JSON files are also accepted in this order:

  • mdpact.config.ts, .mts, .mjs, .js, .cjs, .json
  • mdpact.config.yaml, .yml
  • .mdpact.yaml, .yml

Validation

Every field is parsed through a zod schema. Invalid configs fail with precise, path-scoped errors pointing to the offending field.