一键导入
systematic-debugging
Use when any workflow stage fails — simulation, analysis, plotting, post-processing, or environment setup — before proposing fixes
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Use when any workflow stage fails — simulation, analysis, plotting, post-processing, or environment setup — before proposing fixes
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
| name | systematic-debugging |
| description | Use when any workflow stage fails — simulation, analysis, plotting, post-processing, or environment setup — before proposing fixes |
Random fixes waste time. Investigate root cause first.
Core principle: ALWAYS find root cause before attempting fixes.
Violating the letter of this process is violating the spirit of debugging.
NO FIXES WITHOUT ROOT CAUSE INVESTIGATION FIRST
| Category | Symptoms | Common Causes |
|---|---|---|
| Input error | Missing files, wrong format, bad parameters | Typo in paths, wrong output from prior stage |
| Convergence failure | Iterative solver not converging, optimization stalled | Bad initial conditions, too tight criteria, wrong method |
| Numerical instability | NaN values, diverging quantities, unphysical outputs | Step size too large, ill-conditioned inputs, problematic initial state |
| Resource limit | OOM, timeout, disk full | System too large, too many k-points, long trajectory |
| Wrong results | Converged but incorrect answer | Wrong method/model, missing correction, inappropriate approximation |
| Analysis/plotting error | Missing data, wrong column, library issue | Wrong file format, missing dependency, encoding |
| Environment issue | Missing binary, wrong version, import error | Wrong conda env, missing package, version mismatch |
| Dependency conflict | Software missing feature, incompatible libs | Software missing required module, incompatible library versions |
progress.log with diagnosis and fix appliedsuperscientist:executing-workflowsretry_count is incremented in workflow-state.jsonWhen an HPC stage fails (any stage using a remote backend profile), always start with dpdispatcher.log — it is available locally without any download.
dpdispatcher.logcat {workflow_root}/dpdispatcher.log
Extract for the failed stage's submission:
job_id: 23085)terminated (non-zero Slurm exit) or finished (exit 0 but DPDispatcher found issues)fail_count: Number of times DPDispatcher internally retried the job959691370546a346be2a4770ce9b93789f42ce6a)| DPDispatcher status | Meaning | Root cause category | Next step |
|---|---|---|---|
terminated | Scheduler killed the job | Scheduler/resource error: wrong partition, OOM, walltime exceeded, invalid GPU request, duplicate --gres | Fix resources or custom_flags in submission parameters |
finished + backward_files missing | Job ran to completion but expected outputs not created | Command-level error: wrong input script, missing software package, wrong binary path | Read stage-N/log and stage-N/err if downloaded; if not, request Level 2 diagnostic reproduction run from orchestrator |
| DPDispatcher error (Python traceback) | DPDispatcher itself failed | SSH/network issue, remote_root misconfigured, $ref config invalid | Check machine config path, network connectivity; retry |
custom_flags issuesIf the job was terminated by the scheduler, check dpdispatcher.log or the original submission.json for common custom_flags problems:
#SBATCH prefix: Entries like "--qos=4gpus" instead of "#SBATCH --qos=4gpus" are silently ignored by Slurm. They appear as bare shell lines in the .sub script.gpu_per_node: 1 auto-generates #SBATCH --gres=gpu:1. Adding "#SBATCH --gres=gpu:1" to custom_flags creates a duplicate that some schedulers reject.When the calculation converges and files look correct, but the answer is physically wrong:
| Thought | Reality |
|---|---|
| "I know what's wrong" | Investigate first. You might be wrong. |
| "Quick fix, let me try" | Root cause first. Phase 1 → 2 → 3 → 4. |
| "Let me try one more fix" (after 2+) | Stop. Question the approach. Talk to user. |
| "Results look close enough" | Check against reference. "Close" might be wrong. |
| "The error is in the simulation code" (HPC stage) | Read dpdispatcher.log first. The failure may be scheduler-level, not code-level. |
Use when creating, reading, or updating workflow checkpoint files (workflow-state.json, progress.log, init.sh) — the file-centric state system for cross-session computational workflows
Use when a workflow stage subagent has prepared computation scripts and needs to submit the job to a local or HPC backend via DPDispatcher
Use when a workflow plan exists and stages need to be executed sequentially in the current session
Use when the user wants to set up a new computational experiment — before any computation begins, to design the method, stages, and success criteria
Use before marking any workflow stage as completed — verify outputs exist, are valid, and meet success criteria defined in workflow-state.json
Use when starting a new session and workflow-state.json exists in the working directory — recovers full context from checkpoint files before any new work