@mrciphersmith/keryx 0.3.2 → 0.3.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (164) hide show
  1. package/dist/cli.js +4745 -2482
  2. package/dist/core.js +66 -10
  3. package/package.json +1 -1
  4. package/src/gdskills/bundled/install-manifest.json +578 -2
  5. package/src/gdskills/bundled/rules/core/model-selection.mdc +18 -0
  6. package/src/gdskills/bundled/skills/orchestration/job-orchestrator/SKILL.md +1 -1
  7. package/src/gdskills/bundled/skills/planning/brainstorm/SKILL.md +1 -1
  8. package/src/gdskills/bundled/skills/planning/interviewer/SKILL.md +1 -1
  9. package/src/gdskills/bundled/skills/quality/deploy/SKILL.md +1 -1
  10. package/src/gdskills/bundled/skills/review/review-jev-contract/SKILL.md +193 -0
  11. package/src/gdskills/bundled/skills/review/review-orchestrator/SKILL.detail.md +81 -21
  12. package/src/gdskills/bundled/skills/review/review-orchestrator/SKILL.md +4 -4
  13. package/src/gdskills/bundled/stacks/c-cpp/agent-refs.json +4 -0
  14. package/src/gdskills/bundled/stacks/c-cpp/governance/eval.json +1777 -0
  15. package/src/gdskills/bundled/stacks/c-cpp/governance/scout.json +31 -0
  16. package/src/gdskills/bundled/stacks/c-cpp/pack.json +42 -0
  17. package/src/gdskills/bundled/stacks/c-cpp/rules/coding-style.mdc +80 -0
  18. package/src/gdskills/bundled/stacks/c-cpp/rules/patterns.mdc +87 -0
  19. package/src/gdskills/bundled/stacks/c-cpp/rules/security.mdc +90 -0
  20. package/src/gdskills/bundled/stacks/c-cpp/rules/testing.mdc +83 -0
  21. package/src/gdskills/bundled/stacks/c-cpp/skills/c-cpp-build-fix/SKILL.md +153 -0
  22. package/src/gdskills/bundled/stacks/c-cpp/skills/c-cpp-build-fix/evals.json +74 -0
  23. package/src/gdskills/bundled/stacks/c-cpp/skills/c-cpp-code-review/SKILL.md +132 -0
  24. package/src/gdskills/bundled/stacks/c-cpp/skills/c-cpp-code-review/evals.json +73 -0
  25. package/src/gdskills/bundled/stacks/c-cpp/skills/c-cpp-implementation/SKILL.md +151 -0
  26. package/src/gdskills/bundled/stacks/c-cpp/skills/c-cpp-implementation/evals.json +74 -0
  27. package/src/gdskills/bundled/stacks/c-cpp/skills/c-cpp-testing/SKILL.md +152 -0
  28. package/src/gdskills/bundled/stacks/c-cpp/skills/c-cpp-testing/evals.json +74 -0
  29. package/src/gdskills/bundled/stacks/ci-github-gitlab/agent-refs.json +4 -0
  30. package/src/gdskills/bundled/stacks/ci-github-gitlab/governance/eval.json +1295 -0
  31. package/src/gdskills/bundled/stacks/ci-github-gitlab/governance/scout.json +26 -0
  32. package/src/gdskills/bundled/stacks/ci-github-gitlab/pack.json +41 -0
  33. package/src/gdskills/bundled/stacks/ci-github-gitlab/rules/patterns.mdc +77 -0
  34. package/src/gdskills/bundled/stacks/ci-github-gitlab/rules/security.mdc +144 -0
  35. package/src/gdskills/bundled/stacks/ci-github-gitlab/skills/ci-pipeline-build-fix/SKILL.md +121 -0
  36. package/src/gdskills/bundled/stacks/ci-github-gitlab/skills/ci-pipeline-build-fix/evals.json +73 -0
  37. package/src/gdskills/bundled/stacks/ci-github-gitlab/skills/ci-pipeline-code-review/SKILL.md +139 -0
  38. package/src/gdskills/bundled/stacks/ci-github-gitlab/skills/ci-pipeline-code-review/evals.json +73 -0
  39. package/src/gdskills/bundled/stacks/ci-github-gitlab/skills/ci-pipeline-implementation/SKILL.md +147 -0
  40. package/src/gdskills/bundled/stacks/ci-github-gitlab/skills/ci-pipeline-implementation/evals.json +74 -0
  41. package/src/gdskills/bundled/stacks/csharp-dotnet/agent-refs.json +4 -0
  42. package/src/gdskills/bundled/stacks/csharp-dotnet/governance/eval.json +1881 -0
  43. package/src/gdskills/bundled/stacks/csharp-dotnet/governance/scout.json +33 -0
  44. package/src/gdskills/bundled/stacks/csharp-dotnet/pack.json +38 -0
  45. package/src/gdskills/bundled/stacks/csharp-dotnet/rules/coding-style.mdc +100 -0
  46. package/src/gdskills/bundled/stacks/csharp-dotnet/rules/patterns.mdc +107 -0
  47. package/src/gdskills/bundled/stacks/csharp-dotnet/rules/security.mdc +86 -0
  48. package/src/gdskills/bundled/stacks/csharp-dotnet/rules/testing.mdc +89 -0
  49. package/src/gdskills/bundled/stacks/csharp-dotnet/skills/dotnet-build-fix/SKILL.md +143 -0
  50. package/src/gdskills/bundled/stacks/csharp-dotnet/skills/dotnet-build-fix/evals.json +77 -0
  51. package/src/gdskills/bundled/stacks/csharp-dotnet/skills/dotnet-code-review/SKILL.md +121 -0
  52. package/src/gdskills/bundled/stacks/csharp-dotnet/skills/dotnet-code-review/evals.json +77 -0
  53. package/src/gdskills/bundled/stacks/csharp-dotnet/skills/dotnet-implementation/SKILL.md +134 -0
  54. package/src/gdskills/bundled/stacks/csharp-dotnet/skills/dotnet-implementation/evals.json +76 -0
  55. package/src/gdskills/bundled/stacks/csharp-dotnet/skills/dotnet-testing/SKILL.md +130 -0
  56. package/src/gdskills/bundled/stacks/csharp-dotnet/skills/dotnet-testing/evals.json +77 -0
  57. package/src/gdskills/bundled/stacks/docker-k8s-terraform/agent-refs.json +4 -0
  58. package/src/gdskills/bundled/stacks/docker-k8s-terraform/governance/eval.json +865 -0
  59. package/src/gdskills/bundled/stacks/docker-k8s-terraform/governance/scout.json +16 -0
  60. package/src/gdskills/bundled/stacks/docker-k8s-terraform/pack.json +46 -0
  61. package/src/gdskills/bundled/stacks/docker-k8s-terraform/rules/coding-style.mdc +74 -0
  62. package/src/gdskills/bundled/stacks/docker-k8s-terraform/rules/patterns.mdc +81 -0
  63. package/src/gdskills/bundled/stacks/docker-k8s-terraform/rules/security.mdc +146 -0
  64. package/src/gdskills/bundled/stacks/docker-k8s-terraform/rules/testing.mdc +61 -0
  65. package/src/gdskills/bundled/stacks/docker-k8s-terraform/skills/docker-k8s-terraform-build-fix/SKILL.md +151 -0
  66. package/src/gdskills/bundled/stacks/docker-k8s-terraform/skills/docker-k8s-terraform-build-fix/evals.json +74 -0
  67. package/src/gdskills/bundled/stacks/docker-k8s-terraform/skills/docker-k8s-terraform-review/SKILL.md +135 -0
  68. package/src/gdskills/bundled/stacks/docker-k8s-terraform/skills/docker-k8s-terraform-review/evals.json +76 -0
  69. package/src/gdskills/bundled/stacks/flutter-dart/agent-refs.json +4 -0
  70. package/src/gdskills/bundled/stacks/flutter-dart/governance/eval.json +1849 -0
  71. package/src/gdskills/bundled/stacks/flutter-dart/governance/scout.json +33 -0
  72. package/src/gdskills/bundled/stacks/flutter-dart/pack.json +41 -0
  73. package/src/gdskills/bundled/stacks/flutter-dart/rules/coding-style.mdc +98 -0
  74. package/src/gdskills/bundled/stacks/flutter-dart/rules/patterns.mdc +88 -0
  75. package/src/gdskills/bundled/stacks/flutter-dart/rules/security.mdc +91 -0
  76. package/src/gdskills/bundled/stacks/flutter-dart/rules/testing.mdc +101 -0
  77. package/src/gdskills/bundled/stacks/flutter-dart/skills/flutter-build-fix/SKILL.md +134 -0
  78. package/src/gdskills/bundled/stacks/flutter-dart/skills/flutter-build-fix/evals.json +79 -0
  79. package/src/gdskills/bundled/stacks/flutter-dart/skills/flutter-code-review/SKILL.md +124 -0
  80. package/src/gdskills/bundled/stacks/flutter-dart/skills/flutter-code-review/evals.json +74 -0
  81. package/src/gdskills/bundled/stacks/flutter-dart/skills/flutter-implementation/SKILL.md +139 -0
  82. package/src/gdskills/bundled/stacks/flutter-dart/skills/flutter-implementation/evals.json +77 -0
  83. package/src/gdskills/bundled/stacks/flutter-dart/skills/flutter-testing/SKILL.md +134 -0
  84. package/src/gdskills/bundled/stacks/flutter-dart/skills/flutter-testing/evals.json +74 -0
  85. package/src/gdskills/bundled/stacks/kotlin-android/agent-refs.json +4 -0
  86. package/src/gdskills/bundled/stacks/kotlin-android/governance/eval.json +1889 -0
  87. package/src/gdskills/bundled/stacks/kotlin-android/governance/scout.json +34 -0
  88. package/src/gdskills/bundled/stacks/kotlin-android/pack.json +38 -0
  89. package/src/gdskills/bundled/stacks/kotlin-android/rules/coding-style.mdc +89 -0
  90. package/src/gdskills/bundled/stacks/kotlin-android/rules/patterns.mdc +96 -0
  91. package/src/gdskills/bundled/stacks/kotlin-android/rules/security.mdc +90 -0
  92. package/src/gdskills/bundled/stacks/kotlin-android/rules/testing.mdc +89 -0
  93. package/src/gdskills/bundled/stacks/kotlin-android/skills/compose-implementation/SKILL.md +150 -0
  94. package/src/gdskills/bundled/stacks/kotlin-android/skills/compose-implementation/evals.json +77 -0
  95. package/src/gdskills/bundled/stacks/kotlin-android/skills/kotlin-android-build-fix/SKILL.md +151 -0
  96. package/src/gdskills/bundled/stacks/kotlin-android/skills/kotlin-android-build-fix/evals.json +76 -0
  97. package/src/gdskills/bundled/stacks/kotlin-android/skills/kotlin-android-code-review/SKILL.md +139 -0
  98. package/src/gdskills/bundled/stacks/kotlin-android/skills/kotlin-android-code-review/evals.json +78 -0
  99. package/src/gdskills/bundled/stacks/kotlin-android/skills/kotlin-android-testing/SKILL.md +131 -0
  100. package/src/gdskills/bundled/stacks/kotlin-android/skills/kotlin-android-testing/evals.json +77 -0
  101. package/src/gdskills/bundled/stacks/php-laravel/agent-refs.json +4 -0
  102. package/src/gdskills/bundled/stacks/php-laravel/governance/eval.json +1829 -0
  103. package/src/gdskills/bundled/stacks/php-laravel/governance/scout.json +33 -0
  104. package/src/gdskills/bundled/stacks/php-laravel/pack.json +41 -0
  105. package/src/gdskills/bundled/stacks/php-laravel/rules/coding-style.mdc +82 -0
  106. package/src/gdskills/bundled/stacks/php-laravel/rules/patterns.mdc +80 -0
  107. package/src/gdskills/bundled/stacks/php-laravel/rules/security.mdc +80 -0
  108. package/src/gdskills/bundled/stacks/php-laravel/rules/testing.mdc +82 -0
  109. package/src/gdskills/bundled/stacks/php-laravel/skills/php-laravel-build-fix/SKILL.md +143 -0
  110. package/src/gdskills/bundled/stacks/php-laravel/skills/php-laravel-build-fix/evals.json +74 -0
  111. package/src/gdskills/bundled/stacks/php-laravel/skills/php-laravel-code-review/SKILL.md +126 -0
  112. package/src/gdskills/bundled/stacks/php-laravel/skills/php-laravel-code-review/evals.json +76 -0
  113. package/src/gdskills/bundled/stacks/php-laravel/skills/php-laravel-implementation/SKILL.md +140 -0
  114. package/src/gdskills/bundled/stacks/php-laravel/skills/php-laravel-implementation/evals.json +75 -0
  115. package/src/gdskills/bundled/stacks/php-laravel/skills/php-laravel-testing/SKILL.md +124 -0
  116. package/src/gdskills/bundled/stacks/php-laravel/skills/php-laravel-testing/evals.json +74 -0
  117. package/src/gdskills/bundled/stacks/ruby-rails/agent-refs.json +4 -0
  118. package/src/gdskills/bundled/stacks/ruby-rails/governance/eval.json +1673 -0
  119. package/src/gdskills/bundled/stacks/ruby-rails/governance/scout.json +33 -0
  120. package/src/gdskills/bundled/stacks/ruby-rails/pack.json +42 -0
  121. package/src/gdskills/bundled/stacks/ruby-rails/rules/coding-style.mdc +69 -0
  122. package/src/gdskills/bundled/stacks/ruby-rails/rules/patterns.mdc +93 -0
  123. package/src/gdskills/bundled/stacks/ruby-rails/rules/security.mdc +90 -0
  124. package/src/gdskills/bundled/stacks/ruby-rails/rules/testing.mdc +89 -0
  125. package/src/gdskills/bundled/stacks/ruby-rails/skills/ruby-rails-build-fix/SKILL.md +143 -0
  126. package/src/gdskills/bundled/stacks/ruby-rails/skills/ruby-rails-build-fix/evals.json +73 -0
  127. package/src/gdskills/bundled/stacks/ruby-rails/skills/ruby-rails-code-review/SKILL.md +134 -0
  128. package/src/gdskills/bundled/stacks/ruby-rails/skills/ruby-rails-code-review/evals.json +71 -0
  129. package/src/gdskills/bundled/stacks/ruby-rails/skills/ruby-rails-implementation/SKILL.md +141 -0
  130. package/src/gdskills/bundled/stacks/ruby-rails/skills/ruby-rails-implementation/evals.json +72 -0
  131. package/src/gdskills/bundled/stacks/ruby-rails/skills/ruby-rails-testing/SKILL.md +125 -0
  132. package/src/gdskills/bundled/stacks/ruby-rails/skills/ruby-rails-testing/evals.json +72 -0
  133. package/src/gdskills/bundled/stacks/sql-db/agent-refs.json +4 -0
  134. package/src/gdskills/bundled/stacks/sql-db/governance/eval.json +1829 -0
  135. package/src/gdskills/bundled/stacks/sql-db/governance/scout.json +30 -0
  136. package/src/gdskills/bundled/stacks/sql-db/pack.json +40 -0
  137. package/src/gdskills/bundled/stacks/sql-db/rules/coding-style.mdc +69 -0
  138. package/src/gdskills/bundled/stacks/sql-db/rules/patterns.mdc +134 -0
  139. package/src/gdskills/bundled/stacks/sql-db/rules/security.mdc +74 -0
  140. package/src/gdskills/bundled/stacks/sql-db/rules/testing.mdc +83 -0
  141. package/src/gdskills/bundled/stacks/sql-db/skills/sql-db-build-fix/SKILL.md +147 -0
  142. package/src/gdskills/bundled/stacks/sql-db/skills/sql-db-build-fix/evals.json +72 -0
  143. package/src/gdskills/bundled/stacks/sql-db/skills/sql-db-code-review/SKILL.md +132 -0
  144. package/src/gdskills/bundled/stacks/sql-db/skills/sql-db-code-review/evals.json +73 -0
  145. package/src/gdskills/bundled/stacks/sql-db/skills/sql-db-implementation/SKILL.md +153 -0
  146. package/src/gdskills/bundled/stacks/sql-db/skills/sql-db-implementation/evals.json +77 -0
  147. package/src/gdskills/bundled/stacks/sql-db/skills/sql-db-testing/SKILL.md +129 -0
  148. package/src/gdskills/bundled/stacks/sql-db/skills/sql-db-testing/evals.json +73 -0
  149. package/src/gdskills/bundled/stacks/swift-ios/agent-refs.json +4 -0
  150. package/src/gdskills/bundled/stacks/swift-ios/governance/eval.json +1803 -0
  151. package/src/gdskills/bundled/stacks/swift-ios/governance/scout.json +32 -0
  152. package/src/gdskills/bundled/stacks/swift-ios/pack.json +38 -0
  153. package/src/gdskills/bundled/stacks/swift-ios/rules/coding-style.mdc +92 -0
  154. package/src/gdskills/bundled/stacks/swift-ios/rules/patterns.mdc +112 -0
  155. package/src/gdskills/bundled/stacks/swift-ios/rules/security.mdc +78 -0
  156. package/src/gdskills/bundled/stacks/swift-ios/rules/testing.mdc +90 -0
  157. package/src/gdskills/bundled/stacks/swift-ios/skills/swift-build-fix/SKILL.md +144 -0
  158. package/src/gdskills/bundled/stacks/swift-ios/skills/swift-build-fix/evals.json +75 -0
  159. package/src/gdskills/bundled/stacks/swift-ios/skills/swift-code-review/SKILL.md +122 -0
  160. package/src/gdskills/bundled/stacks/swift-ios/skills/swift-code-review/evals.json +75 -0
  161. package/src/gdskills/bundled/stacks/swift-ios/skills/swift-testing/SKILL.md +131 -0
  162. package/src/gdskills/bundled/stacks/swift-ios/skills/swift-testing/evals.json +75 -0
  163. package/src/gdskills/bundled/stacks/swift-ios/skills/swiftui-implementation/SKILL.md +149 -0
  164. package/src/gdskills/bundled/stacks/swift-ios/skills/swiftui-implementation/evals.json +76 -0
