科学
- 作者仓库星标 34
- 许可证 MIT
- 作者仓库 skills
- 领域
- 数据
- 作者声明的智能体
- 未找到明确声明;不据此推断已兼容或已测试
- 静态检查
- 94 / 100 · 启发式扫描,不代表运行安全
- 运行环境证据
- 未执行;当前没有隔离运行测试证据
- 作者 / 版本 / 许可证
- @ericmjl · MIT
- 上下文用量评级
- 低消耗
- 接入复杂程度
- 需简单配置
- 是否需要外部接口密钥
- 不需要
- 兼容的系统
- 未声明(默认跨平台)
- 运行环境要求
- Python
- 检测到的文件与系统行为
-
- 只读
- 允许写入 / 修改
- 命令执行
- 网络行为
- 仅限本地
- 安装命令数
- 无(仅作为资料)
需要注意: 未声明工具权限范围;实际权限由运行环境决定。
不要打开数据文件并开始编码或绘图。询问或确认:问题背景——生物、化学或数据科学问题;用户希望了解或决定什么;以及任何约束(例如特定变量、子集)。将其记录在会话的`journal.md`中(参见第 3 阶段)。只有在记录并同意上下文后,才能继续检查数据形状并规划第一步。
在`analysis/`(或项目同意的基础)下创建一个会话文件夹。将其命名为描述性 + 会话开始时的 ISO 日期时间,例如`analysis/2025-02-05T14-30-00-protein-binding/`。每个会话文件夹的规范布局: `journal.md` – 此会话的仅附加运行日志 `plots/` – 所有图形(WebP 仅适用于 matplotlib) `scripts/` – 加载数据、总结或绘图的一次性脚本
在采取每项实质性行动之前,请阅读会议的`journal.md`。在日志中记录:数据形状:加载或检查数据后,记下列(以及相关类型)、行计数和任何结构(例如多索引、FASTA 计数、关键字段)。一旦形状已知并且在任何主要数据步骤之后就执行此操作。做了什么(哪个剧本、哪个情节、哪个摘要)发现、惊喜和后续想法
数据的形状:在提出或制作图表之前,确保代理(和用户)知道:存在哪些列/字段、有多少行/记录以及任何关键结构。将其记录在`journal.md`中的`[SHAPE]`条目下。单个第一个图(或表格):帮助用户选择第一个可视化或摘要(例如一个分布、一个概览表)。不要一次生成很多图;对齐该单个步骤,然后执行。
接受指示:用户可能会要求特定的图表、表格或过滤器。明确后才执行。在做之前先问为什么:当用户说“制作这个图”或“给我那张桌子”时,简短地问为什么(例如它支持什么决定或问题)。然后运行脚本并将结果记录在日志中。在每个操作之后:建议最合乎逻辑的下一步(一步),并让用户确认或重定向。不要自动执行长管道。
用于此 EDA 的所有 Python 都位于会话的 `scripts/` 文件夹下的脚本中。每个脚本的顶部都有 PEP723 内联脚本元数据(`# /// script`、`requires-python`、`dependencies`、`# ///`)。使用 `uv run script.py`(或带有 CWD = 会话文件夹的 `uv run scripts/script_name.py`)运行。不要运行原始的`python`或将代码粘贴到 REPL 中;脚本是执行单元并拥有其环境。
将所有 matplotlib(和类似)图形保存为 WebP,而不是 PNG,以保持较小的图像尺寸。使用例如`fig.savefig("plots/overview.webp", format="webp")`。将绘图文件写入会话的`plots/`目录中。描述性地命名文件(例如 `distribution_response.webp`、`first_ten_records.webp`)。当您记录所做的事情时,请在日志中参考这些图。
# Scientific exploratory data analysis
This skill guides **defensive**, **human-led** exploratory data analysis on scientific data. The agent does not open files and dump code; it captures problem context first, helps narrow to a single first step, takes instruction from the user, and asks "why?" before executing when the user requests a specific plot or table.
## Usage
Use this skill when the user provides one or more data files (CSV, FASTA, or other scientific formats) and wants to explore or analyze them. **Start by capturing context**—do not load or plot data until the problem (biological, chemical, or data-science question) is clearly stated and the agent is aligned as a guided assistant.
## Requirements
- **uv** for running Python scripts: every script uses PEP723 inline script metadata and is run with **`uv run script.py`**. Do not run ad-hoc Python or raw interpreters; each script declares and manages its own dependencies.
- Ability to read the relevant data formats (pandas, BioPython, etc.) via dependencies declared in the script block.
## What It Does
1. **Context first** – Capture and record the problem context (what question, what domain) before touching the data.
2. **Single first step** – Help the user narrow to **one** first plot or one first summary (not a barrage of code or plots).
3. **Human-guided execution** – Take instruction on what to do next; when the user says "make this plot" or "give me that table," **ask why** before doing it, then execute.
4. **Session layout** – Each analysis is a **session**: one folder under `analysis/` with a descriptive name and start date/time, containing `journal.md`, `plots/`, and `scripts/`.
5. **Journal** – Append-only `journal.md` per session: record data shape (columns, rows, structure), what was done, and findings.
6. **Scripts and plots** – Throwaway scripts in `scripts/` (PEP723, `uv run`); plots saved as **WebP** (not PNG) for small file size; all under the session folder.
7. **Suggest next step** – After each action, suggest the most logical next step and let the user decide.
## How It Works
### Phase 1: Capture context (before touching data)
- **Do not** open the data file and start coding or plotting.
- Ask for or confirm: the **problem context**—biological, chemical, or data-science question; what the user hopes to learn or decide; and any constraints (e.g. specific variables, subsets).
- Record this in the session’s `journal.md` (see Phase 3). Only after context is recorded and agreed, proceed to inspect data shape and plan the first step.
### Phase 2: Start a data analysis session
- Create **one session folder** under `analysis/` (or a project-agreed base). Name it **descriptive + ISO datetime** at session start, e.g. `analysis/2025-02-05T14-30-00-protein-binding/`.
- **Canonical layout** for each session folder:
- `journal.md` – append-only running journal for this session
- `plots/` – all figures (WebP only for matplotlib)
- `scripts/` – disposable scripts that load data, summarize, or make plots
- Session folder name must include date/time and a short descriptive slug so sessions are sortable and identifiable. See [references/session-structure.md](references/session-structure.md) for the canonical tree.
### Phase 3: Journal (append-only, per session)
- **Before each substantive action**, read the session’s `journal.md`.
- **Record in the journal:**
- **Data shape**: after loading or inspecting the data, jot columns (and types if relevant), row count, and any structure (e.g. multi-index, FASTA count, key fields). Do this as soon as shape is known and after any major data step.
- What was done (which script, which plot, which summary)
- Findings, surprises, and follow-up ideas
- Use a **timestamp** per entry (e.g. ISO or compact `YYYY-MM-DD HH:MM`).
- Tags like `[SHAPE]`, `[PLOT]`, `[FINDING]`, `[NEXT]` keep the journal scannable. The journal is the session’s memory; use it to suggest the next step.
### Phase 4: Understand shape, then one first step
- **Shape of the data**: Before proposing or making plots, ensure the agent (and user) knows: what columns/fields exist, how many rows/records, and any critical structure. Record this in `journal.md` under a `[SHAPE]` entry.
- **Single first plot (or table)**: Help the user choose **one** first visualization or summary (e.g. one distribution, one overview table). Do not generate many plots at once; get alignment on that single step, then execute.
### Phase 5: Human-guided execution and "ask why"
- **Take instruction**: The user may ask for a specific plot, table, or filter. Execute only after clarity.
- **Ask why before doing**: When the user says "make this plot" or "give me that table," briefly ask **why** (e.g. what decision or question it supports). Then run the script and record the outcome in the journal.
- **After each action**: Suggest the **most logical next step** (one step), and let the user confirm or redirect. Do not auto-execute a long pipeline.
### Phase 6: Scripts (disposable, PEP723, uv run)
- All Python used for this EDA lives in **scripts** under the session’s `scripts/` folder.
- **Every script** has **PEP723 inline script metadata** at the top (`# /// script`, `requires-python`, `dependencies`, `# ///`). Run with **`uv run script.py`** (or `uv run scripts/script_name.py` with CWD = session folder). Do **not** run raw `python` or paste code in a REPL; the script is the unit of execution and owns its environment.
- Scripts are **throwaway**: they are for this session’s plots and summaries, not production. Paths in scripts are relative to the session folder (e.g. `../data/file.csv` or as agreed).
### Phase 7: Plots (WebP only for matplotlib)
- Save **all matplotlib (and similar) figures as WebP**, not PNG, to keep image sizes small. Use e.g. `fig.savefig("plots/overview.webp", format="webp")`.
- Write plot files into the session’s **`plots/`** directory. Name files descriptively (e.g. `distribution_response.webp`, `first_ten_records.webp`).
- Reference these plots in the journal when you record what was done.
### When EDA is in a Marimo notebook
When the user conducts this EDA workflow in a **Marimo notebook** (instead of scripts in `scripts/`), follow the same phases above (context first, one step, journal, ask why). In addition:
- **Markdown before and after code**: For each code cell in the notebook, add **markdown cells before and after** that explain what the code does and what the results mean. The markdown before sets up intent; the markdown after summarizes or interprets the output.
See [references/marimo-notebook-eda.md](references/marimo-notebook-eda.md) for the canonical convention.
## Guardrails
1. **Context before data** – Do not open or analyze the data until the problem context is stated and recorded in the session journal.
2. **One first step** – Propose and agree on a single first plot or summary; do not generate a large block of code or many plots in one go.
3. **Ask why** – When the user requests a specific plot or table, ask why (what question or decision it serves) before executing.
4. **Journal as memory** – Read and append to the session’s `journal.md`; record data shape and findings so the next step is informed.
5. **Scripts only via uv run** – No ad-hoc Python; every script has PEP723 metadata and is run with `uv run script.py`.
6. **WebP for plots** – Use WebP for matplotlib (and similar) output; do not save as PNG by default.
7. **Suggest, don’t assume** – After each action, suggest one logical next step and wait for the user to confirm or change direction.
8. **Marimo notebooks** – When EDA is in a Marimo notebook, add markdown cells before and after each code cell to explain intent and results (see [references/marimo-notebook-eda.md](references/marimo-notebook-eda.md)).
按说明文件中的顺序排列。
用途
要求
它的作用
第 1 阶段:捕获上下文(在接触数据之前)
第 2 阶段:开始数据分析会话
文件/命令 -> uv run script.py · analysis/ · journal.md · plots/ · scripts/ · uv run · analysis/2025-02-05T14-30-00-protein-binding/ · YYYY-MM-DD HH:MM
内容校验值 -> 4bb435c0d266
当前原文的自动摘译,尚未人工审校。
用途
当用户提供一个或多个数据文件(CSV、FASTA 或其他科学格式)并想要探索或分析它们时,请使用此技能。首先捕获上下文——在问题(生物、化学或数据科学问题)得到明确说明并且代理被调整为指导助手之前,不要加载或绘制数据。
要求
uv 用于运行 Python 脚本:每个脚本都使用 PEP723 内联脚本元数据,并使用
uv run script.py运行。不要运行临时 Python 或原始解释器;每个脚本都声明并管理自己的依赖项。能够通过脚本块中声明的依赖项读取相关数据格式(pandas、BioPython 等)。它的作用
上下文优先 – 在接触数据之前捕获并记录问题上下文(什么问题、什么领域)。第一步——帮助用户缩小到第一个图或第一个摘要(而不是一堆代码或图)。人工指导执行——接受下一步做什么的指示;当用户说“制作这个图”或“给我那个表”时,在做之前询问为什么,然后执行。会话布局 – 每个分析都是一个会话:
analysis/下的一个文件夹,具有描述性名称和开始日期/时间,包含journal.md、plots/和scripts/。第 1 阶段:捕获上下文(在接触数据之前)
不要打开数据文件并开始编码或绘图。询问或确认:问题背景——生物、化学或数据科学问题;用户希望了解或决定什么;以及任何约束(例如特定变量、子集)。将其记录在会话的
journal.md中(参见第 3 阶段)。只有在记录并同意上下文之后,才能继续检查数据形状并规划第一步。