snap-packager

Generates snapcraft.yaml, lifecycle hooks, and packaging docs from snap-analysis.json, then builds the snap.

7|Updated Apr 30, 2026
One-click install
npx skills add https://github.com/rascheel/scheel-skills --skill snap-packager-rascheel
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: snap-packager
Source: https://github.com/rascheel/scheel-skills/tree/main/snap-packager
Command: npx skills add https://github.com/rascheel/scheel-skills --skill snap-packager-rascheel

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires ruamel.yaml, pyyaml, and includes scripts (resource) and references (resource) and assets (resource) components.

What problem does it solve? Translating an application's packaging analysis into a working snap manifest is error-prone: snapcraft.yaml syntax, interface plugs, layouts, hooks, and OCI-specific concerns like glibc mismatches and merged-/usr layouts all have subtle rules. This Skill reads the structured snap-analysis.json produced by snap-analyzer or snap-oci-analyzer and generates every required file, then runs snapcraft pack and iterates until the build succeeds. ## Core Features & Use Cases - Manifest and hook generation: Writes snap/snapcraft.yaml (core24, snapcraft 8.x), lifecycle hook scripts, and a SNAP_PACKAGING.md guide with build, install, and interface-connection instructions. - OCI rendering mode: When the analysis contains an oci key, it refines the docker-to-snap scaffold in place, rendering platforms, system-usernames, override-build/override-prime steps, content interfaces, and configure/install hooks without ever modifying the container rootfs directly. - Patch mode: When snap-validation-results.json reports failures, it patches the manifest via scripts/patch_snapcraft.py (adding plugs, layouts, or override steps) and rebuilds, supporting the analyze-package-validate loop. - Use Case: After running snap-analyzer on a Go web service, invoke this Skill to produce a complete snap package with strict confinement, the correct plugs, and a tested build, ready for validation. ## Quick Start Package this application as a snap using the snap-analysis.json produced by the analyzer and build it with snapcraft.

Frequently Asked Questions about snap-packager

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I create a snapcraft.yaml for my application?

Run the snap-analyzer skill first to produce snap-analysis.json, then this Skill reads that file and writes snap/snapcraft.yaml, lifecycle hooks, and a SNAP_PACKAGING.md guide. It targets core24 with snapcraft 8.x and builds the snap with snapcraft pack.

How do I convert an OCI container image into a snap?

Use snap-oci-analyzer to produce an analysis with an oci key, then this Skill refines the docker-to-snap scaffold in place. It renders platforms, system-usernames, override-build steps, content interfaces, and configure hooks without ever editing the container rootfs directly.

Can snapcraft build for a different architecture than the host?

Yes. When the analysis contains a non-null target_arch, the Skill emits a platforms stanza with build-on and build-for entries pinning the target architecture. No --build-for flag is needed on snapcraft pack once the stanza is present.

Why does my snap fail with GLIBC version not found errors?

This happens when the OCI image's glibc differs from the base snap's glibc and LD_LIBRARY_PATH leaks into base-snap shells. The fix is setting LD_LIBRARY_PATH to empty in the environment block and embedding RPATH into ELF executables via the scaffold's embed_rpath.sh script.

What should I do when snap validation reports AppArmor denials?

Place the snap-validation-results.json in the project root and rerun the packager; it enters patch mode automatically. It maps each denial to an interface plug or layout entry using scripts/patch_snapcraft.py, then rebuilds the snap.

When should I use layouts versus the content interface in a snap?

Use a layout when a path is hardcoded in the app and the data lives entirely inside one snap. Use the content interface when a writable directory must be shared between two different snaps, and never combine both for the same target path.