notebook-guidance
This skill guides the use of Jupyter notebooks for data analysis, exploration, and visualization, particularly with BigQuery. It outlines best practices for notebook execution and validation (supporting both cell-by-cell execution and full notebook generation depending on tool availability), library installation, and structuring notebooks for clarity. It also covers specific rules for data cleaning, plotting, and integrating with BigQuery SQL and machine learning workflows. Relevant when any of the following conditions are true: 1. The user request involves a data analysis, data exploration, data visualization, or data insights task that requires multiple steps, queries, or visualizations to answer. 2. The user explicitly requests a notebook (.ipynb). 3. You are creating, editing, or executing cells in a Jupyter notebook. 4. You need to query BigQuery from within a notebook. DO NOT use the Python BigQuery client library; instead, you MUST use the `%%bqsql` magics explained in this skill.
What this skill does
# Notebook Guidance
## When to Use a Notebook
Before choosing to use a notebook, evaluate the task complexity using these
heuristics.
Use a notebook if you meet at least one of these 3 criteria:
* π **Data Insights & Storytelling**: Use a notebook for any request to "give
insights", "find trends", "explore data", or "analyze data". These tasks
benefit from using visualizations to present the data.
* π **Visualizations are requested**: The user explicitly asks for charts or
plots.
* π **Stateful / Iterative Exploration**: You need to run a query, inspect
results, and decide the next query based on those results while keeping
state in memory.
Do NOT use a notebook ONLY if:
* π **Simple Fact/Status**: The request only requires a single number (e.g.,
"how many rows") or a status check (e.g., "when was this table updated").
* πββοΈ **Schema Preview**: The request is only about the schema or field
types.
**Golden Rule of Data Storytelling:** If any analytical insight, trend, or
comparison is involved, favor a notebook and a visualization. A notebook is the
"standard" environment for our developer workflow; do not avoid it because of
"overhead".
## Notebook Best Practices
> [!IMPORTANT]
>
> **Agent execution rules**: Your behavior MUST depend on whether the
> `notebook_execute_cell` tool is available in your current context: * **If
> notebook `execute_cell` tool is available**: You MUST follow the incremental
> GENERATE CELL -> EXECUTE CELL -> VALIDATE flow. * **If notebook `execute_cell`
> tool is NOT available**: You MUST generate the complete notebook and request
> user execution.
1. **CONDITIONAL EXECUTION FLOW**:
* **If notebook `execute_cell` tool is available**: Follow the **STEP BY
STEP GENERATE CELL -> EXECUTE CELL -> VALIDATE OUTPUT** flow. Generate
ONE cell, execute it, then verify the output. If the output is data
(e.g. a dataframe), you MUST inspect it to confirm the logic is correct
before generating the next step. Batch generation of an entire notebook
is strictly prohibited because error propagation in notebooks is
expensive to fix.
* **If notebook `execute_cell` tool is NOT available**:
* Create the whole notebook at once.
* Tell the user to run the notebook.
* Tell the user to let you know once the notebook run is completed so
you can check the outputs to verify it's correct and fix any errors.
2. **IDENTIFY DATA EARLY**: Use `@skill:discovering-gcp-data-assets` or
BigQuery list tools to find the correct `project.dataset.table` before
writing ANY code. If the table ID is missing, ask the user.
3. **CLEAN FINAL STATE**: The final notebook MUST NOT have failed cells. If a
cell fails, you MUST fix it. If you tried several versions, delete the
failed attempts before you present the notebook to the user.
4. **LOGICAL CHUNK FIDELITY**: Keep cells small. One logical transformation or
visualization per cell. Group related cells into logical units (e.g., a
BigQuery `%%bqsql` magic cell followed immediately by a Python visualization
cell for those results). Use descriptive **markdown cells** to separate and
document different logical sections.
5. **GENERATE VISUALIZATIONS**: Always accompany data insights with
visualizations; charts are often more effective than raw numbers for
communicating trends and comparisons.
## Kernel & Environment Management
Notebooks run in specific **Kernels** (execution backends). You MUST ensure the
kernelβs Python environment contains the necessary libraries (`bigframes`,
`ipykernel`, etc.).
### Kernel Types
1. **Local Python**: Standard Python 3 kernel running on the notebook host
(Managed instance, local machine).
2. **Cloud Spark Remote (Dataproc Serverless)**: Transient Spark environment
managed by GCP. Use for large-scale data processing.
3. **Cloud Spark Remote (Dataproc Cluster)**: Persistent Spark clusters for
shared or custom configurations.
4. **Colab (Managed)**: Ephemeral Google-managed runtimes.
### No Active Kernel / Setup Check
1. **Infer or Ask about Kernel Preferences**:
- **Infer from Context**:
- If the task mentions "Spark", "PySpark", or "distributed compute",
or if the active workspace is already a Spark cluster, lean towards
**Remote Spark**.
- If the task is focused on "BigQuery", "BigFrames", or standard API
calls, lean towards **Local Python**.
- **Ask when Ambiguous**: If multiple options fit, ask if they prefer a
**Local Python** or a **Cloud/Remote Kernel** (e.g., Colab, Spark).
2. **For Local Setup**: Use `@skill:managing-python-dependencies` to verify if
a virtual environment exists. If not, create one. Ensure `ipykernel` is
installed in that environment. Install any other relevant libraries.
3. **For Remote Setup**: Advise the user to use the UI to select the
appropriate remote kernel.
> [!IMPORTANT]
>
> **HARD STOP on kernel failure**: If a cell execution returns "no active
> kernel" or any kernel-not-found error, you MUST **stop immediately**. Do NOT
> scaffold, generate, or insert any further cells. Inform the user which kernel
> is needed (e.g., PySpark / Dataproc Serverless) and wait for explicit
> confirmation that a kernel is active before proceeding with notebook
> execution.
### Proper Library Installation
#### 1. Local Kernels
Before installing any python libraries, you MUST use
`@skill:managing-python-dependencies` to detect how python dependencies are
managed in the project.
#### 2. Remote Kernels (Spark/Colab)
Since these are often ephemeral or managed by GCP:
* **Check first (REQUIRED)**: Before writing any `%pip install` cell, run
`%pip list` or `import <package>` to confirm the package is not already
present. Managed runtimes (Dataproc Serverless, Colab) pre-install many
common packages. Only install what is confirmed missing.
* Use `%pip install <package>` in the first cell if a package is confirmed
missing and it's the only way to modify the runtime.
When in doubt about the kernel type or preferred installation method, ask the
user for clarification.
## Data Analysis & Visualization Rules
Guidelines for performing exploratory data analysis, data cleaning, and
visualization in notebooks.
### Notebook Layout
The notebook should read like a story. While you have flexibility (e.g.,
multiple visualizations for one data cell, or data cells building on each
other), aim for this general flow:
1. **Title & Objective** (Markdown Cell)
* What is this notebook for? (e.g., `# Retention Analysis`)
2. **Section Header** (Markdown Cell)
* What are we looking at now? (e.g., `## Exploring User Retention`)
3. **Data Acquisition/Transformation** (Python cell, may contain `%%bqsql`
magics)
* Query BigQuery or transform data.
4. **Verification (Optional but Recommended)** (Python Cell)
* `df.head()` or assert sanity checks.
5. **Visualization (The Goal)** (Python Cell)
* Plot the insight (e.g., `df.plot()`).
*Repeat steps 2-5 for each new sub-topic or insight. You can have multiple Data
cells before a Visualization, or multiple Visualizations from one Data cell. The
key is to keep them grouped logically and separated by Markdown headers.*
1. **Final Summary** (Markdown Cell)
* At the end of the notebook, add a markdown cell containing a summary
paragraph that summarizes the findings to the user. The summary MUST
follow these guidelines:
* MUST NOT add Python code to the summary.
* The summary MUST NOT start with a code block.
* The summary MUST be strictly grounded in the numerical data verified in
the notebook.
* The summary MUST ONLY contain the following three sections:
* ### Q&A If the data analysis task contains questions (implied or
Related in Backend & APIs
jfrog
IncludedInteract with the JFrog Platform via the JFrog CLI and REST/GraphQL APIs. Use this skill when the user wants to manage Artifactory repositories, upload or download artifacts, manage builds, configure permissions, manage users and groups, work with access tokens, configure JFrog CLI servers, search artifacts, manage properties, set up replication, manage JFrog Projects, run security audits or scans, look up CVE details, query exposures scan results from JFrog Advanced Security, manage release bundles and lifecycle operations, aggregate or export platform data, or perform any JFrog Platform administration task. Also use when the user mentions jf, jfrog, artifactory, xray, distribution, evidence, apptrust, onemodel, graphql, workers, mission control, curation, advanced security, exposures, or any JFrog product name.
cupynumeric-migration-readiness
IncludedPre-migration readiness assessor for porting NumPy to cuPyNumeric. Use BEFORE substantial porting work begins when the user asks whether code will scale on GPU, whether they should migrate to cuPyNumeric, which NumPy patterns transfer cleanly, what must be refactored before porting, or mentions pre-port assessment, scaling analysis, or refactor planning. Inspect the user's source code, look up NumPy usage, cross-reference the cuPyNumeric API support manifest, and distinguish distributed-scaling-friendly patterns from blockers such as unsupported APIs, scalar synchronization, host round-trips, Python/object-heavy control flow, shape/data-dependent branching, and in-place mutation hazards. Produce a verdict of READY, LIGHT REFACTOR, SIGNIFICANT REFACTOR, or NOT RECOMMENDED, with concrete refactor pointers.
alibabacloud-data-agent-skill
IncludedInvoke Alibaba Cloud Apsara Data Agent for Analytics via CLI to perform natural language-driven data analysis on enterprise databases. Data Agent for Analytics is an intelligent data analysis agent developed by Alibaba Cloud Database team for enterprise users. It automatically completes requirement analysis, data understanding, analysis insights, and report generation based on natural language descriptions. This tool supports: discovering data resources (instances/databases/tables) managed in DMS, initiating query or deep analysis sessions, real-time progress tracking, and retrieving analysis conclusions and generated reports. Use this Skill when users need to query databases, analyze data trends, generate data reports, ask questions in natural language, or mention "Data Agent", "data analysis", "database query", "SQL analysis", "data insights".
token-optimizer
IncludedReduce OpenClaw token usage and API costs through smart model routing, heartbeat optimization, budget tracking, and native 2026.2.15 features (session pruning, bootstrap size limits, cache TTL alignment). Use when token costs are high, API rate limits are being hit, or hosting multiple agents at scale. The 4 executable scripts (context_optimizer, model_router, heartbeat_optimizer, token_tracker) are local-only β no network requests, no subprocess calls, no system modifications. Reference files (PROVIDERS.md, config-patches.json) document optional multi-provider strategies that require external API keys and network access if you choose to use them. See SECURITY.md for full breakdown.
resend-cli
IncludedUse this skill when the task is specifically about operating Resend from an AI agent, terminal session, or CI job via the official resend CLI: installing/authenticating the CLI, sending/listing/updating/cancelling emails, batch sends, domains and DNS, webhooks and local listeners, inbound receiving, contacts, topics, segments, broadcasts, templates, API keys, profiles, or debugging Resend CLI/API failures. Trigger on mentions of Resend CLI, `resend`, `resend doctor`, `resend emails send`, `resend domains`, `resend webhooks listen`, `resend emails receiving`, or agent-friendly terminal automation.
alibabacloud-odps-maxframe-coding
IncludedUse this skill for MaxFrame SDK development and documentation navigation on Alibaba Cloud MaxCompute (ODPS). Helps answer MaxFrame API, concept, official example, and supported pandas API questions; create data processing programs; read/write MaxCompute tables; debug jobs (remote or local); and build custom DPE runtime images. Trigger when users mention MaxFrame, MaxCompute with MaxFrame, ODPS table processing, DPE runtime, MaxFrame docs/examples, DataFrame/Tensor operations, or GPU runtime setup. Works for both English and Chinese queries about Alibaba Cloud data processing with MaxFrame.