Skip to content

Add AI agent/tool skills#4568

Open
dustymabe wants to merge 16 commits into
coreos:mainfrom
dustymabe:dusty-add-agent-skills
Open

Add AI agent/tool skills#4568
dustymabe wants to merge 16 commits into
coreos:mainfrom
dustymabe:dusty-add-agent-skills

Conversation

@dustymabe

Copy link
Copy Markdown
Member

The PR introduces several "skills" for use by AI agents/tools. These skills should enable some simple on up to advanced tasks to be handled in an open session/discussion with an advanced model.

See docs/using-ai-skills.md for examples of prompts to run.

dustymabe added 15 commits June 1, 2026 16:37
Add an OpenCode agent skill that guides AI coding agents through the
core coreos-assembler workflow: initializing a build directory, building
from source or fetching published builds, and launching local QEMU VMs.

The skill acts as a workflow guide rather than duplicating documentation.
It references the canonical docs (docs/building-fcos.md, docs/cosa/run.md,
src/cmd-init, src/cmd-buildfetch, etc.) and instructs the agent to read
them at runtime for command details. This avoids staleness from having
multiple sources of truth.

Key workflow covered:
- Step 1: Set up a COSA workdir (cosa init)
- Step 2a: Build from source (cosa build + cosa osbuild qemu)
- Step 2b: Fetch a published build (cosa buildfetch), defaulting to
  --artifact qemu --decompress for local QEMU usage
- Step 3: Launch a VM (cosa run)

Both container mode (default, via the cosa() bash alias) and local
development mode are documented. Cloud platform workflows are
explicitly out of scope for a future cosa-cloud skill.

Assisted-by: <anthropic/claude-opus-4.6>
Just adds some clarity to the options and how they behave.

Assisted-by: <anthropic/claude-opus-4.6>
We dropped testiso as a separate command in
anomalyco/opencode#23794
so let's update the docs.

Assisted-by: <anthropic/claude-opus-4.6>
Added more context here, including more of the options that
`kola supports`.

Assisted-by: <anthropic/claude-opus-4.6>
Add a skill that guides through the cosa kola test workflow: finding
tests, running them, and checking results. The skill references
docs/kola.md and docs/kola/external-tests.md for detailed flag and
format documentation rather than duplicating them.

Assisted-by: <anthropic/claude-opus-4.6>
cosa-kola's Prerequisites section duplicated build/fetch commands
already covered by cosa-basics. Replace with a directive to load the
cosa-basics skill, and add a reverse reference from cosa-basics to
cosa-kola for running tests.

Assisted-by: <anthropic/claude-opus-4.6>
Explain that ext.config.* test names map to paths under
src/config/tests/kola/ in the cosa workdir. Include the dot-to-slash
naming convention, which files to look for (test.sh, kola.json,
config.bu), and concrete examples.

Assisted-by: <anthropic/claude-opus-4.6>
The stream is auto-detected from the build ID version number when
--build is provided. Update the example and explanation to reflect
this, including the version-to-stream mapping examples.

Assisted-by: <anthropic/claude-opus-4.6>
The buildextend-* commands are deprecated symlinks. Disk images are now
built with 'cosa osbuild <platform>' and uploaded to cloud providers
with 'cosa imageupload-<platform>'.

- Rename docs/cosa/buildextend-aws.md to imageupload-aws.md
- Rename docs/cosa/buildextend-secex.md to osbuild-secex.md
- Update docs/design.md, docs/kola.md, docs/working.md, and
  mantle/README.md to use the new command names
- Add imageupload-* commands to docs/cosa.md command reference
- Rename 'Extended artifacts' section in docs/kola.md to
  'Testing platform artifacts'

Assisted-by: <anthropic/claude-opus-4.6>
cosa run is QEMU-only. Add a section pointing users to
'cosa kola spawn -p <platform>' for spawning instances on cloud
platforms, with examples for AWS and GCP.

