Skip to content
alyn
zhnnky329

Python Model Code Generator skill

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.

$npx skills add zhnnky329/MathModeling-skills --skill python-model-code-generator
View this skill on GitHubzhnnky329/MathModeling-skills/.claude/skills/python-model-code-generator/SKILL.md
Pack stars
1,088
Pack installs
1k
Alyn Score
49/99
Updated
2 months ago
License
MIT
– views – installs via Alyn

Install Python Model Code Generator

Pick your agent. Every command is ready to paste.

$npx skills add zhnnky329/MathModeling-skills --skill python-model-code-generator

The open skills CLI detects your agents (Claude Code, Cursor, Codex and 70+ more) and installs to the right folder. Add -g to install globally.

01

Install it

Run the command above, or upload the folder in Claude.

02

Ask naturally

Describe the task. Your agent loads python-model-code-generator when the request matches its description.

03

Name it if needed

If it does not trigger, say “use the python-model-code-generator skill”. In Codex, type $python-model-code-generator.

The skill itself

SKILL.md

FolderGitHub

Preconditions

  • G2.5 human method choice is recorded in methods/Qx/qx_decisions.jsonl.
  • code/Qx/qx_code_plan.md exists.
  • 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

  1. Read the code plan, decision ledger, method card, probe conditions, and data profile.
  2. Confirm scope:
    • one approved main method;
    • one usable baseline;
    • fallback only when an activation decision or evidenced trigger exists.
  3. Generate clear runnable .py files under code/Qx/.
  4. Use project-root-safe paths, fixed seeds, explicit inputs, and minimal justified dependencies.
  5. Save:
    • tables to results/Qx/experiments/roundN/tables/;
    • metrics to .../metrics/;
    • useful diagnostic/comparison figures to .../figures/;
    • canonical run_summary.json.
  6. Evaluate and record output-degeneracy and fallback-trigger metrics required by the plan.
  7. Persist full logs only on failure or when a warning needs reproduction.
  8. Run the code. Do not claim success from code generation alone.
  9. 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.

Rules

  • Do not change the approved model or baseline.
  • Do not read or overwrite raw data.
  • Do not hide assumptions in code.
  • Do not emit placeholder metrics, figures, or successful statuses.
  • Prefer portable .py scripts over notebook-only workflows.
  • Keep intermediate files only when needed for explanation, review, robustness, or debugging.
  • Use Type 1 diagnostic figures internally; do not present them as paper figures.

Verification

  • Main and baseline both ran and are directly comparable.
  • Fallback code is absent unless activated.
  • Formal outputs and run summary exist.
  • Seed, inputs, versions, warnings, and errors are recorded.
  • Required concentration/degeneracy checks are saved.
  • Next handoff is code-reviewer.

Tips for Python Model Code Generator

  • • Start a fresh session after installing so your agent picks up the new skill.
  • • It is part of a pack with 29 skills. Install only the ones you need with --skill to keep triggers precise.
  • • If two skills overlap, mention the one you want by name.

Questions about Python Model Code Generator

What does the Python Model Code Generator skill do?

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.

How do I install Python Model Code Generator?

Run "npx skills add zhnnky329/MathModeling-skills --skill python-model-code-generator" in your project. The skills CLI installs it for Claude Code, Cursor, Codex and 70+ other agents. In Claude on the web, upload the skill folder as a ZIP under Customize > Skills.

Does Python Model Code Generator work in Cursor and Codex?

Yes. Python Model Code Generator uses the open SKILL.md format, so it works in Claude Code, Claude, Cursor, OpenAI Codex, Gemini CLI, GitHub Copilot and other agents that support agent skills.

Is Python Model Code Generator free?

Python Model Code Generator is open source on GitHub under the MIT license. It is free to install; check the license before commercial use.

Who made Python Model Code Generator?

Python Model Code Generator is published by zhnnky329 in the zhnnky329/MathModeling-skills repository, together with 28 other skills.

Similar skills. From other creators.