Skip to content
Back to skills

482 No Cargo Cult Fixes 70e178dd

ASecurity

When extracting changes from a messy PR, I blindly copied a fix to `retry.py` without questioning whether it was needed.

  • 9 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added June 1, 2026
developmentgocode-review

Security analysis

A100/100

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

Scanned June 1, 2026

npx -y skills add tools-only/X-Skills --skill 482-no-cargo-cult-fixes_70e178dd --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of 482 No Cargo Cult Fixes 70e178dd?

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

Security grade badge for 482 No Cargo Cult Fixes 70e178dd
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/tools-only-482-no-cargo-cult-fixes-70e178dd/badge)](https://www.skillsdirectory.com/skills/tools-only-482-no-cargo-cult-fixes-70e178dd)

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
---
title: No Cargo Cult Fixes - Question Every Change
link: no-cargo-cult-fixes
type: qa
path: qa/
depth: 1
seams: [M]
ontological_relations:
  - relates_to: [[code-review]]
  - affects: [[all-modules]]
  - fixes: [[scope-creep]]
tags:
  - discipline
  - shims
  - code-review
created_at: 2026-01-09T22:15:00Z
updated_at: 2026-01-09T22:15:00Z
uuid: 4fa0c1e7-d7d0-415a-91e4-d69b28210ff0
---

## Problem

When extracting changes from a messy PR, I blindly copied a fix to `retry.py` without questioning whether it was needed.

The signature preservation fix was for pydantic-ai tool schema generation. `retry_on_json_error` is a JSON parsing utility - it never gets passed to pydantic-ai's `Tool()`. The fix there was a shim.

## Root Cause

Cargo culting. "The original PR had it, so I included it."

## Lesson

Before applying any fix, ask: **"Does this code path actually hit the problem?"**

For the signature preservation bug specifically:
- pydantic-ai uses `inspect.signature()` to generate JSON schemas for tools
- Only wrappers that produce functions passed to `Tool()` need the fix
- `retry_on_json_error` wraps JSON parsers, not pydantic-ai tools

## Rule

If you encounter a shim, fix it. Don't care who made it. Don't propagate it.

## Files That Actually Needed The Fix

1. `research_agent.py` - `ProgressTracker.wrap_tool()` wraps tools for pydantic-ai
2. `decorators.py` - `base_tool()` and `file_tool()` wrap tools for pydantic-ai
3. `present_plan.py` - `create_present_plan_tool()` creates a pydantic-ai tool

## Files That Did NOT Need The Fix

- `retry.py` - wraps JSON parsers, not pydantic-ai tools

Files in this skill

  • README.md918 B
  • skill.md1.6 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.

Comments

Loading comments…

Newsletter

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