Assisted-by: <anthropic/claude-opus-4.6>
New skill covering non-QEMU platform workflows: building disk images
with 'cosa osbuild', uploading via 'cosa imageupload-*', running kola
tests with '-p <platform>', and spawning cloud instances with
'kola spawn'. Includes a platform reference table, credential
pointers, and workflow steps.

Assisted-by: <anthropic/claude-opus-4.6>
Update cosa-basics to point to the actual cosa-platforms skill name
instead of the placeholder 'cosa-cloud'. Add a directive in cosa-kola
to load cosa-platforms when testing on non-QEMU platforms.

Assisted-by: <anthropic/claude-opus-4.6>
When cloud images already exist for a build (e.g. AMIs uploaded to
AWS), there is no need to fetch disk artifacts or decompress them.
A plain 'cosa buildfetch -b <build-id>' fetches only meta.json, which
contains the cloud image references that kola picks up automatically.

Update cosa-platforms with a dedicated note explaining this shortcut
and update cosa-basics to clarify when --artifact/--decompress are
needed vs. when they can be skipped.

Assisted-by: <anthropic/claude-opus-4.6>
Covers three workflows for iterating on cosa code:

1. Building mantle Go binaries (kola, ore, plume) inside the cosa
   container and mounting them over the installed copies for testing,
   with persistent Go build cache for fast incremental rebuilds.

2. Using COREOS_ASSEMBLER_GIT to mount modified Python/shell scripts
   from src/ without any rebuild.

3. Full container rebuild via podman build for Dockerfile or
   dependency changes.

Assisted-by: <anthropic/claude-opus-4.6>
This should help getting blocked when querying Fedora's infra for
information.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces new AI skill definitions (cosa-basics, cosa-dev, cosa-kola, and cosa-platforms) and adds a guide on how to use them. It also updates existing documentation to replace deprecated buildextend-* commands with the modern cosa osbuild and cosa imageupload equivalents. The review feedback focuses on standardizing credential paths, correcting non-standard -v= volume mount syntax in container examples, and addressing minor grammatical and semantic issues.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

| Azure | `azure` | `--azure-disk-uri` | `~/.azure/azureCreds.json` |
| DigitalOcean | `do` | `--do-image` | `~/.config/digitalocean.json` |
| ESX/VMware | `esx` | `--esx-base-vm` | `~/.config/esx.json` |
| GCP | `gcp` | `--gcp-image` | GCP service account JSON key |

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

To maintain consistency with the other rows in the table (which specify default credential file paths like ~/.aws/credentials or ~/.azure/azureCreds.json), the default credentials path for GCP should be specified as ~/.config/gcp.json instead of describing the credential type.

Suggested change
| GCP | `gcp` | `--gcp-image` | GCP service account JSON key |
| GCP | gcp | --gcp-image | ~/.config/gcp.json |

Comment on lines +74 to +77
export COREOS_ASSEMBLER_CONTAINER_RUNTIME_ARGS="\
-v=/path/to/coreos-assembler:/srv/cosa-src:ro \
-v=/tmp/cosa-bin:/srv/cosa-bin:rw \
-v=/tmp/cosa-go-cache:/home/builder/.cache/go-build:rw"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Using -v= (with an equals sign) for short options is non-standard and can cause parsing issues or confusion. It is better to use -v (with a space) for short options, or --volume= for long options, to align with standard Docker/Podman CLI usage and other parts of the documentation.

Suggested change
export COREOS_ASSEMBLER_CONTAINER_RUNTIME_ARGS="\
-v=/path/to/coreos-assembler:/srv/cosa-src:ro \
-v=/tmp/cosa-bin:/srv/cosa-bin:rw \
-v=/tmp/cosa-go-cache:/home/builder/.cache/go-build:rw"
export COREOS_ASSEMBLER_CONTAINER_RUNTIME_ARGS="\\
-v /path/to/coreos-assembler:/srv/cosa-src:ro \\
-v /tmp/cosa-bin:/srv/cosa-bin:rw \\
-v /tmp/cosa-go-cache:/home/builder/.cache/go-build:rw"

