Parse Debug Logs
Testing & Qualityparse-debug-logsParse Debug Logs is an Agent Skill for testing & quality published in the GoogleCloudPlatform/magic-modules repository on GitHub: a SKILL.md instruction file an AI agent can load to do this task.
Parses massive Terraform debug logs into an easy-to-read outline of API delays, failures, and request payloads.
QUICK START
How to use this skill
Bring this guide into your coding agent with a prompt tailored to the tool you use.
- Open your project in Codex.
- Copy and paste the prompt below.
- Review files and risks before approving any action.
Prompt to paste
Inspect the Agent Skill at https://github.com/GoogleCloudPlatform/magic-modules/blob/HEAD/.agents/skills/utils/parse-debug-logs/SKILL.md and all supporting files. Report provenance, permissions, scripts, dependencies, and security risks. Propose an exact installation into .agents/skills/parse-debug-logs, but wait for my approval before writing files or running scripts.
Copying this prompt does not install or run the skill. Review third-party files before use.
parse-debug-logs
Note to AI Agents: You MUST read the YAML frontmatter above first. Only read the rest of this file if the
descriptionmatches your current roadblock or required task.
Prerequisites
- You must have a debug log file resulting from a failed
run-acctestsexecution (e.g.,test_output.log).
Execution Steps
1. Verification
Verify the log file exists.
Verify Log Exists
# Replace /path/to/test_output.log with the actual path
ls -lh /path/to/test_output.log
2. The Core Commands
Execute the tf_debug_parser.py script against the debug logs.
Parse Debug Logs
# Execute the parser to extract the outline
python3 <PATH_TO_MAGIC_MODULES>/.agents/scripts/tf_debug_parser.py /path/to/test_output.log --extract-dir <PATH_TO_MAGIC_MODULES>/debug_output
3. Verification & Handoff
- Use the
view_filetool to read the generatedoutline.txtINSIDE the output directory (or its subdirectory if the script creates one). It contains a compressed timeline of API requests/responses and Terraform state transitions. - If you find an API error (HTTP 4xx or 5xx) or an unexpected default field, use
view_fileon the specific JSON payload file referenced inoutline.txt(e.g.,01_REQUEST_POST.json) found in that same directory. - Pivot to the
.agents/skills/operations/troubleshooting_reference.mddocument to map the failure to a known fix strategy before invoking thefixworkflow.