This commit is contained in:
ВяткинАртём
2026-04-07 09:33:47 +03:00
parent 67cb7bcdeb
commit b6eb535e25
18 changed files with 110 additions and 1 deletions
-1
View File
@@ -1 +0,0 @@
../skills
@@ -0,0 +1,55 @@
---
name: dockerfile-builder
description: "Build or rewrite a Dockerfile for the current project, including all required runtime and build dependencies even if the user forgot to mention them. Use when: user asks to create Dockerfile, fix Dockerfile, containerize app, собрать Dockerfile, написать Dockerfile, починить Dockerfile, собрать образ, контейнеризовать проект, образ не работает, перепиши Dockerfile. Prefer safe optimization, but do not risk correctness for image size."
argument-hint: "Project path or app entrypoint to containerize (for example: ., api/, backend/main.py, package.json, pyproject.toml)"
---
# Dockerfile Builder
Creates or rewrites a Dockerfile that actually runs.
## Procedure
### Step 1 — Detect the Stack
Inspect the repository and detect runtime, package manager, entrypoint, port,
and existing container files (`Dockerfile`, `.dockerignore`, compose files).
### Step 2 — Infer Missing Dependencies
Infer system and runtime dependencies from manifests and code even if user did
not mention them.
### Step 3 — Choose Base Image Safely
Prefer correctness over minimal image size.
Use slim/multi-stage only when confidence is high.
### Step 4 — Build Dockerfile
Create or rewrite `Dockerfile` with reproducible install steps, clear command,
and cache-friendly layer order.
Allowed companion updates:
- `.dockerignore`
- `docker-compose.yml` and overrides
- `.env.example`
- startup scripts required for container boot
### Step 5 — Validate
If Docker/Podman is available, attempt real build and startup validation.
If runtime tools are unavailable, perform static validation and clearly report
what was not verified.
### Step 6 — Repair if Broken
If build or run fails, diagnose and rewrite with minimal necessary changes.
## Completion Checklist
- Dockerfile matches detected stack
- Required build/runtime dependencies included
- Startup command is consistent with project
- Validation attempted
- Build/run commands provided to user
+55
View File
@@ -0,0 +1,55 @@
---
name: dockerfile-tester
description: "Test, diagnose, and fix Dockerfile and container startup issues. Use when: image does not build, container exits, app is not reachable, docker run fails, docker compose fails, протестируй Dockerfile, образ не работает, контейнер падает, почини Dockerfile, debug docker image, fix container startup."
argument-hint: "Dockerfile path or service to test (for example: Dockerfile, ./api/Dockerfile, compose service name)"
---
# Dockerfile Tester
Tests container build/runtime behavior, diagnoses failures, and applies fixes.
## Procedure
### Step 1 — Preflight
Check Dockerfile paths, copy directives, command/entrypoint, manifests, and
compose configuration (if present).
### Step 2 — Build Test
Run image build and capture first actionable error.
On failure:
1. Diagnose root cause
2. Apply minimal fix
3. Rebuild
### Step 3 — Runtime Test
Run container with minimal required env and verify process startup, logs,
and port/health readiness (if applicable).
### Step 4 — Compose Test
If compose is part of scope, validate and run target service, then check health
and logs.
### Step 5 — Retry Loop
Repeat fix-and-retest up to 3 iterations, then ask user before deeper changes.
## Allowed File Changes
- `Dockerfile`
- `.dockerignore`
- `docker-compose.yml` and overrides
- `.env.example`
- startup scripts needed for container boot
## Reporting
Return:
- stage results (preflight/build/run/compose)
- fixes applied with reasons
- exact commands for build/run/compose
- remaining blockers, if any
View File
View File