container-plugin/skills/skaffold-testing/SKILL.md
Container image validation with Skaffold test/verify stages — container-structure-tests, security scans. Use when configuring pre-deploy tests or integration tests in Skaffold.
npx skillsauth add laurigates/claude-plugins skaffold-testingInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
| Use this skill when... | Use another skill instead when... | |------------------------|-----------------------------------| | Configuring container-structure-tests | Writing Dockerfiles (use container skills) | | Adding security scans to Skaffold pipelines | General Skaffold build/deploy (use skaffold-development) | | Setting up post-deploy verification | Unit testing application code | | Validating image contents pre-deploy | Kubernetes manifest authoring |
Build -> Test -> Deploy -> Verify
^ ^
Pre-deploy Post-deploy
| Stage | Purpose | Runs During |
|-------|---------|-------------|
| test | Validate images before deployment | dev, run, test |
| verify | Validate deployment works correctly | dev, run, verify |
Failed tests block deployment. Use --skip-tests to bypass.
Two mechanisms for pre-deploy validation:
| Type | Purpose | Tool Required |
|------|---------|---------------|
| structureTests | Validate image contents | container-structure-test binary |
| custom | Run arbitrary commands | None (uses $IMAGE env var) |
Validate image contents without running the container.
apiVersion: skaffold/v4beta11
kind: Config
test:
- image: my-app
structureTests:
- ./tests/structure/*.yaml
structureTestsArgs:
- --driver=tar # Faster, no Docker daemon needed
- -q # Quiet output
| Type | Purpose | Key Fields |
|------|---------|------------|
| commandTests | Verify binaries work | command, args, expectedOutput, exitCode |
| fileExistenceTests | Verify files present/absent | path, shouldExist, permissions, uid, gid |
| fileContentTests | Validate file contents | path, expectedContents, excludedContents |
| metadataTest | Validate image config | envVars, user, entrypoint, cmd, exposedPorts, workdir |
Run arbitrary commands with access to built image via $IMAGE env var.
test:
- image: my-app
custom:
- command: grype $IMAGE --fail-on high --only-fixed
timeoutSeconds: 300
- command: trivy image --exit-code 1 --severity HIGH,CRITICAL $IMAGE
timeoutSeconds: 300
Control when tests re-run:
custom:
- command: ./scripts/integration-test.sh
timeoutSeconds: 600
dependencies:
paths:
- "src/**/*.go"
- "go.mod"
ignore:
- "**/*_test.go"
Run integration tests after deployment succeeds.
| Mode | Environment | Use Case |
|------|-------------|----------|
| local (default) | Docker on host | Quick tests, local dev |
| kubernetesCluster | K8s Job | Integration tests needing cluster access |
verify:
- name: health-check
container:
name: curl-test
image: curlimages/curl:latest
command: ["/bin/sh"]
args: ["-c", "curl -f http://my-app.default.svc:8080/health"]
executionMode:
kubernetesCluster: {}
| Context | Command |
|---------|---------|
| Quick structure test | container-structure-test test --driver=tar -q --image $IMAGE --config tests/structure/security.yaml |
| Security scan (critical only) | grype $IMAGE --fail-on critical -q |
| Skip tests in dev | skaffold dev --skip-tests |
| Run only tests | skaffold test |
| Run only verify | skaffold verify |
| CI with JUnit output | container-structure-test test --image $IMAGE --config test.yaml --test-report junit.xml |
| Flag | Description |
|------|-------------|
| --driver=tar | Use tar driver (faster, no Docker daemon) |
| --driver=docker | Use Docker driver (default) |
| -q | Quiet output |
| --test-report FILE | Generate test report |
| --output json | JSON output format |
| Flag | Description |
|------|-------------|
| --skip-tests | Skip test phase |
| -p PROFILE | Use specific profile |
| --build-artifacts FILE | Use pre-built artifacts |
| Variable | Description |
|----------|-------------|
| $IMAGE | Built image with tag/digest |
For detailed examples, advanced patterns, and best practices, see REFERENCE.md.
tools
Scaffold a new ComfyUI custom-node repo (pyproject, CI, release-please, vitest+pytest, JS extension skeleton) in the picker/gesture vein. Use when bootstrapping or init-ing a comfyui node pack.
tools
Orchestrate a ComfyUI node pack from idea to registry: scaffold, create + seed the repo, open the gitops adoption PR. Use when releasing or spinning up a new comfyui node pack.
testing
macOS EndpointSecurity/EDR high CPU & battery drain. Use when Kandji ESF / XProtect pegs a core; trace the exec storm via powermetrics + eslogger.
development
odiff pixel-by-pixel image diffing. Use when comparing screenshots, detecting visual regressions, diffing before/after PNGs, asserting golden images.