jupytext/SKILL.md
Jupyter Notebook 创建与格式转换技能。当用户提到以下任何请求时必须使用:新建/创建 notebook、Jupyter notebook、.ipynb、jupytext、py:percent、# %% cell 格式、notebook 版本控制、paired notebook、notebook 转 Python、Python 转 notebook、用纯文本写 notebook。即使用户只说「新建一个 notebook」也应触发此技能——先询问用户选用 .py percent format 还是传统 .ipynb,再按选定格式生成。不用于调试已有 notebook 或写普通 Python 脚本。
npx skillsauth add ninehills/skills jupytextInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
本技能帮助用户用纯 Python 脚本编写 Jupyter Notebook,借助 Jupytext 实现 .py ↔ .ipynb 双向转换。
当用户提出以下请求时触发:
# %% cell 分隔符(percent format)必须先问用户想要哪种格式:
| 格式 | 适用场景 |
|------|----------|
| .py(percent format) | 需要版本控制、纯编辑器开发、code review 友好 |
| .ipynb | 需要 Jupyter 原生体验、包含大量输出/图表 |
如果用户只说「新建一个 notebook」,默认推荐 .py(percent format),因为:
# %%).py percent format 文件一个完整的 percent format Python 文件长这样:
# ---
# jupytext:
# formats: ipynb,py:percent
# notebook_metadata_filter: -all
# ---
# %% [markdown]
# # 标题
# 这是一段 Markdown 说明
# %% [markdown]
"""
也可以用三引号写多行 Markdown,
这在 Python 中更易读。
"""
# %%
import numpy as np
import pandas as pd
# %%
data = pd.DataFrame({
"x": np.random.randn(100),
"y": np.random.randn(100),
})
data.head()
关键语法:
| 语法 | 含义 |
|------|------|
| # %% | 代码 cell 开始 |
| # %% [markdown] | Markdown cell 开始 |
| # %% 标题文字 [markdown] | 带标题的 Markdown cell |
| # %% [markdown] + """...""" | 用三引号包裹多行 Markdown(推荐) |
| # %% key="value" | 带 cell metadata |
.ipynb 文件如果用户选择传统 notebook,使用 nbformat 或直接构造 JSON。参考 references/nbformat-guide.md 了解如何用 Python 构造 .ipynb。
根据用户需求,告知或执行:
pip install jupytextjupytext --to notebook script.pyformats: ipynb,py:percent,之后 jupytext --sync script.py 即可同步两端YAML front matter 是 .py 文件头部用 # --- 包围的元数据块:
# ---
# jupytext:
# formats: ipynb,py:percent
# notebook_metadata_filter: -all
# cell_metadata_filter: -all
# ---
# %% [markdown]
# # My Notebook
常用配置:
| 配置 | 作用 |
|------|------|
| formats: ipynb,py:percent | 启用 paired notebook(保存时双向更新) |
| notebook_metadata_filter: -all | 不在 .py 中输出 notebook 级元数据 |
| cell_metadata_filter: -all | 不在 .py 中输出 cell 级元数据 |
| cell_markers: '"""' | Markdown cell 用三引号而非 # 注释 |
在项目根目录创建 jupytext.toml 可设置全局默认:
# 所有 notebook 自动 paired
formats = "ipynb,py:percent"
# Markdown cell 用三引号
cell_markers = '"""'
或 pyproject.toml:
[tool.jupytext]
formats = "ipynb,py:percent"
cell_markers = '"""'
# .py → .ipynb
jupytext --to notebook script.py
# .ipynb → .py (percent format)
jupytext --to py:percent notebook.ipynb
# 启用 paired notebook
jupytext --set-formats ipynb,py:percent notebook.ipynb
# 同步 paired notebook(以较新文件为准)
jupytext --sync notebook.ipynb
# 测试 round-trip 一致性
jupytext --test notebook.ipynb --to py:percent
# 用 black 格式化
jupytext --sync --pipe black notebook.ipynb
# 设置 kernel 信息
jupytext --set-kernel - notebook.py
除了 percent format (# %%),Jupytext 还支持 light format,用 # + / # - 标记 cell 边界:
# +
import numpy as np
# + [markdown]
# 这是一段说明
由于 light format 不如 percent format 通用(仅 Jupytext 原生支持),一般不推荐,除非用户明确要求。
.py 文件中不要混用 percent format 和 light format 的分隔符.ipynb 文件想版本控制,推荐 jupytext --set-formats ipynb,py:percent 转为 paired notebookcell_markers: '"""'.py percent format 文件可以在 VS Code 中直接作为 Interactive Window cell 运行,无需启动 Jupyterdevelopment
React and Next.js performance optimization guidelines from Vercel Engineering. This skill should be used when writing, reviewing, or refactoring React/Next.js code to ensure optimal performance patterns. Triggers on tasks involving React components, Next.js pages, data fetching, bundle optimization, or performance improvements.
tools
UI/UX design intelligence for web and mobile. Includes 50+ styles, 161 color palettes, 57 font pairings, 161 product types, 99 UX guidelines, and 25 chart types across 10 stacks (React, Next.js, Vue, Svelte, SwiftUI, React Native, Flutter, Tailwind, shadcn/ui, and HTML/CSS). Actions: plan, build, create, design, implement, review, fix, improve, optimize, enhance, refactor, and check UI/UX code. Projects: website, landing page, dashboard, admin panel, e-commerce, SaaS, portfolio, blog, and mobile app. Elements: button, modal, navbar, sidebar, card, table, form, and chart. Styles: glassmorphism, claymorphism, minimalism, brutalism, neumorphism, bento grid, dark mode, responsive, skeuomorphism, and flat design. Topics: color systems, accessibility, animation, layout, typography, font pairing, spacing, interaction states, shadow, and gradient. Integrations: shadcn/ui MCP for component search and examples.
data-ai
Triage issues through a state machine driven by triage roles. Use when user wants to create an issue, triage issues, review incoming bugs or feature requests, prepare issues for an AFK agent, or manage issue workflow.
tools
Turn the current conversation context into a PRD and publish it to the project issue tracker. Use when user wants to create a PRD from the current context.