optimize-simplicite-logs
它能做什么
这个工具可以整理 Simplicité 日志文件。它会把原始的文本文件转换成更干净、结构化的格式(JSON),去掉不必要的信息,让分析更轻松。
适用场景
- ✓当你有一个文本格式的大型 Simplicité 日志文件时。
- ✓避免 AI 需要阅读庞大的原始日志文件。
- ✓从日志中提取时间、错误级别和消息等重要信息。
技能链接
https://github.com/github/awesome-copilot/blob/main/skills/optimize-simplicite-logs/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“把这个 Simplicité 日志文件转换成整理好的 JSON,只保留时间戳、级别和消息。”
每周 5 个新技能,1 分钟读完。
工作原理
该工具使用脚本(Python 或 PowerShell)读取日志文本文件,筛选并只选取时间、消息等重要数据,然后将其整理成一个新的 JSON 文件。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
Optimize Simplicite Logs
This skill provides the capability to parse Simplicité logs from a raw .txt file, filter fields to reduce noise, and output the result as structured JSON. This is critical for optimizing AI context size (saving ~56% of tokens) and providing structured, predictable data for troubleshooting.
When to Use This Skill
Use this skill when you need to:
- Analyze user-provided Simplicité log files in
.txtformat. - Avoid ingesting massive raw log files into your context window.
- Extract structured fields (like
timestamp,level,body) from verbose multi-line log output.
IMPORTANT: Instead of directly reading a raw .txt log file provided by the user using file read tools, you must use one of the log converter scripts (PowerShell or Python) to parse the file into a JSON format first, optionally extracting only the fields needed.
Prerequisites
- Access to either the PowerShell script (
/scripts/SimpliciteLog2Json.ps1) or the Python script (/scripts/simplicite-log2json.py).
Core Capabilities
1. Context Optimization
Reduces the tokens consumed by large Simplicité logs by extracting only relevant log fields (e.g. body, timestamp, level) and discarding non-relevant structural log data (like app, endpoint, contextPath).
2. Multi-line Support
Properly captures stack traces and multiline errors inside the body field of the JSON structure, which a simple text search might miss.
3. Stdout Support
If no output path is provided for the JSON file (e.g. omitting --output or -Output), the parsed JSON will be printed directly to stdout, allowing you to pipe the output to other tools.
Output Summary
After processing, the tool prints a summary to stderr (or console):
Processed: 123 entries, Skipped: 2 entries
Usage Examples
Example 1: Python Version (Recommended)
Convert a log file to JSON, keeping only the most important fields:
python /absolute/path/to/skills/optimize-simplicite-logs/scripts/simplicite-log2json.py <input.txt> --include timestamp,level,body --output <output.json>
Example 2: PowerShell Version
/python /absolute/path/to/skills/optimize-simplicite-logs/scripts/SimpliciteLog2Json.ps1 -InputPath "<input.txt>" -Output "<output.json>" -Include "body,timestamp,level"
After generating the <output.json>, you can safely read the resulting file to perform your analysis.
Guidelines
- Always Convert First: Never directly read
.txtlog files from Simplicité using standard text reading tools. Always convert them to JSON using the available scripts. - Filter Fields: Use
--include(Python) or-Include(PowerShell) to restrict fields to what is absolutely necessary to diagnose the issue (usuallytimestamp,level,body). - Available Fields: The fields you can filter include:
timestamp,app,level,endpoint,contextPath,event,user,class,function,rowId,body.
Common Patterns
Pattern: Fast Contextual Troubleshooting
# 1. Run the script to generate a minified JSON output in the current directory
python /absolute/path/to/skills/optimize-simplicite-logs/scripts/simplicite-log2json.py logs.txt --include timestamp,level,body --output logs_minified.json
# 2. Then read logs_minified.json to understand the context.
Limitations
- The parser depends on a fixed regex pattern that matches the standard Simplicité log output. If the log format has been heavily customized, parsing might fail or degrade.
常见问题
为什么不能直接把原始日志文本文件交给 AI?
原始日志文件可能非常大,而且包含很多对 AI 没用的信息,会占用过多的“空间”(token),也让分析变得困难。
我可以提取哪些重要信息?
你可以提取 “timestamp”(时间)、“level”(错误或信息级别)和 “body”(日志的主要消息)等字段。
如果一条日志跨越多行,会怎么样?
该工具可以把这些多行条目合并成一条 JSON 记录,确保详细的错误信息不会丢失。
详情
作者的原始描述
capability to parse Simplicité logs from a raw `.txt` file, filter fields to reduce noise, and output the result as structured JSON.
repo: github/awesome-copilot
热度
- GitHub 星标
- 40k
- 排名
- #7314
- 许可证
- MIT
- 更新时间
- 2026/10/15
评论
- …
同一仓库的更多技能
acquire-codebase-knowledge
40k帮你的智能体理解并编写现有代码项目的文档。它有助于新成员快速上手,或者快速了解项目架构。
acreadiness-assess
40k让你的智能体评估一个项目对 AI 的准备程度,并生成报告。它有助于了解项目在使用 AI 工具方面的准备情况。
acreadiness-generate-instructions
40k帮你的智能体根据评估结果编写 AI 工具的指令文件。它有助于改善 AI 与代码的交互方式,并弥补已发现的不足。
acreadiness-policy
40k让你的智能体协助制定或应用 AI 项目评估的政策。它有助于规范项目的评估方式,并确保合规。