稳定的事件合约
智能体被引导至命名事件、有界 snake_case 字段、显式单元和在 SQL 中仍然有用的标识符。
复制经过审核的 Skill.md,其中包含 TypeScript 和 Python 遥测包装示例、安全事件边界、SQL 验证以及 Claude Code、Codex、Cursor 或其他编程智能体的仪表板工作流程。
将技能运用到工作中
从准备好的 API 密钥和智能体提示开始,运行一个代表性工作流程,并在构建仪表板之前验证生成的事件。
技能涵盖什么
智能体被引导至命名事件、有界 snake_case 字段、显式单元和在 SQL 中仍然有用的标识符。
默认情况下,原始提示、完成、凭据、授权标头和私有有效负载不会进入分析路径。
直到代表性事件到达并且查询或仪表板证明工作流可见时,检测才完成。
Telemetry 包装示例
Pass the API key from trusted server-side configuration and verify a real event with SQL. Anonymous keys support this workflow; claim the workspace before creating dashboards. Keep the Python User-Agent header so requests reach the API.
type TelemetryEvent = Record<string, unknown>;
export async function emitTelemetry(
apiKey: string,
table: string,
data: TelemetryEvent,
) {
const response = await fetch("https://api.telemetry.sh/log", {
method: "POST",
headers: {
Authorization: apiKey,
"Content-Type": "application/json",
},
body: JSON.stringify({ table, data }),
});
if (!response.ok) {
throw new Error(`Telemetry ingestion failed: ${response.status}`);
}
}import json
from urllib.request import Request, urlopen
def emit_telemetry(api_key: str, table: str, data: dict) -> int:
request = Request(
"https://api.telemetry.sh/log",
data=json.dumps({"table": table, "data": data}).encode(),
headers={
"Authorization": api_key,
"Content-Type": "application/json",
"User-Agent": "telemetry-agent/1.0",
},
method="POST",
)
with urlopen(request, timeout=5) as response:
return response.status从这里开始
将占位符替换为服务器端 API 密钥,然后要求智能体在选择事件边界之前检查存储库。
Instrument this project with structured logs using /skill.md. Use this Telemetry API key: YOUR_API_KEY Anonymous keys: logging and synchronous SQL work without signup. Claim the existing workspace at https://telemetry.sh/register with the same key before creating dashboards or alerts. If it is unclaimed, finish with verified event readback and mark account features as pending signup. Please: 1. Find the most important user-facing flows, background jobs, and AI/tooling workflows. 2. Add structured logging with pragmatic snake_case tables and fields. 3. Capture the key signals for each workflow, including status, latency, identifiers, and error context when relevant. 4. Run one real user-facing or operational flow through the instrumented application and verify its event appears 中 Telemetry. Do not use telemetry_quickstart for this milestone. 5. Run a read-only query over that real event, then create a high-level dashboard with charts and tables that summarize the most important signals in this project. 6. Tell me what you instrumented, which real flow you verified, which tables you created, and which dashboard views I should review first. Prefer small, composable events over giant payloads, and optimize for dashboards that humans can scan quickly.审核边界
该技能可帮助智能体找到有用的工作流程边界,但您的团队仍然拥有事件含义、允许的字段、保留策略和操作阈值。
继续工作流程
从有界事件模式和可审查的仪表板开始,了解运行、工具、延迟、成本、故障和结果。
打开指南选择有用的运行、工具、模型、成本、故障和结果边界。
打开指南复制有关产品分析、OpenAI 成本、API、收入和就业机会的重点简报。
打开指南审查事件设计、隐私边界、交付行为和验证。
打开指南应用 Claude Code 实施过程中经过审查的事件契约和验证循环。
打开指南使用集中的 Cursor 工作流程来激活、保留和检查仪表板仪表。
打开指南为 Codex 提供有关产品、可靠性和结果遥测的有限简介并进行验证。
打开指南将模型、令牌、延迟、重试和接受结果事件连接到可审查的 SQL 成本仪表板。
打开指南使用预配置的工作区、API 密钥、智能体提示和入门仪表板免费开始。连接一个真实的工作流程,验证事件,并保存第一个有用的查询。