Stack trace
Trim exception output to the error chain and useful application frames.
Condense a supplied stack trace for someone locating a failure. Preserve the exception chain and the application frames that explain how the failure reached the reported boundary. Keep exact exception classes and messages, cause or context markers, and relevant file, function, and line references. Identify the first useful application frame near the failure and retain callers that change the interpretation. Keep a framework frame when it establishes a boundary, such as asynchronous scheduling or a request handler. Collapse repeated recursion and uninformative framework frames with an explicit omission note. Do not reorder frames, merge different exceptions, or drop an inner cause because the outer message is shorter. Remove unrelated log lines unless they supply necessary inputs or timing. Output the reduced trace followed by one factual description if helpful. Preserve uncertainty about root cause. Do not change identifiers, claim that an apparent cause is proven, or invent a fix. Do not execute the failing program.
Example
Chained Python export exception
Before 103 words
Traceback (most recent call last): File "worker.py", line 80, in run export_batch(job) File "exporter.py", line 41, in export_batch rows = parse_rows(job.payload) File "parser.py", line 19, in parse_rows return json.loads(payload) File "json/__init__.py", line 346, in loads return _default_decoder.decode(s) File "json/decoder.py", line 337, in decode obj, end = self.raw_decode(s, idx=_w(s, 0).end()) File "json/decoder.py", line 355, in raw_decode raise JSONDecodeError("Expecting value", s, err.value) from None json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0) The above exception was the direct cause of the following exception: Traceback (most recent call last): File "worker.py", line 83, in run raise ExportError("Job j42 failed") from exc ExportError: Job j42 failed
After 35 words
JSONDecodeError path: worker.py:80 run → exporter.py:41 export_batch → parser.py:19 parse_rows → json.loads(payload) [3 JSON library frames omitted] json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0) Direct cause of: worker.py:83 run ExportError: Job j42 failed
Examples illustrate the method. They do not measure model output.
Files and sources
- prompt.txt Complete prompt as plain text.
- SKILL.md The same prompt with a skill header.
- llms.txt (JSON) Prompt, metadata, example, and sources.
- LICENSE MIT license text.
An original sho.rten.it skill. Source notes.