Agent Skills › yielded-dev/auth › library-first

library-first

GitHub

指导如何构建或提取可复用的库代码,强调最小化API、明确契约及通过真实消费者验证,避免过度设计。

.agents/skills/library-first/SKILL.md yielded-dev/auth

Trigger Scenarios

需要构建跨项目复用的能力 从应用中提取共享库 修改现有共享库

Install

npx skills add yielded-dev/auth --skill library-first -g -y
More Options

Non-standard path

npx skills add https://github.com/yielded-dev/auth/tree/main/.agents/skills/library-first -g -y

Use without installing

npx skills use yielded-dev/auth@library-first

指定 Agent (Claude Code)

npx skills add yielded-dev/auth --skill library-first -a claude-code -g -y

安装 repo 全部 skill

npx skills add yielded-dev/auth --all -g -y

预览 repo 内 skill

npx skills add yielded-dev/auth --list

SKILL.md

Frontmatter
{
    "name": "library-first",
    "description": "Build or extract reusable libraries, including packages inside application repositories. Use when a capability is intended for reuse across projects or an existing shared library is changing."
}

Library first

Build the smallest reusable capability that serves the current caller. A module or workspace package inside the application is a valid home, even with one consumer. Extend an existing library when it owns the capability. Defer a separate repository, publication, configuration, and extension points until a real consumer needs them.

Put the current reusable workflow behind a small public API. Own the invariants that workflow actually promises; do not expand its scope while extracting it. Applications supply product policy and resources through explicit contracts; the library must not import its consuming app.

Apply the higher quality bar to the behavior the library actually promises. Keep that contract narrow, implement it correctly, and verify it through a real consumer. Add failure, cleanup, concurrency, or recovery handling when the supported workflow requires it or a real bug demonstrates the need. Do not front-load defensive frameworks or broad test matrices to make a new library seem stable. Prefer a lean first release with explicit limits; harden it through small fixes and focused regression tests as actual cases appear. Reuse existing proof and follow repository testing policy.

App-specific composition can move faster while preserving required behavior. Critical paths in both app and library code require performance evidence. Reusable verification tooling should share the real operation across app commands, tests, and CI; use feedback-loops when that tooling is missing or slow.

  • Designing or implementing the reusable API: boundaries.
  • Changing contracts, replacing duplicates, or extracting a package: evolution.

Finish with the boundary actually used, relevant checks passing, and a concise explanation of guarantees, host responsibilities, and limitations.

Version History

  • 72bfeeb Current 2026-10-18 15:34

Same Skill Collection

.agents/skills/alchemy/SKILL.md
.agents/skills/cloudflare/SKILL.md
.agents/skills/dev-kit/SKILL.md
.agents/skills/effect/SKILL.md
.agents/skills/feedback-loops/SKILL.md
.agents/skills/measure-performance/SKILL.md
.agents/skills/o11y/SKILL.md
.agents/skills/project-setup/SKILL.md
.agents/skills/pull-requests/SKILL.md
.agents/skills/show-me/SKILL.md
.agents/skills/simplify/SKILL.md
.agents/skills/testing/SKILL.md

Metadata

Files
0
Version
72bfeeb
Hash
f575d274
Indexed
2026-10-18 15:34

Home - Wiki
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-10-19 06:55
浙ICP备14020137号-1