cx-coding-agents
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseCoding Agents Skill
Coding Agents skill
Use this skill as the entry point for any investigation or data question about AI Center Coding Agents. It identifies which data source each agent uses and tells you which reference files to load before querying.
将此 skill 作为调查 AI Center Coding Agents 或提出相关数据问题的入口。它会确定每个 Agent 使用的数据源,并指明查询前需要加载的参考文件。
Supported Agents
支持的 Agent
| Agent | Data Type | Source Identifier |
|---|---|---|
| Claude Code | Metrics | |
| Claude Code (session text) | Logs | |
| Codex | Logs | |
| Codex (latency) | Spans | |
| Cursor | Spans | |
| Gemini CLI | Metrics | |
| Copilot CLI (direct OTel) | Spans | |
| GitHub Copilot Collector | Metrics | |
| Agent | 数据类型 | 数据源标识符 |
|---|---|---|
| Claude Code | 指标 | |
| Claude Code(session 文本) | 日志 | |
| Codex | 日志 | |
| Codex(延迟) | Spans | |
| Cursor | Spans | |
| Gemini CLI | 指标 | |
| Copilot CLI(direct OTel) | Spans | |
| GitHub Copilot Collector | 指标 | |
Loading References
加载参考文件
Load the agent reference first, then the shared query-language files it depends on:
| Agent | Agent Reference | Shared References |
|---|---|---|
| Claude Code (metrics) | | |
| Claude Code (sessions) | | |
| Codex | | |
| Cursor | | |
| Gemini CLI | | |
| Copilot CLI (direct OTel) | | |
| GitHub Copilot Collector | | |
| Cross-agent comparison | All agent references | All shared references |
先加载 Agent 参考文件,再加载其依赖的共享查询语言文件:
| Agent | Agent 参考文件 | 共享参考文件 |
|---|---|---|
| Claude Code(指标) | | |
| Claude Code(sessions) | | |
| Codex | | |
| Cursor | | |
| Gemini CLI | | |
| Copilot CLI(direct OTel) | | |
| GitHub Copilot Collector | | |
| 跨 Agent 比较 | 所有 Agent 参考文件 | 所有共享参考文件 |
Safety
安全性
All query commands (, , , ) are read-only. They never modify data and can be run freely without .
cx metricscx logscx spanscx dataprime--yes所有查询命令(、、、)均为只读操作。它们不会修改数据,因此无需使用 即可自由执行。
cx metricscx logscx spanscx dataprime--yesCLI Commands
CLI 命令
| Command | Purpose | When to Use |
|---|---|---|
| Find metrics by name | Discover available |
| Instant PromQL query | Point-in-time metric snapshot |
| Range PromQL query (time series) | Claude Code, Gemini CLI, GitHub Copilot Collector trends |
| Log query | Claude Code session text, Codex logs |
| Span query | Cursor, Codex latency, Copilot CLI direct OTel |
| Raw DataPrime query | When you need an explicit |
Output format: append to any command when passing results to an agent or further processing.
-o toonMulti-profile: use (repeatable) to fan out across profiles simultaneously.
-p <profile>| 命令 | 用途 | 使用场景 |
|---|---|---|
| 按名称查找指标 | 发现可用的 |
| 即时 PromQL 查询 | 获取时间点指标快照 |
| 范围 PromQL 查询(时间序列) | Claude Code、Gemini CLI、GitHub Copilot Collector 趋势分析 |
| 日志查询 | Claude Code session 文本、Codex 日志 |
| Span 查询 | Cursor、Codex 延迟、Copilot CLI direct OTel |
| 原始 DataPrime 查询 | 需要在查询中显式使用 |
输出格式: 将结果传递给 Agent 或进行后续处理时,为任意命令追加 。
-o toon多 Profile: 使用 (可重复),可同时向多个 profile 分发查询。
-p <profile>First Response
首次响应
Identify the requested agent and analysis goal. If any required scope is missing, ask before querying:
- Agent: Claude Code, Codex, Cursor, Gemini CLI, or Copilot CLI.
- Time range.
- Optional filters: application, subsystem, user, model, session, repository.
- Output shape: quick answer, table, trend, top-N ranking, investigation notes, or query only.
If the user says "GitHub Copilot Codex", clarify whether they mean Codex or Copilot CLI. AI Center has separate Codex and Copilot CLI dashboards.
Use the same data source as the corresponding dashboard whenever possible:
- Claude Code metrics: PromQL over metrics.
claude_code_* - Claude Code session text: DataPrime over logs.
ai_sessions_claude - Codex: DataPrime over Codex logs for tokens, sessions, models, users, and tools; spans only for latency.
run_turn - Cursor: DataPrime over Cursor spans. Cursor reports prompt length and file edits, not provider token counts.
- Gemini CLI: PromQL over metrics.
gemini_cli_* - Copilot CLI direct OTel: DataPrime over Copilot spans.
- GitHub Copilot Collector: PromQL over org/user/billing metrics when that collector data is present.
github_copilot_*
确定用户请求的 Agent 和分析目标。如果缺少任何必需范围,请在查询前询问:
- Agent: Claude Code、Codex、Cursor、Gemini CLI 或 Copilot CLI。
- 时间范围。
- 可选筛选条件: application、subsystem、user、model、session、repository。
- 输出形式: 快速答案、表格、趋势、Top-N 排名、调查说明或仅提供查询。
如果用户说“GitHub Copilot Codex”,请确认其指的是 Codex 还是 Copilot CLI。AI Center 为 Codex 和 Copilot CLI 提供相互独立的仪表板。
尽可能使用与对应仪表板相同的数据源:
- Claude Code 指标: 对 指标执行 PromQL 查询。
claude_code_* - Claude Code session 文本: 对 日志执行 DataPrime 查询。
ai_sessions_claude - Codex: 对 Codex 日志执行 DataPrime 查询,以获取 tokens、sessions、models、users 和 tools;仅使用 spans 查询 延迟。
run_turn - Cursor: 对 Cursor spans 执行 DataPrime 查询。Cursor 报告 prompt 长度和文件编辑次数,但不报告提供商 token 数量。
- Gemini CLI: 对 指标执行 PromQL 查询。
gemini_cli_* - Copilot CLI direct OTel: 对 Copilot spans 执行 DataPrime 查询。
- GitHub Copilot Collector: 当存在该 Collector 数据时,对 组织、用户和计费指标执行 PromQL 查询。
github_copilot_*
Time and Filters
时间与筛选条件
PromQL (Claude Code, Gemini CLI, GitHub Copilot Collector)
PromQL(Claude Code、Gemini CLI、GitHub Copilot Collector)
Use for counters over the selected window. Common label filter pattern:
increase(metric[<range>])promql
{user_email="<user>",model="<model>",cx_application_name="<app>",cx_subsystem_name="<subsystem>"}- Use ,
sum by (...), orcount by (...)for grouping.topk(N, ...) - For chart trends, use an interval window based on the selected range rather than the full range.
使用 获取所选时间窗口内的 counter 增量。常见的标签筛选模式:
increase(metric[<range>])promql
{user_email="<user>",model="<model>",cx_application_name="<app>",cx_subsystem_name="<subsystem>"}- 使用 、
sum by (...)或count by (...)进行分组。topk(N, ...) - 对于图表趋势,应根据所选范围设置 interval 窗口,而不是使用完整范围。
DataPrime (Codex, Cursor, Copilot CLI direct, Claude Code sessions)
DataPrime(Codex、Cursor、Copilot CLI direct、Claude Code sessions)
- Add clauses for user, model, application, subsystem, session, and operation.
| filter ... - Prefer for dashboard-like tables.
groupby ... aggregate ... - For spans: app/subsystem labels are and
$l.applicationName(mixed case).$l.subsystemName - For logs: app/subsystem labels are and
$l.applicationname(lowercase).$l.subsystemname
App/subsystem filter pattern:
text
| filter $l.applicationName == '<application>' && $l.subsystemName == '<subsystem>'- 添加 子句,按 user、model、application、subsystem、session 和 operation 筛选。
| filter ... - 对于类似仪表板的表格,优先使用 。
groupby ... aggregate ... - 对于 spans,application/subsystem 标签为 和
$l.applicationName(驼峰式大小写)。$l.subsystemName - 对于 logs,application/subsystem 标签为 和
$l.applicationname(全小写)。$l.subsystemname
Application/subsystem 筛选模式:
text
| filter $l.applicationName == '<application>' && $l.subsystemName == '<subsystem>'Cross-Agent Questions
跨 Agent 问题
When comparing agents:
- Normalize units before comparing: cost in USD, tokens as input/output/total, runtime in milliseconds, sessions as distinct conversations.
- State which signals are not equivalent. Cursor prompt length is not a provider token count. Direct Copilot CLI users are pseudonymous IDs (), not email addresses. GitHub Copilot Collector users may be logins, names, or emails.
enduser.pseudo.id - Prefer per-agent sections over a single merged table when dimensions differ.
- For "which agent is most used": compare sessions and users first, then tokens or span counts with caveats.
- For "which agent costs the most": Claude Code has first-class USD metrics. Copilot direct spans expose . Collector billing metrics expose net/gross/discount amounts by organization/SKU. Do not merge Copilot span cost and collector billing without explaining the source and unit difference.
github.copilot.cost
比较 Agent 时:
- 比较前先统一单位: 成本使用 USD,tokens 区分为 input/output/total,运行时间使用毫秒,sessions 按不同的 conversations 计算。
- 说明哪些信号不可直接比较。 Cursor 的 prompt 长度不等同于提供商 token 数量。Copilot CLI direct 用户使用假名 ID(),而不是电子邮件地址。GitHub Copilot Collector 用户可能是 login、姓名或电子邮件地址。
enduser.pseudo.id - 当数据维度存在差异时,优先使用按 Agent 划分的独立章节,而不是合并为单个表格。
- 对于“哪个 Agent 使用量最高”:先比较 sessions 和 users,再比较 tokens 或 span 数量,并说明相关注意事项。
- 对于“哪个 Agent 成本最高”:Claude Code 提供一等公民的 USD 指标。Copilot direct spans 公开 。Collector 计费指标按 organization/SKU 公开净额、毛额和折扣金额。不要在未说明数据源和单位差异的情况下合并 Copilot span 成本与 Collector 计费数据。
github.copilot.cost
Answer Style
回答风格
Always include:
- The agent and data source used.
- The query or a compact query excerpt.
- The time range and filters applied.
- A plain-language interpretation of the result.
- Caveats about empty data, approximate counts, pseudonymous users, missing labels, or non-comparable metrics.
Do not invent fields not listed in the agent reference files. If the user asks for data an agent does not emit, say what is available and propose the nearest supported query.
始终包含:
- 所使用的 Agent 和数据源。
- 查询语句或精简的查询片段。
- 所应用的时间范围和筛选条件。
- 对结果的通俗语言解释。
- 关于空数据、近似计数、假名用户、缺失标签或指标不可比较的注意事项。
不要臆造 Agent 参考文件中未列出的字段。如果用户询问某个 Agent 未产生的数据,请说明有哪些可用数据,并提出最接近的受支持查询。