agentleFS
processmissionprocessmission/oh-my-qemu/skills/qemu-image/SKILL.md

qemu-image

Skill60 starsChanged 13 days agoMITView on GitHub

Inspect or package QEMU disk, SD, eMMC, flash, pflash, firmware, raw, and qcow2 images. Use for read-only image format, partition, region, offset, sector-size, and hash analysis, or for explicitly authorized image creation, conversion, partitioning, filesystem population, and fixed-offset writes with readback and rollback evidence.

We split this skill into the rules it gives an agent

12 rules. About 0 are common, 7 are distinctive, and 5 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈7

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 5

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Use inspect by default, including for ambiguous requests.

    line 37
  2. Very specific:

    Use extract for read-only unpacking or forensics of firmware and disk images.

    line 39
  3. Distinctive:

    Use package only when the user explicitly requests creation, conversion, population, or mutation and the output path and allowed changes …

    line 42
  4. Distinctive:

    If a command's write behavior is uncertain, stop and resolve it first.

    line 45
  5. Very specific:

    Use read-only tool forms first.

    line 67
  6. Very specific:

    Before writing, start from assets/packaging-plan-template.md and record the output, region, and operation tables from …

    line 72
  7. Very specific:

    When using dd, record bs, seek, skip, count, and truncation behavior.

    line 78
  8. Very specific:

    Create a new output under output/ unless another exact path is authorized.

    line 85
  9. Distinctive:

    Read back every material write and compare file contents or extracted byte ranges with their source by SHA-256 or byte comparison.

    line 91
  10. Distinctive:

    Do not treat a QEMU boot as proof of correct packaging: boot behavior can mutate media and does not establish byte-for-byte placement.

    line 96
  11. Distinctive:

    When images and boot files are consumed by another repository or test suite:

    line 101
  12. Distinctive:

    keep separately consumable boot files (kernel image, initramfs, DTB, firmware) when the direct boot path needs them rather than only a …

    line 103

≈ “Common” is an estimate: at least 1 in 5 of the 308,232 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

QEMU Image

Audit workflow

For a non-trivial task that writes to the workspace, use only the needed entries under .oh-my-qemu/<task-slug>/: audit.md (baseline, plan, decisions, evidence, verification, and gaps), commands.md (redacted commands, working directories, and results), logs/ (decisive build, test, and runtime output), scripts/ (probes, parsers, and harnesses), and output/ (generated deliverables, third-party dependencies, and non-QEMU binaries). Keep QEMU's own build tree at source-root builds/build-<target>/, never an unqualified build/. In a Git worktree, add .agents/, .oh-my-qemu/, and builds/ to the file from git rev-parse --git-path info/exclude before writing artifacts or configuring QEMU; preserve existing entries and avoid duplicates. Never stage or commit these paths; stage source only when the user explicitly requests that separate action. At handoff, reconcile git status --short with the baseline and report the task directory, build directory, source changes, pre-existing changes, and unresolved gaps.

QEMU upstream boundary

QEMU's official GitLab and mailing lists are upstream channels. A patch becomes an upstream contribution when it is sent to the maintainers selected through MAINTAINERS. Do not prepare or send agent-generated code, documentation, commit messages, or patches for upstream submission; see the checked-out tree's docs/devel/code-provenance.rst. Research, debugging, analysis, local experiments, verification, and workflow guidance remain allowed. Local branches, commits, patch files, pushes, and pull requests are not by themselves upstream contributions; perform those Git actions only when requested.

Select the mode

  • Use inspect by default, including for ambiguous requests. Keep the target read-only and limit actions to identification, measurement, hashing, and verification.
  • Use extract for read-only unpacking or forensics of firmware and disk images. Record the extraction tool, version, and layout; write extracted content only under task output/; never mutate the input image.
  • Use package only when the user explicitly requests creation, conversion, population, or mutation and the output path and allowed changes are clear. Authorization to inspect is not authorization to write.
  • If a command's write behavior is uncertain, stop and resolve it first. Prefer a task-local working copy and never mutate an input artifact by default.

Record the selected mode, target, authorization boundary, and intended outputs in audit.md before any action that can write.

Inspect an image

  1. Resolve the exact path without following an ambiguous glob; record whether it is a regular file, block device, symlink, or backing-chain member.
  2. Identify the container format independently from its contents: raw, qcow2, or other; virtual and allocated size; backing files; format features that affect mutation. Do not infer format from the suffix.
  3. Record the partition-table type and the logical sector size reported by the tool. List partition and fixed-region start, end, size, type or GUID, filesystem, purpose, and alignment, including boot data outside a partition table.
  4. Express every address with an explicit unit and base; derive byte offsets from start sector times logical sector size. Distinguish image-relative, partition-relative, and nested-container offsets.
  5. Compute SHA-256 for the inspected image and important inputs when practical; record the exact command and identify an unhashable or changing target as a gap.

Use read-only tool forms first. See references/packaging.md for the tool matrix and the packaging, readback, and cross-repo contracts.

Package contract

Before writing, start from assets/packaging-plan-template.md and record the output, region, and operation tables from references/packaging.md in audit.md. Resolve every input and output path, hash each input, and separate firmware, bootloader, kernel, DTB, initrd, root filesystem, and modules even when the final image combines them.

For each write, state whether the offset is bytes or sectors and which base it is relative to. When using dd, record bs, seek, skip, count, and truncation behavior; prove that offset + payload_size stays within its assigned region and the image, and reject overlaps. Classify each target as immutable input, working copy, disposable output, or reusable mutable media, and account for later guest or firmware writes.

Package and verify

  1. Create a new output under output/ unless another exact path is authorized. For an existing target, require explicit overwrite or in-place authorization and prepare a verified backup.
  2. Perform operations in the recorded order; preserve sparse allocation where required and do not let a raw write truncate the output unintentionally.
  3. Flush pending writes, then re-inspect format, sizes, partitions, sector size, regions, and filesystems without repair options.
  4. Read back every material write and compare file contents or extracted byte ranges with their source by SHA-256 or byte comparison. A command exit status is not readback evidence.
  5. Hash the complete output; record pre-mutation and final hashes when a base or existing image was involved.

Do not treat a QEMU boot as proof of correct packaging: boot behavior can mutate media and does not establish byte-for-byte placement.

Cross-repo packaging contract

When images and boot files are consumed by another repository or test suite:

  • keep separately consumable boot files (kernel image, initramfs, DTB, firmware) when the direct boot path needs them rather than only a combined image;
  • pin artifact hashes and record the hash expected by the consuming test;
  • a local HTTP server can serve test assets; record URL, port, document root, and asset hashes;
  • metadata names such as REQUIRED_IMAGES or SUPPORTED_BOOT_MODES are repository-specific and stay in that repository; do not copy the vocabulary into QEMU or this skill as a contract.

Roll back safely

Define rollback before the first write: remove an incomplete new output, or restore a target from the verified backup or clean base. Keep the backup until verification and handoff unless removal is authorized. Prefer building a temporary output and publishing it after readback. If packaging or readback fails, stop writes, preserve evidence, run only the authorized rollback, and verify the restored target. Report partial mutation or failed rollback as an unresolved gap.

Handoff

Provide the selected mode, exact inspected or packaged path, format and layout summary, sector size and offset units, input and output SHA-256 values, mutation policy, readback results, rollback state, audit directory, and unresolved gaps.

Upstream references

  • docs/tools/qemu-img.rst
  • docs/system/invocation.rst
  • docs/devel/code-provenance.rst

Paths can differ between QEMU versions; locate them in the checked-out tree.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.