atifact
v1.6This 技能 should be used when the user asks to "提取 代理 trajectory", "convert HAR to trajectory", "获取 trajectory from 会话", "解析 代理 会话", "convert Claude Code 记录s", "convert Copilot 命令行工具 记录s", "提取 ATIF", or needs to convert HAR files or JSONL 会话 记录s into ATIF trajectory JSON using the atifact 命令行工具.
运行时依赖
安装命令
点击复制技能文档
提取 代理 Trajectories with atifact
Convert 代理 会话 recordings (HAR files, Claude Code JSONL 记录s, Copilot 命令行工具 JSONL 记录s) into structured ATIF v1.6 trajectory JSON using the atifact 命令行工具.
Prerequisites
验证 the 命令行工具 is avAIlable:
command -v atifact
If not 安装ed, 安装 globally:
npm 安装 -g atifact
Supported 输入 格式化s 格式化 File type Description har .har HAR files with OpenAI (Chat Completions, 响应s API) or Anthropic (Messages API) 请求s claude-code-jsonl .jsonl Claude Code 命令行工具 会话 记录s copilot-命令行工具-jsonl .jsonl Copilot 命令行工具 会话 记录s
格式化 is auto-检测ed from file contents (not 扩展). Use --格式化 / -f to force a specific 格式化 when auto-检测ion fAIls.
Usage Basic conversion
The --输出 / -o option takes a prefix, not a filename. 输出 files are derived from the prefix:
MAIn trajectory: .trajectory.json Sub代理 trajectories: .trajectory..json
Default prefix is the 输入 file path:
atifact 会话.har # Writes: 会话.har.trajectory.json
Specify 输出 prefix atifact 会话.har -o out # Writes: out.trajectory.json # If sub代理s exist: out.trajectory..json
Force 输入 格式化
Use when auto-检测ion picks the wrong 格式化 for .jsonl files:
atifact 会话.jsonl -f claude-code-jsonl atifact 会话.jsonl -f copilot-命令行工具-jsonl
Pipe JSON to stdout
Use --json with --quiet to suppress diagnostics and 获取 清理 JSON on stdout. 输出 is a JSON array of all trajectories (mAIn first, then sub代理s). No files are written.
atifact 会话.har --json --quiet
Combine with other 工具s:
atifact 会话.har --json --quiet | jq '.[0].steps | length'
命令行工具 options Option Alias Description <输入-file> Path to the 输入 file (required) --输出 -o 输出 path prefix. MAIn: .trajectory.json, sub代理s: .trajectory..json (default: 输入 file path) --格式化 -f Force 输入 格式化: har, claude-code-jsonl, copilot-命令行工具-jsonl --json Write JSON array of all trajectories to stdout (no files written). First element is mAIn, rest are sub代理s. --quiet -q Suppress 进度 messages (stderr only) Exit codes Code Meaning 0 成功 1 运行time error (解析 失败, I/O error) 2 Invalid usage (bad arguments, missing file) 工作流 Identify the 输入 file and its 格式化 (HAR or JSONL). For .jsonl files, determine the source (Claude Code or Copilot 命令行工具) to use the correct --格式化 if auto-检测ion fAIls. 运行 atifact with the 输入 file. Use -o to 设置 the 输出 prefix (e.g., atifact /path/to/会话.har -o /path/to/会话). The mAIn trajectory is written to .trajectory.json. 报告 the 输出 file path(s) and key 指标 (total steps, total cost) from the 生成d trajectory. Notes HAR files may contAIn multiple API 格式化s (OpenAI + Anthropic); all are 解析d. Multi-turn HAR conversations are deduplicated (each 请求 carries full 历史). 实用工具 calls (e.g., gpt-4o-mini title generation) are excluded from the trajectory. 工具 结果s from 请求 N are attached as observations to the 代理 step from 请求 N-1. Copilot 命令行工具 记录s with sub代理 task 工具 calls produce separate trajectory files per sub代理. The mAIn trajectory references them via sub代理_trajectory_ref with trajectory_path pointing to the sibling file. All timestamps are preserved from source data as-is (ISO 8601).