agentsclimarketplace

Docker environments

Skill sarveshsea/design-skills/skills/docker-environments

Docker-aware Mémoire operation — CI/CD headless pipelines, shared MCP server, agent worker containers, and Figma bridge port-forwarding for containerized setupsFrom its SKILL.md

Install
npx -y skills add sarveshsea/design-skills --skill docker-environments

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

One thing to look at

  • 6 stars6 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

SKILL.md

11.0 KB, ~3.1k tokens by cl100k_base, as published. Nobody here has run it

Docker Environments


name: Docker Environments category: connect activateOn: docker-environment freedomLevel: high version: 1.0.0 description: > Docker-aware Mémoire operation. Detects Dockerfile, docker-compose.yml, and .devcontainer/ in the project root and adapts the Mémoire pipeline accordingly. Covers Figma bridge port-forwarding, CI/CD headless audits, shared MCP server as a team service, agent worker containers, and devcontainer setup.

1. Auto-Detection

Mémoire activates this Note when any of the following are present in the project root:

File / DirectorySignals
DockerfileSingle-service container build
docker-compose.yml / docker-compose.yamlMulti-service orchestration
compose.yml / compose.yamlCompose v2 convention
.devcontainer/devcontainer.jsonVS Code / Codespaces dev environment
.devcontainer/docker-compose.ymlDevcontainer with compose override

When detected, Mémoire applies these Docker-aware defaults:

  • Bridge discovery checks localhost AND host.docker.internal
  • Preview server binds to 0.0.0.0 (not 127.0.0.1)
  • Port conflict warnings include Docker port-mapping guidance
  • memi doctor output includes container networking status

2. Figma Bridge in Docker

Problem: Figma plugin runs on the host machine. Mémoire inside a container cannot auto-discover it — localhost inside the container is the container, not the host.

Fix: Forward the bridge port range from host to container.

# docker-compose.yml
services:
  memoire:
    ports:
      - "9223-9232:9223-9232"  # Figma bridge range
// .memoire/project.json
{
  "bridge": {
    "host": "0.0.0.0",
    "portRange": [9223, 9232]
  }
}

When NOT to use Docker for canvas work: If your primary workflow is Figma canvas operations (design, library, real-time sync), run Mémoire on the host. Port forwarding works but adds latency. Use Docker for CI, MCP, and agent workers.


3. CI/CD Headless Pipeline

Headless-Safe Commands

CommandNeeds BridgeCI-Safe
memi audit --wcagNoYes
memi spec validateNoYes
memi generateNoYes
memi research synthesizeNoYes
memi previewNoYes
memi pullYesNo
memi syncYesNo
memi connectYesNo

Dockerfile (CI Build)

FROM node:20-alpine AS base
WORKDIR /app
COPY package.json package-lock.json ./
RUN npm ci --ignore-scripts
COPY . .
RUN npm run build

FROM base AS ci
ENV MEMOIRE_HEADLESS=true
ENV MEMOIRE_NO_BRIDGE=true
ENTRYPOINT ["node", "dist/cli.js"]

docker-compose.yml with Profiles

version: "3.9"
services:
  # Local dev — bridge enabled, ports forwarded
  memoire-dev:
    build: { context: ., target: base }
    profiles: ["dev"]
    ports:
      - "4400:4400"
      - "4401:4401"
      - "9223-9232:9223-9232"
    volumes: [".:/app", "/app/node_modules"]
    environment: [MEMOIRE_ENV=development]
    command: ["node", "dist/cli.js", "watch", "--code"]

  # CI — headless, no bridge
  memoire-ci:
    build: { context: ., target: ci }
    profiles: ["ci"]
    volumes: [".:/workspace"]
    working_dir: /workspace
    environment: [MEMOIRE_HEADLESS=true, MEMOIRE_NO_BRIDGE=true]
    command: ["node", "dist/cli.js", "audit", "--wcag", "--exit-code"]

  # MCP server — shared team service
  memoire-mcp:
    build: { context: ., target: base }
    profiles: ["mcp"]
    ports: ["4402:4402"]
    environment: [MEMOIRE_MCP_PORT=4402]
    command: ["node", "dist/cli.js", "mcp", "start"]
    restart: unless-stopped

