Skip to content
Back to skills

Check Cli Contract

ASecurity

Compare a command's captured exit status, stdout, and stderr against a known expectation. Use when reproducing an output regression or preparing a CLI smoke test.

  • 4 stars
  • 0 votes
  • 0 copies
  • 4 views
  • Added November 29, 2026
developmentpython

Works with

  • cli

Security analysis

A100/100

Pro scans all 6 files and shows the line behind each finding

Scanned November 29, 2026

npx -y skills add vxxqv/workflow-verification-skills --skill check-cli-contract --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Check Cli Contract?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Check Cli Contract
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/vxxqv-check-cli-contract/badge)](https://www.skillsdirectory.com/skills/vxxqv-check-cli-contract)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: check-cli-contract
description: Compare a command's captured exit status, stdout, and stderr against a known expectation. Use when reproducing an output regression or preparing a CLI smoke test.
---

# Check CLI Contract

Use the local checker with Python 3.11 or newer to identify the first difference
in each captured output stream.

1. Pick the expected behavior from the documented interface or a previously
   accepted run. Use a small fixture with stable outputs. See
   [the sample expectation](assets/expected.json) for the JSON fields.
2. Capture the exact command, exit status, stdout, and stderr from one run.
   Capture the exit status immediately after the command. Save both streams as
   UTF-8 files, including a zero-byte file for an empty stream.
3. Run `python <skill-dir>/scripts/cli_contract.py <expected.json> --exit-code <status> --stdout <stdout-file> --stderr <stderr-file>`.
   Exit 0 means the contract matches. Exit 2 reports a mismatch and identifies
   its stream and line or JSON Pointer. Exit 1 means the expectation or a
   capture needs attention.
4. Report the failing contract, command, and relevant output excerpt. Include
   the tool version when sharing a reproduction. Retest with the same fixture
   after an authorized fix.

Use `mode: "json"` for JSON output and `mode: "text"` for text. JSON object
key order is ignored, while arrays and value types are compared exactly.
Text comparison treats CRLF and LF line endings alike. The checker reads saved
captures. Remove sensitive data before putting a reproduction in a public issue.

Files in this skill

  • SKILL.md1.5 KB
  • agents/openai.yaml195 B
  • assets/accepted.json48 B
  • assets/candidate.json48 B
  • assets/expected.json224 B
  • scripts/cli_contract.py5 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in development →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.