AGENT SKILL

stdlib-first

Solves small programming problems with the language's standard library, platform features, or already-installed packages before adding a new dependency. Use when writing code that could pull in a package (dates, deep clone, UUIDs, HTTP, arg parsing, formatting, validation), or when the user asks which library to use.

License 许可
MIT
所属仓库
Xnadir/vetted
最近更新
2026-10-30
Stars
★ 5
Forks
8

01 前言 Front Matter

name
stdlib-first
license
MIT
description
Solves small programming problems with the language's standard library, platform features, or already-installed packages before adding a new dependency. Use when writing code that could pull in a package (dates, deep clone, UUIDs, HTTP, arg parsing, formatting, validation), or when the user asks which library to use.

03 SKILL.md 正文

Stdlib first

Every new dependency is code you didn't read, running with your app's permissions, updated on someone else's schedule. For a few lines of logic, that trade is almost never worth it: it adds install time, bundle size, supply-chain risk, and upgrade work for the lifetime of the project.

Order of preference

Stop at the first option that does the job well:

  1. The language or runtime already does it. structuredClone, crypto.randomUUID(), fetch, Intl.DateTimeFormat, URL, AbortController; pathlib, dataclasses, argparse, zoneinfo; std::fs, encoding/json.
  2. The platform does it. An HTML <input type="date">, a CSS feature, a database constraint or index, a shell tool that's already required.
  3. A dependency the project already has does it. Check the manifest (package.json, pyproject.toml, go.mod, Cargo.toml) before choosing.
  4. A few lines of your own code do it, clearly written and tested.
  5. Only then add a new dependency. Prefer a small, widely used, maintained package, and say why the options above weren't enough.

Check the project's runtime version before relying on a newer built-in (for example structuredClone needs Node 17+). If it's too old, say so.

When a dependency is the right call

Don't hand-roll things that are genuinely hard to get right: cryptography, parsers for complex formats, time-zone databases, sanitising untrusted HTML. For those, a well-maintained library beats clever local code, and you should say that directly.

Reporting

When you chose not to add a package the user might expect, say so in one line: "Used Intl.RelativeTimeFormat instead of adding moment: no new dependency."

04 同仓库更多 Skills

Xnadir
Xnadir/vetted

root-cause

Finds and fixes the actual cause of a bug instead of patching the symptom at the place it was reported. Use when debugging an error, a failing test, a crash, or wrong output, and when a bug report names one caller, page, or input. Traces the failure back to where the bad state originates and fixes it once there.

★ 5
Xnadir
Xnadir/vetted

prove-it

Separates what was checked from what was only written before a coding task is reported as done. Use when finishing a code change, bug fix, or refactor, and before saying anything is fixed, working, passing, or complete. Pairs each claim with the command and output that backs it, and lists what was not verified.

★ 5
Xnadir
Xnadir/vetted

handoff

Writes a handoff note that lets a fresh agent session or a teammate resume the current task without re-reading the conversation. Use when the user asks for a handoff, summary for later, or context dump, or before ending a long session, switching machines, or clearing context mid-task.

★ 5
Xnadir
Xnadir/vetted

grill

Interviews the user about an under-specified feature, project, or plan before any code is written, one decision at a time with a recommended answer for each. Use when the user asks to be grilled, interviewed, or questioned about requirements, a plan, or a design before building.

★ 5
Xnadir
Xnadir/vetted

bug-hunt-review

Reviews code or a diff for real defects, meaning inputs or states that produce wrong results, crashes, data loss, or security holes, and reports each with a concrete failure scenario. Use when asked to review code, a pull request, a diff, or a change before merge. Leaves out style nitpicks unless asked.

★ 5
Xnadir
Xnadir/vetted

surgical

Keeps code changes to the smallest diff that fully solves the request. Use when editing existing code to fix a bug, add a feature, or respond to review, especially in files with unrelated code nearby. Prevents drive-by refactors, reformatting, renames, and "while I'm here" cleanups that make diffs hard to review.

★ 5