一键导入
debug-teach
Debug an `imprint teach` run — env vars, CLI flags, log files, tracing, and diagnostic commands. Helps diagnose slow, stuck, or failing teach runs.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Debug an `imprint teach` run — env vars, CLI flags, log files, tracing, and diagnostic commands. Helps diagnose slow, stuck, or failing teach runs.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
| name | debug-teach |
| version | 1.0.0 |
| description | Debug an `imprint teach` run — env vars, CLI flags, log files, tracing, and diagnostic commands. Helps diagnose slow, stuck, or failing teach runs. |
| triggers | ["debug teach","teach debug","teach is stuck","teach failing","teach logs","debug compile","why did teach fail","inspect teach run"] |
| allowed-tools | ["Bash","Read"] |
imprint teach runUse this when a teach run failed, is stuck, was slow, or produced broken tools.
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 |
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 1
Common stuck points:
IMPRINT_REPLAY_DEBUG=1 output at /tmp/imprint-replay-debug-*.log.compile-log.jsonpruning vs built + verified in stderr# 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>.png
# 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 doctor
| 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 |
| 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) |
| 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) |
| Path | Contents |
|---|---|
~/.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) |
# 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).log
| 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 |
Prepare a code branch and pull/merge request for human review through safe rebasing, repository-specific validation, multiple independent subagent review rounds, evidence-based fixes, conventional commits, pushing, PR creation, and CI babysitting. Use when asked to prepare, polish, or finalize a PR/MR; obtain several reviews; iterate until clean; or make a branch ready for human review.
Debug an `imprint teach` run — env vars, CLI flags, log files, tracing, and diagnostic commands. Helps diagnose slow, stuck, or failing teach runs.
Refresh checked-in examples from generated Imprint site tools and cut an Imprint patch release. Use when the user asks to commit new generated tools to examples, replace stale example tool snapshots, update example docs/tests after generated tool repairs, or publish a patch release after example/runtime fixes.
Audit and repair generated Google Flights Imprint tools. Use when validating Google Flights search, calendar, booking, airline/bag filters, one-way, round-trip, multi-city, or open-jaw behavior; when investigating `selection_token` or `selected_flights` producer-consumer contracts; or when live audit results are slow, bot-sensitive, under-tested, or incorrectly waived as infrastructure.
Investigate a site's auth-tool compile — ongoing or completed. Locate the real agent transcript (not just the hook log), read the live 2FA verification, inspect the emitted workflow.json, confirm the login actually completed, and diagnose "no auth tool compiled".
Cut a new semver release — bumps package.json, previews changelog, commits, tags, pushes, and verifies npm publish.