bugfix-contract
Synthesize a bug's behavior contract before patching: a behavior matrix from the issue, every visible assertion on the same behavior, conflicts resolved in…
Skill by lasertsole
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/lasertsole-bugfix-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
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 and code. 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/bugfix-contract
What's inside
- Skill name
bugfix-contract- Description
- Synthesize a bug's behavior contract before patching: a behavior matrix from the issue, every visible assertion on the same behavior, conflicts resolved in the issue's favor, and a minimal patch that satisfies both. Use for bug fixes judged by tests you cannot fully see.
- License
- MIT
- Instructions
- 61 lines in SKILL.md · view on GitHub
Before installing
- Instructions call the network
Files (1)
- SKILL.md
SKILL.md (first lines)
# Bugfix Contract
A discipline for bug-fix tasks whose acceptance criteria are **not fully visible**: derive the
behavior contract first, then patch. The failure this prevents is patching the *symptom* while
missing the intended semantics — or worse, aligning the fix with an old test that encodes the bug.
## 1. Behavior matrix
From the issue, extract a matrix of **input → expected rendering/behavior**. Put the issue's own
example(s) in it verbatim. Add the neighboring cases the same code path handles (the fix will
touch them): rule out each row explicitly or keep it as a suspected-affected row.
## 2. Collect the visible contract
Find **every existing assertion** on the same behavior: the repo's tests, doc examples, doctests,
string fixtures. Record what each expects. Two outcomes matter:
- an existing assertion that matches the issue's expectation → it is your regression anchor;
- an existing assertion on the *same behavior* that **contradicts** the issue (it asserts exactly
what the issue calls wrong) → it is a conflict signal, not a constraint (see step 3).
## 3. Conflict rule: the issue wins
When an issue reports rendering/behavior as inaccurate and an existing test asserts that exact
behavior, the acceptance suite for such a fix usually **flips that test**. So:
- treat the conflicting old assertion as *expected to change*; do not bend the fix to satisfy it;
- derive the fix from the issue's semantics (what the correct behavior must be) and the code's
own invariants — not from the old expectation;
- **record the trade-off explicitly** in your final reply ("test X asserted the old behavior; the
fix intentionally changes it"), so a reviewer can see the decision instead of discovering it.
## 4. Minimal-patch discipline
- change the least mechanism that makes the matrix correct — prefer fixing the root cause over
adding a special case for the issue's exact input;
- the patch must keep the *non-conflicting* existing tests green (run them);
- a patch that only moves the symptom (fix one input, break a sibling input) is not done:
re-check the whole matrix.
## 5. Reach for the upstream fix (when the environment allows)
Before inventing the contract, check whether it already exists upstream: extended git history
(`git log --all`, tags beyond the checkout), the project's issue/PR tracker, or a web search.
Probe availability with one bounded attempt (a short `curl -m 5` or a search call); if the
environment is offline, say so and fall back to the matrix — do not silently skip this step.
## 6. Pre-submit self-check
Run the matrix, row by row, in the actual repo (the rows that are runnable). List the rows you
could **not** run and why. State, in one line per row, expected vs actual. "The issue's example
now renders correctly" is necessary but not sufficient — the neighboring rows are the test.
## Honest boundary
This raises the odds; it does not guarantee the hidden contract. When the intended boundary
between two defensible behaviors is genuinely underdetermined by everything visible, the honest
move is to state both readings in your reply and pick the one most consistent with the issue and
the code's invariants — not to guess silently.From lasertsole/sherry_agent, MIT.
More from lasertsole/sherry_agent
- 0.624score
heartbeat
lasertsole
Periodic wake-up service that checks HEARTBEAT.md for pending tasks and executes them automatically.
SkillAFreshness: A★ 5Claude Code +9 - 0.620score
code-wiki
lasertsole
Generate wiki docs + Mermaid diagrams for any codebase.
SkillAFreshness: A★ 5Claude Code +9 - 0.619score
browser
lasertsole
Drive the session's real browser (the 工具箱·浏览器 panel) — open pages, read them as text, click and type, screenshot when layout matters.
SkillAFreshness: A★ 5Claude Code +9 - 0.618score
cron
lasertsole
Schedule reminders and recurring tasks.
SkillAFreshness: A★ 5Claude Code +9 - 0.617score
multimodal_rag
lasertsole
Private knowledge base for indexing multimodal files or folders into a knowledge graph, supporting multi-hop graph retrieval
SkillAFreshness: A★ 5Claude Code +9 - 0.616score
todolist
lasertsole
Session-scoped task tracking with delegation routing and TaskFlow-backed DAG execution.
SkillAFreshness: A★ 5Claude Code +9 - 0.616score
taskflow
lasertsole
Durable multi-step task flows with optimistic locking, detached subagent step dispatch, waiting and idempotent resume via the taskflow_* tool family
SkillAFreshness: A★ 5Claude Code +9 - 0.616score
ulw-execute
lasertsole
Orchestrator execution doctrine.
SkillAFreshness: A★ 5Claude Code +9 - 0.615score
image_to_text
lasertsole
Recognize and describe the content of an image.
SkillAFreshness: A★ 5Claude Code +9 - 0.612score
video_text_to_text
lasertsole
Describe/transcribe video content (such as .mp4, .mkv, .avi) into text.
SkillAFreshness: A★ 5Claude Code +9 - 0.612score
speech_to_text
lasertsole
Transcribe speech (such as .mp3, .wav, .ogg) into text.
SkillAFreshness: A★ 5Claude Code +9 - 0.611score
llm-wiki
lasertsole
Karpathy's LLM Wiki: build/query interlinked markdown KB.
SkillAFreshness: A★ 5Claude Code +9
Signals
- Stars
- 5
- Forks
- 1
- Open issues
- 0
- Last commit (this folder)
- Oct 17, 2026 (12 days ago)
- Last release
- Oct 18, 2026 (10 days ago)
From GitHub (fetched Oct 24, 2026).
Details
- License
- MIT
- Repository
- github.com/lasertsole/sherry_agent
- First seen
- Oct 24, 2026
- Last checked
- Oct 24, 2026
- Source
- GitHubgithub-graphql
More from lasertsole
- 0.624score
heartbeat
lasertsole
Periodic wake-up service that checks HEARTBEAT.md for pending tasks and executes them automatically.
SkillAFreshness: A★ 5Claude Code +9 - 0.620score
code-wiki
lasertsole
Generate wiki docs + Mermaid diagrams for any codebase.
SkillAFreshness: A★ 5Claude Code +9 - 0.619score
browser
lasertsole
Drive the session's real browser (the 工具箱·浏览器 panel) — open pages, read them as text, click and type, screenshot when layout matters.
SkillAFreshness: A★ 5Claude Code +9 - 0.618score
cron
lasertsole
Schedule reminders and recurring tasks.
SkillAFreshness: A★ 5Claude Code +9 - 0.617score
multimodal_rag
lasertsole
Private knowledge base for indexing multimodal files or folders into a knowledge graph, supporting multi-hop graph retrieval
SkillAFreshness: A★ 5Claude Code +9 - 0.616score
taskflow
lasertsole
Durable multi-step task flows with optimistic locking, detached subagent step dispatch, waiting and idempotent resume via the taskflow_* tool family
SkillAFreshness: A★ 5Claude Code +9
Cite this page
bugfix-contract skill. Agent Mart. https://agentmart.dev/skills/lasertsole-bugfix-contract (last updated 2026-10-24)