Running CI Audits

# Run headless WCAG audit
docker compose --profile ci run --rm memoire-ci

# Validate all specs
docker compose --profile ci run --rm memoire-ci \
  node dist/cli.js spec validate --all --strict

# Dry-run code generation
docker compose --profile ci run --rm memoire-ci \
  node dist/cli.js generate --dry-run

GitHub Actions

name: Design System CI
on: [push, pull_request]
jobs:
  design-audit:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - name: WCAG audit
        run: docker compose --profile ci run --rm memoire-ci
      - name: Validate specs
        run: docker compose --profile ci run --rm memoire-ci node dist/cli.js spec validate --all --strict
      - name: Generate (dry run)
        run: docker compose --profile ci run --rm memoire-ci node dist/cli.js generate --dry-run

Exit Codes

CodeMeaningGate
0All pass
1WarningsFail with --fail-on-warn
2ErrorsAlways fails
3Critical violationsAlways fails

Soft policy: gate on 2+. Strict policy: gate on 1+.


4. Shared MCP Server (Team Service)

Problem: Each developer running memi mcp start locally produces divergent design system state.

Fix: Deploy one containerized MCP instance. All Claude Code and Cursor sessions on the team point to it.

FROM node:20-alpine
WORKDIR /app
COPY package.json package-lock.json ./
RUN npm ci
COPY . .
RUN npm run build
VOLUME ["/workspace/.memoire"]
EXPOSE 4402
CMD ["node", "dist/cli.js", "mcp", "start", "--port", "4402"]

Claude Code config for each developer — replace localhost with the shared host:

{
  "mcpServers": {
    "memoire": {
      "url": "http://memoire.internal:4402/mcp",
      "transport": "http"
    }
  }
}

Shared volume for .memoire/ state:

services:
  memoire-mcp:
    volumes:
      - design-system:/workspace/.memoire
    command: ["node", "dist/cli.js", "mcp", "start"]

volumes:
  design-system:
    driver: local
    driver_opts:
      type: nfs
      o: addr=nas.internal,rw
      device: ":/design-system"

5. Agent Workers as Containers

Each role gets isolated resources, its own restart policy, and no shared process state.

services:
  token-engineer:
    build: .
    command: ["node", "dist/cli.js", "agent", "spawn", "token-engineer"]
    environment: [MEMOIRE_AGENT_ROLE=token-engineer]
    restart: on-failure:3
    healthcheck:
      test: ["CMD", "node", "dist/cli.js", "agent", "status", "--role", "token-engineer", "--json"]
      interval: 30s
      timeout: 10s
      retries: 3
      start_period: 15s

  component-architect:
    build: .
    command: ["node", "dist/cli.js", "agent", "spawn", "component-architect"]
    environment: [MEMOIRE_AGENT_ROLE=component-architect]
    restart: on-failure:3

  accessibility-checker:
    build: .
    command: ["node", "dist/cli.js", "agent", "spawn", "accessibility-checker"]
    environment: [MEMOIRE_AGENT_ROLE=accessibility-checker]
    restart: on-failure:3

  orchestrator:
    build: .
    command: ["node", "dist/cli.js", "compose", "--listen"]
    depends_on: [token-engineer, component-architect, accessibility-checker]
    restart: unless-stopped

Scale bottleneck roles (the task queue is lock-based — multiple workers are safe):

docker compose up --scale code-generator=3

6. Devcontainer Support

