Skip to content
Automation
Skill

/behavior-contract

Bug condition/postcondition formalization as testable Behavior Contracts. Defines invariants that must be preserved across fixes.

From plugin
babysitter
1.8k200 skills3 agents21 commands1 MCP
Install
$ npx -y skills add a5c-ai/babysitter --skill behavior-contract --agent claude-code

How it fires

How this skill gets triggered: by you, by Claude, or both.

  • Fires itselfAuto-invocation. Claude auto-loads it when your prompt matches the work.Auto-invocation is when the right skill fires by itself at the right moment, driven by a FLOW.md router and a hook, instead of you invoking it by name. It is the difference between a skill being installed and a skill actually getting used.Read the full definition →
  • You can call itInvoke it directly when you want it.
  • Slash command/behavior-contract

Context preview

The summary Claude sees to decide when to auto-load this skill.

Bug condition/postcondition formalization as testable Behavior Contracts. Defines invariants that must be preserved across fixes.

SKILL.md

behavior-contract.SKILL.md
name: behavior-contract
description: Bug condition/postcondition formalization as testable Behavior Contracts. Defines invariants that must be preserved across fixes.
allowed-tools: Bash(*) Read Write Edit Glob Grep
metadata:
  author: babysitter-sdk
  version: "1.0.0"
  category: pilot-shell-bugfix
  attribution: "Adapted from Pilot Shell by Max Ritter (https://github.com/maxritter/pilot-shell)"
graph:
  domains: [domain:software-engineering]
  skillAreas: [skill-area:agentic-loops, skill-area:orchestration-loop]
  workflows: [workflow:feature-development]
  topics: [topic:developer-experience]
  roles: [role:tech-lead, role:backend-engineer]
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

# 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 audited

Read more
Ships withbabysitter

Enforce obedience on agentic workforces. Manage extremely complex workflows through deterministic, hallucination-free self-orchestration.

Get the whole plugin

Other skills on babysitter.