bug-to-contract
Promote a review finding or bug fix into a contract test that prevents the underlying invariant violation from recurring.
Skill by ultimatile
Chalk Labs
Need help deploying bug-to-contract?
Chalk Labs sets up agents like this inside real teams: connected to your tools, tested on your data, with a human in the loop where it matters.
Install
Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.
npx agentmarket install skill/ultimatile-bug-to-contract
Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.
Get the weekly diff
The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.
About
Use cases: documents, testing, security
Reviews
Write a reviewNo reviews yet. Installed it? Reviews come from verified installers only. How reviews work
Permissions
What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.
- Tools
- No tools found
- Secrets
- None asked for
- Install scripts
- None found
Network hosts it talks to 1
codeload.github.com· found in install command
Files it touches
~/.claude/skills/bug-to-contract
What's inside
- Skill name
bug-to-contract- Description
- Promote a review finding or bug fix into a contract test that prevents the underlying invariant violation from recurring. Companion to finding-to-audit, which elevates to diff-time rules instead.
- License
- MIT
- Instructions
- 96 lines in SKILL.md · view on GitHub
Files (1)
- SKILL.md
SKILL.md (first lines)
# Bug-to-Contract
Review findings and bug fixes address symptoms. This skill asks: **what implicit specification was violated, and is that specification now tested?**
## Inputs
This skill works from two kinds of input. The fix-commit lane uses a **root** on `diff-root`'s consumer contract, halt included; the review-findings lane uses none.
| Input | What to collect |
| -- | -- |
| Review findings | Actionable findings from any review pass (codex, Copilot, human reviewer) that resulted in code changes. The reviewer's framing of the issue. |
| Fix commits | Branch commits whose subject signals a fix: `git log <root-rev>..HEAD --oneline --grep="fix" -i`, then `git show <sha>`. |
When both are available, prefer review findings — a reviewer saying "this doesn't handle column-major layout" is a stronger signal than a commit message.
## Core procedure
### 1. Collect signals
**From review findings:**
- For each actionable finding that resulted in a code change, note what the issue was and what changed.
**From fix commits:**
- Examine the diff of each fix commit:
```bash
git log <root-rev>..HEAD --oneline --grep="fix" -i
git show <commit-sha>
```
### 2. Ask the contract question
For each signal, determine:
1. **What broke?** — The specific symptom (wrong output, crash, silent corruption, reviewer complaint, etc.)
2. **What implicit specification was violated?** — The unstated property that users expect to hold. This is the contract. Examples:
- Memory layout should not affect computation results
- Operation order in einsum should not affect results (up to floating-point tolerance)
- Transpose is an involution: `transpose(transpose(A)) == A`
- Scalar type promotion should be consistent across operations
- Empty inputs should produce empty outputs with correct shape
3. **Is this contract already tested?** — Search for existing tests that verify this property in general, not just the specific case that broke.
### 3. Search for existing contract tests
Look for tests that verify the identified contract beyond the specific case:
```bash
grep -r "test.*layout\|test.*order\|row_major.*column_major" --include="*.rs" tests/
```
If a test exists that covers the general contract, the contract is already guarded. Report this and stop.
### 4. Classify the contract
Identifying the category helps write a general test rather than a point fix test.
| Category | Description | Example |
| -- | -- | -- |
| Representation invariance | Result is independent of internal representation choices | Memory layout, stride order, storage format |
| Algebraic identity | Mathematical property that must hold | Involution, associativity, commutativity |
| Structural preservation | Shape, type, or metadata properties preserved through operations | Output shape matches specification, dtype preserved |
| Boundary behavior | Correct handling of edge cases | Empty input, zero-size dimension, single element |
| Semantic equivalence | Different spellings of the same operation produce the same result | `einsum("ij,jk->ik", A, B)` == `matmul(A, B)` |
### 5. Propose the contract test
Write a test (or propose one) that verifies the **general contract**, not just the specific case that broke. The test should:
- **Vary the representation**: If it's a layout bug, test with all valid layouts
- **Use multiple inputs**: Not just the one that triggered the issue
- **State the contract explicitly**: The test name and/or comment should name the property being verified
### 6. Check for related contracts
Once a contract is identified, look for related contracts in the same category. If memory layout invariance was violated for GEMM, it could also be violated for SVD, QR, eigendecomposition, solve, etc.
Propose tests for related operations if they are missing.
### 7. Report
Present to the user:
1. **The implicit contract** that was violated (one sentence)
2. **Whether it was already tested** (yes/no + evidence)
3. **Proposed contract test** (code or description)
4. **Related contracts** that may also be untested
## Important principles
- **Name the contract**: If you can't name the implicit specification in one sentence, you haven't understood the issue yet.
- **Patterns are escalation-worthy**: A cluster of findings in the same category (e.g., three layout-related issues in one review cycle) indicates a systematically untested contract. Escalate this to the user.
- **Don't boil the ocean**: One contract test per finding is enough.From ultimatile/development-skills, MIT.
More from ultimatile/development-skills
- 0.564score
copilot-review
ultimatile
Create a GitHub PR with Copilot as reviewer and poll until the review arrives.
SkillAFreshness: AClaude Code +9 - 0.561score
authoritative-text-rules
ultimatile
Single source of truth for audit items covering text that an agent executes as instructions.
SkillAFreshness: AClaude Code +9 - 0.561score
code-review-gate
ultimatile
Run the built-in /code-review against the current diff through a fallback lane chain with lane-failure, retry, and exhaustion handling.
SkillAFreshness: AClaude Code +9 - 0.561score
codex-contract-test-review
ultimatile
Narrow Codex pass on a newly added contract test, verifying it is not tautological and would fail on the original buggy implementation.
SkillAFreshness: AClaude Code +9 - 0.561score
diff-root
ultimatile
Single source of truth for the diff root — the ref a change is measured from — covering the consumer contract, where the root comes from, and the per-command…
SkillAFreshness: AClaude Code +9 - 0.561score
done-check
ultimatile
Single-pass audit of the current diff against the applicable quality rule sets before declaring a task complete or requesting external review.
SkillAFreshness: AClaude Code +9 - 0.561score
file-pullreq
ultimatile
Draft and file a GitHub PR using gh-body-conventions and the PR body skeleton, via the gh-post wrapper.
SkillAFreshness: AClaude Code +9 - 0.561score
finding-to-audit
ultimatile
Promote a review finding into a pre-commit audit rule that catches the diff-inspectable issue class (import direction, pub widening, debug artifacts, dropped…
SkillAFreshness: AClaude Code +9 - 0.561score
finding-triage
ultimatile
Single source of truth for per-finding review-triage dispositions and response selection for actionable findings, which the review and audit skills apply by…
SkillAFreshness: AClaude Code +9 - 0.561score
gate-miss-to-issue
ultimatile
Promote a late-caught defect — one an earlier gate should have caught — into a development-skills issue proposing a fix to that gate's procedure.
SkillAFreshness: AClaude Code +9 - 0.558score
codex-plan-review
ultimatile
Review an implementation plan with OpenAI Codex before coding, getting a second opinion on assumptions and approach.
SkillAFreshness: AClaude Code +9 - 0.558score
codex-review
ultimatile
Pre-PR code review on the current branch using the OpenAI Codex CLI, with an iterative fix loop.
SkillAFreshness: AClaude Code +9
Signals
- Stars
- 0
- Forks
- 0
- Open issues
- 71
- Last commit (this folder)
- Oct 11, 2026 (19 days ago)
From GitHub (fetched Oct 24, 2026).
Details
- License
- MIT
- Repository
- github.com/ultimatile/development-skills
- First seen
- Oct 24, 2026
- Last checked
- Oct 24, 2026
- Source
- GitHubgithub-graphql
More from ultimatile
- 0.564score
copilot-review
ultimatile
Create a GitHub PR with Copilot as reviewer and poll until the review arrives.
SkillAFreshness: AClaude Code +9 - 0.561score
codex-contract-test-review
ultimatile
Narrow Codex pass on a newly added contract test, verifying it is not tautological and would fail on the original buggy implementation.
SkillAFreshness: AClaude Code +9 - 0.561score
code-review-gate
ultimatile
Run the built-in /code-review against the current diff through a fallback lane chain with lane-failure, retry, and exhaustion handling.
SkillAFreshness: AClaude Code +9 - 0.561score
authoritative-text-rules
ultimatile
Single source of truth for audit items covering text that an agent executes as instructions.
SkillAFreshness: AClaude Code +9 - 0.561score
diff-root
ultimatile
Single source of truth for the diff root — the ref a change is measured from — covering the consumer contract, where the root comes from, and the per-command…
SkillAFreshness: AClaude Code +9 - 0.561score
done-check
ultimatile
Single-pass audit of the current diff against the applicable quality rule sets before declaring a task complete or requesting external review.
SkillAFreshness: AClaude Code +9
Done for you
Rather not set it up yourself?
Chalk Labs scopes, builds and runs agents for your team: the task audit, the eval harness, the integrations and the weekly ops report. Fixed scope, priced before we start.
See how we build AI agents →Read the case studies
Chalk Labs is a two-founder AI and growth studio. We build AI agents, CRMs and MVPs for Web3 and AI companies, and have shipped 50+ product and token launches.
- launches shipped
- 50+
- launches shipped
- media placements
- 500+
- media placements
- founders on every account
- 2
- founders on every account
Press we've placed: Forbes · CoinDesk · Decrypt · Cointelegraph · The Block
Rahil Jain, Co-founder, Chalk Labs. Ex-Goldman Sachs engineer. You talk to the person who builds it.
Get bug-to-contract running in your business
Tell us what you want to automate. A founder replies within one working day with a plan, not a pitch deck.
Cite this page
bug-to-contract skill. Agent Mart. https://agentmart.dev/skills/ultimatile-bug-to-contract (last updated 2026-10-24)