{"id":45186762,"url":"https://github.com/wrsmith108/claude-skill-docker-optimizer","last_synced_at":"2026-02-20T11:02:54.625Z","repository":{"id":337708740,"uuid":"1127479401","full_name":"wrsmith108/claude-skill-docker-optimizer","owner":"wrsmith108","description":"Claude Code skill for analyzing and optimizing Dockerfiles for faster builds and smaller images","archived":false,"fork":false,"pushed_at":"2026-02-10T21:53:11.000Z","size":9,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-02-11T00:27:52.754Z","etag":null,"topics":["claude-code","claude-skill","developer-tools","docker","dockerfile","optimization"],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/wrsmith108.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-01-04T01:01:20.000Z","updated_at":"2026-02-10T21:53:13.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/wrsmith108/claude-skill-docker-optimizer","commit_stats":null,"previous_names":["wrsmith108/claude-skill-docker-optimizer"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/wrsmith108/claude-skill-docker-optimizer","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wrsmith108%2Fclaude-skill-docker-optimizer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wrsmith108%2Fclaude-skill-docker-optimizer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wrsmith108%2Fclaude-skill-docker-optimizer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wrsmith108%2Fclaude-skill-docker-optimizer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wrsmith108","download_url":"https://codeload.github.com/wrsmith108/claude-skill-docker-optimizer/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wrsmith108%2Fclaude-skill-docker-optimizer/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29648437,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-20T09:27:29.698Z","status":"ssl_error","status_checked_at":"2026-02-20T09:26:12.373Z","response_time":59,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["claude-code","claude-skill","developer-tools","docker","dockerfile","optimization"],"created_at":"2026-02-20T11:02:54.564Z","updated_at":"2026-02-20T11:02:54.616Z","avatar_url":"https://github.com/wrsmith108.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Docker Optimizer\n\nA Claude Code skill for analyzing and optimizing Dockerfiles for faster builds and smaller images.\n\n## Installation\n\n### As a Claude Code Skill\n\n```bash\n# Clone to your Claude skills directory\ngit clone https://github.com/wrsmith108/claude-skill-docker-optimizer.git ~/.claude/skills/docker-optimizer\n```\n\n### Standalone Usage\n\n```bash\nnpx tsx scripts/index.ts [dockerfile-path] [options]\n```\n\n## Trigger Phrases\n\nThis skill activates when you mention:\n- \"slow docker build\"\n- \"optimize Dockerfile\"\n- \"layer caching\"\n- \"reduce image size\"\n- \"docker build taking too long\"\n- \"docker optimization\"\n- \"dockerfile performance\"\n- \"image too large\"\n\n## Capabilities\n\n1. **Layer Order Analysis** - Detects inefficient layer ordering that breaks cache\n2. **Multi-stage Build Detection** - Identifies opportunities for multi-stage builds\n3. **Base Image Optimization** - Recommends slim/alpine variants\n4. **Production Dependencies** - Ensures dev dependencies are excluded\n5. **Package Manager Cleanup** - Verifies apt-get/apk cleanup\n6. **Build Time Estimation** - Estimates time savings from optimizations\n7. **Image Size Estimation** - Estimates size reduction from optimizations\n\n## Usage\n\n```bash\n# Analyze Dockerfile in current directory\nnpx tsx scripts/index.ts\n\n# Analyze specific Dockerfile\nnpx tsx scripts/index.ts /path/to/Dockerfile\n\n# JSON output for programmatic use\nnpx tsx scripts/index.ts --json\n```\n\n## Optimization Checks\n\n| Check | Description | Impact |\n|-------|-------------|--------|\n| Layer order | COPY source after npm install | High |\n| Multi-stage build | Separate build and runtime stages | High |\n| Slim base image | Use node:X-slim or alpine | Medium |\n| Production deps | --production flag on npm ci | Medium |\n| Package cleanup | apt-get clean after install | Medium |\n| .dockerignore | Exclude node_modules, .git | Medium |\n| WORKDIR usage | Explicit WORKDIR instead of cd | Low |\n| Non-root user | Run as non-root for security | Low |\n\n## Output Example\n\n```markdown\n## Dockerfile Analysis\n\n### Issues Found\n\n#### 1. Layer order (Line 5)\n**Current:**\n```dockerfile\nCOPY . .\nRUN npm install\n```\n\n**Fix:** Copy package*.json first, then npm install, then copy source\n\n**Impact:** High - enables npm install layer caching\n\n---\n\n### Summary\n\n| Metric | Current | Optimized |\n|--------|---------|-----------|\n| Build time | ~5 min | ~1 min |\n| Image size | ~1.2GB | ~400MB |\n| Cache hit rate | Low | High |\n```\n\n## Before/After Example\n\n### Before Optimization\n\n```dockerfile\nFROM node:22\nWORKDIR /app\nCOPY . .\nRUN npm install\nCMD [\"node\", \"server.js\"]\n```\n\n### After Optimization\n\n```dockerfile\n# Build stage\nFROM node:22-slim AS build\nWORKDIR /app\nCOPY package*.json ./\nRUN npm ci --production\nCOPY . .\nRUN npm run build\n\n# Production stage\nFROM node:22-slim AS production\nWORKDIR /app\nCOPY --from=build /app/dist ./dist\nCOPY --from=build /app/node_modules ./node_modules\nUSER node\nCMD [\"node\", \"dist/server.js\"]\n```\n\n## Requirements\n\n- Node.js 18+\n- TypeScript (tsx for execution)\n\n## Changelog\n\n### 1.0.1 (2026-02-10)\n\n- **Fixed**: Replaced hardcoded `~/.claude/skills/` paths with relative paths for portability across different install locations\n\n## License\n\nMIT\n\n## Related Skills\n\n- [ci-doctor](https://github.com/wrsmith108/claude-skill-ci-doctor) - Diagnose CI/CD pipeline issues\n- [version-sync](https://github.com/wrsmith108/claude-skill-version-sync) - Sync Node.js versions\n- [flaky-test-detector](https://github.com/wrsmith108/claude-skill-flaky-test-detector) - Detect flaky tests\n- [security-auditor](https://github.com/wrsmith108/claude-skill-security-auditor) - Security audits\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwrsmith108%2Fclaude-skill-docker-optimizer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwrsmith108%2Fclaude-skill-docker-optimizer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwrsmith108%2Fclaude-skill-docker-optimizer/lists"}