|
| 1 | +{ |
| 2 | + "skill_name": "containers-orchestration", |
| 3 | + "evals": [ |
| 4 | + { |
| 5 | + "id": 1, |
| 6 | + "prompt": "Review this Dockerfile for build-cache behavior and provide the smallest safe rewrite:\n\nFROM node:24-alpine\nWORKDIR /app\nCOPY . .\nRUN npm ci\nRUN npm run build\nCMD [\"node\", \"dist/server.js\"]\n\nThe repository has package.json, package-lock.json, src/, tests/, node_modules/, and a .git directory. The final image does not need the compiler or development dependencies. State how to verify cache reuse.", |
| 7 | + "expected_output": "Identify the broad source copy before dependency installation as the primary cache problem. Copy package manifests first, install dependencies, copy source later, add a .dockerignore, use a multi-stage build that copies only runtime artifacts, and verify a repeated BuildKit build reports dependency steps as cached.", |
| 8 | + "files": [], |
| 9 | + "checks": [ |
| 10 | + { |
| 11 | + "id": "manifests-before-source", |
| 12 | + "type": "contains_all", |
| 13 | + "values": [ |
| 14 | + "package.json", |
| 15 | + "package-lock.json", |
| 16 | + "COPY" |
| 17 | + ] |
| 18 | + }, |
| 19 | + { |
| 20 | + "id": "requires-dockerignore", |
| 21 | + "type": "contains", |
| 22 | + "value": ".dockerignore" |
| 23 | + }, |
| 24 | + { |
| 25 | + "id": "uses-multi-stage", |
| 26 | + "type": "contains_any", |
| 27 | + "values": [ |
| 28 | + "multi-stage", |
| 29 | + "AS builder", |
| 30 | + "FROM node:24-alpine AS" |
| 31 | + ] |
| 32 | + }, |
| 33 | + { |
| 34 | + "id": "copies-runtime-artifacts", |
| 35 | + "type": "contains_any", |
| 36 | + "values": [ |
| 37 | + "COPY --from", |
| 38 | + "runtime artifacts", |
| 39 | + "final stage" |
| 40 | + ] |
| 41 | + }, |
| 42 | + { |
| 43 | + "id": "verifies-cache", |
| 44 | + "type": "contains_all", |
| 45 | + "values": [ |
| 46 | + "BuildKit", |
| 47 | + "CACHED", |
| 48 | + "repeated" |
| 49 | + ] |
| 50 | + } |
| 51 | + ] |
| 52 | + }, |
| 53 | + { |
| 54 | + "id": 2, |
| 55 | + "prompt": "A reviewer says every Dockerfile should have the fewest possible layers, so all dependency installation, compilation, cleanup, and application copying should be collapsed into one giant RUN instruction. Is that the correct optimization target? Give the non-negotiable rule and a corrected approach.", |
| 56 | + "expected_output": "Reject raw layer-count minimization. Explain that intentional layers are cache boundaries, keep stable dependency work before frequently changing source, combine only logically coupled package-manager operations, and preserve correctness when BuildKit caches are empty.", |
| 57 | + "files": [], |
| 58 | + "checks": [ |
| 59 | + { |
| 60 | + "id": "rejects-layer-count-target", |
| 61 | + "type": "contains_any", |
| 62 | + "values": [ |
| 63 | + "not the correct", |
| 64 | + "not the goal", |
| 65 | + "do not optimize for", |
| 66 | + "not layer count" |
| 67 | + ] |
| 68 | + }, |
| 69 | + { |
| 70 | + "id": "preserves-cache-separation", |
| 71 | + "type": "contains_all", |
| 72 | + "values": [ |
| 73 | + "cache", |
| 74 | + "separate" |
| 75 | + ] |
| 76 | + }, |
| 77 | + { |
| 78 | + "id": "keeps-stable-work-early", |
| 79 | + "type": "contains_all", |
| 80 | + "values": [ |
| 81 | + "dependencies", |
| 82 | + "source" |
| 83 | + ] |
| 84 | + }, |
| 85 | + { |
| 86 | + "id": "combines-only-coupled-operations", |
| 87 | + "type": "contains_all", |
| 88 | + "values": [ |
| 89 | + "logically coupled", |
| 90 | + "install", |
| 91 | + "cleanup" |
| 92 | + ] |
| 93 | + }, |
| 94 | + { |
| 95 | + "id": "cache-not-correctness", |
| 96 | + "type": "contains_any", |
| 97 | + "values": [ |
| 98 | + "empty cache", |
| 99 | + "cache is empty", |
| 100 | + "cache contents" |
| 101 | + ] |
| 102 | + } |
| 103 | + ] |
| 104 | + }, |
| 105 | + { |
| 106 | + "id": 3, |
| 107 | + "prompt": "Review a Dockerfile's caching strategy in an environment where Docker and BuildKit are unavailable. The file copies requirements.txt before src/ and installs dependencies between those copies. Report what can and cannot be concluded.", |
| 108 | + "expected_output": "Perform a static review that recognizes the cache-friendly ordering, check other contract items such as .dockerignore and coupled package operations, and explicitly state that runtime cache reuse was not verified because BuildKit was unavailable.", |
| 109 | + "files": [], |
| 110 | + "checks": [ |
| 111 | + { |
| 112 | + "id": "recognizes-static-ordering", |
| 113 | + "type": "contains_all", |
| 114 | + "values": [ |
| 115 | + "requirements.txt", |
| 116 | + "src", |
| 117 | + "cache" |
| 118 | + ] |
| 119 | + }, |
| 120 | + { |
| 121 | + "id": "reports-limitation", |
| 122 | + "type": "contains_all", |
| 123 | + "values": [ |
| 124 | + "BuildKit", |
| 125 | + "unavailable", |
| 126 | + "not verified" |
| 127 | + ] |
| 128 | + }, |
| 129 | + { |
| 130 | + "id": "does-not-claim-runtime-proof", |
| 131 | + "type": "not_regex", |
| 132 | + "pattern": "(?i)(cache reuse (?:is|was) verified|verified cache reuse)" |
| 133 | + } |
| 134 | + ] |
| 135 | + } |
| 136 | + ] |
| 137 | +} |
0 commit comments