pdd-kit lint
Check that the Product Model is structurally sound after every edit. The skills run it for you; adding it to CI is optional.
npx pdd-toolkit lint [--json]
Options
| Option | Meaning |
|---|---|
--json | Print the result as JSON instead of lines |
What it does
- Finds the model. See Choosing the Product Model.
- Checks every file against the rules for its resource type. Each rule is listed on its type's page: the model as a whole, the Product, Entities, Interfaces, Experiences and Screens, Domains, Capabilities, Journeys, Business Rules, Variations and References.
- Checks that every code Reference points at a file Git tracks.
- Prints each error and warning, then a one-line verdict.
It only reads. A clean result means the model is well formed, not that it
matches the code. Use pdd-verify
for that.
JSON output
{
"ok": false,
"errors": ["/repo/product-model/capabilities/place-order/capability.md: missing H1 title"],
"warnings": [],
"counts": {
"interfaces": 3, "experiences": 2, "screens": 1, "domains": 2, "entities": 6,
"capabilities": 3, "capabilityScenarios": 4, "journeys": 2,
"journeyScenarios": 3, "businessRules": 2
}
}
Each error and warning is one string, prefixed with the file it concerns
(for a resource, its absolute path). When no model is found, the output is
{ "ok": false, "errors": ["<message>"], "warnings": [], "counts": {} }.
Exits 0 when there are no errors (warnings never fail lint), 1 when there are errors or no model is found, and 2 for an unknown option.
Run it in CI (optional)
Nothing requires CI. The skills run lint on the developer's machine whenever they change the model, and that is enough to keep it valid.
If you also want pull requests checked, run lint on every pull request, not
only when product-model/ changes: a code rename can break a code Reference.
npx pdd-toolkit lint needs no setup:
name: pdd-kit
on: pull_request
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 22 # any version from 22.12
- run: npx pdd-toolkit lint
Warnings never fail the job; errors do. A green lint checks structure only:
whether the code does what the model says is
pdd-verify's job.
Next
viewto read the model as a report.