agentleFS
seayniclabsseayniclabs/homelab-infra-mcp/skills/containers/SKILL.md

containers

Skill0 starsChanged 20 days agoMITView on GitHub

Check, read, restart and inspect Docker containers on a homelab through the docker tools, with a dry run before every change. Use when the user asks for container status, logs, resource use, a restart, or wants a container started, stopped, removed or its images pulled or pruned.

9 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use observability.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • OpenAISkill

    observability

    Vercel Observability expert guidance — Drains (logs, traces, speed insights, web analytics), Web Analytics, Speed Insights, runtime logs, custom events, OpenTelemetry integration, and monitoring dashboards. Use when instrumenting, debugging, or optimizing application performance and user experience on Vercel.

    Also in 3 projects that use this

The file

Show its rules and text

We split this skill into the rules it gives an agent

14 rules. 0 are common, 3 are distinctive, and 11 are very specific to this project.

  • 0

    Common

    Most of the 5 edited versions we read keep these.

  • 3

    Distinctive

    This author's own choices. Worth a look.

  • 11

    Very specific

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

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

    If the user gives no action, list these and ask which one they need: status, health, logs, restart, stats, images.

    line 13
  2. Very specific:

    Call docker_containers with action set to list.

    line 17
  3. Distinctive:

    Put every container that is stopped, exited, restarting or unhealthy at the top of the table.

    line 19
  4. Very specific:

    If a container is down, offer the next step: logs first, then restart.

    line 20
  5. Very specific:

    Call homelab_health to confirm the Docker module can reach the engine.

    line 26
  6. Very specific:

    Call docker_containers with action set to list and read every page.

    line 27
  7. Distinctive:

    If both lists are empty, report the count of running containers and stop.

    line 29
  8. Very specific:

    Call docker_containers with action set to logs and the container name.

    line 33
  9. Very specific:

    Call docker_containers with action set to restart, the container name and dry_run set to true.

    line 43
  10. Very specific:

    Call the same request without dry_run.

    line 45
  11. Very specific:

    Verify: call docker_containers with action set to get for the container.

    line 46
  12. Distinctive:

    Read the last 50 lines of logs.

    line 47
  13. Very specific:

    Call docker_containers with action set to stats.

    line 56
  14. Very specific:

    Every error reads homelab.docker.<code>: <message> Fix: <hint>.

    line 80

“Common” is measured: kept by at least 6 in 10 of the 5 edited versions of this file we could read. “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

Manage containers

This skill uses three tools from the docker module: docker_containers, docker_images and docker_inventory. The module is on by default. If a call says the module is off, turn it on with HOMELAB_DOCKER_ENABLED=true.

If the user gives no action, list these and ask which one they need: status, health, logs, restart, stats, images.

status

  1. Call docker_containers with action set to list.
  2. Present a table: Container | State | Health | Image. Use only the fields the tool returns.
  3. Put every container that is stopped, exited, restarting or unhealthy at the top of the table.
  4. If a container is down, offer the next step: logs first, then restart.

Lists return one page. Read the page size from limit. If the page is full, call again with offset set to the number of rows already read. Do not say "all containers are up" until a page comes back shorter than limit.

health

  1. Call homelab_health to confirm the Docker module can reach the engine.
  2. Call docker_containers with action set to list and read every page.
  3. Report two lists: containers not running or restarting, and containers whose health check fails. Name each one with its state.
  4. If both lists are empty, report the count of running containers and stop.

logs

  1. Call docker_containers with action set to logs and the container name. Ask for 50 lines when the user gives no count.
  2. Quote each line that contains error, warn, fatal, panic, exception, refused, denied or timeout.
  3. Summarize in one sentence: healthy operation, a repeating error, a startup failure, or a crash loop. Use the timestamps to tell a crash loop (the same startup lines repeat) from one error that happened once.
  4. For the most frequent error, name the next check: the dependency it cannot reach, the port, the mounted path, or the name of the environment variable that is missing. Name variables only. Never print their values.
  5. Redact any token, password or key that appears in a log line before you show it.

restart

A restart changes a running service, so it goes through the approval flow.

  1. Call docker_containers with action set to restart, the container name and dry_run set to true. Show the plan: container, current state, and what happens.
  2. Get a go-ahead from the user in chat.
  3. Call the same request without dry_run. The person approves the change in the MCP client. If the call returns approval_unavailable, stop, report the message, and explain the setting it names. Do not set that setting yourself.
  4. Verify: call docker_containers with action set to get for the container. The state must read running.
  5. Read the last 50 lines of logs. Report startup warnings.
  6. Report four facts: container name, state before, state after, warnings.

A restart does not fix a bad image or a bad configuration. If the container restarts into the same error, stop and use the homelab-troubleshooting skill.

Compose stacks. Homelab has no compose-stack tool. Restart a multi-container stack on the host with docker compose restart in the stack's directory, or restart each container with docker_containers. With Portainer, docker_inventory with kind set to stacks lists each stack. Pass stack_id to get one stack's compose file.

stats

Call docker_containers with action set to stats. Report CPU and memory per container in one table. Flag any container whose memory use is above 85% of its limit when the container has a limit set.

stop, start and remove

Each one follows the restart flow: dry run, go-ahead in chat, approved call, verification.

  • stop ends the process. Say so in the plan and name the dependent services that will fail.
  • start runs a stopped container. Check its state after the call.
  • remove deletes the container and its writable layer. Say so in the plan. Named volumes stay on the host.

Homelab lists volumes and networks through docker_inventory with kind set to volumes or networks. It does not delete volumes. Tell the user to remove a volume on the host themselves.

images

  • docker_images with action set to list shows local images.
  • pull fetches a tag. Run it with dry_run first, then approval.
  • remove and prune delete images. Run prune with dry_run first and report how many images it would remove before the approved call.

Running commands inside a container

Homelab has no tool that runs a command inside a container. Tell the user the exact command to run on the host, for example docker exec -it <container> sh, and read the output they paste back. Do not suggest a command that writes to the container.

Errors

Every error reads homelab.docker.<code>: <message> Fix: <hint>. Pass the Fix: line to the user as written.

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.