Community生产力与协作github.com

addyosmani/source-driven-development

将每一个实现决策锚定在官方文档上。在需要权威、有来源引用的代码且避免过时模式时使用。适用于任何注重正确性的框架或库构建。

source-driven-development 是什么?

该技能的核心原则是“源驱动开发”(Source-Driven Development),要求AI代理在生成任何代码或提供实现建议时,必须优先查阅并引用官方文档。它旨在杜绝开发者或AI依赖过时博文、个人经验或非权威来源的不良习惯,确保生成的每一段代码都有可靠、最新的依据。该技能适用于任何框架或库(如React、Vue、Django、Spring等),特别强调在关键决策点(如API使用、配置、最佳实践)上提供可追溯的官方来源。通过这种机制,可以显著降低引入deprecated模式或安全漏洞的风险,提升代码质量与可维护性。该技能已在Claude Code、Cursor等主流AI编码工具上验证,要求代理在响应中包含具体的文档链接或引用,便于用户交叉验证。

兼容平台~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/addyosmani/agent-skills/tree/main/skills/source-driven-development

Installed? Explore more 生产力与协作 skills: steipete/gemini, steipete/gh-issues, steipete/skill-creator · View all 6 →

在你喜欢的 AI 中提问

打开一个已预加载此 Agent Skill 的新对话。

文档

source-driven-development 是做什么的?

将每一个实现决策锚定在官方文档上。在需要权威、有来源引用的代码且避免过时模式时使用。适用于任何注重正确性的框架或库构建。

概述

源驱动开发(Source-Driven Development)是一种方法论,确保AI代理生成的所有代码都优先基于框架、库或工具的官方文档。这消除了猜测和过时的知识,通过将每个实现决策绑定到权威来源,提供可靠、可追溯的代码

为什么使用

  • 避免过时模式:许多AI模型依赖于可能过时或错误的训练数据。源驱动开发确保AI优先查阅当前版本的官方文档
  • 提高正确性:通过引用官方来源,代码更有可能遵循最佳实践,并避免已知的陷阱
  • 可追溯性:每个决策都可以追溯到具体文档,方便代码审查、调试和知识传递
  • 框架无关:适用于任何有文档的框架或库——React、Vue、Angular、Django、Flask、Spring等

如何使用

使用此技能时,AI代理应:

  1. 识别相关官方文档:对于给定的任务或API,查找该框架或库的官方文档
  2. 基于文档提供实现:使用文档中的信息(代码示例、配置选项、最佳实践)来生成代码
  3. 引用来源:在响应中包含链接或引用,指示所使用信息的位置(例如:根据React官方文档...)
  4. 保持更新:优先使用最新版本的文档。如果兼容性问题需要降级,请注明版本

支持平台

  • Claude Code
  • Cursor
  • Codex(及其他基于AI的编码助手)

使用示例

用户:“如何在React中实现useEffect?”

