Fix Kits · Kin Score · 18 check points
Fix Kit: API Ruleset
Publish your API style guide as a Spectral ruleset, with real rules and a real spread of severities.
- Effort: About a day to write; it then runs in your CI.
- Who needs it: of the providers each check applies to (apis.io, scored 2026-11-21, rubric 0.28.1): 100% miss “Publishes a ruleset”; 100% miss “Substantial ruleset”; 100% miss “Balanced severities”.
- You get: the full kit (PDF and Markdown): how to find what your API really does, step-by-step fix, starter schemas, an OpenAPI Overlay that applies it across your contract, a script that checks your work exactly the way the scorer does, and docs-platform notes.
What the check measures
Everyone who designs an API has rules, even if they live only in a reviewer’s head: plural resource names, one error shape, cursor pagination, every operation secured. A Spectral ruleset writes those rules down as code that a linter runs on every contract. It tells your own teams what “good” means, and it tells an agent, a partner or a code generator what to expect from every API you ship.
The checks read the Spectral rulesets in your catalog repo’s rules/ folder.
| Check | Points | What earns it |
|---|---|---|
Publishes a ruleset (rules_present) |
10 | Your primary ruleset declares at least 1 rule of its own under rules: |
Substantial ruleset (rules_substantial) |
5 | Your primary ruleset enforces 20 or more rules: the rules you wrote, plus 41 if it extends: spectral:oas (27 for spectral:asyncapi, 15 for spectral:arazzo) |
Balanced severities (balanced_severities) |
3 | Across all your rulesets together, at least one rule is severity: warn and at least one is severity: info |
How the scorer reads a ruleset:
- Where it looks. Every
.ymland.yamlfile in therules/folder of your repo in the catalog. A.jsonruleset is not read. When you point to a published ruleset from yourapis.yml(Step 5), that’s where its copy lands. - What counts as a rule. Each entry under
rules:whose value is a full rule definition (a map withgiven,thenand so on). A line that only turns a rule on or off (operation-tag-defined: off) is not counted. - Severity. Read from each rule’s
severity:. A rule with noseverity:counts aswarn. Use the wordserror,warn,info,hint: numeric severities (0-3) aren’t recognised aswarnorinfo. Rules pulled in byextends:add to the rule count but not to the severity count. - The primary ruleset. Since rubric 0.28, your own ruleset wins whenever there is one: if any ruleset in
rules/is classified as provider-authored (its provenance reads harvested, published, declared, first-party and the like), the primary is picked from those alone, however many rules our generated ones carry. Only when none is yours does the scorer fall back to the ruleset with the highest enforced count (authored plus inherited) across all of them. If two tie, the first file alphabetically wins. Before 0.28 our generator’s ~50-rule rulesets routinely outranked a provider’s own published ruleset (roadmap#1139).
The rules are in signals/score.rb (primary_ruleset and the three checks) and the counting in the apis.io build (build.py, which records rule_count, effective_rule_count and severity_counts).
What this means in practice:
extends: spectral:oasplus one rule of your own already passes the first two checks (1 + 41 = 42). The base is the better engineering choice anyway; you don’t have to copy its rules into your file.extends: spectral:oaswith no rules of your own fails Publishes a ruleset, because that check counts only the rules you wrote.- A ruleset that’s all
errorfails Balanced severities. One that’s allerrorandhintfails it too:hintdoesn’t count. - The checks score what your ruleset declares. Spectral isn’t run against your contracts, so a passing ruleset doesn’t mean your API passes it (lint it yourself, Step 4).
Who wrote it matters. The Contract Governance facet credits a ruleset by its authorship. One you publish and point to is credited as yours. One API Evangelist generated from your contracts earns only a fraction of the points (a derived artifact is credited at 0.25), so writing your own is worth more than a ruleset we wrote for you.
The rule above is the public rubric (rubric page). The kit sells the working method: the steps, starters, overlay and check script.