write-slice

An automated authoring workflow for Chisel slice definition files (SDFs), which describe the package files included in a smaller Ubuntu system image.

In plain words
What is it for?
Use it to create a new package slice, update one when necessary, or forward-port a slice to another Ubuntu release branch. It tests and commits the work but does not open a pull request.
Why use it?
It reduces the manual work and mistakes involved in understanding a package, creating its slice, checking the result, and preserving existing published slices.

Command

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add commands/rockcrafters/mason/write-slice
Clone the repo
git clone --depth 1 https://github.com/rockcrafters/mason
Per session 72 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 6,727 The whole file, excluding the scripts and references it only reads on demand.
Security scan B 2 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00072 $0.06727
Opus 5 $0.00036 $0.03363
Sonnet 5 $0.00014 $0.01345
Haiku 4.5 $0.00007 $0.00673

Measured yesterday against content hash de32858c9c53, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade B, and why

write-slice scanned grade B with 2 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Asks for rootmediumPrivilege escalation

A mod that escalates privileges can change anything on the machine, not only the project.

Requires `dpkg-deb` + network to the mirror (archive.ubuntu.com / ports.ubuntu.com). No sudo or apt cache needed.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

curl -fsSL -o /dev/null -w "%{http_code}" \
mason/skills/chisel-releases/commands/write-slice.md · 436 lines

How it starts

The opening of the file, as written. The whole thing — 436 lines — stays where its author put it; the contents beside it link to each section on GitHub.

You author slices against canonical/chisel-releases.

Scope: author + test + commit slices locally. Do NOT open PRs -- the user opens the PR themselves.

You run autonomously. There is no human in the loop mid-task. Where the workflow below would historically pause for confirmation, instead make the best-supported decision, proceed, and record the decision (with rationale and any open questions) in your final report. Surface anything genuinely ambiguous or risky in that report rather than blocking.

Existing slices are append-only. Only modify a published slice if strictly necessary (e.g. fixing a bug, adding a missing dependency, or accommodating an upstream packaging change). Never reorganise, rename, or remove paths from existing slices without a concrete reason -- downstream consumers depend on the current layout. When in doubt, create a new slice rather than changing an existing one. If you do change an existing SDF, run scripts/check-diff.py --base <target-branch> before committing -- it flags any slice or path you removed by accident (the removed-slices CI gate rejects those).

Prerequisites: run scripts/orientation <package> first -- it reports your working dir, the skill dir, and the target release + manifest format (from chisel.yaml) deterministically. Then read shared/CHISEL.md for chisel/SDF format reference, branch model, schema versions, and canonical naming conventions. This command focuses on the workflow of writing slices.

When this prompt and the repo disagree, trust the repo. Read slices/bash.yaml or slices/base-files.yaml on the target branch as canonical reference.


Workflow

Follow these steps in order. Do NOT skip steps.

Step 1: Validate

  1. Confirm it is an Ubuntu package. Chisel only supports packages from Ubuntu (and Ubuntu Pro) archives. Verify against the archive -- scripts/deb-list.py <pkg> (or apt-cache show <pkg> where apt is available); do not assume existence from the name. If the package is not found, stop and report it -- do not author anything.
  2. Identify the target Ubuntu release (e.g. ubuntu-24.04). This determines which chisel-releases branch to target.
  3. Check the branch is not EOL. Read chisel.yaml on the target branch: maintenance.end-of-life must be in the future.
  4. Check format: version in chisel.yaml. This gates available features (see shared/CHISEL.md schema versions table). Do not use v2+/v3+ features on older formats.
  5. Avoid duplicates. Check slices/<pkg>.yaml does not already exist on the target branch. If it does, stop and report it.

Read the full file on GitHub · 436 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday First seen · 436 lines · 72 tokens per session scan B de32858c9c53

Subscribe to this mod's changes

write-slice is a command published in the GitHub repository rockcrafters/mason (2 stars, last pushed 1mo ago), licensed Apache-2.0. It adds 72 tokens to every session and 6,727 once invoked, about $0.0004 per session on Opus 5. A static security scan graded it B with 2 findings (asks for root, makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.