跳到正文
cccskills
免费在 GitHub 公开中文介绍

llm-generation

本技能整理应用中的 LLM 生成流程,涵盖可复用且有版本的提示词、结构化输出、服务级模型选择和追踪,帮助区分业务流程标识与提示词标识。

原文查看原文说明

Use for application prompts, generateObject/generateText, model selection and generation tracing. Excludes provider adapters and agent snapshots.

lobehub/lobehub星标 83,506(GitHub 83,506 + cccskills 0)

实测评分 未实测

查看安装方法

适用场景

  • 为可复用提示词管理版本
  • 将结构化 LLM 输出接入服务
  • 追踪生成流程所用模型和执行状态

中文介绍

功能

本技能指导将应用中的 LLM 调用设计为可复用、可追踪的生成流程。建议将可复用提示词与 JSON 结构、结构名称及提示词版本一起管理;模型配置、输入验证、数据保存和错误处理则由所属服务负责。对于使用 generateObject 或 generateText 的流程,追踪记录应区分业务场景、提示词版本和结构名称,并让模型选择独立于提示词版本。技能还涵盖生成结果验证、失败时的处理方式,以及检查是否错误复用旧提示词或场景。

适用场景

在服务中添加新的 LLM 生成流程、希望共享较长提示词而不是将其写在服务代码中,或需要按业务流程追踪生成质量、耗时和成本时,可以使用本技能。

使用示例

  • “请整理这个生成流程的提示词和 JSON 结构,使其可以复用。”
  • “请为这次 LLM 调用设置合适的场景名称和提示词版本。”
  • “请检查结构化输出的验证方式和失败处理。”

注意事项

提供商适配器规范和智能体执行快照不在本技能范围内。

本介绍由 AI(OpenAI Codex)根据公开的 SKILL.md 撰写。准确的规格请查看下方原文。

文档检查

AI 根据 SKILL.md 的内容检查了需要注意的操作和使用前提。评分只依据实际运行的结果(实测对比)。

安全性发送数据、删除文件、执行命令等是否有说明
A良好资料没有描述删除数据或向外发送的步骤。
安装难易度所需工具和 API 密钥是否少且有说明
B部分不足资料提到 Bun 检查和多个软件包,但未提供安装说明。

不计入评分。 由 AI(OpenAI Codex)于 2026年10月26日 评估。仅供参考,安装前请同时查看原文。

如果您认为评估有误,请申请复核

请写明哪一项有误以及原因。无需登录。我们会对照 SKILL.md 重新评估,并在此处更新结果。

此表单受 reCAPTCHA 保护,适用 Google 的隐私权政策和服务条款。

包含的文件(2)

  • SKILL.md4.3 KB
  • agents/openai.yaml264 B

SKILL.md(原文)

安装前可以查看交给 AI 代理的指令内容。

LLM Generation

Implement business-facing LLM calls as explicit, independently observable workflows. Keep prompt identity, model policy, structured output, and tracing responsibilities separate.

Locate the Existing Boundary

Before editing a call, inspect:

  • packages/prompts for reusable application prompts;
  • apps/server/src/services/aiGeneration for the server-side structured generation wrapper;
  • packages/const/src/llmGenerationTracing.ts for scenario names;
  • packages/llm-generation-tracing for tracing option and registry behavior;
  • the owning service for model configuration and business-specific schemas.

Use agent-tracing for execution-snapshot diagnosis and agent-runtime-hooks for lifecycle hook behavior. Neither owns application LLM generation conventions.

Prompt Ownership and Versioning

  • Put a reusable generation contract in packages/prompts/src/chains: the message builder, JSON schema, schema name, and prompt version should be exported together. Do not leave substantial system prompts or model-facing input serialization embedded in a service.
  • Keep execution concerns in the owning server service: model configuration, AiGenerationService, tracing entity IDs, Zod validation, persistence, and business error handling do not belong in the prompt chain.
  • Keep each *_PROMPT_VERSION beside the prompt it versions and export both from the same module.
  • Format versions as v<major> or v<major>.<minor>, for example v1 or v1.2.
  • Store only the version in promptVersion. Do not include a feature or scenario prefix such as expertise-ingestion-v1; scenario carries workflow identity.
  • Bump the version whenever a prompt or output contract changes in a way that should create a separate evaluation or tracing cohort.
export const EXAMPLE_PROMPT_VERSION = 'v1';

export const EXAMPLE_SYSTEM_PROMPT = `...`;

Scenario Semantics