Comment on lines +118 to +119
export COREOS_ASSEMBLER_CONTAINER_RUNTIME_ARGS="\
-v=/tmp/cosa-bin/kola:/usr/bin/kola:ro"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Use -v (with a space) instead of -v= to follow standard Docker/Podman CLI syntax.

Suggested change
export COREOS_ASSEMBLER_CONTAINER_RUNTIME_ARGS="\
-v=/tmp/cosa-bin/kola:/usr/bin/kola:ro"
export COREOS_ASSEMBLER_CONTAINER_RUNTIME_ARGS="\\
-v /tmp/cosa-bin/kola:/usr/bin/kola:ro"

Comment on lines +128 to +130
export COREOS_ASSEMBLER_CONTAINER_RUNTIME_ARGS="\
-v=/tmp/cosa-bin/kola:/usr/bin/kola:ro \
-v=/path/to/aws-creds:/srv/aws-creds:ro"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Use -v (with a space) instead of -v= to follow standard Docker/Podman CLI syntax.

Suggested change
export COREOS_ASSEMBLER_CONTAINER_RUNTIME_ARGS="\
-v=/tmp/cosa-bin/kola:/usr/bin/kola:ro \
-v=/path/to/aws-creds:/srv/aws-creds:ro"
export COREOS_ASSEMBLER_CONTAINER_RUNTIME_ARGS="\\
-v /tmp/cosa-bin/kola:/usr/bin/kola:ro \\
-v /path/to/aws-creds:/srv/aws-creds:ro"

Comment on lines +170 to +171
export COREOS_ASSEMBLER_CONTAINER_RUNTIME_ARGS="\
-v=/tmp/cosa-bin/kola:/usr/bin/kola:ro"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Use -v (with a space) instead of -v= to follow standard Docker/Podman CLI syntax.

Suggested change
export COREOS_ASSEMBLER_CONTAINER_RUNTIME_ARGS="\
-v=/tmp/cosa-bin/kola:/usr/bin/kola:ro"
export COREOS_ASSEMBLER_CONTAINER_RUNTIME_ARGS="\\
-v /tmp/cosa-bin/kola:/usr/bin/kola:ro"

Comment thread docs/using-ai-skills.md
# Working with COSA's AI skills
{: .no_toc }

Example tasks to hand to an AI tool (i.e. opencode, goose) leveraging

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Use e.g. (exempli gratia, meaning 'for example') instead of i.e. (id est, meaning 'that is') since 'opencode' and 'goose' are examples of AI tools, not an exhaustive definition.

Suggested change
Example tasks to hand to an AI tool (i.e. opencode, goose) leveraging
Example tasks to hand to an AI tool (e.g., opencode, goose) leveraging

Comment on lines +183 to +184
prevent abuse. When querying APIs or web pages for information set a
User-Agent and Accept headers to increase the chance of making it

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Add a comma after 'information' for better readability, and correct 'set a User-Agent and Accept headers' to 'set User-Agent and Accept headers' (or 'set a User-Agent and an Accept header') to fix the grammatical agreement.

Suggested change
prevent abuse. When querying APIs or web pages for information set a
User-Agent and Accept headers to increase the chance of making it
prevent abuse. When querying APIs or web pages for information, set
User-Agent and Accept headers to increase the chance of making it

@dustymabe dustymabe force-pushed the dusty-add-agent-skills branch from f5b253f to 795420f Compare June 1, 2026 20:52

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While running cosa-basics I came across two issues:

  1. Started with a simple Fetch the latest stable FCOS build and launch a QEMU VM. After the fetching was done agent instructed to cd into the build directory and simply cosa run. This didn't work as my coreos-assembler image was outdated. I had to first run podman pull... to move onto the next step.

  2. Once coreos-assembler was updated cosa run didn't work because of Error: creating container storage: the container name "cosa" is already in use... I guess the skill could be improved by adding :do not run cosa run as this leaves dangling containers.

Out of curiosity I also recorded the usage for this simple skill run:

Usage by model:         
       claude-opus-4-6:  3.6k input, 2.9k output, 180.9k cache read, 99.4k cache write

Comment thread docs/using-ai-skills.md
{: .no_toc }

