behavior-contract
Bug condition/postcondition formalization as testable Behavior Contracts. Defines invariants that must be preserved across fixes.
Best use case
behavior-contract is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
Bug condition/postcondition formalization as testable Behavior Contracts. Defines invariants that must be preserved across fixes.
Teams using behavior-contract should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/behavior-contract/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How behavior-contract Compares
| Feature / Agent | behavior-contract | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
Bug condition/postcondition formalization as testable Behavior Contracts. Defines invariants that must be preserved across fixes.
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
SKILL.md Source
# behavior-contract
You are **behavior-contract** -- the bug formalization skill for Pilot Shell bugfix mode.
## Overview
This skill formalizes bugs as Behavior Contracts -- precise, testable descriptions of what is wrong (Bug Condition), what should happen (Postcondition), and what must not change (Invariants).
## Contract Structure
### Bug Condition
The exact input, state, or sequence that triggers the bug. Must be specific enough to write a failing test.
**Example**: "When `processPayment()` receives an amount of exactly $0.00, it throws an unhandled TypeError instead of returning a zero-amount receipt."
### Postcondition
The correct behavior that must hold after the fix is applied.
**Example**: "When `processPayment()` receives $0.00, it returns a valid Receipt object with `amount: 0` and `status: 'completed'`."
### Invariants
Existing correct behaviors that must be preserved by the fix.
**Example**:
- "Positive amounts still process correctly"
- "Negative amounts still throw `InvalidAmountError`"
- "Receipt format remains unchanged for all amount types"
## Contract Document Template
```markdown
# Behavior Contract: [Bug Title]
## Bug Condition
[Precise description of triggering conditions]
## Postcondition
[Expected correct behavior after fix]
## Invariants
- [ ] Invariant 1: [existing behavior to preserve]
- [ ] Invariant 2: [existing behavior to preserve]
## Testable Assertions
1. `expect(processPayment(0)).toEqual({ amount: 0, status: 'completed' })`
2. `expect(processPayment(100)).toEqual({ amount: 100, status: 'completed' })`
3. `expect(() => processPayment(-1)).toThrow(InvalidAmountError)`
```
## Usage in Bugfix Workflow
1. Bug analysis identifies root cause at file:line
2. This skill formalizes the contract from the analysis
3. tdd-enforcer writes failing test from Bug Condition
4. tdd-enforcer writes preservation tests from Invariants
5. Minimal fix applied, contract auditedRelated Skills
Smart Contract Analysis Skill
Ethereum and blockchain smart contract security analysis
contract-test-framework
Consumer-driven contract testing for SDK-API compatibility. Generate Pact consumer tests, verify provider contracts, configure Pact broker, and implement can-i-deploy checks.
pact-contract-testing
Consumer-driven contract testing with Pact framework. Generate consumer contracts, configure Pact Broker publishing, execute provider verification, detect breaking changes, and integrate with CI/CD pipelines.
steering-behaviors
Steering behaviors skill for flocking, avoidance, and group movement.
behavior-trees
Behavior tree design and implementation skill for game AI. Enables creation of behavior tree structures, custom nodes, decorators, composites, and integration with game engines for NPC and enemy AI systems.
payer-contract-analysis
Analyze payer contracts for reimbursement rates, terms, and value-based incentives to optimize revenue and support contract negotiations
contract-extractor
Extracts key terms from contracts, identifies risks, flags unusual provisions
contract-analyzer
Contract analysis and negotiation support skill with clause extraction and risk identification
docusign-contracts
DocuSign contract and e-signature integration for deal closure
contract-test-generator
Generate contract tests for API migrations with consumer-driven contracts and provider verification
process-builder
Scaffold new babysitter process definitions following SDK patterns, proper structure, and best practices. Guides the 3-phase workflow from research to implementation.
babysitter
Orchestrate via @babysitter. Use this skill when asked to babysit a run, orchestrate a process or whenever it is called explicitly. (babysit, babysitter, orchestrate, orchestrate a run, workflow, etc.)