Apr 20, 2026

全生命周期生产级 Agent Skills

如何使用 addyosmani/agent-skills,在从规格到部署的整条工作流中贯彻资深工程师纪律。

#tutorial#engineering#best-practices#developer-tools

AI 编码 Agent 默认走最短路径:跳过规格、不写测试、推出能跑但上不了生产的代码。Addy Osmani 的 agent-skills 用 19 条结构化工作流,贯彻资深工程师在生产代码中的同一套纪律。

与其他合集的区别

多数 Skill 仓库提供单点工具:写提交、做评审、生成测试。本合集覆盖软件开发生命周期六个阶段:

阶段Skill强化什么
定义idea-refine、spec-driven-development先写规格再写代码
规划planning-and-task-breakdown小步、可验证任务
构建incremental-implementation、context-engineering、frontend-ui-engineering、api-and-interface-design薄切片、合理架构
验证test-driven-development、browser-testing-with-devtools、debugging-and-error-recovery测试是证明而非装饰
评审code-review-and-quality、code-simplification、security-and-hardening、performance-optimization五维评审
发布git-workflow-and-versioning、ci-cd-and-automation、deprecation-and-migration、documentation-and-adrs、shipping-and-launch安全、可回滚部署

Skill 借鉴 Google 工程文化:API 设计中的 Hyrum 定律、测试中的 Beyonce 规则、简化中的 Chesterton 栅栏、Git 中的主干开发。

安装

claude plugin marketplace add addyosmani/agent-skills
claude plugin install agent-skills@addy-agent-skills

# 或本地克隆
git clone https://github.com/addyosmani/agent-skills.git

Skill 按上下文自动激活:做 UI 触发 frontend-ui-engineering,设计 API 触发 api-and-interface-design,一般无需手动调用。

实战:从想法到生产发布功能

步骤 1:定义功能

/spec Build a user notification system that supports email, in-app, and push channels.

spec-driven-development 写 PRD:目标、命令、结构、代码风格、测试策略与边界。先审文档再写代码。

步骤 2:拆任务

/plan Generate implementable tasks from this spec

planning-and-task-breakdown 拆成小任务,含验收标准与依赖顺序。

步骤 3:增量实现

/build Implement the notification dispatch module first

incremental-implementation 强制薄垂直切片:实现、测试、验证、提交;用功能开关与安全默认值,保证每次提交可部署。

步骤 4:测试先行

/test Write tests for the notification dispatch module

test-driven-development 遵循红-绿-重构;测试金字塔(80% 单元、15% 集成、5% E2E)与 Beyonce 规则:生产可能坏的地方就要有测试。

步骤 5:合并前评审

/review Review the notification feature changes

code-review-and-quality 五维评审:正确性、可读性、安全、性能、可维护性;单次约 100 行,按严重度标注。

步骤 6:安全发布

/ship Deploy the notification feature

shipping-and-launch 跑上线清单、分阶段发布与监控回滚。

斜杠命令

命令作用
/spec定义要做什么
/plan规划怎么做
/build增量构建
/test证明可用
/review合并前评审
/code-simplify降复杂度
/ship部署生产

何时不必使用

若只要轻量单用途 Skill 可跳过。本合集强调流程;若只需写提交信息或快速评审,Anthropic 官方 Skill 更简单。适合希望把工程纪律写进 Agent 工作流的团队。

技巧

  • 下个功能从 /spec 开始。
  • 对存量代码用 /code-simplify,遵循 Chesterton 栅栏:先理解再删。
  • 处理用户输入、认证或外部数据的代码应跑 security-and-hardening
  • 单次改动控制在约 100 行以内。

更多工程类 Skill 见 SkillMap 排行榜