跳到正文
TakoAPI
返回技能列表

doc-accurate-codegen

由 tobisamaa 提供

Calendar & Scheduling
343下载量由 clawskills.sh 提供
0浏览量
0 个赞登录后即可为这个技能点赞
—暂无评分
你的评分

简介

Generate code that references actual documentation, preventing hallucination bugs.

描述

该技能的功能

Enforces documentation-first code generation to prevent LLM hallucination bugs. Before writing any code, it loads relevant docs, extracts actual API signatures, and validates the output against them. Works for API usage, configuration files, and feature implementation.

Code generators that rely on training data alone will hallucinate method names and parameters; this skill forces every generation step to reference live documentation instead.

何时使用

  • Generating code for an unfamiliar third-party API
  • Writing configuration files for a new tool or framework
  • Updating code after a library releases breaking changes
  • Implementing a feature with an SDK you haven't used before
  • Verifying that a method signature hasn't been renamed or removed

示例工作流

输入

User asks: Write a Python script that uses the requests library to fetch paginated API results

智能体
  1. 1

    Fetches the official requests library documentation via web_fetch

  2. 2

    Extracts method signatures for Session, get, and response handling

  3. 3

    Generates Python code using exact parameter names and return types from docs

  4. 4

    Validates generated code against the extracted signatures

  5. 5

    Returns code with documentation source references and validation status

输出

Validated Python script with inline doc source references and confirmed API signatures

前置要求

  • BRAVE_API_KEY environment variable

安装

clawhub install tobisamaa/doc-accurate-codegen

运行 CLI 命令,或把这段提示词粘贴到 Claude Code、Cursor、Codex 或你在用的任意编程智能体里。

链接