Token导航 LogoToken导航TokenDH.com
开发执行命令github未标认证来源可访问许可证需确认审计通过

instrument-existing-agent-with-prefactor-sdkinstrument existing Agent with prefactor SDK 命令行

Agent Skill

instrument-existing-agent-with-prefactor-sdk 用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要围绕仓库状态、代码变更或协作事项进行整理时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

894

周安装

38

GitHub Stars

2

下载量

313
CodexClaudeCursorGemini CLI

安装说明

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

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

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

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

命令行安装

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

skills.shnpx skills
npx skills add https://github.com/prefactordev/typescript-sdk --skill instrument-existing-agent-with-prefactor-sdk

简介

instrument-existing-agent-with-prefactor-sdk 用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息。

  • 适用于围绕仓库状态、代码变更或协作事项进行整理的任务场景。
  • 支持对 GitHub 相关协作信息和代码变更的处理与跟踪。
  • 安装前需确认权限范围、维护状态及是否触发联网或命令执行。
  • 适用宿主包括 Codex、Claude、Cursor、Gemini CLI,接入前应确认版本、权限和运行环境要求。

SKILL.md

Instrument Existing Agent With Prefactor SDK

Instrument a working agent that was built without Prefactor.

Core principle: instrument boundaries, not business logic.

Quick Start

  1. Bootstrap Prefactor resources with skills/bootstrap-existing-agent-with-prefactor-cli/SKILL.md.
  2. Install required Prefactor packages with the project's existing package manager (bun, npm, pnpm, or yarn).
  3. Identify runtime path: built-in adapter (@prefactor/langchain, @prefactor/ai, @prefactor/openclaw) or custom @prefactor/core adapter.
  4. Add one top-level run span and child spans around LLM/tool boundaries.
  5. Preserve context propagation and package-prefixed span types.
  6. Record error metadata and rethrow original errors.
  7. Finish spans on success, error, cancel, and stream terminal paths.
  8. Verify in your project's build/test/typecheck flow.

Prerequisite

Before instrumentation, ensure these runtime credentials are set from CLI bootstrap output:

  • PREFACTOR_API_URL
  • PREFACTOR_API_TOKEN
  • PREFACTOR_AGENT_ID

Use the created agent_id for PREFACTOR_AGENT_ID.

Also ensure dependencies are installed from npm via the project's package manager:

  • one of @prefactor/langchain, @prefactor/ai, @prefactor/openclaw
  • @prefactor/core only when no built-in adapter is available

Coding Tool Trigger Phrases

If the user asks for any of these, apply this skill:

  • "instrument this existing agent"
  • "this agent already works, add prefactor tracing"
  • "wrap this existing langchain/ai agent with prefactor"
  • "add tracing for tool calls and runs"
  • "tool calls are missing in my coding tool timeline"

Use With Custom Provider Skill

Sometimes you need both skills.

  • If the framework/provider is already supported by a Prefactor adapter, use this skill directly.
  • If the framework/provider is not supported yet, first use skills/create-provider-package-with-core/SKILL.md to build a custom adapter, then use this skill to instrument the existing agent with that adapter.

Recommended sequence when unsupported:

  1. Create provider adapter with @prefactor/core.
  2. Integrate adapter into the existing agent entrypoint.
  3. Validate run/llm/tool/error spans in real executions.

Implementation Rules

  • Prefer built-in adapters before low-level @prefactor/core:

- LangChain -> @prefactor/langchain - AI SDK -> @prefactor/ai - OpenClaw -> @prefactor/openclaw

  • Import init, withSpan, and shutdown from the same selected adapter package (@prefactor/ai or @prefactor/langchain) when an adapter exists.
  • Do not mix adapter init with withSpan/shutdown imported from @prefactor/core unless you pass an explicit tracer to withSpan.
  • Why: mixed helper imports can lead to No active tracer found (for example with nested package instances), which drops manual custom spans.
  • Keep imports package-local and explicit, for example:
import { init, withSpan, shutdown } from '@prefactor/ai';
// or
import { init, withSpan, shutdown } from '@prefactor/langchain';
  • This mixed-import tracer risk applies to adapter-style flows (@prefactor/ai, @prefactor/langchain) and not to the @prefactor/openclaw plugin runtime model.
  • If a built-in adapter does not exist, follow skills/create-provider-package-with-core/SKILL.md.
  • Keep provider span types package-prefixed (langchain:*, ai-sdk:*, openclaw:*).
  • Run nested work inside active context so parent/child trace trees stay intact.
  • Capture input/output safely (redact secrets, enforce truncation limits).
  • Instrumentation must never crash user code.

Verification

Run equivalent project verification commands (for example build, typecheck, and tests).

Also run at least one real agent request and confirm:

  • top-level run span exists
  • child llm/tool spans are correctly nested
  • terminal status appears for success and failure

References

  • For coding-tool-oriented keyword coverage and trigger wording, read references/coding-tool-triggers.md.
  • For an execution checklist and failure diagnostics, read references/instrumentation-checklist.md.

Common Mistakes

  • Instrumenting every helper instead of boundaries.
  • Using generic span types.
  • Swallowing exceptions after logging.
  • Missing stream cancel/error completion paths.

适合场景

01

用户想查找某类 Agent Skill 时

02

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

03

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

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

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

能力 4

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

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

平台分布

Codex

39.96%
按下载量换算125

Claude

28.81%
按下载量换算90

Cursor

17.75%
按下载量换算56

Gemini CLI

10.53%
按下载量换算33

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

执行命令

安装流程涉及命令执行,可能通过 npx skills add https://github.com/prefactordev/typescript-sdk --skill instrument-existing-agent-with-prefactor-sdk 联网下载 Skill 或依赖。用户安装前应确认命令来源、仓库内容和执行环境。

安装前确认

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

来源信息

继续浏览同类 Skills