跳到正文
Skillpedia
分析与电子表格14k · #11318

jupyter-notebooks

它能做什么

这项技能构建 Jupyter 笔记本,将说明文字、SQL 或 Python 代码和结果结合在一起。适合希望分析过程能被他人审阅和重新运行的分析师。

适用场景

  • ✓当你想把一项分析保存为他人可以重新运行的笔记本的时候。
  • ✓当你需要记录某个数字是如何计算得出的审计轨迹的时候。
  • ✓当你想为报告或建议配套一个笔记本的时候。

技能链接

https://github.com/XiaomiMiMo/MiMo-Code/blob/main/packages/cli/src/skill/builtin/.bundle/data-analytics/workflows/jupyter-notebooks/SKILL.md

复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。

使用方法

最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。

可直接粘贴的消息

请用这个技能帮我:https://github.com/XiaomiMiMo/MiMo-Code/blob/main/packages/cli/src/skill/builtin/.bundle/data-analytics/workflows/jupyter-notebooks/SKILL.md 阅读该链接中的 SKILL.md 文件,并在我的任务中按照它的说明来做。
想让你的 AI 自己找到这样的技能吗?安装免费的 Skillpedia MCP:只需一行,每次任务前它都会在 15,000+ 个技能中搜索。1 分钟完成安装 →

可以这样问 AI

“我想要一个笔记本,根据我们的销售表计算月度留存率,这样我的团队可以重新运行。”

每周 5 个新技能,1 分钟读完。

工作原理

智能体会先在笔记本开头给出清晰的摘要,然后按顺序编写代码单元,并从头到尾运行一遍,以确认其能正常工作。如果无法运行,它会列出重现结果所需的步骤。

技术内容(原始 SKILL.md)

作者在 GitHub 上的英文原文。

Related Skills

Use $validate-data when notebook results support a recommendation, shared claim, or decision.

Jupyter Notebooks

Create clean, reproducible Jupyter notebooks that are easy to skim, rerun, and handoff. Treat the notebook as a reader-facing analysis artifact, not a scratchpad dump. Notebook work is not complete until the notebook executes successfully top-to-bottom, or the execution gap is called out with the exact validation steps needed to reproduce it.

Workflow

  1. Lock the notebook mode and scope.

    Decide whether the notebook is an analysis report, experiment log, diagnostic notebook, data-quality check, market-sizing calculation, model exploration, tutorial, or companion artifact for a report. Identify the reader, decision, expected handoff, required inputs, and whether the task calls for a new notebook or targeted edits to an existing one.

  2. Inspect or scaffold with notebook-safe tooling.

    Prefer JupyterLab, nbformat, nbclient, or an existing scaffold utility over hand-editing raw JSON. When editing an existing notebook, preserve its intent and minimize JSON churn. Avoid reordering cells unless it clearly improves the top-to-bottom story. If raw JSON editing is unavoidable, validate the notebook structure before finishing.

  3. Structure the notebook for the chosen mode.

    For analytical notebooks, default to:

    1. ## tl;dr
    2. ## Context & Methods
    3. ## Data
    4. ## Results
    5. ## Takeaways

    Write tl;dr and takeaways after reviewing executed outputs. Use concrete observed values, visible patterns, rows, or charts, not assumptions. Include a ### Key Assumptions subsection in Context & Methods when assumptions affect correctness.

    For tutorials or walkthroughs, adapt the same discipline to a teaching flow:

    1. ## Goal
    2. ## Setup
    3. ## Steps
    4. ## Checks
    5. ## Next Steps
  4. Build a clear data and computation path.

    Separate setup, imports, parameters, data loading, data preparation, calculations, visualizations, and interpretation. If the notebook uses both SQL and Python, keep complex SQL in SQL cells or separate query files rather than large embedded Python strings unless there is a clear reason. Use descriptive variable names and keep each code cell focused on one step.

  5. Use data sources deliberately.

    When a notebook needs table data, first use ~~structured_data to confirm table choice, schema, partition filters, sample rows, and query-submission policy. Use the relevant source connector when available, then fall back to exports or pasted SQL when needed. Use ~~operations_logs for freshness or lineage checks when they matter. Record query permalinks, request IDs, source paths, dashboard links, extract names, or other source artifacts in the notebook context for any executed result that supports the analysis. Keep heavy queries filtered and bounded instead of turning the notebook into a broad live-source scan.

  6. Make cells readable and bounded.

    Add concise markdown headers before most code cells. Keep headers brief and action-oriented, such as ### 1. Load Data, ### 2. Validate Inputs, or ### 3. Plot Results. Favor several short cells over one large mixed-purpose cell. Keep prose short: explain purpose, assumptions, and expected result, not every line of code. Split multiple tables or charts across separate cells instead of dumping all outputs from one cell.

  7. Validate results before writing conclusions.

    Check that key numbers, charts, and takeaways match executed outputs. Bound raw debug output, oversized tables, and noisy logs. If a result is surprising, add a local reasonableness check, small sample inspection, or reconciliation against a trusted source before promoting it to the summary.

  8. Execute and record validation status.

    Run the notebook top-to-bottom when the environment allows:

    python -m jupyter nbconvert --execute --to notebook --inplace path/to/notebook.ipynb
    

    Optional local setup when needed:

    uv pip install jupyterlab nbformat nbclient ipykernel
    

    If execution is not possible, say so explicitly and provide the exact command, missing dependency, credential, data access, kernel, or environment step needed to validate locally.

Standards

Notebook Structure

  • Make the default top-to-bottom read clear before the reader starts executing cells out of order.
  • Put executive summary material at the t
常见问题

笔记本必须能运行吗?

这项技能说明,除非从头到尾能够运行,或者说明了未能运行的原因,否则笔记本工作不算完成。

它能编辑我已有的笔记本吗?

能。它可以进行有针对性的编辑,并保留笔记本的原始意图。

什么时候应该验证结果?

这项技能说明,当结果支撑某项建议或决定时,应验证笔记本。

详情

作者的原始描述

Create, edit, or validate reproducible SQL or Python notebooks. Use for notebooks, SQL/Python scratchpads, reproducible exploration, audit trails, or runnable companions where the analysis should be reviewable or rerunnable.

repo: XiaomiMiMo/MiMo-Code

热度

GitHub 星标
14k
排名
#11318
许可证
MIT
更新时间
2026/11/2

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能