debug-teach
Skill24 starsChanged 31 days agoMITView on GitHub
Debug an `imprint teach` run — env vars, CLI flags, log files, tracing, and diagnostic commands. Helps diagnose slow, stuck, or failing teach runs.
In this repository17 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- commitSkill
- imprint-example-refresh-releaseSkill
- imprint-google-flights-live-auditSkill
- imprint-reteach-auditSkill
- imprint-teach-deepdiveSkill
- pr-review-convergenceSkill
- prSkill
- releaseSkill
- commitSkill
- debug-teachSkill
- imprint-auth-compile-logSkill
- imprint-reteach-auditSkill
- imprint-teach-deepdiveSkill
- prSkill
- releaseSkill
The file
We split this skill into the rules it gives an agent
3 rules. About 0 are common, 3 are distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 21
Use this when a teach run failed, is stuck, was slow, or produced broken tools.
- Distinctive: line 25
Ask the user (or infer from context) which scenario applies:
- Distinctive: line 36
Check what stage it's in:
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Debug an imprint teach run
Use this when a teach run failed, is stuck, was slow, or produced broken tools.
Step 1 — Determine what happened
Ask the user (or infer from context) which scenario applies:
| Scenario | Go to |
| Teach is currently running and looks stuck | Step 2a |
| Teach finished but tools are broken | Step 2b |
| Teach errored out | Step 2c |
| Teach was slow and user wants to know why | Use /imprint-teach-deepdive instead |
Step 2a — Stuck teach (still running)
Check what stage it's in:
# See if the compile-log is being written (growing = still compiling)
ls -la ~/.imprint/<site>/*/.compile-log.json
# Check if Chrome is still alive (replay/record stage)
pgrep -fl chromium || pgrep -fl chrome
# If tracing was on, check the last span
bun run scripts/analyze-phoenix.ts --kind teach --last 1Common stuck points:
- Replay stage: browser hung waiting for a network response. Kill and re-run; check
IMPRINT_REPLAY_DEBUG=1output at/tmp/imprint-replay-debug-*.log - Compile agent looping: the agent is retrying a failing verification. Check the tail of
.compile-log.json - Shared module build: a module failed to verify and is retrying. Look for
pruningvsbuilt + verifiedin stderr
Step 2b — Teach finished but tools are broken
# Run audit to get a structured report
bun run src/cli.ts audit <site> --json
# Read the audit report
cat ~/.imprint/<site>/.audit-report.json | jq '{score, verdicts: [.verdicts[] | {tool: .tool, verdict: .verdict}]}'
# Read the compile agent's full conversation for a broken tool
cat ~/.imprint/<site>/<broken-tool>/.compile-log.json | jq '.[].role' | head -20
# Check the tool plan the agent was given
cat ~/.imprint/<site>/<broken-tool>/.tool-plan.md
# Test the playbook interactively
bun run src/cli.ts playbook <site> --headed --trace --param key=value
# Screenshots land at /tmp/imprint-playbook-<tool>-step<N>-<ts>.pngStep 2c — Teach errored out
# Check the compile log for the error
cat ~/.imprint/<site>/<tool>/.compile-log.json | jq 'last'
# Validate the session recording is intact
bun run src/cli.ts check ~/.imprint/<site>/sessions/*.json
# Check environment
bun run src/cli.ts doctorEnvironment variables reference
Verbosity & logging
| Variable | Effect |
IMPRINT_DEBUG=1 | Verbose stderr: every HTTP request, cookie/storage snapshots, Chromium stderr, full stack traces |
IMPRINT_QUIET=1 | Suppress all imprint logs |
IMPRINT_REPLAY_DEBUG=1 | Write timestamped replay events to /tmp/imprint-replay-debug-<ts>.log |
Tracing (OpenTelemetry → Phoenix)
| Variable | Effect |
IMPRINT_TRACE=1 | Enable tracing (aliases: IMPRINT_TRACING=1, OPENINFERENCE_TRACE=1) |
PHOENIX_COLLECTOR_ENDPOINT | Phoenix collector URL (auto-enables tracing) |
IMPRINT_TRACE_LLM_IO=1 | Capture prompt text + LLM responses in spans |
IMPRINT_TRACE_TOOL_IO=1 | Capture tool arguments + results in spans |
IMPRINT_TRACE_IO=1 | Shorthand for both LLM + tool I/O |
IMPRINT_TRACE_BATCH=0 | Flush spans immediately (useful for short/killed runs) |
IMPRINT_TRACE_PROJECT | Phoenix project name (default: imprint) |
Compile & planning knobs
| Variable | Effect |
IMPRINT_KEEP_TEST=1 | Keep generated parser.test.ts after compile |
IMPRINT_NO_BUILD_PLAN=1 | Skip shared-module planning |
IMPRINT_NO_TOOL_PLAN=1 | Skip per-tool implementation planning |
IMPRINT_NO_PREREQ_PLAN=1 | Skip prerequisite analysis |
IMPRINT_COMPILE_ACT_SPACING_MS=0 | Fast compile-time replay (default 25000ms) |
Files written during teach
| Path | Contents |
~/.imprint/<site>/.build-plan-log.json | Incremental planner diagnostics; exists even if planning times out or returns invalid JSON |
~/.imprint/<site>/<tool>/.compile-log.json | Full compile-agent conversation |
~/.imprint/<site>/<tool>/.tool-plan.md | LLM-generated implementation plan |
~/.imprint/<site>/.audit-report.json | Audit results (after imprint audit) |
~/.imprint/<site>/.audit-transcript.txt | Audit session transcript |
/tmp/imprint-replay-debug-<ts>.log | Replay debug log (IMPRINT_REPLAY_DEBUG=1) |
/tmp/imprint-playbook-<tool>-step<N>-<ts>.png | Step screenshots (--trace) |
Quick recipes
# Full-verbose teach
IMPRINT_DEBUG=1 IMPRINT_REPLAY_DEBUG=1 imprint teach <site> --url <url> 2>&1 | tee teach-run.log
# Teach with Phoenix tracing
IMPRINT_TRACE=1 IMPRINT_TRACE_LLM_IO=1 imprint teach <site> --url <url>
# Fast iteration (skip slow parts, reuse existing session)
IMPRINT_COMPILE_ACT_SPACING_MS=0 IMPRINT_NO_PREREQ_PLAN=1 \
imprint teach <site> --skip-replay --from-session <path>
# Capture everything to a file
IMPRINT_DEBUG=1 imprint teach <site> --url <url> 2>&1 | tee teach-$(date +%s).logDiagnostic subcommands
| Command | Purpose |
imprint doctor | Check environment (Bun, Chromium, LLM providers) |
imprint check <session> | Validate captured session completeness |
imprint playbook <site> --headed --trace | Interactive playbook test with screenshots |
imprint audit <site> --json | Score tools; generate report + transcript |
imprint mcp status | Audit MCP registrations + generated tools |
imprint probe-backends <site> | Test backend ladder |
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

