# Create Image

> Build a host OS image using the Image Composer Tool (ICT) from a source template with customizable user credentials.

- Skill: `open-edge-platform/create-image` (Agent Skill)
- Install (CLI): `npx skillmds@latest add open-edge-platform/create-image`
- Raw SKILL.md: https://api.skillmd.com/api/skills/open-edge-platform/create-image/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: open-edge-platform (https://skillmd.com/u/open-edge-platform)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/open-edge-platform/create-image

---


## Trigger Phrases
- create image
- create handheld image
- create server image
- build companion compute image
- build uav image
- build host image
- generate ubuntu image
- build Panther Lake image
- run ict image build

## Required Inputs
- enib_home: absolute path to this repository root (default: current workspace root)

All derived paths use defaults — never prompt for them unless the user explicitly overrides:
- `target_template`: auto-resolve from user intent text using these rules:
   - If text includes any server intent phrase (`server`, `uav`, `companion`, `companion server`, `uav companion`), use `infrastructure/host-os/ict/generic-companion-os-server-template.yml`
   - If text includes handheld intent phrase (`handheld`, `backpack`), use `infrastructure/host-os/ict/generic-handheld-os-template.yml`
   - If no specific server intent is detected, fall back to `infrastructure/host-os/ict/generic-handheld-os-template.yml`
- `work_template`: `<target_template>` basename prefixed with `work-`
- `os_image_composer_repo`: `<enib_home>/tools/image-composer-tool`

## Preconditions
Run all checks silently. On any failure, stop and print only the error with the fix command — no prompts, no questions:
- [ ] `grep -E "^(NAME|VERSION)=" /etc/os-release` — warn if not Ubuntu 22.04/24.04, but do not stop
- [ ] `go version` — on failure: `ERROR: Go not found. Install Go 1.24.0+`
- [ ] `command -v ukify && dpkg -l mmdebstrap | grep '^ii'` — on failure: `ERROR: Missing tools. Run: sudo apt install systemd-ukify mmdebstrap`
- [ ] `test -f <enib_home>/<target_template>` — on failure: `ERROR: Template not found: <path>`
- [ ] `<work_template>` path differs from `<target_template>` path
- [ ] **Sudo probe** (immediately before step 5): `sudo -n true` — on failure: `ERROR: sudo requires a password. Run 'sudo -v' in your terminal, then re-trigger. If that still fails, run: echo 'Defaults timestamp_type=global' | sudo tee /etc/sudoers.d/agent-timestamp && sudo chmod 0440 /etc/sudoers.d/agent-timestamp && sudo visudo -c` — see [AGENTS.md](../../AGENTS.md#sudo-handling-must-follow-for-all-skills-that-invoke-sudo)

## Steps
**Run silently (no prompts):**
1. Clone `image-composer-tool` if missing, or reuse existing checkout:
   - `git clone --branch ICT_Release_2026.2 https://github.com/open-edge-platform/image-composer-tool.git <os_image_composer_repo>`
   - If already cloned: `cd <os_image_composer_repo> && git fetch --tags && git checkout ICT_Release_2026.2`
2. Build the tool binary:
   - `cd <os_image_composer_repo>`
   - `go build -buildmode=pie -ldflags "-s -w" ./cmd/image-composer-tool`
3. Prepare template copy:
   - `cp <enib_home>/<target_template> <os_image_composer_repo>/<work_template>`
4. Validate template:
   - `cd <os_image_composer_repo>`
   - `./image-composer-tool validate <work_template>`

**Prompt only once before destructive action:**
5. Ask for confirmation before the privileged build (overwrites workspace output directory).
6. Build the image:
   - `sudo -E ./image-composer-tool build <work_template>`
7. Collect generated artifacts from:
   - `<os_image_composer_repo>/workspace/ubuntu-ubuntu24-x86_64/imagebuild/<config-name>/`

## Validation
- Template validation exits with code 0.
- Build command exits with code 0 and reports successful image creation.
- At least one `.raw.gz` artifact is present under workspace output path.
- Software Bill of Materials (SBOM) and/or manifests are present when generated by the build profile.

## Rollback
- Remove temporary working template: `rm -f <os_image_composer_repo>/<work_template>`
- Remove failed partial output directory if user approves: `rm -rf <os_image_composer_repo>/workspace/ubuntu-ubuntu24-x86_64/imagebuild/<config-name>`

## Safety Rules
- Ask only before the privileged build step. Never prompt for paths, defaults, or non-destructive commands.
- Never infer credentials, keys, or secrets.
- Never print full private key contents.
- Stop on precondition or validation failure and provide next-action guidance.

## Expected Result Summary
Return:
- whether preconditions passed
- validation status
- build status
- artifact file names and absolute paths
- troubleshooting hints when build fails (for example, certificate or no_proxy issues)

