Skip to content
Back to skills

Contract First

ASecurity

Specify inputs, outputs, compatibility, and failure semantics before changing a public API or module boundary.

  • 3 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added October 13, 2026
ai-agentsapi

Works with

  • api

Security analysis

A100/100

Scanned October 13, 2026

npx -y skills add sujith011/agentic-pro-skills --skill contract-first --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Contract First?

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

Security grade badge for Contract First
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/sujith011-contract-first/badge)](https://www.skillsdirectory.com/skills/sujith011-contract-first)

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: contract-first
description: "Specify inputs, outputs, compatibility, and failure semantics before changing a public API or module boundary."
---

# Contract First
Resolve ambiguities at the boundary rather than hiding them in implementation.

## Process
1. Identify consumers and the authoritative contract (types, schema, protocol, or docs).
2. Define valid input, output, error codes, authorization, and invariants.
3. For state-changing calls, decide idempotency, concurrency, and partial-failure semantics where applicable.
4. Include examples for success, invalid input, and compatibility with existing callers.
5. Implement against the contract and verify it through the public interface.

## Example
An order-creation API defines the idempotency-key scope and what happens when the same key is reused with a different payload.

## Stop conditions
Do not use silent fallbacks or broad optional types to hide an unresolved invariant. Ask if it changes public behavior.

## Evidence
- [ ] Consumers and error semantics are explicit.
- [ ] Contract tests exercise applicable edge cases.
- [ ] Existing callers remain compatible or have a migration path.

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.

Comments

Loading comments…

Newsletter

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