SuperAPI AI 工具集

api documentation lookup

编程与开发

查看项目

更新于 10-16 10:44

技能介绍

用途

该技能用于查找 Effect-TS 的 API 文档。当用户提出“look up Effect API”“check the Effect docs”“find Effect function signature”“what does Effect.X do”等需求时,可通过 WebFetch 直接从官方文档站点检索信息。

主要能力

  • 从官方文档站点 https://effect-ts.github.io/effect/ 获取 API 文档。
  • 支持核心 effect 包的模块,URL 模式为: https://effect-ts.github.io/effect/effect/{Module}.ts.html 涉及的常见模块包括 Effect、Schema、Stream、Layer、Context、Schedule、Fiber、Queue、Ref、Scope、Option、Either、Chunk、HashMap、HashSet、Duration、Config、ConfigProvider、Match、Data、Cause、Exit、Random、Clock、Tracer、Metric、Logger、Sink、PubSub、Deferred、Semaphore、Request、RequestResolver、Cache、TestClock、Runtime、ManagedRuntime。 例如: Effect:https://effect-ts.github.io/effect/effect/Effect.ts.html Schema:https://effect-ts.github.io/effect/effect/Schema.ts.html Stream:https://effect-ts.github.io/effect/effect/Stream.ts.html Layer:https://effect-ts.github.io/effect/effect/Layer.ts.html
  • 支持 @effect/* 作用域包,URL 模式为: https://effect-ts.github.io/effect/{package-name}/{Module}.ts.html 例如: @effect/platform 的 HttpClient:https://effect-ts.github.io/effect/platform/HttpClient.ts.html @effect/platform 的 FileSystem:https://effect-ts.github.io/effect/platform/FileSystem.ts.html @effect/platform 的 KeyValueStore:https://effect-ts.github.io/effect/platform/KeyValueStore.ts.html @effect/cli 的 Command:https://effect-ts.github.io/effect/cli/Command.ts.html @effect/sql 的 SqlClient:https://effect-ts.github.io/effect/sql/SqlClient.ts.html

使用方式

  1. 识别模块:确定目标 API 属于哪个模块,例如 Effect.map → Effect 模块,Schema.Struct → Schema 模块,Stream.fromIterable → Stream 模块,Layer.provide → Layer 模块。
  2. 构造 URL:按上述 URL 规则拼接。例如查询 Effect.retry 使用 https://effect-ts.github.io/effect/effect/Effect.ts.html;查询 Schema.transform 使用 https://effect-ts.github.io/effect/effect/Schema.ts.html。
  3. 使用针对性提示词调用 WebFetch 提取所需信息。示例: WebFetch( url: "https://effect-ts.github.io/effect/effect/Effect.ts.html", prompt: "Find the documentation for Effect.retry. Include the function signature, description, parameters, and any usage examples." )

示例查询

  • 查询特定函数:“What are the parameters for Effect.retry?” → 在 Effect 模块页面中查找 retry 函数的完整类型签名、参数、选项和用法示例。
  • 查询类型/接口:“What fields does Schedule have?” → 在 Schedule 模块页面中获取 Schedule 类型及其主要组合子,如 exponential、spaced、recurs 等。
  • 查询模块概览:“What functions are available in the Stream module?” → 在 Stream 模块页面中列出主要函数类别及简要说明。
  • 查询相关函数:“What are all the catch* functions in Effect?” → 在 Effect 模块页面中查找以 catch 开头的错误处理函数,如 catchAll、catchTag、catchTags、catchSome 等及其签名和用途。

提示词模式

  • 查询函数签名:“Find the complete type signature for {functionName}. Include all overloads if they exist.”
  • 查询用法示例:“Find documentation and code examples for {functionName}. Focus on practical usage patterns.”
  • 理解参数:“Explain the parameters and options for {functionName}. What does each parameter do?”
  • 查找相关函数:“List all functions related to {topic} in this module. Include brief descriptions.”
  • 模块概览:“Provide an overview of this module. What are the main categories of functions and types?”

提示与最佳实践

  • 提示词要具体,明确索取签名、示例或参数。
  • 选择正确的模块:Effect 函数在 Effect.ts,Schema 函数在 Schema.ts,依此类推。
  • 查看相关函数:文档中包含 “See also” 链接。
  • 查找示例:大多数函数附带实用代码示例及预期输出。
  • 注意版本信息:函数会标注 “Since v2.0.0” 之类的版本信息。
  • 文档索引位于 https://effect-ts.github.io/effect/ ,可在不确定模块归属时用于发现可用包和模块。
  • 注意重载:许多 Effect 函数有多个签名。
  • 查阅 “Since” 标注以确认 API 在当前 Effect 版本中是否可用。

附加资源

除 API 签名外,更完整的 Effect 文档(教程、指南和深入说明)可查阅 ${CLAUDE_PLUGIN_ROOT}/references/llms-full.txt。

限制

资料未提供该技能的收费、价格、平台支持范围或效果数据,暂未提供相关信息。