关于 prefactor-skill-selector
用于为 Prefactor 任务选择对应技能的路由技能,覆盖 Agent 设置、遥测、适配器开发、合规元数据、追踪摘要和运行分析,并说明默认操作顺序。
主要功能
- 01按请求路由至 Prefactor 技能
- 02CLI 设置与凭据指引
- 03SDK 和适配器埋点指引
- 04Provider 包创建说明
- 05合规与追踪模板路由
- 06Agent 运行分析路由
适用场景
- 01选择为现有 Agent 添加遥测的技能
- 02设置 Prefactor 资源与凭据
- 03为 span 添加合规元数据
- 04调查异常的 Agent 运行
安装
复制下面的命令,在终端中运行。
$
npx skills add https:/ / github.com/ prefactordev/ typescript-sdk --skill prefactor-skill-selector安装后在 Claude Code 中输入/prefactor-skill-selector确认已加载。
详细介绍
Prefactor 技能选择器
使用此文件作为 Prefactor 技能的路由指南。
可用技能
skills/bootstrap-existing-agent-with-prefactor-cli/SKILL.md:使用prefactor setup/prefactor setup --create配置 Prefactor 凭据、写入环境变量值并选择软件包。skills/instrument-existing-agent-with-prefactor-sdk/SKILL.md:使用 Prefactor SDK 为现有 Agent 添加监测,以便编码工具查看运行情况、LLM/工具跨度、令牌用量和故障。skills/create-provider-package-with-core/SKILL.md:基于@prefactor/core创建新的提供方软件包,将其作为轻量适配器,并遵循 core 优先的边界和追踪惯例。skills/report-agent-risk-data/SKILL.md:在 Agent 已完成监测后,为跨度类型填充data_risk字段,以用于合规跟踪和数据治理。skills/write-span-summary-templates/SKILL.md:在跨度类型架构上编写 Liquid 显示模板,让 Prefactor UI 中的追踪信息显示为易读的单行摘要。skills/inspect-agent-run-with-prefactor-cli/SKILL.md:根据 CLI 跨度数据,对 Prefactor Agent 运行进行根因分析;在 Agent 自身代码库中运行(用户需提供实例 ID 和问题表现)。
选择规则
- 如果请求涉及通过 CLI 配置 Prefactor 资源或凭据,请先加载
skills/bootstrap-existing-agent-with-prefactor-cli/SKILL.md。 - 如果请求涉及为现有 Agent 添加遥测功能,且不改写业务逻辑,请加载
skills/instrument-existing-agent-with-prefactor-sdk/SKILL.md。 - 如果请求涉及使用
@prefactor/core创建自定义提供方适配器,请加载skills/create-provider-package-with-core/SKILL.md。 - 如果请求涉及为跨度类型添加风险或合规元数据,请加载
skills/report-agent-risk-data/SKILL.md。 - 如果请求涉及跨度摘要模板、显示模板、架构上的 Liquid 模板,或让 Prefactor UI 中的跨度更易读,请加载
skills/write-span-summary-templates/SKILL.md。 - 如果请求涉及对异常、出乎意料、成本高昂、不完整或被点踩的 Agent 运行进行根因分析,请加载
skills/inspect-agent-run-with-prefactor-cli/SKILL.md。
默认工作流
为现有 Agent 添加监测时,默认按以下顺序进行:
- 确认用户已运行
prefactor login。 - 运行
skills/bootstrap-existing-agent-with-prefactor-cli/SKILL.md(prefactor setup或prefactor setup --create --name ... --description ...)。 - 检查项目并安装匹配的 Prefactor 适配器(
@prefactor/langchain、@prefactor/ai、@prefactor/openclaw、@prefactor/claude)。 - 对于适配器式监测,从同一个适配器软件包导入
init、withSpan和shutdown(或者在使用 corewithSpan时传入显式追踪器)。 - 如果没有匹配的适配器软件包,请使用
skills/create-provider-package-with-core/SKILL.md。 - 使用
skills/instrument-existing-agent-with-prefactor-sdk/SKILL.md为现有 Agent 添加监测。 - 可选:使用
skills/report-agent-risk-data/SKILL.md填充合规元数据。 - 可选:使用
skills/write-span-summary-templates/SKILL.md添加易读的追踪摘要。
评论
支持 Markdown