read-the-damn-docs
BuilderIO/skills
在實作、整合或除錯第三方 API、函式庫及服務之前,必須先進行網路搜尋並閱讀官方文件,以確保準確性並避免憑空猜測。
...展開全部請仔細閱讀那些該死的文件
當權威文件能解答問題時,切勿憑空猜測。 最常見的 正確做法是透過網路搜尋最新的官方文件,開啟相關 頁面,並在編寫程式碼前仔細閱讀。無論是 API、版本、服務供應商行為、 設定、限制、生命週期鉤子,或是涉及安全的流程,都應以 文件中實際記載的內容作為解答依據。
「文件優先」的觸發條件
當符合以下任一情況時,請先閱讀文件再繼續:
- 使用者要求「最新」、「當前」、「官方」、「受支援」、「最佳 實務」、「建議」、「今天」、「現在」或「查一下」。
- 所需的文件尚未存於儲存庫中,亦未由使用者提供。請透過 網路搜尋官方文件,而非寄望模型記憶體中的資訊是最新的。
- 該任務涉及新增、升級、配置或匯入套件、SDK、框架、 外掛程式、CLI、模型、雲端資源或供應商整合。
- 該 API 發展迅速或對版本敏感:AI SDK、OpenAI/Anthropic/Google API、Next.js、React、Tailwind、Vite、Nitro、Drizzle、Prisma、Stripe、GitHub、 Slack、Notion、瀏覽器 API、部署平台、身份驗證函式庫,以及類似項目。
- 實作涉及身份驗證、OAuth 權限範圍、許可權、機密資訊、 Webhook、計費、付款、個人識別資訊 (PII)、加密、資料保留、資料遷移、 重試、速率限制、配額、快取、部署或合規性。
- 錯誤訊息可能提及功能已廢棄、未知選項、缺少匯出項目、 配置無效、不支援的欄位、預設值變更,或版本不符。
- 一個儲存庫可能包含本地文件、ADR、生成的架構、OpenAPI 規格、路由/動作 登錄表、設計系統文件,或套件層級的 README,這些都可能定義 合約。
- 此選擇若要逆轉將代價高昂:公開的資料傳輸格式、資料庫架構、 遷移策略、持久化識別碼、事件名稱、客戶可見的行為,或 外部自動化合約。
- 你發現自己正要為外部 API 寫下「通常」、「大概」、「我認為」、「依 記憶所及」,或是從模型記憶中複製的程式碼。
什麼才算作文件
請使用現有最具權威性的來源:
- 本地儲存庫文件、規格說明、ADR、資料結構、生成的類型、套件 README,以及 針對專案特定行為的測試。
- 官方產品文件、API 參考、遷移指南、變更日誌、發行 說明,以及第三方行為的 SDK 原始碼/類型。若尚未掌握確切網址,可透過網路 搜尋取得這些資源。
- 版本的套件註冊表元資料。在新增依賴項之前,請執行
npm view,version pnpm view,或其生態系統 中的等效工具,然後閱讀該主要版本的文件。version - 當官方文件不完整時,可參考原始碼或類型定義。請將此 視為證據,而非流傳的軼聞。
若已有官方文件,請避免將 Stack Overflow、過時的部落格文章、隨機程式碼片段以及記憶中的內容作為主要 來源。僅在已知權威性規範後,才將社群來源用於除錯 症狀。
必備工作流程
- 確定確切的適用範圍:套件名稱、已安裝版本、目標版本、 提供者端點、CLI 指令、設定檔、本地輔助程式、架構或產品 功能。
- 除非相關文件
已存在於本地端,或使用者提供了網址,否則應在網路上搜尋最新的官方文件。請使用針對性搜尋,例如
,official docs ,或migration guide .API reference - 開啟並閱讀最接近該介面的文件。針對內部程式碼,應優先使用 本機文件,其次才是官方上游文件。對於新套件,在撰寫匯入、 設定或安裝指令之前,請先確認 最新版本。
- 萃取執行該任務所需的少量關鍵資訊:選項名稱、匯入項目、生命週期 規則、預設行為、破壞性變更、限制、權限,以及 當前主要版本的範例。
- 利用這些事實進行實作或解答。若文件與現有 程式碼有衝突,請檢查本機程式碼路徑並指出差異之處。
- 透過最簡潔有效的檢查進行驗證:類型檢查、測試、編譯、CLI 模擬執行、 API 架構驗證,或本地重現。
- 在最終解答中,若相關證據會影響建議或實作,請明確標示所參考的 文件或本地檔案名稱。
必須觸發文件更新的範例
- 「為此應用程式新增 Tailwind。」在建立設定檔或假設舊版 PostCSS 設定之前, 請先從網路上查閱當前的 Tailwind 主要版本及其安裝 文件。
- 「使用 AI SDK 進行回應串流。」請從官方文件中驗證當前的 AI SDK 主要版本、 匯入項目、提供者套件名稱、串流輔助函式,以及伺服器/執行時 範例。
- 「設定 Stripe Webhooks。」在編寫程式碼前,請先閱讀 Stripe 最新的簽名驗證、 事件重試、端點密鑰,以及框架正文解析相關文件。
- 「修復此 Next.js 快取錯誤。」在假設快取失效語義之前,請先閱讀已安裝 Next.js 主要版本 及路由模式的相關文件。
- 「新增 Drizzle 遷移檔。」在產生檔案之前,請先閱讀當前的 Drizzle 套件文件以及現有儲存庫的 遷移規範。
- 「建立 GitHub Action。」在編寫程式碼前,請先閱讀官方的 Actions 語法與權限文件,
特別是關於
pull_request,workflow_run、OIDC、憑證及建構產物等內容。 - 「為什麼這個 OAuth 流程會失敗?」在修改程式碼之前,請先閱讀提供者的權限範圍、重定向 URI、 PKCE、代幣刷新以及應用程式驗證相關文件。
- 「使用此儲存庫的 plan/comment/action 系統。」在設計端點或屬性之前,請先閱讀本地文件、路由/動作 註冊表、架構及測試。
- 「升級 Vite/Nitro/React。」在編輯設定檔或匯入檔案之前,請先閱讀遷移指南,以確認確切的目標 主要版本。
- 「我們應該使用哪種模型?」在提出建議前,請先閱讀當前供應商的模型文件、定價/限制 頁面以及 SDK 範例。
何時只需快速瀏覽本地文件即可
無需為每個微小修改而瀏覽網路。當答案已存在於儲存庫中時——例如現有的輔助函式用法、鄰近的測試、 類型化介面、生成的客戶端、ADR 或套件的 README—— 只需快速瀏覽本地文件即可。 但若任務 取決於外部工具、套件、提供者或現行產品行為,網路 搜尋通常是正確的第一步。針對簡單的語言語法、錯字修正、 格式調整,或無外部契約的獨立程式碼,請照常處理。
若無法取得文件
若因網路連線、授權問題或缺少本地檔案而無法查閱文件,請在 依賴記憶之前明確說明此情況。縮小不確定性範圍,若可行則檢視原始碼或 類型,並避免將結果呈現為「已確認為最新」。
---
name: read-the-damn-docs
description: Forces web searches and reading of official docs before implementing, integrating, or debugging third-party APIs, libraries, and services to ensure accuracy and avoid guesswork.
---
# Read The Damn Docs
Do not guess where authoritative docs can answer the question. The most common
right move is to web-search for the current official docs, open the relevant
pages, and read them before coding. For APIs, versions, provider behavior,
config, limits, lifecycle hooks, or security-sensitive flows, ground the answer
in what the docs actually say.
## Docs-First Triggers
Read docs before proceeding when any of these are true:
- The user asks for "latest", "current", "official", "supported", "best
practice", "recommended", "today", "now", or "look it up".
- The needed docs are not already in the repo or supplied by the user. Search
the web for the official docs rather than hoping model memory is current.
- The task adds, upgrades, configures, or imports a package, SDK, framework,
plugin, CLI, model, cloud resource, or provider integration.
- The API is fast-moving or version-sensitive: AI SDKs, OpenAI/Anthropic/Google
APIs, Next.js, React, Tailwind, Vite, Nitro, Drizzle, Prisma, Stripe, GitHub,
Slack, Notion, browser APIs, deployment platforms, auth libraries, and similar.
- The implementation depends on auth, OAuth scopes, permissions, secrets,
webhooks, billing, payments, PII, encryption, data retention, migrations,
retries, rate limits, quotas, caching, deploys, or compliance.
- An error mentions deprecation, unknown options, missing exports, invalid
config, unsupported fields, changed defaults, or version mismatch.
- A repo has local docs, ADRs, generated schemas, OpenAPI specs, route/action
registries, design-system docs, or package-level READMEs that could define the
contract.
- The choice is expensive to reverse: public wire formats, database schema,
migration strategy, persistent IDs, event names, customer-visible behavior, or
external automation contracts.
- You catch yourself about to write "usually", "probably", "I think", "from
memory", or code copied from model memory for an external API.
## What Counts As Docs
Use the most authoritative source available:
- Local repo docs, specs, ADRs, schemas, generated types, package READMEs, and
tests for project-specific behavior.
- Official product docs, API references, migration guides, changelogs, release
notes, and SDK source/types for third-party behavior. Find these with web
search when you do not already have the exact URL.
- Package registry metadata for versions. Before adding a dependency, run
`npm view <pkg> version`, `pnpm view <pkg> version`, or the ecosystem
equivalent, then read the docs for that major version.
- Source code or type definitions when official docs are incomplete. Treat this
as evidence, not folklore.
Avoid Stack Overflow, old blog posts, random snippets, and memory as the primary
source when official docs exist. Use community sources only to debug symptoms
after the authoritative contract is known.
## Required Workflow
1. Identify the exact surface: package name, installed version, target version,
provider endpoint, CLI command, config file, local helper, schema, or product
feature.
2. Search the web for the current official docs unless the relevant docs are
already local or the user supplied a URL. Use targeted searches such as
`<product> <feature> official docs`, `<package> migration guide`, or
`<provider> API reference`.
3. Open and read the docs closest to that surface. Prefer local docs first for
internal code, then official upstream docs. For new packages, verify the
latest version before writing imports, config, or install commands.
4. Extract the few facts needed for the task: option names, imports, lifecycle
rules, default behavior, breaking changes, limits, permissions, and examples
for the current major version.
5. Implement or answer using those facts. If the docs conflict with existing
code, inspect the local code path and call out the discrepancy.
6. Verify with the smallest useful check: typecheck, tests, build, CLI dry run,
API schema validation, or a local reproduction.
7. In the final answer, name the docs or local files consulted when that
evidence affects the recommendation or implementation.
## Examples That Must Trigger Docs
- "Add Tailwind to this app." Check the current Tailwind major and its install
docs from the web before creating config files or assuming old PostCSS setup.
- "Use the AI SDK to stream responses." Verify the current AI SDK major,
imports, provider package names, streaming helpers, and server/runtime
examples from official docs.
- "Wire up Stripe webhooks." Read Stripe's current signature verification,
event retry, endpoint secret, and framework body-parsing docs before coding.
- "Fix this Next.js caching bug." Read the docs for the installed Next.js major
and router mode before assuming cache invalidation semantics.
- "Add Drizzle migrations." Read the current Drizzle kit docs and existing repo
migration conventions before generating files.
- "Create a GitHub Action." Read official Actions syntax and permissions docs,
especially for `pull_request`, `workflow_run`, OIDC, tokens, and artifacts.
- "Why does this OAuth flow fail?" Read the provider's scopes, redirect URI,
PKCE, token refresh, and app verification docs before changing code.
- "Use this repo's plan/comment/action system." Read local docs, route/action
registries, schemas, and tests before inventing endpoints or props.
- "Upgrade Vite/Nitro/React." Read the migration guide for the exact target
major before editing config or imports.
- "What model should we use?" Read current provider model docs, pricing/limits
pages, and SDK examples before recommending.
## When A Quick Local Read Is Enough
Do not browse the web for every tiny edit. A docs pass can be local and brief
when the answer is already in the repo: existing helper usage, nearby tests,
typed interfaces, generated clients, ADRs, or package READMEs. But if the task
depends on an external tool, package, provider, or current product behavior, web
search is usually the right first step. For trivial language syntax, typo fixes,
formatting, or self-contained code with no external contract, proceed normally.
## If Docs Are Unavailable
If network access, auth, or missing local files prevents reading the docs, say
that plainly before relying on memory. Narrow the uncertainty, inspect source or
types if available, and avoid presenting the result as confirmed-current.
所有檔案
0 個檔案安裝 read-the-damn-docs
請下載並將技能檔案解壓縮至您的 .claude/skills/ 目錄中。
下載 ZIP複製儲存庫並將技能檔案複製到您的專案中。
git clone https://github.com/BuilderIO/skills/tree/main/skills/read-the-damn-docs # Copy SKILL.md to your .claude/skills/ directory
複製





首頁