AI(使用源驱动开发):“根据React官方文档(https://react.dev/reference/react/useEffect),useEffect用于在组件中执行副作用。以下是一个基于官方示例的实现...”

工作流程

  1. 用户提出请求:用户请求实现某个功能或使用特定API
  2. AI检索官方文档:AI查找该功能或API的官方文档(可能从本地缓存或在线获取)
  3. AI提供实现:基于文档生成代码,包括注释和来源引用
  4. 用户验证:用户可以点击文档链接确认准确性

潜在改进

  • 添加自动文档提取工具(如Web爬虫)以保持AI知识库同步
  • 在AI提示中加入版本感知上下文,以处理多个文档版本
  • 为常见框架和库建立来源验证检查清单

结论

源驱动开发是在AI辅助开发中确保代码质量和正确性的强大范式。通过将每个实现决策锚定在官方文档中,可以减少错误、避免过时模式,并构建更可靠的软件。

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

addyosmani/agent-skills

Builds production-quality, accessible, responsive user-facing UIs. Use when building or modifying interfaces and pages, creating components, implementing layouts, meeting WCAG accessibility requirements, managing state, or when the output needs to look and feel production-quality rather than AI-generated.

addyosmani/agent-skills

Prepares production launches. Use when preparing to deploy to production, or when asking what needs to be in place before shipping. Use when you need a pre-launch checklist, when setting up monitoring, when planning a staged rollout, or when you need a rollback strategy.

addyosmani/agent-skills

Guides stable API and interface design. Use when designing APIs, module boundaries, or any public interface. Use when creating REST or GraphQL endpoints, defining type contracts between modules, or establishing boundaries between frontend and backend.

addyosmani/browser-testing-with-devtools

Tests in real browsers via Chrome DevTools MCP. Use when building or debugging anything that runs in a browser. Use when you need to inspect the DOM, capture console errors, analyze network requests, profile performance, or verify visual output with real runtime data. Requires the chrome-devtools MCP server to be configured.

addyosmani/ci-cd-and-automation

Automates CI/CD pipeline setup. Use when setting up or modifying build and deployment pipelines. Use when you need to automate quality gates, configure test runners in CI, or establish deployment strategies.

addyosmani/code-review-and-quality

Conducts multi-axis code review. Use before merging any change. Use when reviewing code written by yourself, another agent, or a human. Use when you need to assess code quality across multiple dimensions before it enters the main branch.

addyosmani/code-simplification

Simplifies code for clarity. Use when refactoring code for clarity without changing behavior. Use when code works but is harder to read, maintain, or extend than it should be. Use when reviewing code that has accumulated unnecessary complexity.

addyosmani/constraint-driven-development

Establishes a project's quality bar as a written contract and stops agents quietly lowering it. Interviews the user on which dimensions matter, supplies sane default thresholds when they have no number in mind, records everything in CONSTRAINTS.md, and watches the diff for a weakened bar — new @ts-ignore or eslint-disable suppressions, skipped or deleted tests, assertions stripped out, unimplemented stubs, thresholds edited down. Use when no quality bar is written down, when the user says "set up constraints" or "define our standards", when the user wants dimensions they care about — accessibility, web performance, coverage — set up as enforced constraints, when an agent keeps silencing checks or skipping tests to get to green, when you need a coverage or performance threshold and don't know what number to pick, or when an agent writes more code than anyone will read.

addyosmani/debugging-and-error-recovery

Guides systematic root-cause debugging. Use when tests fail, builds break, behavior doesn't match expectations, or you encounter any unexpected error. Use when you need a systematic approach to finding and fixing the root cause rather than guessing.

addyosmani/deprecation-and-migration

Manages deprecation and migration. Use when removing old systems, APIs, or features. Use when migrating users from one implementation to another. Use when deciding whether to maintain or sunset existing code.

addyosmani/documentation-and-adrs

Records decisions and documentation. Use when making architectural decisions, changing public APIs, shipping features, or when you need to record context that future engineers and agents will need to understand the codebase.

addyosmani/doubt-driven-development

Subjects every non-trivial decision to a fresh-context adversarial review before it stands. Use when correctness matters more than speed, when working in unfamiliar code, when stakes are high (production, security-sensitive logic, irreversible operations), or any time a confident output would be cheaper to verify now than to debug later.

addyosmani/git-workflow-and-versioning

Structures git workflow practices. Use when making any code change. Use when committing, branching, resolving conflicts, or when you need to organize work across multiple parallel streams.

addyosmani/idea-refine

Refines raw ideas into sharp, actionable concepts through structured divergent and convergent thinking. Use when an idea is still vague, when you need to stress-test assumptions before committing to a plan, or when you want to expand options before converging on one. Triggers on "ideate", "refine this idea", or "stress-test my plan".

addyosmani/incremental-implementation

Delivers changes incrementally. Use when implementing any feature or change that touches more than one file. Use when you're about to write a large amount of code at once, or when a task feels too big to land in one step.

addyosmani/interview-me

Extracts what the user actually wants instead of what they think they should want. Achieves this through one-question-at-a-time interview until ~95% confidence about the underlying intent. Use when an ask is underspecified ("build me X" without "for whom" or "why now"), when the user explicitly invokes ("interview me", "grill me", "are we sure?", "stress-test my thinking"), or when you catch yourself silently filling in ambiguous requirements before any plan, spec, or code exists.

addyosmani/observability-and-instrumentation

Instruments code so production behavior is visible and diagnosable. Use when adding logging, metrics, tracing, or alerting. Use when shipping any feature that runs in production and you need evidence it works. Use when production issues are reported but you can't tell what happened from the available data.

addyosmani/performance-optimization

Optimizes application performance. Use when performance requirements exist, when you suspect performance regressions, or when Core Web Vitals or load times need improvement. Use when profiling reveals bottlenecks that need fixing.

addyosmani/planning-and-task-breakdown

Breaks work into ordered tasks. Use when you have a spec or clear requirements and need to break work into implementable tasks. Use when a task feels too large to start, when you need to estimate scope, or when parallel work is possible.

addyosmani/security-and-hardening

Hardens code against vulnerabilities. Use when handling user input, authentication, data storage, or external integrations. Use when building any feature that accepts untrusted data, manages user sessions, or interacts with third-party services.

相关技能