Treat scenario as the stable product workflow and lifecycle-stage partition, not as a label for a prompt, schema, model, or helper.

  • Check TRACING_SCENARIOS before adding a call.
  • Reuse a scenario only for the same user-visible workflow and lifecycle stage.
  • Add a scenario when the business action differs, even if another call shares its prompt or JSON schema. Editable goal-criteria drafting and run-time verification planning are different scenarios.
  • Never borrow a nearby scenario as a placeholder. Doing so contaminates latency, cost, success-rate, and quality data.
  • Pass schemaName for structured generation and relevant entity IDs when available.

Model Policy

  • Resolve the model and provider through the owning service's configuration policy. Do not silently inherit an unrelated chat model.
  • When a workflow requires a stable service model, give it an explicit default and expose the corresponding service-model configuration instead of hardcoding the model only at the call site.
  • Keep model choice separate from prompt version. Changing a configured model does not rename the prompt or scenario.
  • Prefer the shared server generation service when it fits the call so runtime initialization, routing, and tracing remain consistent.

Structured Generation

  • Give each JSON schema a stable, workflow-appropriate name.
  • Keep prompt instructions and schema requirements aligned; required fields in one must be supplied by the other.
  • Validate generated content at the service boundary and preserve the owning service's fallback/error behavior.
  • Do not reuse a schema name to justify reusing an unrelated tracing scenario.

Verification

For every new or corrected generation workflow:

  1. Assert the emitted scenario, promptVersion, and schemaName where applicable.
  2. Test the prompt's important behavioral constraints without snapshotting the entire prose.
  3. Test structured-output validation and relevant failure behavior.
  4. Search for stale inline prompts, old version strings, and incorrectly reused scenarios.
  5. Run bun run check <changed-files...> and bun run check --type for cross-package changes.

Use the testing skill for test mechanics and the typescript skill for TypeScript changes.

评价

还没有评价。欢迎分享你的使用感受。

评论

无需登录即可发表。欢迎分享使用感受、提问,或说明在哪些环境下无法运行。

还没有评论。来写第一条吧。

提交后会立即公开。请勿填写邮箱、电话等个人信息。URL 最多 2 个。

0 / 1000 字

此表单受 reCAPTCHA 保护,适用 Google 的隐私权政策和服务条款。

同一仓库的技能

acceptance

免费有简介

通过实际操作产品验证交付内容,记录用户可查看的证据,并发布验收报告。可检查已有验证计划或创建检查项,选择合适的操作界面,并使用 `lh` CLI 发布结果。

  • 实际检查更改后的产品行为
  • 收集截图或其他验证证据
  • 编写验证计划和报告
lobehub/lobehub8.4万2026年10月26日 更新

add-model-provider

免费有简介

本技能指导在 LobeHub 中接入 AI 模型提供商,涵盖运行时、模型信息、设置、品牌展示、文档和验收,并帮助判断新增模型是否需要新的提供商集成。

  • 为 LobeHub 接入新的 AI 模型提供商
  • 更新提供商设置说明或介绍
  • 判断添加模型是否需要新的提供商集成
lobehub/lobehub8.4万2026年10月26日 更新

add-setting-env

免费有简介

本技能指导如何用服务器端环境变量设置用户偏好默认值,涵盖变量校验、服务器配置、写入用户状态,以及更新 `.env.example` 和自托管文档。

  • 通过环境变量设置用户偏好默认值
  • 将设置接入服务器配置和用户状态
  • 更新环境变量示例及文档
lobehub/lobehub8.4万2026年10月26日 更新

agent-runtime-hooks

免费有简介

说明如何在智能体执行步骤、工具调用、人工审批、上下文压缩和子智能体调用时注册钩子。钩子可观察事件、模拟本地工具结果,也可通过 Webhook 按配置策略允许或拒绝工具调用。

  • 记录智能体步骤和错误
  • 测试时模拟工具结果
  • 通过 Webhook 允许或拒绝工具调用
lobehub/lobehub8.4万2026年10月26日 更新

agent-signal

免费有简介

此技能用于为智能体设计事件驱动的后台工作流,划分来源、信号、动作和策略的职责,并处理异步交接、去重、执行范围、完成记录与运行观测。

  • 添加事件触发的后台任务
  • 将工作移出对话请求
  • 防止动作重复执行
lobehub/lobehub8.4万2026年10月26日 更新

agent-testing-bot

免费有简介

本技能在 macOS 桌面聊天应用中测试机器人频道:打开应用、进入频道或联系人、发送消息、等待回复并截图。支持 Discord、Slack、Telegram、微信、飞书和 QQ;iMessage 使用 BlueBubbles 桥接。

  • 检查真实 Discord 频道中的机器人回复
  • 测试 Slack 或 Telegram 的对话流程
  • 记录 macOS 应用中的操作结果
lobehub/lobehub8.4万2026年10月26日 更新

查看 lobehub 的全部技能

报告此技能的问题