Agent skill

Python Model Code Generator

by zhnnky329 in zhnnky329/MathModeling-skills

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.

MITAuto-check passed

Install Python Model Code Generator

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

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install zhnnky329/MathModeling-skills python-model-code-generator --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/zhnnky329/MathModeling-skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.codex/skills/python-model-code-generator .claude/skills/python-model-code-generator && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
python-model-code-generator
GitHub stars
1.1k
Token cost
~691 tokens
SKILL.md length
311 words
Files
1
Skills in repo
29
Repo updated
First seen
Licence
MIT

At a glance

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.

  • Works in 9 steps: Read the code plan, decision ledger,… → Confirm scope → Generate clear runnable .py files under… → …
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Python Model Code Generator is an agent skill from zhnnky329/MathModeling-skills. 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.

Its SKILL.md is about 690 tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It works with Python. The repository describes itself as: 面向数学建模竞赛的 Claude Code / Codex Skills ,支持分阶段建模流程与 Python、MATLAB/北太天元代码分支。 The licence is MIT.

Example prompts

  • “/python-model-code-generator”

Requirements

  • Python 3

Workflow steps

9 steps, taken from the first numbered list in SKILL.md.

  1. Read the code plan, decision ledger, method card, probe conditions, and data profile.
  2. Confirm scope
  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
  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.

What it can do on your machine

Read from SKILL.md and the folder at commit 0b46e9c. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md.

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Python Model Code Generator loads about 691 tokens when it runs. Until then it costs about 52 tokens; SKILL.md has 311 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~52
When it runs · the whole SKILL.md, loaded when a task matches
~691

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from zhnnky329/MathModeling-skills at commit 0b46e9c, republished under its MIT licence (© zhnnky329). 311 words, ~691 tokens.

