Logo : Sim Code Explainer

Sim Code Explainer

Communauté
mkaremm80
sim-code-explainer

Turn any Python simulation or engineering program into a colourful, zero-to-hero PDF guide that explains every block and line, the theory and system model behind it, every variable and what changing it does, and the actual results of running it (plus a Google Colab notebook). Use this whenever the user uploads or points to Python code and wants it explained, documented, taught, turned into a report/tutorial/lecture notes, or "explained from zero for someone who doesn't know Python" - for any domain (communications/OFDM/5G, control/PID, power systems, signal processing, queueing, Monte-Carlo, physics, ML, finance models). Also use it when the user asks to first WRITE a simulator for a system (e.g. "simulate OFDM and measure BER vs SNR, then explain the code in a PDF") and then explain it.

Présentation

Éditeurmkaremm80
DépôtMy-Skills-on-Claude
Nom de la compétencesim-code-explainer
Étoiles
91
Forks
20
Fichiers inclus
19
LicenceMIT
Liens
  • Instructions en Markdown

    Un fichier SKILL.md que le modèle charge à la demande : il ne consomme donc des tokens que lorsqu’une demande correspond réellement à la compétence.

  • Compatible avec tous les LLM

    Les compétences IA sont rédigées en Markdown et non sous forme de code propre à un fournisseur. Elles fonctionnent donc avec GPT, Claude, Gemini, Grok ou un modèle local.

  • Fichiers inclus : 19

    Des scripts, des gabarits et des références que le modèle peut consulter pendant son travail. Les fichiers sont en lecture seule et ne sont jamais exécutés.

  • Open source

    Publiée par mkaremm80 sur GitHub. Consultez les sources avant de l’installer.

Installation

Installez la compétence IA Sim Code Explainer dans TypingMind pour l’utiliser avec n’importe quel LLM, ou ajoutez-la à un autre agent capable de lire SKILL.md.

1

Installer dans TypingMind

TypingMind installe une compétence directement depuis son dossier GitHub : l’application lit SKILL.md, regroupe les fichiers de ressources et enregistre le tout localement.

  1. Ouvrez l’application et accédez à Plugins → Compétences.
  2. Choisissez « Installer depuis GitHub ».
  3. Copiez l’URL ci-dessous, qui pointe vers le dossier de la compétence, puis collez-la et confirmez.
    https://github.com/mkaremm80/My-Skills-on-Claude/tree/main/skills/sim-code-explainer
  4. Activez la compétence dans chaque discussion où vous souhaitez pouvoir l’utiliser.
Plugins → Compétences → Ajouter une compétence → Via une URL GitHub, puis collez l’URL du dossier et appuyez sur Continuer.
2

Installer dans un autre agent

Tout agent capable de lire le format Agent Skills peut utiliser cette compétence : copiez le dossier dans le répertoire des compétences de cet agent.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/mkaremm80/My-Skills-on-Claude.git /tmp/My-Skills-on-Claude
mkdir -p .claude/skills
cp -r /tmp/My-Skills-on-Claude/skills/sim-code-explainer .claude/skills/sim-code-explainer
Redémarrez Claude Code après la copie pour que la nouvelle compétence soit prise en compte.

Utilisez cette compétence dans TypingMind

Activez Sim Code Explainer dans n’importe quelle discussion TypingMind et le modèle s’occupe du reste. Le nom et la description de la compétence figurent dans le prompt système. Dès qu’une demande correspond, le modèle charge lui-même l’intégralité des instructions : vous n’avez jamais à l’invoquer manuellement, et elle ne consomme aucun token tant qu’elle n’est pas utilisée.

Le modèle charge automatiquement Sim Code Explainer dès qu’une demande correspond à cette compétence.

Compatible avec tous les modèles IA

Les compétences IA sont de simples instructions Markdown, et non du code propre à un fournisseur. Ainsi, la compétence Sim Code Explainer n’est pas liée au modèle pour lequel elle a été conçue. Installez-la une seule fois dans TypingMind et utilisez-la avec GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama ou un modèle local que vous exécutez vous-même, le tout avec vos propres clés API.

  • Chargée uniquement en cas de besoin

    Le prompt système ne contient que le nom et la description. Les instructions sont récupérées à la première demande correspondante : une compétence inutilisée ne coûte donc rien.

  • Changez de modèle en cours de discussion

    La compétence étant constituée d’instructions et non de code, elle reste fonctionnelle lorsque vous changez de modèle : le nouveau modèle lit le même fichier SKILL.md.

Instructions de la compétence

Voici le contenu de SKILL.md que le modèle charge. Lisez-le avant l’installation : une compétence contient des instructions que votre modèle suivra.

Simulation Code Explainer

Produce a guide that lets a reader with zero Python knowledge understand a program completely: what problem it solves, the theory, how every group of lines works, why it is written that way, what each variable does to the results, and what the actual results mean.

