agentleFS
wedabrowedabro/bro-skills/.agents/skills/speckit.devops/SKILL.md

speckit.devops

Skill3 starsChanged 45 days agoMITView on GitHub

Docker Infrastructure & Security Hardening Specialist — Port ENV-first.

  • Reads credentials

We split this skill into the rules it gives an agent

8 rules. About 0 are common, 1 is distinctive, and 7 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 7

    Very specific

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

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

    Read .agents/memory/constitution.md, .env.example, existing Dockerfile, and docker-compose.yml.

    line 10
  2. Very specific:

    Precedence Rule: If .env or system environment already defines port variables (e.g.

    line 20
  3. Very specific:

    Check running Docker locally via: docker compose ps --format json 2>$null.

    line 26
  4. Very specific:

    Use named volumes for package caches (e.g.

    line 31
  5. Distinctive:

    Never hardcode secrets, credentials, or private keys in Dockerfile or compose files.

    line 42
  6. Very specific:

    Document all port variables, defaults, and usage instructions in .env.example.

    line 46
  7. Very specific:

    Update .agents/knowledge_base/infrastructure.md with container topology, networks, volumes, and health verification steps.

    line 47
  8. Very specific:

    Never run docker compose down -v on production.

    line 53

≈ “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

Mission

Architect, configure, and maintain robust, containerized runtime environments and reproducible Docker infrastructure with strict ENV-first port isolation and non-root security standards.

Inputs and Outputs

  • Read .agents/memory/constitution.md, .env.example, existing Dockerfile, and docker-compose.yml.
  • Produce and maintain Dockerfile, docker-compose.yml, docker-compose.prod.yml, .dockerignore, .env.example, and .agents/knowledge_base/infrastructure.md.

Protocol

1. Port Allocation (ENV-first)

  • Published and container ports MUST always be driven by environment variables:
    • Local: read from .env file or environment.
    • Production/CI: read from server environment.
    • Compose mapping format: "${PUBLIC_PORT}:${WEB_CONTAINER_PORT}".
  • Precedence Rule: If .env or system environment already defines port variables (e.g. PUBLIC_PORT, ADMIN_PORT, API_PORT), ABSOLUTELY PRESERVE existing ports and never trigger overwrite scans.
  • Port Discovery Policy:
    • Existing ports in .env: SKIP scan and use existing configuration.
    • Local without .env and no running Docker: scan available host ports using helper and select consecutive available ports.
    • Local with already running containers: extract ports from active containers; do not re-scan.
    • Staging/Production without .env: perform initial scan and persist to .env.
  • Check running Docker locally via: docker compose ps --format json 2>$null.
  • Standard Port Spacing Pattern: Public Frontend N → Admin Frontend N+1 → Backend API N+2.

2. Local Docker Runtime

  • Configure compose with volume mounts for code hot-reloading.
  • Use named volumes for package caches (e.g. node_modules) to avoid host-container filesystem locking.
  • Declare healthchecks with interval, timeout, and retries for every service.

3. Production Multi-Stage Hardening

  • Implement multi-stage builds separating build tooling from minimal runtime images (builder → runner).
  • Enforce non-root execution (USER node or USER appuser).
  • Strip development dependencies and compiler artifacts from the final image.
  • Standardize on Alpine or Slim official base images.

4. Security & Isolation Controls

  • Maintain comprehensive .dockerignore blocking .env, .git, temporary artifacts, and host dependencies.
  • Never hardcode secrets, credentials, or private keys in Dockerfile or compose files.
  • Expose only ports strictly required for inter-service communication or external reverse proxies.

5. Infrastructure Documentation

  • Document all port variables, defaults, and usage instructions in .env.example.
  • Update .agents/knowledge_base/infrastructure.md with container topology, networks, volumes, and health verification steps.

Completion Gate

Docker configurations build cleanly, services reach healthy status without root privileges, ports are 100% ENV-driven without collisions, and .env.example is fully documented.

Guard Rails

Never run docker compose down -v on production. Never hardcode port numbers or credentials. Never scan ports if containers are already running or .env exists.

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.