xiaohongshu
xiaohongshu
docker
Container-based development for isolated, reproducible environments. Use when running npm commands, installing packages, executing code, or managing project dependencies. Trigger phrases include "npm install", "run the build", "start the server", "install package", or any code execution request.
Full skill instructions
Execute all package installations and code execution inside Docker containers. This keeps the host machine clean and ensures consistent environments across projects.
Type: Autonomous Execution
Directive: EXECUTE, DON'T ASK
This skill enforces Docker-first development automatically. When you request npm/node operations, commands are executed inside Docker without asking for permission.
Enforcement Behavior:
docker execFor new projects, see setup.md for the complete first-time setup guide.
Minimal setup:
# 1. Start container
docker compose --profile dev up -d
# 2. Verify running
docker ps --filter "name=my-project"
# 3. Run commands in container
docker exec my-project-dev-1 npm install
docker exec my-project-dev-1 npm test
docker exec my-project-dev-1 npm run build
These commands are BLOCKED on the host machine:
npm install, npm ci, npm run, npm test, npm exec
npx <anything>
yarn add, yarn install, yarn run
pnpm add, pnpm install, pnpm run
node <script>
tsx <script>
bun <script>
Why? Installing packages on the host:
All Node.js commands MUST use this prefix:
docker exec <container-name> <command>
Note: Use docker exec WITHOUT the -it flag in Claude Code:
# Correct (works in Claude Code)
docker exec my-project-dev-1 npm run build
# Wrong (fails with "not a TTY")
docker exec -it my-project-dev-1 npm run build
Before running ANY npm/node command, verify the container is running.
docker ps --filter "name=<container-name>" --format "table {{.Names}}\t{{.Status}}\t{{.Ports}}"
Expected output:
NAMES STATUS PORTS
my-project-dev-1 Up X minutes 0.0.0.0:3000->3000/tcp
If container is NOT running:
cd /path/to/project
docker compose --profile dev up -d
docker ps --filter "name=<container-name>"
If container shows "Exited":
docker logs <container-name> --tail 20
docker compose --profile dev down
docker compose --profile dev up -d
docker ps --filter "name=<container-name>"
docker logs <container-name> --tail 50
curl -s http://localhost:<port> > /dev/null && echo "Running" || echo "Not running"
docker compose --profile dev up -d # Start
docker compose --profile dev down # Stop
docker compose --profile dev restart dev # Restart
docker compose --profile dev up -d --build # Rebuild
docker exec <container> npm install <package> # Install package
docker exec <container> npm install -D <package> # Install dev dependency
docker exec <container> npm test # Run tests
docker exec <container> npm run typecheck # Type checking
docker exec <container> npm run lint # Linting
docker exec <container> npm run build # Build
docker exec <container> /bin/sh # Shell (use -it for interactive)
| Operation | Use docker exec? | Reason |
|---|---|---|
npm install | Always | Packages install in container only |
npm run dev | No | Already running via docker-compose |
npm test | Yes | Tests run in container environment |
npm run build | Yes | Build happens in container |
git commands | No | Git runs on host (manages files) |
| File editing | No | Volume mount syncs automatically |
| Database migrations | Yes | Uses container's Node environment |
┌─────────────────────────────────────────────────────────────┐
│ HOST (macOS/Linux/Windows) │
│ │
│ ┌─────────────────────────────────────────────────────┐ │
│ │ Docker Container (my-project-dev-1) │ │
│ │ │ │
│ │ Node 20 (Slim or Alpine) │ │
│ │ └── node_modules/ (container-only, NOT on host) │ │
│ │ └── Dev server (port 3000) │ │
│ │ │ │
│ │ Volume Mounts: │ │
│ │ └── .:/app (source code sync) │ │
│ │ └── node_modules:/app/node_modules (persist deps) │ │
│ └─────────────────────────────────────────────────────┘ │
│ │ │
│ ▼ │
│ Port mapped │
│ │ │
│ ▼ │
│ http://localhost:<port> │
└─────────────────────────────────────────────────────────────┘
Key Point: node_modules exists ONLY in the container. The host machine stays clean.
volumes:
- .:/app # Source code (synced)
- node_modules:/app/node_modules # Dependencies (container-only)
What this means:
node_modules/ lives in a named Docker volume, NOT on host filesystemdocker ps -a --filter "name=<container-name>"
docker logs <container-name>
docker compose --profile dev up -d
lsof -i :<port>
# Kill the process or change port in docker-compose.yml
docker compose --profile dev down
docker compose --profile dev build --no-cache
docker compose --profile dev up -d
docker exec <container> npm install
docker inspect <container-name> | grep -A 10 "Mounts"
docker compose --profile dev restart dev
If you see platform warnings:
# Add to docker-compose.yml service
platform: linux/amd64 # or linux/arm64
See setup.md for the complete native module troubleshooting guide including:
ERR_DLOPEN_FAILED resolutionpackage.json or DockerfileFor automated health monitoring and CI integration, see health-checks.md:
| Task | Action |
|---|---|
| Install dependency | docker exec <container> npm install <pkg> |
| Run tests | docker exec <container> npm test |
| Check types | docker exec <container> npm run typecheck |
| Build project | docker exec <container> npm run build |
| Start dev server | Container already runs it via docker-compose |
| Edit files | Edit directly (volume mount syncs) |
| Git operations | Run on host (not in container) |
For complete Docker development support, use with these complementary skills:
| Skill | Purpose |
|---|---|
| docker-enforce | Automatically blocks/transforms host commands to run inside Docker |
| docker-optimizer | Analyzes Dockerfiles for optimization opportunities |
| docker-guard | Prevents hangs when Docker daemon is unresponsive |
Provides automated enforcement of Docker-first policy:
npm, npx, yarn, pnpm, node, tsx, bun commandsdocker execInstall: git clone https://github.com/wrsmith108/docker-enforce.git ~/.claude/skills/docker-enforce
| Document | Contents |
|---|---|
| setup.md | First-time setup, native module troubleshooting, project configuration |
| health-checks.md | Container healthchecks, monitoring scripts, NPM integration |
Last updated: January 2026
xiaohongshu
technical spec
product ux expert
database patterns
Conduct multi-agent task orchestration and workflow coordination.
Initialize project with Conductor artifacts (product definition,
Expert in web animations, transitions, and motion design using Framer Motion and CSS
Creates Mermaid and ASCII diagrams for flowcharts, architecture, ERDs, state machines, mindmaps, and more. Use when user mentions diagram, flowchart, mermaid, ASCII diagram, text diagram, terminal diagram, visualize, C4, mindmap, architecture diagram, sequence diagram, ERD, or needs visual docume...
PostgreSQL bindings for H3 hexagonal grid system. Use when working with H3 cells in Postgres, including spatial indexing, geometry/geography integration, and raster analysis.
Context-Driven Development skill for projects using Conductor. Use this skill when you detect a `conductor/` directory in the project, when working on tasks defined in a `plan.md` file, or when the user asks about tracks, specs, or plans. Automatically applies TDD workflow, tracks task completion...
Display project status, active tracks, and next actions
Official Stakpak application containerization standard operating procedure, a step-by-step guidline to properly dockerize applications. This is a rule book curated by the Stakpak Team.
Generate, edit, and beat-sync AI video with leading models in one workspace.
The world's fastest calendar for remote work
Transform Your Design with AI Designer by ImgCreator.ai
Revolutionizing Video Production with AI-Powered Creativity
Extend an image past the frame and let AI fill the new aspect ratio.
Discover your celebrity doppelgänger with StarByFace!
ChainClarity explains 700+ crypto whitepapers in plain English, with layered summaries, comparisons, research tools, alerts, and a $4.99 Pro plan.
Opus.ai: Revolutionize Your Web Experience