{ "schema_version": 2, "kind": "shortening-method", "format": "agent-skill", "id": "stack-trace", "name": "Stack trace", "category": "Technical", "summary": "Trim exception output to the error chain and useful application frames.", "use_cases": [ "Exception triage", "Crash report excerpts" ], "word_count": 155, "url": "https://sho.rten.it/methods/stack-trace/", "instructions_url": "https://sho.rten.it/methods/stack-trace/SKILL.md", "skill_url": "https://sho.rten.it/methods/stack-trace/SKILL.md", "json_url": "https://sho.rten.it/methods/stack-trace/llms.txt", "plain_text_url": "https://sho.rten.it/methods/stack-trace/prompt.txt", "license": "MIT", "sources_url": "https://sho.rten.it/sources/#stack-trace", "skill_name": "stack-trace", "skill_description": "Trim exception output to the error chain and useful application frames. Use for Exception triage, Crash report excerpts.", "agents_md_url": "https://sho.rten.it/methods/stack-trace/AGENTS.md", "sources": [], "instructions": "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.\n\nKeep 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.\n\nCollapse 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.\n\nOutput 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": { "context": "Chained Python export exception", "before": "Traceback (most recent call last):\n File \"worker.py\", line 80, in run\n export_batch(job)\n File \"exporter.py\", line 41, in export_batch\n rows = parse_rows(job.payload)\n File \"parser.py\", line 19, in parse_rows\n return json.loads(payload)\n File \"json/__init__.py\", line 346, in loads\n return _default_decoder.decode(s)\n File \"json/decoder.py\", line 337, in decode\n obj, end = self.raw_decode(s, idx=_w(s, 0).end())\n File \"json/decoder.py\", line 355, in raw_decode\n raise JSONDecodeError(\"Expecting value\", s, err.value) from None\njson.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)\n\nThe above exception was the direct cause of the following exception:\n\nTraceback (most recent call last):\n File \"worker.py\", line 83, in run\n raise ExportError(\"Job j42 failed\") from exc\nExportError: Job j42 failed", "after": "JSONDecodeError path:\nworker.py:80 run → exporter.py:41 export_batch → parser.py:19 parse_rows → json.loads(payload)\n[3 JSON library frames omitted]\njson.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)\n\nDirect cause of:\nworker.py:83 run\nExportError: Job j42 failed", "must_preserve": [ "worker.py:80 run; exporter.py:41 export_batch; parser.py:19 parse_rows; json.loads(payload)", "json.decoder.JSONDecodeError exact message and position", "JSONDecodeError is direct cause of ExportError", "worker.py:83 run; ExportError: Job j42 failed", "Frame order preserved; omissions marked; no invented payload diagnosis" ], "omitted": [ "Three standard JSON library frames; exact exception retained" ], "kind": "illustrative" } }