r/ClaudeAI • u/Glittering_Device653 • 3d ago
Built with Claude I made an Agent Skill that stops coding agents from picking a stack out of habit
A site I work on has about a million pages, and roughly 80% of its requests come from crawlers. It was built on the default stack, on a host that bills CPU time per request. Months later a one-hour prototype measured 282 ms of CPU per page render on that stack and 6.2 ms on a simpler one. We migrated. If that prototype had been built on day one, there would have been nothing to migrate.
So I wrote a skill that makes the agent do the cheap check first. It's called no-regret-stack.
What it does
Before adding any package, it checks live data (deps.dev, the registry, OSV, GitHub) and answers in one line:
avoid request@2.88.2: deprecated upstream, no release since 2020, 1 advisory. Built-in fetch does this. Use that instead?For anything costly to undo (framework, hosting, database, auth and so on) it reads the project, asks at most three questions, measures the one number that could force a migration, gives a single pick with a runner-up and revisit triggers, and waits for your OK before writing code. Then it records the decision in docs/decisions/.
Why I think it's needed
Before writing it I ran three requests through Claude Code without the skill. It swapped a package I had named for another one without asking. It built SQLite into a project without asking who else needed the data. It scaffolded an entire site before asking a single question.
Something I didn't expect
In one test run the measurement did not crown the fastest framework. On my laptop, Next.js took 1.8 to 2.2 ms of CPU per page, Astro 0.2 to 0.3, Hono 0.1. On a flat-priced VPS all three were far below what the load needed, so the pick came down to fit. The ratio went into the decision file as the thing to recheck if the billing model ever changes.
What's in the repo
- The skill itself
- 23 reference files, one per kind of choice, with regret patterns linked to the posts and postmortems they come from
- A zero-dependency Node script for the package check. It works on its own for npm, PyPI, crates.io, Go, Maven and NuGet
Limits
It's v0.1. Behaviour is checked by hand against a list of scenarios, and I have only run a few of them. If you have a lot of skills installed, Claude Code may list this one without its description, and then it won't trigger by itself. One line in CLAUDE.md fixes that; the README has it.
Install
Claude Code:
/plugin marketplace add Caqil/no-regret-stack
/plugin install no-regret-stack@no-regret-stackCodex, Cursor, Gemini CLI and others:
npx skills add Caqil/no-regret-stackRepo (MIT): https://github.com/Caqil/no-regret-stack
What I'd most like back: regret patterns from your own migrations, with a link if it was written up.
1
u/Ok_Tea4891 3d ago
The measure-before-you-pick idea is sound, especially asking the agent to name the one number that could force a migration. One thing I'd add is recording what the measurement was run on, since a laptop number and a per-request CPU billing number can rank frameworks differently. A revisit trigger written as a concrete threshold (for example CPU ms per render at a given traffic level) is easier to act on than a general note. Did you see the skill ever get skipped when a request sounded small, like adding one package?