Examples (look at them before writing your first guide):

  • examples/pid_motor/ - a complete worked case: original code, block-marked code, the full make_guide.py and the resulting 31-page PDF. Use its make_guide.py as the model for yours.
  • examples/mm1_queue/ - a shorter guide (24 pages) for an event-driven simulation.
  • examples/ofdm_reference_guide.pdf - a 65-page guide for a 5G MIMO-OFDM simulator: the depth to aim for when the code is large and the domain is rich.

Deliverables: <Name>_Guide.pdf, <name>.ipynb (Colab), the block-marked .py, and the figures.

Workflow

0. Agree on scope (one short message, then proceed)

Confirm in one message, with sensible defaults so the user can just say "go":

  • audience (default: zero Python, basic engineering maths),
  • language of the PDF (default English; the PDF engine is Latin/Greek only, so warn that Arabic or other right-to-left output is not supported),
  • scope: what the report covers and what it deliberately leaves out. Users care about this - they will present the report, so the scope must be stated explicitly in the PDF (a scope page is built in).
  • If the user has no code yet and wants you to write the simulator first, also agree on the system model, the parameters and the measurements, then write clean, block-marked code (see "Writing the simulator" below) before continuing.

Set up: SK=<this skill folder>; work in a fresh folder; pip install reportlab pygments matplotlib numpy if missing (pdftoppm from poppler-utils is used for QA if present).

1. Analyse the code

bash
python $SK/scripts/code_parser.py user_code.py --write-markers user_code_marked.py

This prints the blocks, functions/classes, tunable parameters and the Python features used, and writes user_code.analysis.json. If the file had no # ==== [BLOCK n] Title ==== markers it writes a copy with proposed markers. Then open the marked copy and refine it by hand:

  • give every block a meaningful title ("Motor model: one Euler step" rather than "motor_step()"),
  • split blocks longer than ~40-60 lines at natural boundaries (a marker may be indented inside a function; the block then ends at the next marker),
  • never change the program's logic; only add or edit marker comments (and, at most, explanatory comments). Re-run code_parser.py on the marked file afterwards.

Read the whole program carefully. You must understand every line before explaining it - trace the data flow (what each array/object holds, its shape/units) and identify the system model it implements.

2. Run it and capture the results

bash
python $SK/scripts/run_and_capture.py user_code_marked.py --out run_out --timeout 900

Figures land in run_out/figures/: those the program saves keep their own names, those it only shows become auto_01.png, auto_02.png, ... in display order. Printed output goes to run_out/stdout.txt, a summary to run_out/run_report.json (status, run time, work_dir). Look at every figure (open the PNGs) and read the output; these are the only numbers you may quote as results. To compute extra numbers (a value at another setting, a check against theory, exercise outcomes), import the marked program as a module in make_guide.py and call its functions, as examples/pid_motor/make_guide.py does - never type numbers by hand.

  • If the run is slow, look for a quick-mode flag in the code or ask the user before editing values; say in the guide which settings were used.
  • If it cannot run here (missing data files, GPU, licences, hours of runtime), still write the guide, but say clearly in the scope page and results chapter that results are not shown and why. Never invent numbers or draw "expected" plots as if they were results.
  • If the code has a bug, tell the user; explain the code as written and mention the issue in a warn box rather than silently fixing it.

3. Write the guide script

Copy templates/guide_template.py to make_guide.py in the work folder and fill it in (set SCE_SKILL_DIR or the SKILL path at its top). Read references/api.md for the helper functions and references/writing_guide.md for how to write each part - it describes the depth and tone that make these guides good. Key points:

  • Follow the chapter blueprint at the top of the template (scope, Python from zero, ideas, system model, code block by block, control panel, how the simulation works, results, summary, exercises, glossary).
  • Every block gets explain_block(...): one-sentence summary, the code with real line numbers, a line-by-line table covering every non-trivial line, and the boxes that apply (idea / model / what / py / warn).
  • Every tunable variable appears in the control-panel table with meaning, default, sensible range and the effect of increasing it on the results.
  • Every figure of the run appears in the results chapter with a res box that quotes the real numbers (parse them from stdout.txt or recompute them from saved data) and explains why the curve looks the way it does, linking back to equations (3.x) and to variables.
  • Draw 1-3 concept diagrams with scripts/diagram_kit.py (pipeline of the system with function names, a simulation-loop flowchart); add matplotlib explanatory plots where a picture teaches better.

4. Build and check visually

bash
python make_guide.py
python $SK/scripts/render_check.py <Name>_Guide.pdf --out qa

Open the contact sheets in qa/ and fix what you see: overlapping text, figures too small or split, empty half pages, red "figure not found" boxes, unreadable equations, tables overflowing. Zoom into a few pages with --pages 3 12 25 --dpi 80. Iterate until clean.

5. Notebook and delivery

bash
python $SK/scripts/make_notebook.py user_code_marked.py <name>.ipynb --title "..." [--pip "pkg1 pkg2"]

Execute it once if Jupyter is available (jupyter nbconvert --to notebook --execute) to be sure it runs top to bottom. Deliver the PDF, notebook, marked .py and figures (a zip is convenient), with a short summary of what the guide contains and any limitations (e.g. results not reproducible here).

