doc-driven-development

Original🇨🇳 Chinese
Translated

Documentation-driven development specification that requires Agent to consult official documentation and examples before generating code or fixing bugs, including API verification processes, search strategies and MCP invocation rules. It is applicable to scenarios such as accessing third-party libraries, troubleshooting API errors, and version changes.

8installs
Added on

NPX Install

npx skill4agent add qiao-925/qiao-skills doc-driven-development

SKILL.md Content (Chinese)

View Translation Comparison →

Documentation-Driven Development Specification

When generating code or fixing bugs, consult official documentation and examples first before starting implementation.

⚠️ Core Mandatory Requirements

Scenarios Where Documentation Must Be Consulted

  • When implementing new features, connecting to third-party library APIs, or troubleshooting API errors, consult official documentation first
  • When encountering
    AttributeError
    /
    TypeError
    / uncertain version changes, must verify API definitions and examples
  • For internal APIs encapsulated by the project itself, you can skip as appropriate

Agent Execution Steps

  1. Stop guessing: Clarify the name and version of the API/module to be queried
  2. Consult documentation: Prioritize using
    Context7
    to obtain official documentation; if unavailable, use
    DuckDuckGo
    to search for official sources and conduct secondary verification
  3. Implement based on documentation: Implement or fix code according to the parameters, return values and examples in the documentation

MCP Invocation Baseline (Documentation Query Scenarios)

  • For documentation/API issues, prioritize using
    Context7
    , and use
    DuckDuckGo
    for latest announcements or entry information
  • Call at most one external service per round; if multiple tools are really needed, call them serially and explain the reasons
  • Keep queries as minimal and necessary as possible (keywords, number of results, time window, tokens)
  • When 429/rate limiting occurs, back off for 20 seconds and narrow the scope before retrying
  • Attach "Tool Call Briefing" in the output (tool, input summary, parameters, time, source, retry)
  • Offline first by default, do not upload sensitive information, comply with robots/ToS and privacy constraints

AI Agent Behavior Requirements

Problem Identification

Problem TypeFeatureHandling Method
API does not exist
AttributeError: 'X' has no attribute 'Y'
Find the correct API
Parameter error
TypeError: unexpected keyword argument
Find the correct parameters
Abnormal behaviorResults do not meet expectationsFind the correct usage
Version issueAPI changed after a certain versionFind version differences

Collect Error Information

Must collect:
  • Complete error stack
  • Relevant code snippets
  • Version of the library/framework used

Implement Based on Documentation (Guessing is Prohibited)

python
# 错误:基于猜测实现
index.query(question, top_k=10)  # 可能参数名不对

# 正确:基于文档实现
# 查阅文档后确认正确的参数名
index.query(question, similarity_top_k=10)

Verification After Fix

  • Run tests to confirm the fix
  • Check if new problems are introduced
  • Verify performance in different scenarios

References

  • references/api-verification.md
    - Detailed description of API verification process (problem identification, documentation consultation, implementation of fixes)
  • references/search-strategy.md
    - Documentation search strategy and question guidance
  • references/mcp-usage-rules.md
    - MCP invocation rules (tool selection, rate limiting, security boundary, failure degradation and traceable output)