Download SKILL.mdSave it as .claude/skills/python-model-code-generator/SKILL.md (or your agent's skills folder).
name
python-model-code-generator
description
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.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:

text
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.

© zhnnky329, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in .codex/skills/python-model-code-generator of zhnnky329/MathModeling-skills.

Open the folder on GitHubat commit 0b46e9c

Compare with similar skills

Python Model Code Generator next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Python Model Code Generator compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Python Model Code Generator this skillzhnnky329/MathModeling-skills1.1k—~691Automated safety check: PassMIT
MCP Server Builderanthropics/skills180k64 repos~2.3kAutomated safety check: PassApache-2.0
PDF Processinganthropics/skills180k48 repos~2kAutomated safety check: PassProprietary
NotebookLM Research AssistantPleasePrompto/notebooklm-skill7.8k14 repos~2.4kAutomated safety check: NotesMIT
Manim Video Productionbrowser-use/video-use28k6 repos~3kAutomated safety check: PassMIT
Code Review ChecklistshareAI-lab/learn-claude-code78k5 repos~1.1kAutomated safety check: PassMIT

Similar skills

  • MCP Server Builder

    anthropics/skills

    Official

    Guides the design and implementation of Model Context Protocol servers in TypeScript or Python, from tool naming and error messages to evaluation.

    180k GitHub starsUsed in 64 repos~2.3k tokens
    Agent WorkflowsAuto-check passed
  • PDF Processing

    anthropics/skills

    Official

    Handles everyday PDF jobs in Python and on the command line: extract text and tables, merge, split, rotate, watermark, fill forms, encrypt and OCR.

    180k GitHub starsUsed in 48 repos~2k tokens
    Documents & OfficeAuto-check passed
  • NotebookLM Research Assistant

    PleasePrompto/notebooklm-skill

    Lets Claude Code ask questions of your Google NotebookLM notebooks through browser automation and return answers grounded in your uploaded sources.

    7.8k GitHub starsUsed in 14 repos~2.4k tokens
    Knowledge ManagementAuto-check: notes
  • Manim Video Production

    browser-use/video-use

    Produces math and technical explainer videos with Manim Community Edition: concept animations, equation derivations, algorithm walkthroughs and data stories.

    28k GitHub starsUsed in 6 repos~3k tokens
    Media & CreativeAuto-check passed
  • Code Review Checklist

    shareAI-lab/learn-claude-code

    Reviews code against a five-part checklist covering security, correctness, performance, maintainability and testing, and reports findings in a fixed format.

    78k GitHub starsUsed in 5 repos~1.1k tokens
    DevelopmentAuto-check passed
  • PPT Master

    hugohe3/ppt-master

    Generates editable PowerPoint decks, rebuilds slides from images, fills .pptx templates and polishes existing presentations through routed workflows.

    58k GitHub starsUsed in 1 repo~2.5k tokens
    Documents & OfficeAuto-check passed

More from zhnnky329/MathModeling-skills

All 29 skills in this repo
  • Method Selector

    zhnnky329/MathModeling-skills

    Build and risk-screen a compact role-based method shortlist for a mathematical-modeling subquestion.

    1.1k GitHub stars~1.6k tokensUpdated 14 days ago
    Auto-check passed
  • Problem Classifier

    zhnnky329/MathModeling-skills

    Classify each parsed mathematical-modeling subquestion by required output and structure, surface ambiguous framing trade-offs for human choice, and record primary/secondary task types without…

    1.1k GitHub stars~611 tokensUpdated 14 days ago
    Auto-check passed
  • Data Auditor Cleaner

    zhnnky329/MathModeling-skills

    Map contest attachments to subquestions, audit and clean raw data, and emit one reusable data profile with quality, coverage, imbalance, concentration, and method-readiness evidence for downstream…

    1.1k GitHub stars~1.1k tokensUpdated 14 days ago
    Auto-check passed
  • Decision Prompt Builder

    zhnnky329/MathModeling-skills

    Build one compact choice card at a genuine mathematical-modeling judgment point.

    1.1k GitHub stars~837 tokensUpdated 14 days ago
    Auto-check passed
  • Matlab Model Code Generator

    zhnnky329/MathModeling-skills

    Generate and run minimal reproducible MATLAB or Beita Tianyuan compatible code for the human-approved main method and usable baseline, with compact experiment artifacts and a canonical run summary.

    1.1k GitHub stars~685 tokensUpdated 14 days ago
    Auto-check passed
  • Model Code Analyzer

    zhnnky329/MathModeling-skills

    Translate a human-approved main method and usable baseline into a minimal language-neutral implementation and experiment contract.

    1.1k GitHub stars~881 tokensUpdated 14 days ago
    Auto-check passed

Works with

Questions about Python Model Code Generator

What does Python Model Code Generator 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. Python Model Code Generator is an agent skill from zhnnky329/MathModeling-skills. 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 in Claude Code?

Run `npx skills add zhnnky329/MathModeling-skills --skill python-model-code-generator -a claude-code`. Or copy the skill folder (.codex/skills/python-model-code-generator in zhnnky329/MathModeling-skills) into .claude/skills/python-model-code-generator in your project. Claude Code loads it when a task matches its description.

How do I install Python Model Code Generator in Codex?

Run `npx skills add zhnnky329/MathModeling-skills --skill python-model-code-generator -a codex`. Or copy the skill folder (.codex/skills/python-model-code-generator in zhnnky329/MathModeling-skills) into .agents/skills/python-model-code-generator in your project. Codex loads it when a task matches its description.

Can I use Python Model Code Generator in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add zhnnky329/MathModeling-skills --skill python-model-code-generator -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/python-model-code-generator, .gemini/skills/python-model-code-generator, .github/skills/python-model-code-generator and .opencode/skills/python-model-code-generator in your project.

What does Python Model Code Generator need to run?

SKILL.md names no scripts, command-line tools or credentials: Python Model Code Generator is instructions for the agent only. Our summary lists: Python 3.

Does Python Model Code Generator access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Python Model Code Generator safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Python Model Code Generator use?

Python Model Code Generator is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Python Model Code Generator use?

About 691 tokens (SKILL.md is roughly 2.8k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Python Model Code Generator?

Skills that share tags, products or a category with Python Model Code Generator: MCP Server Builder (anthropics/skills, 180k stars), PDF Processing (anthropics/skills, 180k stars), NotebookLM Research Assistant (PleasePrompto/notebooklm-skill, 7.8k stars) and Manim Video Production (browser-use/video-use, 28k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Python Model Code Generator?

zhnnky329 (a GitHub user) maintains it in zhnnky329/MathModeling-skills, which has 1,059 GitHub stars. The repository holds 29 skills in this directory. The repository was last updated on September 24, 2026.

Source: zhnnky329/MathModeling-skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.