refactor-compose

Refactors and generates standardized docker-compose.yml and .env files following Docker best practices.

1|Updated Jun 29, 2026
One-click install
npx skills add https://github.com/natthasath/natthasath-marketplace --skill refactor-compose-natthasath
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: refactor-compose
Source: https://github.com/natthasath/natthasath-marketplace/tree/main/plugins/refactor/skills/refactor-compose
Command: npx skills add https://github.com/natthasath/natthasath-marketplace --skill refactor-compose-natthasath

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Docker Compose files often grow inconsistent across projects, with unordered properties, ad-hoc naming, and scattered environment variables that cause configuration errors between dev, staging, and production. This Skill enforces a single standard for docker-compose.yml and .env files so teams can review, debug, and deploy services without guesswork. ## Core Features & Use Cases - Standardized Compose Structure: Reorders service properties (container_name, image, restart, environment, ports, volumes, networks, depends_on, healthcheck) into a consistent layout. - Naming Conventions: Applies predictable naming for services, containers ({service}_app, {service}_db), networks, and volumes based on the tech stack. - Grouped .env Organization: Structures environment variables into Global, Database, and per-Service configuration groups with English comments. - Use Case: You want to deploy Postgres and n8n together. Invoke the skill with the service names and receive a clean docker-compose.yml plus a matching .env file with FQIN image names, pinned versions, healthchecks, and production-ready defaults. ## Quick Start Run /refactor-compose with the path to your existing docker-compose.yml, or simply name the services you want to deploy, to get a standardized compose file and .env generated immediately.

Frequently Asked Questions about refactor-compose

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I standardize a docker-compose.yml file?▼

Standardizing a docker-compose.yml means ordering service properties consistently (container_name, image, restart, environment, ports, volumes, networks, depends_on, healthcheck) and moving all configurable values into a grouped .env file. This skill applies that structure automatically to existing or new files.

How to structure a .env file for Docker Compose with multiple services?▼

Group variables by service: a Global Configuration block (GLOBAL_NAME, RESTART_POLICY, TIMEZONE, healthcheck settings), then per-service blocks like Postgres Configuration and each app's Configuration with container name, image name, version, and ports. Add English comments labeling each group.

What naming convention should Docker Compose services and containers use?▼

Name services after their technology (nginx, postgres), replacing spaces with underscores (uptime_kuma). Set container_name to {service}_app for web services, {service}_db for databases, and {service}_{tech} otherwise. Networks and volumes follow {SERVICE_CONTAINER_NAME}_network and _data patterns.

Should I pin image versions in docker-compose or use latest?▼

Prefer a stable release one version behind the newest when available; otherwise use latest or an explicit version. Always specify images with a fully qualified image name (FQIN) to avoid ambiguity when multiple registries are configured.

Can I use this skill without an existing docker-compose file?▼

Yes. If you only provide service names or a tech stack, it generates a new docker-compose.yml and .env from the standard template without asking follow-up questions. Existing files are refactored against every rule instead.

Why avoid default values inside docker-compose.yml?▼

Hardcoding defaults in docker-compose.yml splits configuration across two places and causes drift between environments. This skill forces all values into the .env file so the compose file stays a pure template and each environment is controlled by its own .env.