DEV Community

adamya
adamya

Posted on

🐷 Piggy — I Made an AI Plugin That Writes 80–94% Less Code

The Problem

Every AI coding agent I used wrote too much code.

Ask it to validate an email? It writes a 40-line class with regex, error types, and an interface.
Ask it to debounce a function? It returns a full utility library.

Senior developers don't do this. A senior dev who's been paged at 3am for over-engineered code writes the laziest solution that actually works — and nothing more.

So I built Piggy 🐷 — a plugin that makes your AI agent think like that senior dev.

What is Piggy?

Piggy is a plugin/skill for AI coding agents. Once installed, it forces the simplest solution before writing any code.

The best code is the code you never wrote.

Before writing anything, Piggy checks a ladder:

Does this need to exist at all? (YAGNI — skip speculative features)
Already in this codebase? Reuse the existing helper.
Does stdlib do it? Use it, zero dependencies.
Native platform feature? over a picker lib. CSS over JS.
Already-installed dependency solves it? Use it. Never add new ones for what a few lines can do.
Can it be one line? One line.
Only then: the minimum code that works.

Benchmark Results

I tested across 5 everyday tasks (email validator, debounce, CSV sum, countdown timer, rate limiter) on 3 models (Haiku, Sonnet, Opus), 10 runs each:

MetricWithout PiggyWith PiggyLines of code100%6–20% (↓ 80–94%)Token cost100%23–53% (↓ 47–77%)Speedbaseline3–6× faster

Less code = fewer bugs, cheaper API calls, faster responses.

Works With Every Major AI Tool

Piggy supports all major AI coding platforms:

Claude Code → /plugin marketplace add adamyasingh-12/Piggy-
Cursor → copy .cursor/rules/piggy.mdc to your rules folder
Windsurf → copy .windsurf/rules/piggy.md
GitHub Copilot → included config
Codex, Devin, Kiro, Gemini, OpenCode → all supported

Commands

Once installed, you get 10 commands:

CommandWhat it does/piggyLazy mode — simplest solution that works/piggy-reviewScan a diff for over-engineering/piggy-auditWhole-repo scan — ranked list of what to delete/piggy-debtHarvest all piggy: comments into a debt ledger/piggy-explainWhy was this simplification chosen?/piggy-scoreComplexity score 1–10, before vs after/piggy-compareLazy vs verbose version side by side/piggy-testMinimal test for the lazy solution/piggy-gainShow the benchmark scoreboard/piggy-helpQuick reference card

3 Intensity Levels

/piggy lite → suggest lazy alternatives, you decide
/piggy → ladder enforced, stdlib first (default)
/piggy ultra → YAGNI extremist, deletion before addition

Example — "Add a cache for these API responses"

lite: Done, cache added. FYI: functools.lru_cache covers this in one line if you'd rather not own a cache class.

full: @lru_cache(maxsize=1000) on the fetch function. Skipped custom cache class.

ultra: No cache until a profiler says so. A hand-rolled TTL cache class is a bug farm with a hit rate.

Install Now

bash# Claude Code
/plugin marketplace add adamyasingh-12/Piggy-

GitHub: https://github.com/adamyasingh-12/Piggy-

MIT licensed. Stars and feedback welcome! 🐷⭐

Top comments (0)