Writing the simulator (only when the user asks you to create it)

Write code a beginner can follow: one make_config(**changes) (or a clear parameter section) with a comment on every parameter, small single-purpose functions, # ==== [BLOCK n] Title ==== markers from the start, vectorised NumPy where natural, a fixed random seed, plots saved to figures/ and also shown, a theory/validation check against a closed-form result whenever one exists (it is what makes the results trustworthy), and a FAST flag if the full run takes more than a few minutes.

Quality bar (why it matters)

  • The reader is a beginner who will present or reuse this work: a wrong number or an unexplained line breaks their trust and their presentation. Accuracy beats length.
  • Explanations should connect three levels every time: Python mechanics (what the line does) -> engineering meaning (what it represents in the system) -> consequence (what changes in the results if it changes).
  • Quote results only from the actual run, with units, and say how reliable they are (statistical noise, step size, number of runs).
  • Keep the scope honest: list what the model ignores; do not add features the user did not ask for.

Fichiers inclus

Le modèle lit ces fichiers à la demande lorsque la compétence est chargée. Ils sont accessibles en lecture et ne sont jamais exécutés.

Foire aux questions

À quoi sert la compétence IA Sim Code Explainer ?

Turn any Python simulation or engineering program into a colourful, zero-to-hero PDF guide that explains every block and line, the theory and system model behind it, every variable and what changing it does, and the actual results of running it (plus a Google Colab notebook). Use this whenever the user uploads or points to Python code and wants it explained, documented, taught, turned into a report/tutorial/lecture notes, or "explained from zero for someone who doesn't know Python" - for any domain (communications/OFDM/5G, control/PID, power systems, signal processing, queueing, Monte-Carlo...

Pourquoi utiliser Sim Code Explainer sur TypingMind ?

Parce que vous l’installez une seule fois pour l’utiliser avec n’importe quel modèle. Sim Code Explainer se compose de simples instructions en Markdown plutôt que de code propre à un fournisseur. La même compétence fonctionne donc avec GPT-5, Claude, Gemini, Grok ou un modèle local, et vous pouvez changer de modèle en cours de discussion sans perturber son fonctionnement. TypingMind utilise vos propres clés API : vous payez donc directement les fournisseurs plutôt qu’un abonnement par siège, et vos compétences et discussions restent dans votre propre espace de stockage.

Comment installer Sim Code Explainer dans TypingMind ?

Dans TypingMind, ouvrez Plugins → Compétences → Installer depuis GitHub et collez https://github.com/mkaremm80/My-Skills-on-Claude/tree/main/skills/sim-code-explainer. TypingMind lit le fichier SKILL.md, regroupe les fichiers associés et installe le tout sous forme de compétence que vous pouvez activer pour chaque discussion.

Quels modèles d’IA peuvent utiliser Sim Code Explainer ?

N’importe quel modèle que vous connectez dans TypingMind. Les compétences IA sont de simples instructions en Markdown, et non du code propre à un fournisseur. GPT, Claude, Gemini, Grok et les modèles locaux peuvent donc tous charger cette compétence lorsqu’une demande lui correspond.

Combien de modèles d’IA puis-je utiliser avec Sim Code Explainer ?

Autant que vous le souhaitez. Vous pouvez utiliser Sim Code Explainer avec tout modèle qui prend en charge les compétences : GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama et bien d’autres, le tout dans TypingMind avec vos propres clés API.

La compétence IA Sim Code Explainer est-elle gratuite ?

Oui. Cette compétence est publiée sur GitHub par mkaremm80 sous licence MIT. Vous ne payez que votre propre fournisseur d’IA pour les tokens utilisés.

Que sont les compétences IA ?

Une compétence IA est un ensemble d’instructions réutilisables qui apprend à un modèle d’IA à accomplir une tâche précise. Elle suit le format ouvert Agent Skills : un fichier SKILL.md contenant un nom et une description, ainsi que les éventuels scripts, gabarits ou fichiers de référence dont le modèle peut avoir besoin. Le modèle ne lit les instructions que lorsque votre demande correspond à la compétence. Une compétence installée ne coûte donc rien tant qu’elle n’est pas utilisée.

En quoi les compétences IA diffèrent-elles des plugins ou des serveurs MCP ?

Un plugin ou un serveur MCP fournit au modèle de nouveaux outils à appeler : du code qui s’exécute quelque part et renvoie un résultat. Une compétence IA lui apporte plutôt des connaissances et une méthode : comment aborder une tâche, quelles étapes suivre et à quoi ressemble un bon résultat. Les compétences sont de simples instructions en Markdown. Elles ne nécessitent donc ni serveur, ni clé API, ni environnement d’exécution, et fonctionnent avec n’importe quel modèle.

Tout voir

Créez votre propre espace de travail IA dès maintenant

Abonnez-vous à notre newsletter pour être informé des nouvelles fonctionnalités et des prochains cadeaux à gagner 👇