AgentStack
Browse Sign in
Browse Why AgentStack Sell Docs
Sign in
SKILL verified MIT Self-run

Execute Notebook

skill-kclemoveki-agentic-skills-eda-execute-notebook · by kclemoveki

Execute a Jupyter notebook headless with kernel restart using papermill. Captures all cell outputs and overwrites the notebook with the executed version. Fails loudly on the first error with cell index and traceback.

No reviews yet
0 installs
29 views
0.0% view→install

Install

$ agentstack add skill-kclemoveki-agentic-skills-eda-execute-notebook

✓ scanned · ✓ verified, works with Claude Code, Cursor, and more.

Security review

✓ Passed

No issues found. Passed automated security review. · v0.1.0 How review works →

  • Prompt-injection patterns
  • Secret / credential exfiltration
  • Dangerous shell & filesystem operations
  • Untrusted network calls
  • Known-malicious package signatures

What it can access

  • Network access No
  • Filesystem access No
  • Shell / process execution No
  • Environment & secrets No
  • Dynamic code execution No

From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.

View the full security report →

Verified badge

Passed review? Show it. Paste this badge into your README, it links to the public security report.

AgentStack Verified badge Links to your public security report.
[![AgentStack Verified](https://agentstack.voostack.com/badges/verified.svg)](https://agentstack.voostack.com/security/report/skill-kclemoveki-agentic-skills-eda-execute-notebook)

Reliability & compatibility

Security review passed
0 installs to date
no reviews yet
4mo ago

Declared compatibility

Claude CodeClaude Desktop

Compatibility is declared by the source manifest. End-to-end runtime verification is coming, see below.

Preview Execution monitoring

We're building live execution health for every listing: tool-call success rate, median latency, uptime, and last-checked timestamps, measured, not self-reported. It isn't live yet, so we don't show numbers we can't stand behind.

How agent discovery & health will work →
Are you the author of Execute Notebook? Claim this listing to set pricing, connect Stripe payouts, and keep 70% of every sale.
Sign up to claim

About

Skill: Execute Notebook

Run the notebook at $ARGUMENTS end-to-end with a fresh kernel and persist its outputs back into the file. This is the "restart and run all" hygiene step recommended by Rule 7 of Ten Simple Rules for Writing and Sharing Computational Analyses in Jupyter Notebooks (Rule et al. 2019), automated.

Step 1 — Pre-flight checks

Before invoking papermill, verify:

  1. Notebook exists: resolve $ARGUMENTS to an absolute path. If the file does not exist, fail with: Notebook not found: .
  2. Papermill installed: run python3 -c "import papermill" via Bash. If it raises ModuleNotFoundError, fail with:

`` papermill not installed. Install with one of: pip install papermill poetry add papermill ``

  1. Dependencies sanity check (warning, not error): if neither requirements.txt nor pyproject.toml exists in the notebook's directory or cwd, print:

`` WARNING: no requirements.txt or pyproject.toml found. Consider running /freeze-deps first. `` Do not abort on this warning — proceed with execution.

  1. Kernel availability: read the notebook JSON, extract metadata.kernelspec.name. Run jupyter kernelspec list --json via Bash and verify the kernel exists. If not, fail with:

``` Kernel '' not available. Available kernels:

```

Step 2 — Execute the notebook

Invoke papermill from the notebook's directory as cwd (so relative paths like data/foo.csv resolve correctly):

cd 
python3 -c "
import papermill as pm
import time
start = time.time()
try:
    pm.execute_notebook(
        input_path='',
        output_path='',  # overwrite
        kernel_name='',
        progress_bar=False,
        log_output=False,
        request_save_on_cell_execute=True,  # save partial output on failure
    )
    print(f'OK {time.time() - start:.1f}')
except pm.PapermillExecutionError as exc:
    print(f'FAIL {time.time() - start:.1f} cell={exc.cell_index} ename={exc.ename} evalue={exc.evalue}')
    raise
"

Capture stdout/stderr. Distinguish the OK and FAIL cases for the report.

Step 3 — Report to the user

On success

Notebook executed in s —  cells run, 0 errors. Updated .

` = count of cell_type == 'code'` cells in the post-execution notebook.

After printing the success line, also check the notebook for placeholder observation markers (``). If any are present, append:

Hint:  placeholder observation cells detected. Run /annotate-findings  to fill them with real findings derived from the executed outputs.

This closes the workflow loop: /analyze-dataset writes structure with placeholders → /execute-notebook runs the code → /annotate-findings writes real findings based on outputs.

On failure

Read the partially-saved notebook (papermill writes it even on failure thanks to request_save_on_cell_execute=True). Find the first cell with outputs containing an error output. Extract:

  • ename and evalue
  • The first 5 non-empty lines of the failing cell's source

Print:

Notebook execution FAILED at cell  (took s before error).
Error: : 
First lines of failing cell:
    
    
    ...
Partial output saved to . Inspect that cell, fix the issue, and re-run /execute-notebook.

If the failure is a ModuleNotFoundError, append:

Hint: missing module. Run /freeze-deps and ensure all dependencies are installed.

Constraints

  • All Python code in helper scripts must use type hints + NumPy-style docstrings.
  • Do not modify the notebook except via papermill (no manual cell injection).
  • Do not retry on failure — let the user inspect and re-run explicitly.
  • Do not suppress traceback information; the goal is loud failure with actionable detail.
  • The notebook's existing kernel metadata is authoritative — do not silently fall back to a different kernel.

Out of scope (v1)

  • Parametrization: papermill supports parameters cell injection, but accepting params via $ARGUMENTS complicates the contract. Future skill /execute-notebook-with-params or extension of this one.
  • Notebook validation: not checking notebook format version or schema. Papermill handles that internally.
  • Concurrent execution of multiple notebooks: this skill executes one at a time. Use a wrapper or shell loop for batches.

Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

Install and usage instructions live in the source repository linked above.

Reviews

No reviews yet, be the first.

Versions

  • v0.1.0 Imported from the upstream source.