Python Model Code Generator
Generate and run minimal reproducible Python modeling code for the human-approved main...
Install
npx skills add zhnnky329/MathModeling-skills --skill python-model-code-generator -g -a claude-code -y- Repository
- zhnnky329/MathModeling-skills1.1k
- Category
- Engineering
- Updated
- 1mo ago
- License
- MIT
- Context cost
- Lightabout 632 tokens
- Runs scripts
- No, instructions only
What it does
Generate and run minimal reproducible Python modeling code for the human-approved main method and usable baseline, saving compact experiment artifacts and a canonical run summary.
Preconditions
- G2.5 human method choice is recorded in
methods/Qx/qx_decisions.jsonl. code/Qx/qx_code_plan.mdexists.- Required cleaned data and profile exist.
- The plan targets Python.
Legacy method pools and code/model-code-analyzer.md may be read during migration, but they do not override the human choice.
Workflow
- Read the code plan, decision ledger, method card, probe conditions, and data profile.
- Confirm scope:
- one approved main method;
- one usable baseline;
- fallback only when an activation decision or evidenced trigger exists.
- Generate clear runnable
.pyfiles undercode/Qx/. - Use project-root-safe paths, fixed seeds, explicit inputs, and minimal justified dependencies.
- Save:
- tables to
results/Qx/experiments/roundN/tables/; - metrics to
.../metrics/; - useful diagnostic/comparison figures to
.../figures/; - canonical
run_summary.json.
- tables to
- Evaluate and record output-degeneracy and fallback-trigger metrics required by the plan.
- Persist full logs only on failure or when a warning needs reproduction.
- Run the code. Do not claim success from code generation alone.
- Hand off to
code-reviewer.
Script Layout
Prefer the smallest clear layout:
code/Qx/
├── qx_code_plan.md
├── qx_baseline.py
├── qx_main.py
└── run_all.py # only when coordination is useful
Do not create one script per unapproved candidate. Do not create a README that duplicates the code plan.
Run Summary
Follow the schema in model-code-analyzer. Include:
- approved decision ID;
- method IDs and roles;
- inputs and outputs;
- seed and environment;
- execution status and timing;
- compact metric summaries;
- output-degeneracy evidence;
- warnings/errors;
- fallback-trigger state.
