api-docker-type-model

Generates and maintains Perl type classes mirroring Docker Engine API swagger definitions.

2|Updated Apr 29, 2026
One-click install
npx skills add https://github.com/Getty/p5-api-docker --skill api-docker-type-model-getty
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: api-docker-type-model
Source: https://github.com/Getty/p5-api-docker/tree/main/.claude/skills/api-docker-type-model
Command: npx skills add https://github.com/Getty/p5-api-docker --skill api-docker-type-model-getty

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Maintaining the generated API::Docker::Type::* class hierarchy requires knowing exactly where each change belongs — the generator, its YAML data files, or the runtime DSL — because hand-editing generated files breaks the byte-identical verification suite and is silently lost on regeneration. ## Core Features & Use Cases - Change routing: Maps each kind of edit (prose, Perl field names, inline class names, deliberate spec deviations) to the correct maint/ data file or script. - Generation rules enforcement: Documents the non-obvious invariants — never hand-edit generated files, the generator only creates never overwrites, caller-data keys under additionalProperties pass through byte for byte, and null handling differs for known versus unknown fields. - Drift verification workflow: Defines completion criteria via spec-to-type.pl --verify, spec-drift-check.pl baselines, and the full test suite. - Use Case: When a drift check reports that a newer Docker swagger adds fields to HostConfig, use this Skill to decide whether the fix goes in spec-to-type-names.yaml, the exceptions file, or the generator itself, then regenerate and verify. ## Quick Start Ask the assistant to update the API::Docker type model for a newer Docker swagger spec and verify the generated classes pass the drift check.

Frequently Asked Questions about api-docker-type-model

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I update a generated API::Docker::Type class?

Never edit files under lib/API/Docker/Type/ directly; the test suite asserts they are byte-identical to generator output. Change maint/spec-to-type.pl, its YAML data files, or the shared spec-common.pl logic, then regenerate and run --verify.

Where do I change the Perl name of a Docker API field?

Field name mappings live in maint/spec-to-type-names.yaml. Names with runs of capitals like CPUShares or OOMKillDisable cannot be derived automatically, so the generator refuses to guess and requires a curated entry.

Why does the generator refuse to overwrite existing type classes?

The generator only creates new files and never overwrites, with no --force option. Generated classes are hand-reviewed and documented after creation, so a blind re-run would silently discard that curated work.

How are hash fields like Labels and PortBindings serialized?

Fields marked additionalProperties in the swagger have caller-chosen keys, typed as { Str, $value_type }. The DSL passes those keys through byte for byte, since translating them would silently rewrite user data like com.example.Some-Label.

What happens when the Docker daemon sends fields not in the spec?

Unknown fields pass through unchanged in both directions, so callers on newer engines still work. A null for a known field is read as unset, while a null under an unknown or caller-chosen key is preserved verbatim.

Why must the swagger be parsed with YAML::XS instead of YAML::PP?

Docker's example blocks are multi-line flow maps with under-indented closing braces, which YAML::PP refuses to parse. Both maint scripts read the spec through maint/spec-common.pl using YAML::XS.