agentleFS
dmzoneilldmzoneill/skills/local-build-test/SKILL.md

local-build-test

Skill2 starsChanged 19 days agoApache-2.0View on GitHub

Build container image locally with Podman and run tests. Build, tag, run container, execute tests, health check, cleanup. Use when user says "build locally", "test container", "podman build".

The file

We split this skill into the rules it gives an agent

2 rules. About 0 are common, 0 are distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈0

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    If tests passed: skill_run("create_mr", ...) or skill_run("deploy_to_ephemeral", ...)

    line 62
  2. Very specific:

    If failed: fix tests, check podman_logs

    line 63

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 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

Local Build Test

Build a container image locally using Podman and optionally run tests.

Inputs

InputTypeDefaultPurpose
repostringrequiredPath to repo with Containerfile/Dockerfile
tagstring"local-test"Image tag
dockerfilestring"Containerfile"Containerfile path relative to repo
run_testsbooltrueRun tests inside container
test_commandstring"python -m pytest tests/ -x --tb=short"Test command
cleanupbooltrueRemove container after testing

Persona

Load devops persona (podman, curl). May need database for psql_tables.

Workflow

1. Bootstrap

  • persona_load("devops")
  • Resolve image: localhost/{repo_basename}:{tag}, container: {repo_basename}-test

2. Pre-Build

  • podman_images(filter=repo_basename) — existing images

3. Build

  • podman_build(context=repo, dockerfile=dockerfile, tag=image_name) — build image
  • podman_images(filter=repo_basename) — verify build

4. Run Container

  • podman_run(image=image_name, name=container_name, detach=true, ports="8080:8000")

5. Test (if run_tests)

  • podman_exec(container=container_name, command=test_command) — run tests
  • podman_logs(container=container_name, tail=50) — logs
  • curl_get(url="http://localhost:8080/api/v1/health/") — health check
  • curl_timing(url="http://localhost:8080/api/v1/health/") — response time
  • psql_tables() — DB tables (if applicable)

6. Cleanup (if cleanup)

  • podman_stop(container=container_name)
  • podman_rm(container=container_name)

7. Error Handling

  • On "containerfile not found": try "Dockerfile" instead of "Containerfile"
  • On "manifest unknown": verify base image, run podman_pull for base
  • On "address already in use": stop conflicting container or use different port

8. Session Log

  • memory_session_log("Local build and test", "image={image_name}, build={success}, tests={passed}")

Next Steps

  • If tests passed: skill_run("create_mr", ...) or skill_run("deploy_to_ephemeral", ...)
  • If failed: fix tests, check podman_logs

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.