// .devcontainer/devcontainer.json
{
  "name": "Mémoire Dev",
  "dockerComposeFile": "docker-compose.yml",
  "service": "memoire-dev",
  "workspaceFolder": "/app",
  "features": {
    "ghcr.io/devcontainers/features/node:1": { "version": "20" }
  },
  "forwardPorts": [4400, 4401, 9223, 9224, 9225],
  "postCreateCommand": "npm ci && npm run build",
  "customizations": {
    "vscode": {
      "extensions": ["dbaeumer.vscode-eslint", "esbenp.prettier-vscode"]
    }
  },
  "remoteEnv": {
    "FIGMA_ACCESS_TOKEN": "${localEnv:FIGMA_ACCESS_TOKEN}",
    "MEMOIRE_ENV": "development"
  }
}
  • remoteEnv forwards FIGMA_ACCESS_TOKEN from host shell — set once in .zshrc/.bashrc, never committed.
  • VS Code auto-forwards ports in forwardPorts. The Figma plugin connects to localhost:9223 on the host; VS Code tunnels it into the container transparently.

7. Environment Variables Reference

VariableDefaultPurpose
MEMOIRE_HEADLESSfalseDisables interactive TUI, uses JSON output
MEMOIRE_NO_BRIDGEfalseSkips Figma bridge discovery entirely
MEMOIRE_ENVdevelopmentdevelopment, ci, production
MEMOIRE_MCP_PORT4402Port for MCP HTTP transport
MEMOIRE_PREVIEW_PORT4400Port for preview server
MEMOIRE_DASHBOARD_PORT4401Port for dashboard server
MEMOIRE_BRIDGE_HOST0.0.0.0Host to bind the WebSocket bridge listener
MEMOIRE_AGENT_ROLEgeneralRole for a spawned agent worker
FIGMA_ACCESS_TOKENFigma REST API token (required for memi pull)

Set in .env for local dev (never commit). Use Docker secrets or CI environment for production.


8. .memoire/project.json Docker Block

{
  "docker": {
    "enabled": true,
    "mode": "dev",
    "bridge": {
      "host": "0.0.0.0",
      "portRange": [9223, 9232],
      "fallbackHost": "host.docker.internal"
    },
    "preview": { "host": "0.0.0.0", "port": 4400 },
    "ci": {
      "headless": true,
      "noBridge": true,
      "exitOnAuditError": true,
      "failOnWarn": false
    },
    "mcp": { "shared": true, "host": "memoire.internal", "port": 4402 }
  }
}
FieldDefaultDescription
docker.modedevdev, ci, or mcp
bridge.fallbackHosthost.docker.internalFallback for Docker Desktop on Mac/Win
ci.failOnWarnfalseExit non-zero on audit warnings
mcp.sharedfalseUse shared remote MCP server

9. Anti-Patterns

Never: Run bridge exclusively in Docker for canvas work

Every canvas op adds a port-forward round trip. Run Mémoire on the host for design-heavy sessions.

Never: Use root user in production containers

# Bad
CMD ["node", "dist/cli.js"]

# Good
RUN addgroup -S memoire && adduser -S memoire -G memoire
USER memoire
CMD ["node", "dist/cli.js"]

Never: Bake .memoire/ into the image

Mount it as a volume. Baking it in means every spec change requires a rebuild.

VOLUME ["/workspace/.memoire"]

Never: Bind preview server to 127.0.0.1 in containers

Set MEMOIRE_PREVIEW_HOST=0.0.0.0 or configure via .memoire/project.json.

Never: Hardcode FIGMA_ACCESS_TOKEN in docker-compose.yml

# Bad
environment: [FIGMA_ACCESS_TOKEN=figd_abc123...]

# Good — read from host env
environment: [FIGMA_ACCESS_TOKEN=${FIGMA_ACCESS_TOKEN}]

# Production — Docker secrets
secrets:
  figma_token: { external: true }
services:
  memoire-mcp:
    secrets: [figma_token]
    environment: [FIGMA_ACCESS_TOKEN_FILE=/run/secrets/figma_token]

Never: Skip health checks on agent workers

Dead workers stall the task queue. The heartbeat timeout is 30s. Always add health checks and restart: on-failure.

What ships with it: 1 file

898 B alongside SKILL.md

Keep looking

Skills are one crate of 326,970. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.