# Configuration

> The kwikqa.config.json repair policy: which files KwikQA may edit, generated paths it never touches, change budgets, and the CI fix policy.

Repairs need a reviewed `kwikqa.config.json` at the root of your project. It is plain JSON: loading it never runs any code. Create it with `npx kwikqa init`, then review and commit it.

## Example

```
{
  "schemaVersion": "1.0",
  "editablePaths": [
    { "class": "spec", "pattern": "tests/**/*.spec.ts" },
    { "class": "page-object", "pattern": "tests/pages/**/*.ts" }
  ],
  "generatedPaths": ["**/*.generated.ts", "**/__snapshots__/**"],
  "budgets": { "maxFiles": 3, "maxChangedLines": 100 }
}
```

`init` proposes rules for the layout it finds: `tests/` and `e2e/` for Playwright, `cypress/e2e/**/*.cy.ts` for Cypress, and `test/specs/**/*.ts` for WebdriverIO. It names Cypress support files and WebdriverIO page objects (`test/pageobjects/`) for you to add as shared rules if you want KwikQA to propose fixes there. For Maven and Gradle projects it proposes `src/test/java/**/*Test.java`, `*Tests.java`, and `*IT.java`, and for pytest projects `tests/**/test_*.py` and `tests/**/*_test.py`, where it finds them. Where it finds page objects, step definitions, or pytest fixtures, it names them for you to add as shared rules in the same way.

## Fields

- **`schemaVersion`**
  Always `"1.0"` for this version.
- **`editablePaths`**
  The only files a repair may change. Each rule pairs a glob `pattern` with a `class` that says what kind of test code it is. Anything that matches no rule, including all application code, is off limits.
- **`generatedPaths`**
  Globs for generated files. A repair never edits them, even if an editable rule also matches.
- **`budgets`**
  The largest repair KwikQA may propose: `maxFiles` from 1 to 3 and `maxChangedLines` from 1 to 100, counting added and removed lines. A cause that needs more becomes a manual recommendation.
- **`ci`**
  Optional. `"ci": { "fix": { "pullRequests": "draft" } }` lets `kwikqa fix` run in GitHub Actions, Azure Pipelines, or GitLab CI/CD without a terminal, and open its validated repair as a draft pull request: see [Fix pull requests](https://kwikqa.com/docs/ci/#fix-pull-requests). `pullRequests` must be `"draft"`. `maxPullRequestsPerRun` is from 1 to 5, and left out it is 1. A run repairs up to that many failure groups, one fix each. More than 1 needs an Enterprise plan (Enterprise or BYOK Enterprise); on other plans a run uses 1, and KwikQA says so when the policy asks for more. `retry`, false unless set, gives a failed validation its one retry, which is one more request. The policy counts only as committed: a file changed in the job approves nothing. kwikqa before 0.3.0 refuses a config with a `ci` section.

## Classes

| Class | For |
| --- | --- |
| `spec` | Test files. |
| `page-object` | Page objects and screen models. |
| `fixture` | Playwright fixtures. |
| `test-data` | Test data builders and factories. |
| `test-helper` | Test-only helper modules. |
| `playwright-config` | Playwright configuration. |
| `framework-config` | Cypress or WebdriverIO configuration. |

> **Shared code.** Page objects, fixtures, helpers, and configuration are shared by many tests, so a change has a larger blast radius. Each repair to them is validated over every test that uses it; see [the workflow](https://kwikqa.com/docs/how-it-works/#shared). `init` only proposes spec rules on its own; add shared classes deliberately.

## Local files

KwikQA writes run records, patch journals, and validation output to `.kwikqa/` in your project. Keep it out of git; `init` offers to add it to `.gitignore`.

---

Source: https://kwikqa.com/docs/configuration/
