Skip to content
Skills Library
Data & analytics · Learning & explanation

execution

/execution

How Stencila executes documents - kernels, staleness-driven re-execution, execution options, and debugging chunks that error or do not re-run. Use when running stencila execute or render, when a code chunk is not re-running, when choosing a language/kernel, or when reading execution errors.

Repository
stencila ↗
Licence
Apache-2.0
Last repository change
28.10.2026

Assessment and security

100/ 100Class: good
Format25 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content35 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
1
Scripts
0
HTML comments
0
URLs in SKILL.md
0
Deprecation

No signals detected. Repository changed on 28.10.2026, without references to retired models or APIs.

Licence

Apache-2.0, otwarta: można używać i zmieniać, z zachowaniem licencji i informacji o zmianach.

What it does and when to use it

How Stencila executes documents - kernels, staleness-driven re-execution, execution options, and debugging chunks that error or do not re-run. Use when running stencila execute or render, when a code chunk is not re-running, when choosing a language/kernel, or when reading execution errors.

Original author description

How Stencila executes documents - kernels, staleness-driven re-execution, execution options, and debugging chunks that error or do not re-run. Use when running stencila execute or render, when a code chunk is not re-running, when choosing a language/kernel, or when reading execution errors.

How it works

  1. Staleness: why a chunk may not re-run
  2. Kernels
  3. Reading execution errors
  4. Checking without mutating
Original SKILL.md headings · 86 lines, 520 words
SKILL.md preview
---
name: execution
description: How Stencila executes documents - kernels, staleness-driven re-execution, execution options, and debugging chunks that error or do not re-run. Use when running stencila execute or render, when a code chunk is not re-running, when choosing a language/kernel, or when reading execution errors.
user-invocable: false
---

# Executing Stencila documents

`stencila execute doc.smd` runs the executable code in a document and saves
the outputs into it. `stencila render doc.smd out.html` is execute **plus**
encode to output formats. Always invoke non-interactively:

```sh
NO_COLOR=1 stencila execute doc.smd --yes
NO_COLOR=1 stencila render doc.smd out.html --yes
```

## Staleness: why a chunk may not re-run

Execution is staleness-driven. A chunk re-runs only when it (or something it
depends on) has changed since its last recorded execution. This is why
"I edited the prose and re-executed, but the plot didn't regenerate" is
expected behaviour, not a bug. Also check the chunk's execution mode in the
source: `lock` prevents re-execution to preserve outputs, `always` forces
re-run every time.

To override staleness:

- `--force-all` — re-execute everything regardless of staleness. The first
  thing to try when outputs look out of date.
- `--skip-code` — skip executing code (useful to re-run only other
  executable node types).
- `--ignore-errors` — do not fail the command on execution errors; render
  what can be rendered.
- `--no-save` (`execute` only) — run without writing outputs back to the
  source document. Use for a reproducibility check that must not mutate
  files.
- `--dry-run` — compile and prepare but do not actually execute.

`execute` and `render` share the execution option group, but `--no-save` is
`execute`-only, and output/encoding options (`--to`, `--theme`, etc.) are
`render`-only. Check `--help` when unsure.

## Kernels

Each language executes in a kernel. `stencila kernels list` shows what is
available on this machine. Current kernels include:

| Kernel | Languages | Notes |
|---|---|---|
| `python` | Python | uses the local environment (e.g. uv, venv) |
| `r` | R | local R installation |
| `nodejs` | JavaScript | local Node.js |
| `quickjs` | JavaScript | builtin, no install needed |
| `bash` | Bash, Shell | |
| `kuzu`, `docsdb`, `docsql` | Cypher, DocsQL | database queries |
| `mermaid`, `graphviz` | Mermaid, DOT | diagrams |
| `jviz` | Cytoscape, ECharts, Plotly, Vega-Lite | JSON visualization specs |
| `jinja` | Jinja | templating |
| `asciimath`, `tex` | AsciiMath, TeX/LaTeX | math |
| `style` | CSS, HTML, Tailwind | styling |

The language on a code chunk selects the kernel (e.g. `python` → the Python
kernel; `js` and `javascript` → a JavaScript kernel). A language with no
matching kernel is a common cause of chunks silently not producing output.

For a quick one-off check that a kernel works, without touching any
document:

```sh
NO_COLOR=1 stencila kernels execute python "1 + 1" --yes
```

## Reading execution errors

Execution messages are attached to the chunk that produced them and printed
to stderr. Work through them in document order — an error in an early chunk
(e.g. an import failure) commonly cascades into "name is not defined" errors
in later chunks; fix the first error first. When a package is missing,
`stencila kernels packages <kernel>` lists what the kernel can see.

## Checking without mutating

For a "does this document still reproduce?" check:

```sh
NO_COLOR=1 stencila execute doc.smd --force-all --no-save --ignore-errors --yes
```

then report the errors, rather than saving over existing outputs.

Versions

RepositoryScoreLicence
This page · stencila/stencila100Apache-2.0
CrowdStrike/fusion-skills100MIT

Database snapshot: 13.11.2026 · package version 590f08316cca (SHA-256 digest of the entire package)

Downloads in the last 30 days: 0 · ranking

Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

  • 100workspaces
    Stencila workspace configuration and document tracking - stencila.toml sections, stencila init, track/status/untrack/clean, and what lives in the .stencila/ directory. Use when configuring a Stencila project, setting up remotes or outputs, interpreting stencila status, or…
  • 100skill-creation
    Create a new Stencila workspace skill. Use when asked to create, write, or scaffold a SKILL.md file or skill directory.

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.