Example tasks to hand to an AI tool (i.e. opencode, goose) leveraging
the skills under .agents/skills. To leverage a skill run `/skills` and

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried to run this skill in claude as I don't have mentioned in docs opencode or goose installed. Since claude Code looks for skills under .claude/skills/, not .agents/skills/. I got them working by symlinking:

mkdir -p .claude/skills
ln -s ../../.agents/skills/cosa-basics .claude/skills/cosa-basics
ln -s ../../.agents/skills/cosa-kola .claude/skills/cosa-kola
ln -s ../../.agents/skills/cosa-dev .claude/skills/cosa-dev
ln -s ../../.agents/skills/cosa-platforms .claude/skills/cosa-platforms

This skill covers workflows for making and testing changes to
coreos-assembler (COSA) itself, including the Go binaries in `mantle/`,
the Python/shell scripts in `src/`, and the container image.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I ran this skill three times with the same prompt: "Add a --hello flag to mantle/cmd/kola/main.go that prints "hello from kola" and exits. Build the modified kola binary and verify it works with cosa kola --hello".
I succeeded only at the very last aproach after a little bit of tweaking. During the first two runs the agent bypassed the cosa container workflow completely - it ran go build and /tmp/kola --hello instead of building and testing insite the cosa container. When it couldn't run cosa kola it just said "can't test, cosa requires the container environment" and stopped.

Adding "Important" and "Prerequistes" section that explain how to set up the cosa alias and workdir before starting, instead of pointing to a separate skill. After that, the agent followed approach 1 as expected.

Again, interestingly the failed attempts used more tokens than the correct one:
Failed:

Usage by model:
 claude-opus-4-6:  93 input, 3.4k output, 818.5k cache read, 98.3k cache write ($1.11)

Correct:

  Usage by model:
       claude-opus-4-6:  421 input, 3.1k output, 480.4k cache read, 54.2k cache write ($0.66)
Suggested change
## IMPORTANT: Always use the COSA container
COSA is designed to run inside a container. You MUST NOT:
- Run `go build` directly on the host
- Run `mantle/build` or `make kola` directly on the host
- Run `./build.sh` directly on the host
- Execute built binaries directly on the host (e.g. `./bin/kola`, `/tmp/kola`)
All building and testing MUST go through the `cosa` alias, which runs
commands inside the COSA container. If `cosa` is not available, set it
up first (see Prerequisites below) -- do not fall back to building
on the host.
## Prerequisites
Before using any approach below, you MUST:
1. **Set up the `cosa()` bash alias** -- check if `cosa` is already
available in the user's shell (`type cosa`). If not, see the
Key documentation references below for setup instructions.
2. **Have a cosa workdir** -- a directory where `cosa init` was previously
run (contains `src/config/`, `builds/`, `tmp/`, etc.). Ask the user
where their existing workdir is, or create one:
`
mkdir myworkdir && cd myworkdir
cosa init https://github.com/coreos/fedora-coreos-config
`
All `cosa` commands must be run from inside a cosa workdir.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll consider this. I've still been developing on these in the background and trying to make it easier for non-frontier models to work with.

That being said I don't know if telling the harness not to execute those commands "on the host" is the right thing.

"the host" is the environment the harness is running in. It could be an environment where users do develop cosa. It could be a slimmed down sandbox (no golang toolchain to build). It could be direct access to the host. It could be running inside a COSA container already. So I think we have to be careful with the guidance here.

Comment thread .agents/skills/cosa-kola/SKILL.md
Comment thread .agents/skills/cosa-platforms/SKILL.md
@c4rt0

c4rt0 commented Jun 5, 2026

Copy link
Copy Markdown
Member

I also went through all the docs updates (other than using-ai-skills.md on which I commented on), these lgtm.

@dustymabe

Copy link
Copy Markdown
Member Author

I also went through all the docs updates (other than using-ai-skills.md on which I commented on), these lgtm.

Thanks @c4rt0. I'll probably push up and update to these "skills" early next week. I've learned a lot in the past week.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants