Optimize Simplicité Logs

Optimize Simplicité Logs

Parses raw Simplicité log text files into filtered structured JSON with a bundled script so the AI reads less noise and uses fewer tokens.

Skill files3 files

scripts/

SKILL.md75 lines
1
---
2
name: optimize-simplicite-logs
3
description: capability to parse Simplicité logs from a raw `.txt` file, filter fields to reduce noise, and output the result as structured JSON.
4
---
5
6
# Optimize Simplicite Logs
7
8
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.
9
10
## When to Use This Skill
11
12
Use this skill when you need to:
13
- Analyze user-provided Simplicité log files in `.txt` format.
14
- Avoid ingesting massive raw log files into your context window.
15
- Extract structured fields (like `timestamp`, `level`, `body`) from verbose multi-line log output.
16
17
**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.
18
19
## Prerequisites
20
21
- Access to either the PowerShell script (`/scripts/SimpliciteLog2Json.ps1`) or the Python script (`/scripts/simplicite-log2json.py`).
22
23
## Core Capabilities
24
25
### 1. Context Optimization
26
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`).
27
28
### 2. Multi-line Support
29
Properly captures stack traces and multiline errors inside the `body` field of the JSON structure, which a simple text search might miss.
30
31
### 3. Stdout Support
32
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.
33
34
## Output Summary
35
36
After processing, the tool prints a summary to stderr (or console):
37
```
38
Processed: 123 entries, Skipped: 2 entries
39
```
40
41
## Usage Examples
42
43
### Example 1: Python Version (Recommended)
44
Convert a log file to JSON, keeping only the most important fields:
45
```sh
46
python /absolute/path/to/skills/optimize-simplicite-logs/scripts/simplicite-log2json.py <input.txt> --include timestamp,level,body --output <output.json>
47
```
48
49
### Example 2: PowerShell Version
50
```powershell
51
/python /absolute/path/to/skills/optimize-simplicite-logs/scripts/SimpliciteLog2Json.ps1 -InputPath "<input.txt>" -Output "<output.json>" -Include "body,timestamp,level"
52
```
53
54
After generating the `<output.json>`, you can safely read the resulting file to perform your analysis.
55
56
## Guidelines
57
58
1. **Always Convert First:** Never directly read `.txt` log files from Simplicité using standard text reading tools. Always convert them to JSON using the available scripts.
59
2. **Filter Fields:** Use `--include` (Python) or `-Include` (PowerShell) to restrict fields to what is absolutely necessary to diagnose the issue (usually `timestamp,level,body`).
60
3. **Available Fields:** The fields you can filter include: `timestamp`, `app`, `level`, `endpoint`, `contextPath`, `event`, `user`, `class`, `function`, `rowId`, `body`.
61
62
## Common Patterns
63
64
### Pattern: Fast Contextual Troubleshooting
65
```sh
66
# 1. Run the script to generate a minified JSON output in the current directory
67
python /absolute/path/to/skills/optimize-simplicite-logs/scripts/simplicite-log2json.py logs.txt --include timestamp,level,body --output logs_minified.json
68
69
# 2. Then read logs_minified.json to understand the context.
70
```
71
72
## Limitations
73
74
- 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.
75

© GitHub, Inc. · MIT · source · posted by @OpenSourceBuffGuy on promptparty.com

@OpenSourceBuffGuy

I find openly licensed prompts and post them here.

0 followers · 14,621 prompts

More by @OpenSourceBuffGuy

See all
Sea turtle carrying floating film studio island prompt image

Sea turtle carrying floating film studio island

Draws a giant sea turtle carrying a floating island film studio through a starry sky, where fairies polish rough film strips into golden film.

image-prompt, nano-banana, 3d-render, cartoon, fantasy-world, creatures, animals, whimsical, dreamy, cinematic, dramatic-lighting, vibrant-colors, bokeh, miniature, widescreen, night-scene, illustration, concept-art, surreal, storytelling, clay-3d

Desert buggy escapes drones past industrial outpost prompt image

Desert buggy escapes drones past industrial outpost

Builds a 15-second desert chase video where a racer in an armored buggy escapes drones past an industrial outpost, using five reference images with set jobs.

video-prompt, hailuo, action, multi-shot, timed-beats, camera-movement, reference-image, character-consistency, negative-prompt, cinematic, sci-fi, cars, landscape, aerial-view, tracking-shot, photorealistic, sound-effects, structured-output, long-form, widescreen

1 view
Cozy Pixel Art Farm Island Village prompt image

Cozy Pixel Art Farm Island Village

Draws a cozy 16-bit pixel-art farming village across six small islands joined by bridges, with exact counts for buildings, animals and crops.

image-prompt, gpt-image, pixel-art, isometric, game-assets, concept-art, maps, worldbuilding, cozy, vibrant-colors, ocean, landscape, wide-shot, widescreen, game-development, video-games, structured-output, whimsical, summer, high-angle, aerial-view, animals, negative-prompt, cityscape

1 view

Reviews

Loading reviews…

Discussion

Loading comments…