prefactor-skill-selector

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Prefactor Skill Selector

Prefactor Skill 选择器

Use this file as a router for Prefactor skills.
使用本文件作为Prefactor Skills的路由工具。

Available Skills

可用Skills

  • skills/bootstrap-existing-agent-with-prefactor-cli/SKILL.md
    : bootstrap Prefactor resources for an existing agent using CLI (
    profile
    ,
    environment
    ,
    agent
    ,
    agent_instance
    ) and prepare runtime env vars/package choice.
  • skills/instrument-existing-agent-with-prefactor-sdk/SKILL.md
    : instrument an existing agent with Prefactor SDK so coding tools can see runs, llm/tool spans, token usage, and failures.
  • skills/create-provider-package-with-core/SKILL.md
    : create a new provider package as a thin adapter over
    @prefactor/core
    with core-first boundaries and tracing conventions.
  • skills/bootstrap-existing-agent-with-prefactor-cli/SKILL.md
    :通过CLI为现有Agent初始化Prefactor资源(
    profile
    environment
    agent
    agent_instance
    ),并准备运行时环境变量/包选择。
  • skills/instrument-existing-agent-with-prefactor-sdk/SKILL.md
    :使用Prefactor SDK为现有Agent添加埋点,以便编码工具可以查看运行情况、LLM/工具调用链路、Token使用量以及失败信息。
  • skills/create-provider-package-with-core/SKILL.md
    :基于@prefactor/core创建新的提供商包,作为轻量适配器,遵循核心优先的边界和追踪约定。

Selection Rules

选择规则

  • If the request is about provisioning Prefactor resources via CLI for an existing app, load
    skills/bootstrap-existing-agent-with-prefactor-cli/SKILL.md
    first.
  • If the request is about adding telemetry to an existing agent without rewriting business logic, load
    skills/instrument-existing-agent-with-prefactor-sdk/SKILL.md
    .
  • If the request is about creating a custom provider adapter with
    @prefactor/core
    , load
    skills/create-provider-package-with-core/SKILL.md
    .
  • 如果需求是通过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

Default Workflow

默认工作流

When instrumenting an existing agent, default to this order:
  1. Run
    skills/bootstrap-existing-agent-with-prefactor-cli/SKILL.md
    to set up resources (
    environment
    ,
    agent
    ,
    agent_instance
    ).
  2. Install required Prefactor npm package(s) via the project's package manager.
  3. Choose the matching adapter package if available (
    @prefactor/langchain
    ,
    @prefactor/ai
    ,
    @prefactor/openclaw
    ).
  4. For adapter-style instrumentation (
    @prefactor/langchain
    or
    @prefactor/ai
    ), keep
    init
    ,
    withSpan
    , and
    shutdown
    imports from that same adapter package (or pass an explicit tracer when using core
    withSpan
    ).
  5. If no matching adapter package exists, use
    skills/create-provider-package-with-core/SKILL.md
    .
  6. Instrument the existing agent with
    skills/instrument-existing-agent-with-prefactor-sdk/SKILL.md
    .
为现有Agent添加埋点时,默认遵循以下步骤:
  1. 运行
    skills/bootstrap-existing-agent-with-prefactor-cli/SKILL.md
    来设置资源(
    environment
    agent
    agent_instance
    )。
  2. 通过项目的包管理器安装所需的Prefactor npm包。
  3. 如果有匹配的适配器包(
    @prefactor/langchain
    @prefactor/ai
    @prefactor/openclaw
    ),选择该包。
  4. 对于适配器式埋点(
    @prefactor/langchain
    @prefactor/ai
    ),从同一适配器包导入
    init
    withSpan
    shutdown
    (或在使用核心
    withSpan
    时传入显式的追踪器)。
  5. 如果没有匹配的适配器包,使用
    skills/create-provider-package-with-core/SKILL.md
  6. 使用
    skills/instrument-existing-agent-with-prefactor-sdk/SKILL.md
    为现有Agent添加埋点。