Token导航 LogoToken导航TokenDH.com
研究检索操作浏览器github未标认证来源可访问许可证需确认审计通过

prompt-apiprompt API 搜索

Agent Skill

用于辅助 API 设计、接口文档、请求响应结构和服务集成说明。它适合让 Agent 梳理 endpoint、生成 OpenAPI 草稿、检查字段命名、整理错误码或辅助前后端联调。使用时需要确认真实业务语义、鉴权方式、分页和错误处理规则;涉及生成接口文档时,应避免凭空补字段,最好从现有代码、schema 或接口样例中提取事实。

总安装

1,909

周安装

78

GitHub Stars

27

下载量

612
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:prompt-api(prompt API 搜索)
来源仓库:https://github.com/webmaxru/agent-skills
仓库路径:skills/prompt-api
安装命令:
npx skills add https://github.com/webmaxru/agent-skills --skill prompt-api
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/webmaxru/agent-skills --skill prompt-api

简介

用于辅助 API 设计、接口文档、请求响应结构和服务集成说明。

  • 适合让 Agent 梳理 endpoint、生成 OpenAPI 草稿或整理错误码。
  • 通过安装命令添加,需确认真实业务语义和鉴权方式。
  • 生成接口文档时应从现有代码或样例中提取事实,避免凭空补字段。
  • prompt-api 属于研究检索类 Skill,可作为该场景下的辅助能力补充。

SKILL.md

Prompt API

Procedures

Step 1: Identify the integration surface

  1. Inspect the workspace for browser entry points, UI handlers, and any existing AI abstraction layer.
  2. Execute node scripts/find-frontend-targets.mjs. to inventory likely frontend files and existing Prompt API usage when a Node runtime is available.
  3. If a Node runtime is unavailable, inspect the nearest package.json, HTML entry point, and framework entry files manually to identify the browser app boundary.
  4. If the workspace contains multiple frontend apps, prefer the app that contains the active route, component, or user-requested feature surface.
  5. If the inventory still leaves multiple plausible frontend targets, stop and ask the user which app should receive the Prompt API integration.
  6. If the project is not a browser web app, stop and explain that this skill does not apply.

Step 2: Confirm Prompt API viability

  1. Read references/prompt-api-reference.md before writing code.
  2. Read references/examples.md when the feature needs a spec-valid message shape for text, multimodal, prefix, or tool-enabled sessions.
  3. Read references/compatibility.md when the feature must support multiple browser generations or decide between native support and polyfills.
  4. Read references/polyfills.md when the feature needs concrete package installation or backend configuration examples for Prompt API or Task API polyfills.
  5. Verify that the feature runs in a secure window context and that the language-model permissions-policy allows access from the current frame.
  6. If the integration must run in a Web Worker or other non-window context, stop and explain the platform limitation.
  7. Choose the session shape the feature needs: prompt(), promptStreaming(), initialPrompts, append(), measureContextUsage(), tools, or responseConstraint.
  8. If the project uses TypeScript, add or preserve typings that cover the Prompt API surface used by the project.

Step 3: Implement a guarded session wrapper

  1. Read assets/language-model-service.template.ts and adapt it to the framework, state model, and file layout in the workspace.
  2. Gate session creation behind LanguageModel.availability() using the same creation options that the feature will use at runtime, including expected modalities and tools.
  3. Create sessions only after user activation when model download or instantiation may begin.
  4. Use AbortController for cancelable prompts and call destroy() when the session is no longer needed.
  5. If the feature runs in a cross-origin iframe, require allow="language-model" on the embedding iframe.
  6. Do not depend on params(), topK, or temperature; the spec marks them EXPERIMENTAL and extension-only, so portable web page integrations must not require them.
  7. Treat availability() as a passive capability check: if it reports downloading before user activation, do not assume the current page initiated that download or lock the UI into an app-started busy state.

Step 4: Wire UX and fallback behavior

  1. Surface distinct states for unavailable devices, model download, ready sessions, and in-flight prompts.
  2. If download progress matters to the feature, attach a monitor listener during LanguageModel.create() and render progress in the UI.
  3. Keep a non-AI fallback for unsupported browsers, unsupported devices, or blocked iframe contexts.
  4. If the feature needs structured output, pass a JSON Schema through responseConstraint, use omitResponseConstraintInput only when the prompt already carries the required format instructions, and parse the returned string before using it.
  5. Respect prompt-shape validation rules: system messages belong in initialPrompts, prefix: true applies only to the final assistant message, and assistant message content must remain text-only.
  6. If availability() reports downloading before the app has called create(), present that as informational browser state rather than a page-owned active download, and keep controls usable unless the app itself is busy.

Step 5: Validate behavior

  1. Test short responses with prompt() and long responses with promptStreaming() when applicable.
  2. Verify that repeated prompts reuse context intentionally, that destroyed sessions are not reused, and that the app uses compatibility checks for context measurement and overflow handling across browser versions.
  3. Read references/troubleshooting.md if the integration throws NotSupportedError or behaves differently across frames or execution contexts.
  4. Run the workspace build, typecheck, or tests after editing.

Error Handling

  • If LanguageModel is missing, prefer progressive enhancement with a maintained Prompt API polyfill or a non-AI fallback instead of inventing a custom compatibility layer.
  • If availability() returns downloading before the app has called create(), treat it as passive browser state. Only surface live progress and block prompt submission when the app itself has started LanguageModel.create().
  • If availability() or prompt() throws NotSupportedError, align the creation and prompt options with the actual modalities, languages, message roles, and tools used by the feature.
  • If the feature must run in Web Workers, redirect the integration to a window context because the Prompt API is not available in workers.
  • If the feature lives in a cross-origin iframe, require allow="language-model" from the embedding page before continuing.
  • If node scripts/find-frontend-targets.mjs. cannot run, identify the browser app boundary manually and continue only after a single target app is clear.

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

36.37%
按下载量换算223

Claude

30.19%
按下载量换算185

Cursor

16.61%
按下载量换算102

Gemini CLI

10.05%
按下载量换算62

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

操作浏览器

该 Skill 可能涉及浏览器控制能力,使用时可能读取或操作网页内容,需要在受控环境中确认权限边界。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills