ワンクリックで
code-analyzer
Deep analysis of ML source code repositories — AST call graphs, training loop dissection, reproducibility scoring.
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
メニュー
Deep analysis of ML source code repositories — AST call graphs, training loop dissection, reproducibility scoring.
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
SOC 職業分類に基づく
Beamer LaTeX slide workflow: create, compile, review, and polish academic presentations. Use this skill whenever the user works on Beamer .tex slide decks, or asks to create slides, make a presentation, prepare a lecture, build a talk, or generate Beamer slides from a paper. Covers: creation, editing, compilation, proofreading, visual audit, pedagogical review, TikZ diagrams, figure extraction, and comprehensive quality checks. Trigger on: beamer, slides, lecture, presentation, seminar talk, conference talk, defense slides, tikz, compile latex, proofread slides, slide review, 讨论班, 论文讲解. Do NOT trigger on: powerpoint, pptx, PPT, 做PPT — use the powerpoint-slides skill instead.
Compare reproduced results against paper-reported values. Generate Markdown/JSON/Beamer reports.
Generate implementation code scaffolding from paper descriptions when no source code exists.
Convert LaTeX math formulas from papers into executable PyTorch/NumPy code.
Automate paper reproduction on remote GPU servers via mcp-ssh, using code-analyzer's reports.
Prepare structured presentation materials from parsed papers for beamer-skill's create workflow.
| name | code-analyzer |
| description | Deep analysis of ML source code repositories — AST call graphs, training loop dissection, reproducibility scoring. |
Perform comprehensive analysis of a cloned ML research repository to understand:
This skill produces a structured JSON report consumed by other skills:
# Install optional dependencies (for flowchart generation)
pip install -r code-analyzer/requirements.txt
# Run full analysis
python code-analyzer/analyze.py workspace/<paper>/code/<repo>/ -o workspace/<paper>/code_analysis.json
# With optional code2flow flowchart
python code-analyzer/analyze.py <code_dir> -o analysis.json --flowchart
Scans imports and dependency files to identify:
ast module, PyCG-inspired)nn.Module subclassesself.conv1 = nn.Conv2d(...) from __init__for epoch in range(...) training loops via ASTBased on NeurIPS/PwC standards:
| Check | Points |
|---|---|
| Dependency spec (requirements.txt) | 15 |
| Training code | 15 |
| Evaluation code | 10 |
| Pre-trained models | 10 |
| Config files | 10 |
| README training commands | 10 |
| Results table | 10 |
| Dockerfile | 5 |
| LICENSE | 5 |
| .gitignore | 5 |
| Tests | 5 |
Total: 100 points → Grade A/B/C/D/F
Automatically generates a step-by-step reproduction plan with shell commands.
The JSON report contains:
{
"framework": {"primary": "pytorch", "all": {...}},
"structure": {"total_files": 42, "total_py_files": 28},
"ast_analysis": {
"model_classes": [...],
"key_functions": {"train": [...], "forward": [...], "loss": [...]},
"call_graph": {"module.func": ["callee1", "callee2"]},
"stats": {"total_functions": 150, "model_classes": 3}
},
"training": {
"training_loops": [...],
"optimizers": ["AdamW"],
"loss_functions": ["CrossEntropyLoss"],
"hyperparameters": {"lr": "0.001", "batch_size": "32"}
},
"configs": {
"config_systems": ["argparse"],
"argparse_args": [{"name": "--lr", "default": "0.001"}]
},
"reproducibility": {
"total_score": 75,
"grade": "B",
"recommendations": [...]
},
"reproduction_plan": [
{"step": 1, "name": "Environment Setup", "commands": [...]},
{"step": 2, "name": "Training", "commands": [...]}
]
}
ast, re, json, pathlib)code2flow for flowchart generation (pip install code2flow)code_analysis.json used by:
code-reproducer → reads reproduction plan, training commandspaper-presenter → reads AST analysis for code-theory alignmentresult-analyzer → reads expected metrics for comparisonWhen encountering issues with code analysis, fetch these URLs:
| Topic | URL |
|---|---|
Python ast module docs | https://docs.python.org/3/library/ast.html |
| PyCG call graph analysis | https://github.com/vitsalis/PyCG |
| PyCG paper (ICSE'21) | https://arxiv.org/abs/2103.00587 |
| code2flow flowcharts | https://github.com/scottrogowski/code2flow |
| ML Code Completeness Checklist | https://medium.com/paperswithcode/ml-code-completeness-checklist-e9127b168501 |
| Papers With Code trends | https://paperswithcode.com/trends |
| PyTorch model inspection | https://pytorch.org/docs/stable/generated/torch.nn.Module.html |
| HuggingFace Trainer API | https://huggingface.co/docs/transformers/main_classes/trainer |
Problem: AST parsing fails on a Python file. Likely cause: Non-standard Python syntax, encoding issues, or Python 2 code.
# Fetch Python ast docs:
fetch_url("https://docs.python.org/3/library/ast.html")
Problem: code2flow not generating flowcharts.
Solution: Ensure graphviz is installed system-wide.
# Windows
choco install graphviz
# Ubuntu
apt-get install graphviz
# Fetch code2flow docs:
fetch_url("https://github.com/scottrogowski/code2flow")
Problem: Need to understand why a repo scored low.
# Fetch the ML Code Completeness methodology:
fetch_url("https://medium.com/paperswithcode/ml-code-completeness-checklist-e9127b168501")