/hatch3r:hatch3r-api-spec runs instead · from hatch3r
Generates and validates OpenAPI specs from codebase route definitions. Includes endpoint inventory, schema validation, documentation generation, and oasdiff breaking-change CI gate.
This skill never runs in Claude Code
It ships in hatch3r at skills/, but /hatch3r:hatch3r-api-spec (a command, or a skill Claude Code finds first) has the same name: typing it, or Claude choosing it, runs that one instead.
commands/hatch3r-api-spec.md (Decision 13 handoff)This skill shares the id: hatch3r-api-spec with the orchestrator command commands/hatch3r-api-spec.md. The two are NOT duplicates — they split the OpenAPI workflow by execution model per CONSTITUTION §6 Decision 13:
commands/hatch3r-api-spec.md (orchestrator entry): the canonical multi-agent pipeline — researcher scans routes, docs-writer assembles the spec, reviewer validates (agentPipeline: [hatch3r-researcher, hatch3r-docs-writer, hatch3r-reviewer]). Use the command when the workflow warrants sub-agent fan-out (Tier 2/3 framework detection, drift detection, breaking-change review).oasdiff breaking-change CI gate wiring) is the inline-procedure detail the command references rather than restates.The merge-candidate review (F16.3-H3) flagged the shared id; this handoff documentation is the explicit workflow-split declaration that disambiguates the pair. A future collapse into a single command appendix requires coordinated edits to the command body, the bundled content inventory (skills count), and the Decision-13 anti-duplicate-id gate in src/cli/commands/validate.ts.
Task Progress:
- [ ] Step 0: Detect ambiguity (P8 B1)
- [ ] Step 1: Inventory existing endpoints
- [ ] Step 2: Generate OpenAPI spec
- [ ] Step 3: Validate schemas
- [ ] Step 4: Generate documentation
- [ ] Step 5: Verify spec accuracy
- [ ] Step 6: Wire oasdiff breaking-change CI gate
Before any work, scan the invocation for unresolved questions in scope, intent, acceptance criteria, target environment, or irreversibility. If any are found, ask the user via the platform-native question tool per agents/shared/user-question-protocol.md. Do not proceed under silent assumption. Default path, not an exception. Triggers for THIS skill: OpenAPI version (3.0 vs 3.1), spec output path, auth scheme (Bearer vs OAuth2 vs API key), breaking-change policy (block vs version vs document), and target consumers (SDK clients vs human docs vs both).
openapi.yaml (or openapi.json) at the project root or docs/api/ directory.info block with title, version, description, and contact.components/schemas for shared request/response types.$ref references to avoid schema duplication.security schemes matching the project's authentication (Bearer, API key, OAuth2).required, minLength, maxLength, pattern, enum).nullable: true or type union.spectral, redocly lint) if available in the project.application/json, multipart/form-data, etc.) match actual handlers.oasdiff Breaking-Change CI GateBreaking changes on stable endpoints must trip CI before merge. This step enforces the canonical lean-threshold floor "API breaking-change events on stable endpoints = 0 per release" (see agents/shared/principles.md, verified by oasdiff / buf breaking / graphql-inspector CI gate).
oasdiffPick one of two install paths:
npm i -g @tufin/oasdiffdocker run --rm -t -v $(pwd):/specs tufin/oasdiff <subcommand>Pin the version in CI (e.g., npm i -g @tufin/[email protected] or tufin/oasdiff:1.10) so a new release of oasdiff does not change gate semantics mid-cycle.
The gate compares the spec on the feature branch against the spec at the merge base on the default branch. Fail CI on any breaking change to a stable endpoint; report non-breaking diffs as informational.
git show origin/main:openapi.yaml > /tmp/openapi.base.yaml).oasdiff breaking /tmp/openapi.base.yaml ./openapi.yaml --fail-on ERR — exit code 1 when one or more ERR-level breaking changes are detected.x-stability: experimental via --match-path or by maintaining an oasdiff-ignore.yaml rules file for documented breaking changes already coordinated with consumers.name: API Breaking-Change Gate
on:
pull_request:
paths:
- 'openapi.yaml'
- 'openapi.json'
- 'docs/api/**'
jobs:
oasdiff:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-node@v4
with:
node-version: '22'
- name: Install oasdiff
run: npm i -g @tufin/[email protected]
- name: Resolve base spec
run: |
git show origin/${{ github.base_ref }}:openapi.yaml > /tmp/openapi.base.yaml
- name: Run breaking-change diff
run: |
oasdiff breaking /tmp/openapi.base.yaml ./openapi.yaml \
--fail-on ERR \
--format githubactions
The --format githubactions flag emits ::error:: annotations so each breaking change shows up inline on the PR diff.
When a breaking change is deliberate (versioned endpoint cut, deprecated field removed after the documented sunset window):
oasdiff-ignore.yaml with the change ID, the affected operation, and a link to the consumer-coordination record.info.version in line with the project's API versioning policy (semver-major for breaking changes on stable endpoints).The gate stays green only because the change is recorded — not because the breaking signal was silenced.
Fan-out scales with task size; token cost never justifies serializing independent work (rules/hatch3r-fan-out-discipline.md P8 B2; agents/shared/efficiency-patterns.md). Tier boundaries for THIS skill:
Emit sub_agents_spawned: { count, rationale, task_structure } in your output.
oasdiff breaking CI gate is wired and fails on any ERR-level breaking change on stable endpoints (CONSTITUTION §2 P5: 0 per release)info/components/schemas/$ref/security structures and the JSON-Schema-aligned validation keywords used in Steps 2–3.oasdiff breaking --fail-on ERR CI-gate behavior, --format githubactions annotations, and ignore-rules file in Step 6.What SKILL.md sets; muted values are Claude Code's defaults
Claude Code refuses to install this plugin
.claude-plugin/plugin.json: commands: Invalid input, agents: Invalid string: must start with "./", agents: Invalid string: must end with ".md", skills: Invalid string: must start with "./", mcpServers: Invalid string: must start with "./"
.claude-plugin/plugin.json: commands: Invalid input, agents: Invalid string: must start with "./", agents: Invalid string: must end with ".md", skills: Invalid string: must start with "./", mcpServers: Invalid string: must start with "./"
Checked against Claude Code 2.1.332's install rules. The listing below is what the repository ships; Claude Code cannot install it as published.
55 skills in this plugin
/hatch3r-a11y-auditRuns a WCAG AA accessibility audit with findings and fixes across 7 scan categories (keyboard, contrast, ARIA, reduced motion, screen reader, high contrast, automated axe). Use when auditing and remediating accessibility./hatch3r-adhoc-orchestrateScaffolds the ad-hoc Tier >= 2 orchestration protocol -- Per-Turn Pipeline-State Header, implementer delegation plan, End-of-Turn Delegation Attestation. Use for a multi-phase task with no registered command to avoid inline-implementation bypass mode./hatch3r-ai-featureEval-driven development workflow for shipping AI features — write eval before prompt, measure, iterate, ship with caching + cost telemetry + model fallback + hallucination SLIOther plugins' skills for the same job