Summary
Pi Agent 日志分析工具,用于分析 .log/ 目录下的结构化 JSONL 日志。支持按时间/角色/模块/模型多维分析,识别警告模式,生成可视化报告。当用户提到"分析日志"、"查看日志"、"日志统计"、"log分析"、"最近活动"、"模型使用"、"会话分析"时使用此技能。
dwsy/agent
Pi Agent 日志分析工?
npx skills add dwsy/agent --skill pi-log-analyzer
Pi Agent 日志分析工具,用于分析 .log/ 目录下的结构化 JSONL 日志。支持按时间/角色/模块/模型多维分析,识别警告模式,生成可视化报告。当用户提到"分析日志"、"查看日志"、"日志统计"、"log分析"、"最近活动"、"模型使用"、"会话分析"时使用此技能。
Related neighbors and high-traction skills in the same topics — useful to compare before installing.
Helps users discover and install agent skills when they ask questions like "how do I do X", "fi…
3.3M installsBrowser automation CLI for AI agents. Use when the user needs to interact with websites, includ…
810.4K installsReview UI code for Web Interface Guidelines compliance. Use when asked to "review my UI", "chec…
617.3K installsBuild, deploy, evaluate, optimize, fine-tune, and manage Microsoft Foundry agents, models, and …
576.5K installsPrepare azd-based Azure projects for deployment: generates azure.yaml, infrastructure (Bicep/Te…
568.3K installsOther skills from dwsy/agent · top by installs.
npx skills add dwsy/agent
Declared targets from SKILL.md / docs. Unmarked agents are not listed — the skill may still install via the CLI.
main
Files included with this skill beyond the listing page.
SKILL.md
3,324 B
SUMMARY.md
354 B
分析 Pi Agent 的结构化日志(.log/*.jsonl),提供多维度统计和问题诊断。
日志为 JSONL 格式,每行一个 JSON 对象:
{
"schema": "2.0.0",
"timestamp": "2026-05-07T00:46:30.942Z",
"level": "info|warn|error",
"tag": "auto-extract|checkpoint|vector|...",
"message": "日志消息",
"context": {
"role": "default|bw|psm|jly|zero",
"sessionId": "uuid",
"cwd": "/path",
"pid": 12345
},
"meta": {
"model": "provider/model-name",
"duration_ms": 1234,
...
},
"traceId": "tr-xxx"
}
运行内置分析脚本:
python3 ~/.pi/agent/skills/pi-log-analyzer/scripts/analyze.py [目录路径] [天数]
参数:
目录路径:日志目录,默认 .log/天数:分析最近 N 天,默认 3示例:
# 分析最近 3 天
python3 ~/.pi/agent/skills/pi-log-analyzer/scripts/analyze.py
# 分析最近 7 天
python3 ~/.pi/agent/skills/pi-log-analyzer/scripts/analyze.py .log/ 7
# 分析指定目录
python3 ~/.pi/agent/skills/pi-log-analyzer/scripts/analyze.py /path/to/logs 5
脚本生成以下分析:
如需更细致的分析,可用 Python 读取日志:
import json
from collections import Counter
with open('.log/2026-05-09.jsonl') as f:
for line in f:
d = json.loads(line)
# 访问字段:d['level'], d['tag'], d['meta']['model'], etc.
| 标签 | 含义 |
|---|---|
auto-extract |
自动记忆提取 |
checkpoint |
定时保存点 |
daily-memory |
每日记忆写入 |
vector |
向量索引操作 |
pending |
待处理项 |
repair |
记忆修复 |
embedding |
嵌入生成 |
knowledge |
知识库操作 |
原因:LLM 返回的记忆提取结果格式不符合预期
典型模式:
<think> 标签建议:
检查 meta.model 字段确认使用的模型,对比 models.json 配置。