Skip to content
Back to skills

Code Contract

ASecurity

What a change does to a public surface, each change classed patch, minor, or major, with the consumers it reaches

  • 2 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added November 17, 2026
ai-agentsbashgitapi

Works with

  • api

Security analysis

A100/100

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

Scanned December 3, 2026

npx -y skills add ku5ic/claude-kit --skill code-contract --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Code Contract?

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

Security grade badge for Code Contract
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/ku5ic-code-contract/badge)](https://www.skillsdirectory.com/skills/ku5ic-code-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: code-contract
description: What a change does to a public surface, each change classed patch, minor, or major, with the consumers it reaches
argument-hint: "[base ref] [path]"
allowed-tools:
  - Bash(git diff *)
  - Bash(git log *)
  - Bash(git show *)
  - Bash(kit code-graph *)
  - Bash(kit detect-stack)
  - Bash(kit git-base *)
  - Bash(kit scratch-dir *)
  - Bash(ast-grep run *)
---

# /code-contract

Diff the public surface between a base and the working tree, class each change patch, minor, or major, and list what each change reaches. Read-only.

Loading this skill isn't enough. Before the step a row names, read its file.

| Before                                          | Read                                                                                           |
| ----------------------------------------------- | ---------------------------------------------------------------------------------------------- |
| Step 2, with a schema file                      | [reference/schemas.md](reference/schemas.md)                                                   |
| Step 2, with the ecosystem's API tool installed | [reference/ecosystem-tools.md](reference/ecosystem-tools.md)                                   |
| Step 3, classing each change                    | [reference/semver.md](reference/semver.md), [reference/behavioral.md](reference/behavioral.md) |

Stack specifics come from the stack's pattern skill.

## Procedure

1. Surface. The base is the argument, else `kit git-base`. A path argument limits the surface to what's under it. What's public comes from the project: a package's declared exports, a published schema, its routes, a component library's props. The report names the surface it treated as public. Unclear, ask.
2. Base and head, first that applies:
   - A schema file (OpenAPI, GraphQL, protobuf) whose checker is installed. Its checker runs on the base's copy (`git show <base>:<file>`) and the working tree's, per [reference/schemas.md](reference/schemas.md). Without the checker, read the schema file on both sides with `git show` and say no checker ran.
   - The ecosystem's API tool, installed and configured in the project, run per [reference/ecosystem-tools.md](reference/ecosystem-tools.md).
   - Otherwise exported symbols, routes, and props, found with `ast-grep` on both sides, the base's files read with `git show`. The report says no checker ran.
3. Class each change by [reference/semver.md](reference/semver.md), then scan the diff for what [reference/behavioral.md](reference/behavioral.md) lists, which no type diff sees.
4. Consumers. Each changed symbol gets `/code-impact`'s Consumers procedure, run here. A published package's consumers outside the repo are unknown, and the report says so.

## Report

Load the report-format skill and use its format, written to the path `kit scratch-dir contract <scope-slug>` prints, with these narrowings:

- The TL;DR's first bullet is the bump in place of the health word: `patch`, `minor`, or `major: <the change that forces it>`. Under `0.y.z`, it says the class is advice.
- A Changes table with the change, its class, its evidence (the checker's line, or `file:line` on each side), and its consumers.
- A major change is a `failure` when the project's version or commit doesn't say major, else `info`. A behavioral change is a `warning`. A change that is both takes the higher.

## Reply

The report path and the bump line.

## Stop

Read-only. No version bump, no changelog edit, no install.

Arguments: `$ARGUMENTS`

Files in this skill

  • SKILL.md3.3 KB
  • reference/behavioral.md816 B
  • reference/ecosystem-tools.md915 B
  • reference/schemas.md1.1 KB
  • reference/semver.md651 B
  • sources.md1.9 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 ai-agents →

Comments

Loading comments…

Newsletter

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