@@ -0,0 +1,74 @@
1
+ {
2
+ "triggers": {
3
+ "positive": [
4
+ "The Docker build keeps failing with a permission denied error",
5
+ "Kubernetes rejected this Deployment manifest, can you help fix it",
6
+ "Why does terraform plan want to destroy this bucket after I renamed it",
7
+ "This Helm chart won't render, values lookup is failing",
8
+ "terraform validate keeps erroring on this module",
9
+ "docker build can't find the file it's supposed to copy"
10
+ ],
11
+ "negative": [
12
+ "Review this Dockerfile for security issues",
13
+ "Write unit tests for this Terraform module",
14
+ "Deploy this service to production",
15
+ "Fix the failing Go build",
16
+ "Fix this GitHub Actions workflow that's failing",
17
+ "Scan this repo for dependency vulnerabilities"
18
+ ]
19
+ },
20
+ "scenarios": [
21
+ {
22
+ "id": "docker-nonroot-permission-fix",
23
+ "prompt": "A Dockerfile switches to a non-root user with `USER app`, and the very next build fails because /app can't be written to -- permission denied. What's the right way to solve this?",
24
+ "strictness": "high",
25
+ "expected_behavior": [
26
+ {
27
+ "grader": "judge",
28
+ "rubric": "A correct answer identifies that the files were copied/created while the build was still running as root, so the `app` user does not own them and cannot write to /app, and fixes ownership at the source -- using COPY --chown=app:app for copied files, or a RUN chown/mkdir step executed before the USER instruction switches away from root -- rather than working around the permission error by loosening permissions or reverting to root.",
29
+ "pass_criteria": [
30
+ "Identifies the root cause: files were copied or created while the build still ran as root, so the non-root `app` user does not own /app and cannot write to it.",
31
+ "Gives a concrete fix: either `COPY --chown=app:app ...` on the copy step, or a `RUN chown`/`mkdir -p` step for /app executed before the USER instruction switches to the non-root user.",
32
+ "Keeps the container running as the non-root user in the final fix -- the fix changes ownership, not who the container runs as."
33
+ ],
34
+ "fail_criteria": [
35
+ "Recommends `chmod 777` (or another world-writable permission change) on /app, or reverts to `USER root` to make the write succeed, instead of fixing ownership at the copy/create step. Mentioning either only to warn against it is not a failure."
36
+ ]
37
+ }
38
+ ],
39
+ "calibration": {
40
+ "known_right": "The build is still running as root when the files land in /app (via COPY or an earlier RUN), so once it switches to USER app, that user doesn't own those files and can't write into the directory -- permission denied. The fix is to make `app` own the directory from the start: either add `--chown=app:app` to the COPY instruction that puts the files there, or add a `RUN mkdir -p /app && chown app:app /app` (or an equivalent chown of the already-copied files) before the `USER app` line. Either way the final image still runs as `app`, non-root -- this only changes who owns the directory, not who the container runs as.",
41
+ "known_wrong": "Easiest fix here: add `RUN chmod 777 /app` right before the USER switch so any user can write to it regardless of ownership -- that clears the permission denied error immediately and the build passes.",
42
+ "vague": "Sounds like an ownership problem -- you'll probably need to adjust permissions somewhere before the user switch happens.",
43
+ "subtle_wrong": "This is an ownership mismatch after the USER switch, worth fixing properly at some point. For now though, the simplest unblock is `RUN chmod 777 /app` right before `USER app` -- it's a common enough pattern in build images where the exact ownership doesn't matter much, and it gets the build green without having to chase down every file that needs `--chown`."
44
+ },
45
+ "anti_patterns": ["chmod 777"]
46
+ },
47
+ {
48
+ "id": "terraform-rename-state-mv",
49
+ "prompt": "A rename inside a Terraform module makes `terraform plan` show that an existing S3 bucket will be destroyed and recreated, even though nothing about the bucket itself changed. The bucket holds real data. How do you avoid losing it?",
50
+ "strictness": "high",
51
+ "expected_behavior": [
52
+ {
53
+ "grader": "judge",
54
+ "rubric": "A correct answer identifies that renaming the resource block changed its address in Terraform's state, so Terraform sees the old address as gone and the new address as a brand-new resource -- hence the destroy-then-create plan -- and fixes it with `terraform state mv <old_address> <new_address>` to relink the existing real bucket to its new configuration address, without accepting the destroy/recreate plan.",
55
+ "pass_criteria": [
56
+ "Explains the actual cause: the rename changed the resource's address in configuration, and Terraform's state still has the old address, so it plans a destroy of the old address and a create of the new one.",
57
+ "Names the specific fix: `terraform state mv <old_address> <new_address>` (or the equivalent moved block) to relink the existing bucket to the renamed address without touching the real resource.",
58
+ "Treats the destroy/recreate plan as something to avoid applying, not as an acceptable outcome for a stateful resource holding real data."
59
+ ],
60
+ "fail_criteria": [
61
+ "Recommends running `terraform apply -auto-approve` (or any unreviewed apply) to push the destroy/recreate plan through, or otherwise accepts the resource being destroyed and recreated as an acceptable fix for a rename. Mentioning `-auto-approve` only to warn against it is not a failure."
62
+ ]
63
+ }
64
+ ],
65
+ "calibration": {
66
+ "known_right": "This is a state-address problem, not an actual infrastructure change: renaming the resource block changed its address in the configuration, but Terraform's state file still has the bucket recorded under the old address. From Terraform's point of view, the old address no longer exists in config (so it plans a destroy) and the new address is a resource it's never seen before (so it plans a create) -- even though both addresses point at what should be the same real bucket. The fix is `terraform state mv <old_resource_address> <new_resource_address>`, which updates the state file to track the existing bucket under its new address without touching the real resource at all. After that, `terraform plan` should show no changes. Do not apply the destroy/recreate plan as it stands -- for a bucket holding real data, that would actually delete and rebuild it.",
67
+ "known_wrong": "The rename is causing a full replace in the plan. Since the bucket contents can probably be restored from a backup if needed, the fastest path here is just to run `terraform apply -auto-approve` and let it destroy and recreate the bucket under the new name -- it'll be back up in a minute or two.",
68
+ "vague": "That destroy-and-recreate in the plan looks risky for a bucket with real data -- you'll want to handle the rename more carefully before applying.",
69
+ "subtle_wrong": "The destroy/recreate is because of the rename changing the resource's address, which is a real concern for a bucket with live data. Since this particular bucket has versioning enabled though, applying the plan with `terraform apply -auto-approve` should be safe enough -- versioning means the objects aren't really gone even if the bucket itself gets recreated, so it's simpler than tracking down the exact `state mv` command."
70
+ },
71
+ "anti_patterns": ["-auto-approve"]
72
+ }
73
+ ]
74
+ }
@@ -0,0 +1,135 @@
1
+ ---
2
+ name: docker-k8s-terraform-review
3
+ description: "Use when reviewing a Dockerfile, Docker Compose file, Kubernetes/Helm manifest, or Terraform change for security and config-authoring risks -- root containers, unpinned base images, secrets baked into image layers, missing Kubernetes securityContext/NetworkPolicy, and Terraform state/secrets handling. Read-only, no edits: never builds an image, runs a deployment/release (use the `deploy` quality skill for that), or resolves a failing build/validate/plan (use `docker-k8s-terraform-build-fix` for that)."
4
+ triggers:
5
+ - "review this Dockerfile for security issues"
6
+ - "check this Kubernetes manifest before it ships"
7
+ - "review this Terraform change for security problems"
8
+ - "does this Dockerfile run as root"
9
+ - "review this Helm chart change"
10
+ - "check this docker-compose file for secrets"
11
+ metadata:
12
+ origin: authored
13
+ category: review
14
+ version: "1.0.0"
15
+ compatible_harnesses: "claude,codex,cursor,zed,opencode"
16
+ license: "MIT"
17
+ ---
18
+
19
+ # Docker / Kubernetes / Terraform review
20
+
21
+ Read-only review of a Dockerfile, Docker Compose file, Kubernetes/Helm
22
+ manifest, or Terraform change for the config-authoring and security risks
23
+ specific to this pack's three file types: root containers, unpinned base
24
+ images, secrets baked into image layers, missing Kubernetes
25
+ `securityContext`/`NetworkPolicy`, and Terraform state/secrets handling.
26
+ This skill never edits config — it reports findings. `rules/coding-style.mdc`,
27
+ `rules/patterns.mdc`, and `rules/security.mdc` are the rule set findings are
28
+ checked against. It does not scan a built image for known CVEs (that is
29
+ `security-audit`'s job) and it does not run or deploy anything (that is
30
+ `deploy`'s job).
31
+
32
+ ## Workflow
33
+
34
+ ### Step 1: Scope the review
35
+
36
+ 1. Identify the changed files (`git diff` against the review base) —
37
+ review only Dockerfiles, compose files, Kubernetes/Helm YAML, and
38
+ `.tf`/`.tfvars` files in the diff, not the whole repository.
39
+ 2. Read enough of the surrounding, unchanged file to know whether a
40
+ flagged pattern is new in this diff or pre-existing; note pre-existing
41
+ issues separately from ones the diff introduces.
42
+
43
+ ### Step 2: Check each changed file against the focus list
44
+
45
+ **Dockerfile and Compose**
46
+ - A diff that adds `USER root` back onto a previously non-root image, or a
47
+ missing `USER` instruction where the base image's own default is NOT
48
+ known to be non-root — flag it (confirm the base image's actual default
49
+ before flagging a bare missing-`USER` case; some images, e.g.
50
+ `nginxinc/nginx-unprivileged`, already default to non-root with no
51
+ `USER` line needed — see `rules/security.mdc`'s non-root-by-default
52
+ rule for the full distinction).
53
+ - A `FROM` line pinned only by a mutable tag, or a diff that drops an
54
+ existing digest pin (e.g. changing `FROM node:20-slim@sha256:<digest>`
55
+ to `FROM node:latest`) — flag the loss of reproducibility; every
56
+ production-bound Dockerfile should pin its base image by digest.
57
+ - A secret (API key, token, password) passed via `ARG`/`ENV`/`COPY`
58
+ instead of a `RUN --mount=type=secret` build-time mount, or a Compose
59
+ file with a credential hardcoded in `environment:` instead of sourced
60
+ from an `.env`/secrets file — flag it; the value persists in the image
61
+ layer or the committed file either way.
62
+
63
+ **Kubernetes and Helm**
64
+ - A container `securityContext` missing `runAsNonRoot: true`,
65
+ `allowPrivilegeEscalation: false`, or a capabilities drop
66
+ (`capabilities.drop: ["ALL"]`) — flag whichever is missing.
67
+ - A workload manifest shipped with no accompanying `NetworkPolicy` in a
68
+ namespace that has none, or a `NetworkPolicy` broad enough to defeat a
69
+ default-deny boundary — a `spec.ingress` entry that is a single empty
70
+ rule object (`ingress: [{}]`, allow-all — not the same as an EMPTY
71
+ `ingress:` array, which is deny-all) or a `podSelector: {}` on a policy
72
+ meant to scope one workload — flag it.
73
+ - A container with no `resources.requests`/`resources.limits` — flag it
74
+ per `rules/coding-style.mdc`.
75
+
76
+ **Terraform**
77
+ - A hardcoded credential or connection string literal in a `.tf`/`.tfvars`
78
+ file — flag it regardless of whether a `sensitive = true` variable
79
+ exists elsewhere in the same file.
80
+ - A `sensitive = true` value treated in the diff's own comments/PR
81
+ description as if that alone encrypted the value — flag the
82
+ misunderstanding: `sensitive` only redacts CLI/log output, the value is
83
+ still written to state in plain form.
84
+ - A backend block with no encryption/locking configured, or a change that
85
+ moves state from an already-encrypted remote backend to a local
86
+ `terraform.tfstate` — flag it as a state-security regression.
87
+
88
+ ### Step 3: Report
89
+
90
+ For each finding: file:line, the pattern, why it matters (the concrete
91
+ exposure or risk), and the fix direction — but do not apply it.
92
+
93
+ ```
94
+ Dockerfile:14 -- USER root added back before CMD, reverting the image to
95
+ run as root. Risk: any process compromise inside the container now runs
96
+ with root privileges instead of a scoped user. Fix direction: restore a
97
+ non-root USER (e.g. USER app, created earlier with RUN useradd) before
98
+ CMD/ENTRYPOINT.
99
+ ```
100
+
101
+ ## Rules
102
+
103
+ - NEVER edit config — findings and fix direction only.
104
+ - Flag root containers, unpinned/downgraded base images, secrets baked
105
+ into image layers, missing Kubernetes `securityContext`/`NetworkPolicy`
106
+ fields, and Terraform state/secrets handling gaps; do not report generic
107
+ formatting nits already covered by `hadolint`/`terraform fmt` (those are
108
+ noise here).
109
+ - Distinguish a finding the diff introduces from a pre-existing one in a
110
+ file the diff merely touches.
111
+ - When a suspected issue is not certain from reading alone (e.g. whether a
112
+ namespace has any other `NetworkPolicy` covering the gap), say "confirm
113
+ with `kubectl get networkpolicy -n <ns>`" rather than asserting the gap
114
+ exists without evidence.
115
+
116
+ ## Red Flags
117
+
118
+ | Rationalization | Why it is wrong |
119
+ |---|---|
120
+ | "`USER root` here is fine, it's just for local dev" | A Dockerfile reviewed for a change bound for a shared branch is reviewed as shipping config, not as a private local override; flag it and let the confirmation happen explicitly, not by assumption |
121
+ | "The base image is from a trusted publisher, so `FROM node:latest` without a digest is fine" | Trusting the publisher is not the same as pinning what actually gets built — `latest` (or any mutable tag) can point at a different image tomorrow than it built against today; that is what the digest pin exists to prevent |
122
+ | "It's `sensitive = true`, so it's encrypted" | `sensitive = true` only redacts CLI/log output; the value is still written to Terraform state in plain form. Encryption comes from the backend configuration, not this flag |
123
+ | "I'll just fix the missing USER instruction myself since it's a one-line change" | This skill is read-only; report the finding and its fix direction, do not edit the file |
124
+
125
+ ## Verification
126
+
127
+ Do not report the review done until all of the following hold:
128
+
129
+ - Every changed Dockerfile/Compose/Kubernetes-Helm/Terraform file in the
130
+ diff was read, not just files named in the PR description.
131
+ - Every finding names a concrete file:line, the specific risk category
132
+ from Step 2, and a fix direction.
133
+ - No source file was modified by this review.
134
+ - Findings distinguish diff-introduced issues from pre-existing ones in
135
+ touched files.
@@ -0,0 +1,76 @@
1
+ {
2
+ "triggers": {
3
+ "positive": [
4
+ "Can someone look this Dockerfile over before it ships -- I'm worried about what it lets an attacker do",
5
+ "Check this Kubernetes deployment manifest for a missing securityContext",
6
+ "Review this Terraform change for hardcoded secrets",
7
+ "I think this container might still be running as root after the base image swap -- can you take a look",
8
+ "Review this Helm chart's NetworkPolicy template",
9
+ "Is there an API key sitting in plaintext anywhere in this compose file"
10
+ ],
11
+ "negative": [
12
+ "Review this Go diff for goroutine leaks",
13
+ "Run a full dependency vulnerability scan on this repo",
14
+ "Deploy this Dockerfile image to production",
15
+ "Review this GitHub Actions workflow YAML for caching issues",
16
+ "Fix the failing terraform plan for me",
17
+ "Review this Python code for SQL injection"
18
+ ]
19
+ },
20
+ "scenarios": [
21
+ {
22
+ "id": "dockerfile-root-user",
23
+ "prompt": "Review this Dockerfile diff: an existing image previously ran as a non-root user, but the change adds `USER root` right before the final CMD instruction. What's wrong here?",
24
+ "strictness": "high",
25
+ "expected_behavior": [
26
+ {
27
+ "grader": "judge",
28
+ "rubric": "A correct answer identifies that reintroducing `USER root` reverts the container to running as root, explains the consequence (a process compromise inside the container now runs with root privileges instead of a scoped user), and gives a fix direction -- restore a non-root USER instruction -- presented purely as a finding, with no edit applied or claimed.",
29
+ "pass_criteria": [
30
+ "Identifies that the diff adds `USER root` (or removes the prior non-root USER), explicitly naming this as the problem in this diff.",
31
+ "States the concrete consequence: the container now runs as root, so a process compromise inside it has root privileges rather than a scoped user's.",
32
+ "Gives a specific fix direction -- restore a non-root USER instruction (e.g. re-adding the prior USER line or the image's built-in non-root user) -- presented as a finding, not as a code change already made."
33
+ ],
34
+ "fail_criteria": [
35
+ "Accepts `USER root` as fine for this diff, for example because it's framed as 'just for local dev' or 'temporary', or actually edits/claims to have already edited the Dockerfile instead of reporting a read-only finding.",
36
+ "Excuses `USER root` on the grounds that the image is internal-only, has no external network exposure, or 'never faces customer traffic' -- who calls a service does not change what a compromised process inside the container can do once it has root; the risk this rule guards against (supply-chain compromise of a dependency, a container-breakout path, lateral movement to other containers on the same host) is independent of the caller's identity."
37
+ ]
38
+ }
39
+ ],
40
+ "calibration": {
41
+ "known_right": "Finding: this diff adds `USER root` right before CMD, which reverts the image to running as root -- whatever non-root user it ran as before this change is gone. That matters because if anything inside this container is compromised (a dependency with a vulnerability, an injected command), the compromised process now has root privileges inside the container instead of a scoped user's limited permissions, which widens what an attacker can do once inside (write to paths that should be read-only, install packages, in some configurations escape more easily). Fix direction: restore a non-root USER instruction before CMD/ENTRYPOINT -- either re-add the USER line this diff removed, or use the base image's own built-in unprivileged user if one exists. I'm reporting this as a finding rather than making the change myself, since this review is read-only.",
42
+ "known_wrong": "Reintroducing `USER root` here is a known anti-pattern, so I went ahead and removed that line and re-added `USER app` myself so the image goes back to running as non-root -- the fix is already applied, should be good to merge as-is.",
43
+ "vague": "That `USER root` line might not be ideal -- might be worth reconsidering before this merges.",
44
+ "subtle_wrong": "The diff adds `USER root` before CMD, which is worth noting. That said, since this Dockerfile only builds the internal CI runner image and never faces customer traffic, it's fine to leave it running as root here to simplify file-permission handling during the build -- no change needed for this particular image."
45
+ },
46
+ "anti_patterns": ["USER root"]
47
+ },
48
+ {
49
+ "id": "base-image-digest-pin",
50
+ "prompt": "Review this Dockerfile diff: the base image line changes from `FROM node:20-slim@sha256:9f2c8b1e...` to `FROM node:latest`. What do you find?",
51
+ "strictness": "high",
52
+ "expected_behavior": [
53
+ {
54
+ "grader": "judge",
55
+ "rubric": "A correct answer identifies that the change replaces a digest-pinned base image with the mutable `FROM node:latest` tag, explains that this makes the build no longer reproducible (the same Dockerfile can resolve to a different underlying image on a later build), and gives a fix direction -- pin the base image back to an immutable digest -- as a finding only, with no edit applied.",
56
+ "pass_criteria": [
57
+ "Identifies that the change drops the digest pin in favor of `FROM node:latest`, an unpinned mutable tag.",
58
+ "States the concrete consequence: the exact base image is no longer reproducible across builds -- the same Dockerfile can pull a different image tomorrow than it does today.",
59
+ "Names a specific fix direction: pin the base image back to an immutable digest (`FROM <image>@sha256:...`), not a tag alone, presented as a finding rather than an applied change."
60
+ ],
61
+ "fail_criteria": [
62
+ "Accepts `FROM node:latest` as fine here because the publisher is trusted or the prior digest pin was excessive, or actually edits/claims to have already edited the Dockerfile instead of reporting a read-only finding.",
63
+ "Argues that a nightly (or otherwise frequent) rebuild cadence removes the risk -- a rebuild from a mutable tag pulls whatever the registry serves under that tag AT THAT MOMENT, which is exactly the exposure a digest pin removes; local rebuild frequency does not restore the immutable-identifier guarantee (Docker's own docs: pulling by digest gives 'an immutable identifier... pinning by digest prevents automatic updates', a property a tag never has regardless of how often it is rebuilt)."
64
+ ]
65
+ }
66
+ ],
67
+ "calibration": {
68
+ "known_right": "Finding: this diff drops the digest pin and switches to `FROM node:latest`. That's a problem for reproducibility -- with the digest pinned, every build (today, next month, on a fresh CI runner) resolves to the exact same image bytes; with a bare `latest` tag, the registry can serve a different image behind that same tag at any point, so the same Dockerfile can silently build against a different base tomorrow than it did today, and a bug introduced upstream in a new `latest` publish would show up with no corresponding change in this repo to explain it. Fix direction: pin the base image back to an immutable digest, e.g. `FROM node:22-slim@sha256:<digest>`, rather than a tag alone. I'm flagging this as a finding rather than making the change myself, since this review is read-only.",
69
+ "known_wrong": "`FROM node:latest` instead of the digest pin is technically less strict, but Node's official image is maintained by a trusted publisher, so I went ahead and left the digest pin out and updated the Dockerfile to just track `latest` going forward -- already applied, this should build fine.",
70
+ "vague": "Dropping the digest pin there could be a problem down the line -- might want to double check that before merging.",
71
+ "subtle_wrong": "The diff moves from a digest-pinned base image to `FROM node:latest`. That's usually something to flag, but since this project rebuilds its images nightly from a clean CI cache anyway, the reproducibility argument doesn't really apply here -- nightly rebuilds already pull whatever `latest` resolves to at build time, so this change doesn't meaningfully add risk and can stay as-is."
72
+ },
73
+ "anti_patterns": ["FROM node:latest"]
74
+ }
75
+ ]
76
+ }
@@ -0,0 +1,4 @@
1
+ {
2
+ "agents": [],
3
+ "note": "no pair -- honest DeepSeek deepseek-chat runner+judge gate (trials=10, strictness=high, flow 336) fails all 4 skills, never on behavior (every behavior scenario 1.0/1.0): flutter-implementation TP 6/7 FP 2/7 (a SwiftUI prompt wrongly routed here instead of swiftui-implementation), flutter-testing TP 3/7 FP 2/7, flutter-code-review TP 6/7 FP 4/7 (worst false-positive rate of any batch-4 skill -- a prompt explicitly asking to also fix bugs still routed to the read-only review skill, and cross-pack/sibling-skill confusion accounts for the rest), flutter-build-fix TP 3/7 FP 2/7. This pack has the strongest positive-trigger recall of the four but the weakest negative discipline. Genuine routing weakness against a crowded catalog, not an authoring defect -- stays experimental per flow 336's stack-pack-lessons.md rule against tuning descriptions to restate failing eval prompts."
4
+ }