dsh-ecc-skills 0.4.0

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 (278) hide show
  1. package/LICENSE +22 -0
  2. package/README.md +99 -0
  3. package/cordis.patch.yml +5 -0
  4. package/lib/index.js +195 -0
  5. package/package.json +46 -0
  6. package/skills/accessibility/SKILL.md +147 -0
  7. package/skills/agent-architecture-audit/SKILL.md +257 -0
  8. package/skills/agent-eval/SKILL.md +147 -0
  9. package/skills/agent-harness-construction/SKILL.md +74 -0
  10. package/skills/agent-introspection-debugging/SKILL.md +154 -0
  11. package/skills/agent-payment-x402/SKILL.md +225 -0
  12. package/skills/agent-self-evaluation/SKILL.md +182 -0
  13. package/skills/agent-sort/SKILL.md +216 -0
  14. package/skills/agentic-engineering/SKILL.md +64 -0
  15. package/skills/agentic-os/SKILL.md +388 -0
  16. package/skills/ai-first-engineering/SKILL.md +52 -0
  17. package/skills/ai-regression-testing/SKILL.md +386 -0
  18. package/skills/android-clean-architecture/SKILL.md +340 -0
  19. package/skills/angular-developer/SKILL.md +155 -0
  20. package/skills/api-connector-builder/SKILL.md +121 -0
  21. package/skills/api-design/SKILL.md +524 -0
  22. package/skills/architecture-decision-records/SKILL.md +180 -0
  23. package/skills/article-writing/SKILL.md +80 -0
  24. package/skills/automation-audit-ops/SKILL.md +143 -0
  25. package/skills/autonomous-agent-harness/SKILL.md +274 -0
  26. package/skills/autonomous-loops/SKILL.md +611 -0
  27. package/skills/backend-patterns/SKILL.md +562 -0
  28. package/skills/benchmark/SKILL.md +95 -0
  29. package/skills/benchmark-methodology/SKILL.md +191 -0
  30. package/skills/benchmark-optimization-loop/SKILL.md +71 -0
  31. package/skills/blender-motion-state-inspection/SKILL.md +165 -0
  32. package/skills/blueprint/SKILL.md +106 -0
  33. package/skills/brand-discovery/SKILL.md +145 -0
  34. package/skills/brand-voice/SKILL.md +98 -0
  35. package/skills/browser-qa/SKILL.md +105 -0
  36. package/skills/bun-runtime/SKILL.md +85 -0
  37. package/skills/canary-watch/SKILL.md +108 -0
  38. package/skills/carrier-relationship-management/SKILL.md +212 -0
  39. package/skills/cisco-ios-patterns/SKILL.md +164 -0
  40. package/skills/ck/SKILL.md +148 -0
  41. package/skills/claude-devfleet/SKILL.md +112 -0
  42. package/skills/click-path-audit/SKILL.md +245 -0
  43. package/skills/clickhouse-io/SKILL.md +445 -0
  44. package/skills/code-tour/SKILL.md +254 -0
  45. package/skills/codebase-onboarding/SKILL.md +234 -0
  46. package/skills/codehealth-mcp/SKILL.md +167 -0
  47. package/skills/coding-standards/SKILL.md +551 -0
  48. package/skills/competitive-platform-analysis/SKILL.md +214 -0
  49. package/skills/competitive-report-structure/SKILL.md +162 -0
  50. package/skills/compose-multiplatform-patterns/SKILL.md +300 -0
  51. package/skills/config-gc/SKILL.md +120 -0
  52. package/skills/configure-ecc/SKILL.md +206 -0
  53. package/skills/connections-optimizer/SKILL.md +190 -0
  54. package/skills/content-engine/SKILL.md +132 -0
  55. package/skills/content-hash-cache-pattern/SKILL.md +162 -0
  56. package/skills/context-budget/SKILL.md +136 -0
  57. package/skills/continuous-agent-loop/SKILL.md +46 -0
  58. package/skills/contract-first/SKILL.md +287 -0
  59. package/skills/cost-aware-llm-pipeline/SKILL.md +184 -0
  60. package/skills/cost-tracking/SKILL.md +97 -0
  61. package/skills/council/SKILL.md +204 -0
  62. package/skills/council-multi-model/SKILL.md +167 -0
  63. package/skills/cpp-coding-standards/SKILL.md +724 -0
  64. package/skills/cpp-testing/SKILL.md +325 -0
  65. package/skills/crosspost/SKILL.md +112 -0
  66. package/skills/csharp-testing/SKILL.md +322 -0
  67. package/skills/customer-billing-ops/SKILL.md +141 -0
  68. package/skills/customs-trade-compliance/SKILL.md +263 -0
  69. package/skills/dart-flutter-patterns/SKILL.md +564 -0
  70. package/skills/dashboard-builder/SKILL.md +109 -0
  71. package/skills/data-scraper-agent/SKILL.md +765 -0
  72. package/skills/data-throughput-accelerator/SKILL.md +74 -0
  73. package/skills/database-migrations/SKILL.md +430 -0
  74. package/skills/deep-research/SKILL.md +160 -0
  75. package/skills/defi-amm-security/SKILL.md +167 -0
  76. package/skills/delivery-gate/SKILL.md +126 -0
  77. package/skills/deployment-patterns/SKILL.md +428 -0
  78. package/skills/design-system/SKILL.md +83 -0
  79. package/skills/dev-team/SKILL.md +203 -0
  80. package/skills/django-celery/SKILL.md +458 -0
  81. package/skills/django-patterns/SKILL.md +735 -0
  82. package/skills/django-security/SKILL.md +644 -0
  83. package/skills/django-tdd/SKILL.md +730 -0
  84. package/skills/django-verification/SKILL.md +470 -0
  85. package/skills/dmux-workflows/SKILL.md +192 -0
  86. package/skills/docker-patterns/SKILL.md +520 -0
  87. package/skills/documentation-lookup/SKILL.md +91 -0
  88. package/skills/dotnet-patterns/SKILL.md +322 -0
  89. package/skills/dynamic-workflow-mode/SKILL.md +124 -0
  90. package/skills/e2e-testing/SKILL.md +327 -0
  91. package/skills/ecc-tools-cost-audit/SKILL.md +161 -0
  92. package/skills/email-ops/SKILL.md +122 -0
  93. package/skills/energy-procurement/SKILL.md +228 -0
  94. package/skills/enterprise-agent-ops/SKILL.md +51 -0
  95. package/skills/error-handling/SKILL.md +377 -0
  96. package/skills/eval-harness/SKILL.md +271 -0
  97. package/skills/evm-token-decimals/SKILL.md +131 -0
  98. package/skills/exa-search/SKILL.md +108 -0
  99. package/skills/fal-ai-media/SKILL.md +289 -0
  100. package/skills/fastapi-patterns/SKILL.md +514 -0
  101. package/skills/finance-billing-ops/SKILL.md +128 -0
  102. package/skills/flox-environments/SKILL.md +497 -0
  103. package/skills/flutter-dart-code-review/SKILL.md +436 -0
  104. package/skills/foundation-models-on-device/SKILL.md +243 -0
  105. package/skills/frontend-a11y/SKILL.md +446 -0
  106. package/skills/frontend-design-direction/SKILL.md +93 -0
  107. package/skills/frontend-patterns/SKILL.md +657 -0
  108. package/skills/fsharp-testing/SKILL.md +281 -0
  109. package/skills/gan-style-harness/SKILL.md +279 -0
  110. package/skills/generating-python-installer/SKILL.md +820 -0
  111. package/skills/git-workflow/SKILL.md +716 -0
  112. package/skills/github-ops/SKILL.md +145 -0
  113. package/skills/golang-patterns/SKILL.md +676 -0
  114. package/skills/golang-testing/SKILL.md +721 -0
  115. package/skills/google-workspace-ops/SKILL.md +96 -0
  116. package/skills/growth-log/SKILL.md +128 -0
  117. package/skills/healthcare-cdss-patterns/SKILL.md +246 -0
  118. package/skills/healthcare-emr-patterns/SKILL.md +160 -0
  119. package/skills/healthcare-eval-harness/SKILL.md +208 -0
  120. package/skills/healthcare-phi-compliance/SKILL.md +146 -0
  121. package/skills/hermes-imports/SKILL.md +89 -0
  122. package/skills/hexagonal-architecture/SKILL.md +277 -0
  123. package/skills/hipaa-compliance/SKILL.md +79 -0
  124. package/skills/homelab-network-readiness/SKILL.md +170 -0
  125. package/skills/homelab-network-setup/SKILL.md +130 -0
  126. package/skills/homelab-pihole-dns/SKILL.md +275 -0
  127. package/skills/homelab-vlan-segmentation/SKILL.md +312 -0
  128. package/skills/homelab-wireguard-vpn/SKILL.md +306 -0
  129. package/skills/hookify-rules/SKILL.md +128 -0
  130. package/skills/inherit-legacy-style/SKILL.md +157 -0
  131. package/skills/intent-driven-development/SKILL.md +360 -0
  132. package/skills/inventory-demand-planning/SKILL.md +247 -0
  133. package/skills/investor-materials/SKILL.md +97 -0
  134. package/skills/investor-outreach/SKILL.md +92 -0
  135. package/skills/ios-icon-gen/SKILL.md +158 -0
  136. package/skills/iterative-retrieval/SKILL.md +212 -0
  137. package/skills/ito-baskets/SKILL.md +263 -0
  138. package/skills/ito-compute/SKILL.md +151 -0
  139. package/skills/ito-inference/SKILL.md +119 -0
  140. package/skills/ito-training/SKILL.md +123 -0
  141. package/skills/java-coding-standards/SKILL.md +384 -0
  142. package/skills/jira-integration/SKILL.md +303 -0
  143. package/skills/jpa-patterns/SKILL.md +152 -0
  144. package/skills/knowledge-ops/SKILL.md +155 -0
  145. package/skills/kotlin-coroutines-flows/SKILL.md +285 -0
  146. package/skills/kotlin-exposed-patterns/SKILL.md +720 -0
  147. package/skills/kotlin-ktor-patterns/SKILL.md +690 -0
  148. package/skills/kotlin-patterns/SKILL.md +712 -0
  149. package/skills/kotlin-testing/SKILL.md +825 -0
  150. package/skills/kubernetes-patterns/SKILL.md +756 -0
  151. package/skills/laravel-patterns/SKILL.md +416 -0
  152. package/skills/laravel-plugin-discovery/SKILL.md +230 -0
  153. package/skills/laravel-security/SKILL.md +948 -0
  154. package/skills/laravel-tdd/SKILL.md +675 -0
  155. package/skills/laravel-verification/SKILL.md +180 -0
  156. package/skills/latency-critical-systems/SKILL.md +75 -0
  157. package/skills/lead-intelligence/SKILL.md +322 -0
  158. package/skills/liquid-glass-design/SKILL.md +279 -0
  159. package/skills/living-docs-governance/SKILL.md +137 -0
  160. package/skills/llm-trading-agent-security/SKILL.md +147 -0
  161. package/skills/logistics-exception-management/SKILL.md +222 -0
  162. package/skills/loop-design-check/SKILL.md +143 -0
  163. package/skills/mailtrap-email-integration/SKILL.md +77 -0
  164. package/skills/make-interfaces-feel-better/SKILL.md +152 -0
  165. package/skills/manim-video/SKILL.md +90 -0
  166. package/skills/market-research/SKILL.md +76 -0
  167. package/skills/marketing-campaign/SKILL.md +114 -0
  168. package/skills/mcp-server-patterns/SKILL.md +70 -0
  169. package/skills/messages-ops/SKILL.md +105 -0
  170. package/skills/ml-adoption-playbook/SKILL.md +57 -0
  171. package/skills/mle-workflow/SKILL.md +348 -0
  172. package/skills/motion-advanced/SKILL.md +597 -0
  173. package/skills/motion-foundations/SKILL.md +300 -0
  174. package/skills/motion-patterns/SKILL.md +435 -0
  175. package/skills/motion-ui/SKILL.md +576 -0
  176. package/skills/mysql-patterns/SKILL.md +413 -0
  177. package/skills/nanoclaw-repl/SKILL.md +34 -0
  178. package/skills/nasiko-control-plane/SKILL.md +49 -0
  179. package/skills/nestjs-patterns/SKILL.md +231 -0
  180. package/skills/netmiko-ssh-automation/SKILL.md +174 -0
  181. package/skills/network-bgp-diagnostics/SKILL.md +168 -0
  182. package/skills/network-config-validation/SKILL.md +211 -0
  183. package/skills/network-interface-health/SKILL.md +153 -0
  184. package/skills/nextjs-turbopack/SKILL.md +58 -0
  185. package/skills/nodejs-keccak256/SKILL.md +103 -0
  186. package/skills/nutrient-document-processing/SKILL.md +168 -0
  187. package/skills/nuxt4-patterns/SKILL.md +101 -0
  188. package/skills/opensource-pipeline/SKILL.md +256 -0
  189. package/skills/orch-add-feature/SKILL.md +45 -0
  190. package/skills/orch-build-mvp/SKILL.md +49 -0
  191. package/skills/orch-change-feature/SKILL.md +43 -0
  192. package/skills/orch-fix-defect/SKILL.md +43 -0
  193. package/skills/orch-pipeline/SKILL.md +121 -0
  194. package/skills/orch-refine-code/SKILL.md +44 -0
  195. package/skills/parallel-execution-optimizer/SKILL.md +74 -0
  196. package/skills/perl-patterns/SKILL.md +505 -0
  197. package/skills/perl-security/SKILL.md +504 -0
  198. package/skills/perl-testing/SKILL.md +476 -0
  199. package/skills/plan-canvas/SKILL.md +196 -0
  200. package/skills/plankton-code-quality/SKILL.md +237 -0
  201. package/skills/postgres-patterns/SKILL.md +148 -0
  202. package/skills/prediction-market-oracle-research/SKILL.md +64 -0
  203. package/skills/prediction-market-risk-review/SKILL.md +61 -0
  204. package/skills/prisma-patterns/SKILL.md +401 -0
  205. package/skills/product-capability/SKILL.md +142 -0
  206. package/skills/product-lens/SKILL.md +93 -0
  207. package/skills/production-audit/SKILL.md +207 -0
  208. package/skills/production-scheduling/SKILL.md +238 -0
  209. package/skills/project-flow-ops/SKILL.md +112 -0
  210. package/skills/prompt-optimizer/SKILL.md +398 -0
  211. package/skills/python-patterns/SKILL.md +751 -0
  212. package/skills/python-testing/SKILL.md +817 -0
  213. package/skills/pytorch-patterns/SKILL.md +397 -0
  214. package/skills/quality-nonconformance/SKILL.md +260 -0
  215. package/skills/quarkus-patterns/SKILL.md +723 -0
  216. package/skills/quarkus-security/SKILL.md +468 -0
  217. package/skills/quarkus-tdd/SKILL.md +812 -0
  218. package/skills/quarkus-verification/SKILL.md +481 -0
  219. package/skills/ralphinho-rfc-pipeline/SKILL.md +68 -0
  220. package/skills/react-native-patterns/SKILL.md +326 -0
  221. package/skills/react-patterns/SKILL.md +342 -0
  222. package/skills/react-performance/SKILL.md +575 -0
  223. package/skills/react-testing/SKILL.md +424 -0
  224. package/skills/recsys-pipeline-architect/SKILL.md +115 -0
  225. package/skills/recursive-decision-ledger/SKILL.md +81 -0
  226. package/skills/redis-patterns/SKILL.md +404 -0
  227. package/skills/regex-vs-llm-structured-text/SKILL.md +221 -0
  228. package/skills/remotion-video-creation/SKILL.md +43 -0
  229. package/skills/repo-scan/SKILL.md +170 -0
  230. package/skills/research-ops/SKILL.md +113 -0
  231. package/skills/returns-reverse-logistics/SKILL.md +240 -0
  232. package/skills/rules-distill/SKILL.md +265 -0
  233. package/skills/rust-patterns/SKILL.md +500 -0
  234. package/skills/rust-testing/SKILL.md +501 -0
  235. package/skills/safety-guard/SKILL.md +76 -0
  236. package/skills/santa-method/SKILL.md +307 -0
  237. package/skills/scientific-db-pubmed-database/SKILL.md +176 -0
  238. package/skills/scientific-db-uspto-database/SKILL.md +178 -0
  239. package/skills/scientific-pkg-gget/SKILL.md +167 -0
  240. package/skills/scientific-thinking-literature-review/SKILL.md +193 -0
  241. package/skills/scientific-thinking-scholar-evaluation/SKILL.md +161 -0
  242. package/skills/search-first/SKILL.md +183 -0
  243. package/skills/security-bounty-hunter/SKILL.md +100 -0
  244. package/skills/security-scan/SKILL.md +166 -0
  245. package/skills/seo/SKILL.md +155 -0
  246. package/skills/skill-scout/SKILL.md +141 -0
  247. package/skills/skill-stocktake/SKILL.md +195 -0
  248. package/skills/social-graph-ranker/SKILL.md +155 -0
  249. package/skills/social-publisher/SKILL.md +130 -0
  250. package/skills/springboot-patterns/SKILL.md +315 -0
  251. package/skills/springboot-security/SKILL.md +273 -0
  252. package/skills/springboot-tdd/SKILL.md +159 -0
  253. package/skills/springboot-verification/SKILL.md +232 -0
  254. package/skills/swift-actor-persistence/SKILL.md +144 -0
  255. package/skills/swift-concurrency-6-2/SKILL.md +216 -0
  256. package/skills/swift-protocol-di-testing/SKILL.md +191 -0
  257. package/skills/swiftui-patterns/SKILL.md +259 -0
  258. package/skills/taste/SKILL.md +264 -0
  259. package/skills/tdd-workflow/SKILL.md +583 -0
  260. package/skills/team-agent-orchestration/SKILL.md +111 -0
  261. package/skills/team-builder/SKILL.md +169 -0
  262. package/skills/terminal-opener/SKILL.md +55 -0
  263. package/skills/terminal-ops/SKILL.md +110 -0
  264. package/skills/tinystruct-patterns/SKILL.md +279 -0
  265. package/skills/token-budget-advisor/SKILL.md +134 -0
  266. package/skills/ui-demo/SKILL.md +466 -0
  267. package/skills/ui-to-vue/SKILL.md +135 -0
  268. package/skills/uncloud/SKILL.md +344 -0
  269. package/skills/unified-memory/SKILL.md +170 -0
  270. package/skills/unified-notifications-ops/SKILL.md +188 -0
  271. package/skills/verification-loop/SKILL.md +129 -0
  272. package/skills/video-editing/SKILL.md +311 -0
  273. package/skills/videodb/SKILL.md +375 -0
  274. package/skills/vite-patterns/SKILL.md +450 -0
  275. package/skills/vue-patterns/SKILL.md +471 -0
  276. package/skills/windows-desktop-e2e/SKILL.md +888 -0
  277. package/skills/workspace-surface-audit/SKILL.md +126 -0
  278. package/skills/x-api/SKILL.md +235 -0
@@ -0,0 +1,520 @@
1
+ ---
2
+ name: docker-patterns
3
+ description: Docker and Docker Compose patterns for local development, hardened CLI installer harnesses, container security, networking, volumes, and multi-service orchestration. Use when creating or reviewing Dockerfiles and Compose services, testing installers across Linux distributions, or planning accurate native macOS and Windows validation.
4
+ ---
5
+
6
+ # Docker Patterns
7
+
8
+ Docker and Docker Compose best practices for containerized development.
9
+
10
+ ## Docker Compose for Local Development
11
+
12
+ ### Standard Web App Stack
13
+
14
+ ```yaml
15
+ # docker-compose.yml
16
+ services:
17
+ app:
18
+ build:
19
+ context: .
20
+ target: dev # Use dev stage of multi-stage Dockerfile
21
+ ports:
22
+ - "3000:3000"
23
+ volumes:
24
+ - .:/app # Bind mount for hot reload
25
+ - /app/node_modules # Anonymous volume -- preserves container deps
26
+ environment:
27
+ - DATABASE_URL=postgres://postgres:postgres@db:5432/app_dev
28
+ - REDIS_URL=redis://redis:6379/0
29
+ - NODE_ENV=development
30
+ depends_on:
31
+ db:
32
+ condition: service_healthy
33
+ redis:
34
+ condition: service_started
35
+ command: npm run dev
36
+
37
+ db:
38
+ image: postgres:16-alpine
39
+ ports:
40
+ - "5432:5432"
41
+ environment:
42
+ POSTGRES_USER: postgres
43
+ POSTGRES_PASSWORD: postgres
44
+ POSTGRES_DB: app_dev
45
+ volumes:
46
+ - pgdata:/var/lib/postgresql/data
47
+ - ./scripts/init-db.sql:/docker-entrypoint-initdb.d/init.sql
48
+ healthcheck:
49
+ test: ["CMD-SHELL", "pg_isready -U postgres"]
50
+ interval: 5s
51
+ timeout: 3s
52
+ retries: 5
53
+
54
+ redis:
55
+ image: redis:7-alpine
56
+ ports:
57
+ - "6379:6379"
58
+ volumes:
59
+ - redisdata:/data
60
+
61
+ mailpit: # Local email testing
62
+ image: axllent/mailpit
63
+ ports:
64
+ - "8025:8025" # Web UI
65
+ - "1025:1025" # SMTP
66
+
67
+ volumes:
68
+ pgdata:
69
+ redisdata:
70
+ ```
71
+
72
+ ### Development vs Production Dockerfile
73
+
74
+ ```dockerfile
75
+ # Stage: dependencies
76
+ FROM node:22-alpine AS deps
77
+ WORKDIR /app
78
+ COPY package.json package-lock.json ./
79
+ RUN npm ci
80
+
81
+ # Stage: dev (hot reload, debug tools)
82
+ FROM node:22-alpine AS dev
83
+ WORKDIR /app
84
+ COPY --from=deps /app/node_modules ./node_modules
85
+ COPY . .
86
+ EXPOSE 3000
87
+ CMD ["npm", "run", "dev"]
88
+
89
+ # Stage: build
90
+ FROM node:22-alpine AS build
91
+ WORKDIR /app
92
+ COPY --from=deps /app/node_modules ./node_modules
93
+ COPY . .
94
+ RUN npm run build && npm prune --production
95
+
96
+ # Stage: production (minimal image)
97
+ FROM node:22-alpine AS production
98
+ WORKDIR /app
99
+ RUN addgroup -g 1001 -S appgroup && adduser -S appuser -u 1001
100
+ USER appuser
101
+ COPY --from=build --chown=appuser:appgroup /app/dist ./dist
102
+ COPY --from=build --chown=appuser:appgroup /app/node_modules ./node_modules
103
+ COPY --from=build --chown=appuser:appgroup /app/package.json ./
104
+ ENV NODE_ENV=production
105
+ EXPOSE 3000
106
+ HEALTHCHECK --interval=30s --timeout=3s CMD wget -qO- http://localhost:3000/health || exit 1
107
+ CMD ["node", "dist/server.js"]
108
+ ```
109
+
110
+ ### Override Files
111
+
112
+ ```yaml
113
+ # docker-compose.override.yml (auto-loaded, dev-only settings)
114
+ services:
115
+ app:
116
+ environment:
117
+ - DEBUG=app:*
118
+ - LOG_LEVEL=debug
119
+ ports:
120
+ - "9229:9229" # Node.js debugger
121
+
122
+ # docker-compose.prod.yml (explicit for production)
123
+ services:
124
+ app:
125
+ build:
126
+ target: production
127
+ restart: always
128
+ deploy:
129
+ resources:
130
+ limits:
131
+ cpus: "1.0"
132
+ memory: 512M
133
+ ```
134
+
135
+ ```bash
136
+ # Development (auto-loads override)
137
+ docker compose up
138
+
139
+ # Production
140
+ docker compose -f docker-compose.yml -f docker-compose.prod.yml up -d
141
+ ```
142
+
143
+ ## Networking
144
+
145
+ ### Service Discovery
146
+
147
+ Services in the same Compose network resolve by service name:
148
+ ```
149
+ # From "app" container:
150
+ postgres://postgres:postgres@db:5432/app_dev # "db" resolves to the db container
151
+ redis://redis:6379/0 # "redis" resolves to the redis container
152
+ ```
153
+
154
+ ### Custom Networks
155
+
156
+ ```yaml
157
+ services:
158
+ frontend:
159
+ networks:
160
+ - frontend-net
161
+
162
+ api:
163
+ networks:
164
+ - frontend-net
165
+ - backend-net
166
+
167
+ db:
168
+ networks:
169
+ - backend-net # Only reachable from api, not frontend
170
+
171
+ networks:
172
+ frontend-net:
173
+ backend-net:
174
+ ```
175
+
176
+ ### Exposing Only What's Needed
177
+
178
+ ```yaml
179
+ services:
180
+ db:
181
+ ports:
182
+ - "127.0.0.1:5432:5432" # Only accessible from host, not network
183
+ # Omit ports entirely in production -- accessible only within Docker network
184
+ ```
185
+
186
+ ## Volume Strategies
187
+
188
+ ```yaml
189
+ volumes:
190
+ # Named volume: persists across container restarts, managed by Docker
191
+ pgdata:
192
+
193
+ # Bind mount: maps host directory into container (for development)
194
+ # - ./src:/app/src
195
+
196
+ # Anonymous volume: preserves container-generated content from bind mount override
197
+ # - /app/node_modules
198
+ ```
199
+
200
+ ### Common Patterns
201
+
202
+ ```yaml
203
+ services:
204
+ app:
205
+ volumes:
206
+ - .:/app # Source code (bind mount for hot reload)
207
+ - /app/node_modules # Protect container's node_modules from host
208
+ - /app/.next # Protect build cache
209
+
210
+ db:
211
+ volumes:
212
+ - pgdata:/var/lib/postgresql/data # Persistent data
213
+ - ./scripts/init.sql:/docker-entrypoint-initdb.d/init.sql # Init scripts
214
+ ```
215
+
216
+ ## Container Security
217
+
218
+ ### Dockerfile Hardening
219
+
220
+ ```dockerfile
221
+ # 1. Use specific tags (never :latest)
222
+ FROM node:22.12-alpine3.20
223
+
224
+ # 2. Run as non-root
225
+ RUN addgroup -g 1001 -S app && adduser -S app -u 1001
226
+ USER app
227
+
228
+ # 3. Drop capabilities (in compose)
229
+ # 4. Read-only root filesystem where possible
230
+ # 5. No secrets in image layers
231
+ ```
232
+
233
+ ### Compose Security
234
+
235
+ ```yaml
236
+ services:
237
+ app:
238
+ security_opt:
239
+ - no-new-privileges:true
240
+ read_only: true
241
+ tmpfs:
242
+ - /tmp
243
+ - /app/.cache
244
+ cap_drop:
245
+ - ALL
246
+ cap_add:
247
+ - NET_BIND_SERVICE # Only if binding to ports < 1024
248
+ ```
249
+
250
+ ### Secret Management
251
+
252
+ ```yaml
253
+ # GOOD: Use environment variables (injected at runtime)
254
+ services:
255
+ app:
256
+ env_file:
257
+ - .env # Never commit .env to git
258
+ environment:
259
+ - API_KEY # Inherits from host environment
260
+
261
+ # GOOD: Docker secrets (Swarm mode)
262
+ secrets:
263
+ db_password:
264
+ file: ./secrets/db_password.txt
265
+
266
+ services:
267
+ db:
268
+ secrets:
269
+ - db_password
270
+
271
+ # BAD: Hardcoded in image
272
+ # ENV API_KEY=sk-proj-xxxxx # NEVER DO THIS
273
+ ```
274
+
275
+ ## Hardened CLI Installer Harnesses
276
+
277
+ Use containers to test installer behavior against disposable project copies without allowing the test to mutate the source checkout.
278
+
279
+ ### Respect the Platform Boundary
280
+
281
+ - Run real containers for Linux distributions such as Debian and Ubuntu.
282
+ - macOS cannot run as a Docker container because Docker shares a Linux kernel. Run the same shell-free test entry point natively on macOS.
283
+ - Windows containers require a Windows Docker engine. Run platform-independent logic on a native Windows CI runner and reserve Windows containers for a Windows host.
284
+ - Keep a native Ubuntu/macOS/Windows CI matrix for host-specific paths, command shims, quoting, and filesystem behavior.
285
+
286
+ Do not claim that a Linux container validates macOS or Windows behavior.
287
+
288
+ ### Enforce the Isolation Contract
289
+
290
+ - Pin base images by immutable digest and pin installed CLI versions.
291
+ - Run as a non-root numeric UID/GID when distro account names differ.
292
+ - Mount the repository and source project read-only.
293
+ - Copy the source project into a writable `tmpfs` workspace before any mutation.
294
+ - Mount `/workspace` with `noexec`, UID/GID 1000, and `mode=0700` so only the
295
+ container user can inspect project data.
296
+ - Keep npm and npx's executable cache at `NPM_CONFIG_CACHE=/tmp/npm-cache` on
297
+ the executable `/tmp` mount. Its default size is 2 GiB and can be adjusted
298
+ with `ECC_TMPFS_SIZE`; `ECC_WORKSPACE_SIZE` separately controls the private
299
+ workspace mount.
300
+ - Set `read_only: true`, `no-new-privileges:true`, `cap_drop: [ALL]`, and a finite `pids_limit`.
301
+ - Keep the default real-CLI services on `network_mode: none`. Add network access
302
+ only through a visibly named opt-in service for an authenticated provider
303
+ session; never make it an accidental environment-driven default.
304
+ - Create only the writable temporary paths the tool needs.
305
+ - Do not pass host credentials into the container by default.
306
+ - Default to a dry run and whitelist only the explicit `dry-run`, `install`,
307
+ `plugin`, and `shell` modes.
308
+ - Use argument arrays or `spawnSync(..., { shell: false })` for cross-platform runners. Never interpolate project paths into a shell command.
309
+
310
+ ### Exercise the ECC Plugin Setup Harness
311
+
312
+ Use `docker/plugin-setup/compose.yaml` as the reference implementation. It provides:
313
+
314
+ - `fixture-tests` for the focused install manifest, target, and executor suite.
315
+ - `real-cli` for the pinned Debian-based generic Linux image.
316
+ - `real-cli-ubuntu` for the pinned Ubuntu image.
317
+
318
+ Validate the Compose model before building:
319
+
320
+ ```bash
321
+ docker compose -f docker/plugin-setup/compose.yaml config --quiet
322
+ ```
323
+
324
+ Build both real Linux images:
325
+
326
+ ```bash
327
+ docker compose -f docker/plugin-setup/compose.yaml \
328
+ build real-cli real-cli-ubuntu
329
+ ```
330
+
331
+ Run the safe default flow in each image:
332
+
333
+ ```bash
334
+ docker compose -p ecc-plugin-debian-test \
335
+ -f docker/plugin-setup/compose.yaml \
336
+ run --rm -T real-cli dry-run
337
+
338
+ docker compose -p ecc-plugin-ubuntu-test \
339
+ -f docker/plugin-setup/compose.yaml \
340
+ run --rm -T real-cli-ubuntu dry-run
341
+ ```
342
+
343
+ The dry run executes the current public command contract:
344
+
345
+ ```bash
346
+ ecc install --profile core --target claude-project --dry-run --json
347
+ ```
348
+
349
+ Before that command runs, the container creates a locally packed npm artifact
350
+ from the read-only checkout with `npm pack --ignore-scripts`. It extracts the
351
+ self-created tarball under `/tmp`, validates the `ecc-universal` package name,
352
+ required install manifests, and the confined `package.json` `bin.ecc` mapping,
353
+ then invokes the extracted `ecc` executable. The runtime stays on
354
+ `network_mode: none`, does not execute package lifecycle scripts, and does not
355
+ rely on host `node_modules`; its exact pinned production dependencies are
356
+ already present in the image.
357
+
358
+ The harness rejects an empty plan, a non-`claude-project` target, any operation
359
+ outside `/workspace/project/.claude`, or any dry run that creates the target
360
+ directory. `install` performs the isolated apply twice, checks its managed
361
+ install state, lists the installed target, and runs `doctor`.
362
+
363
+ ### Start, Open, Reconnect, and Clean Up a Named Session
364
+
365
+ Start a detached container without `--rm` so leaving a terminal does not remove
366
+ the session:
367
+
368
+ ```bash
369
+ docker compose -p ecc-plugin-session \
370
+ -f docker/plugin-setup/compose.yaml \
371
+ run --detach --name ecc-plugin-shell real-cli shell
372
+ ```
373
+
374
+ The container copies the read-only fixture to the stable private directory
375
+ `/workspace/project`. Confirm it is running, then emit the Docker side of the
376
+ terminal-opener v1 data contract:
377
+
378
+ ```bash
379
+ docker inspect --format '{{.State.Running}}' ecc-plugin-shell
380
+ node docker/plugin-setup/interactive-plan.js \
381
+ --container ecc-plugin-shell \
382
+ --workdir /workspace/project \
383
+ --json \
384
+ -- bash
385
+ ```
386
+
387
+ The JSON result has exactly an `executable` and `argv` boundary (plus
388
+ `contractVersion: 1`): the executable is `docker`, and argv begins with
389
+ `exec`, `-it`, and `-w`. Pass that data to the separate terminal-opener skill
390
+ when it is installed. This Docker harness deliberately does not import a
391
+ terminal adapter, interpolate a shell command, or manage a host GUI process.
392
+ Until then, open the same PTY in the current host terminal directly:
393
+
394
+ ```bash
395
+ docker exec -it -w /workspace/project ecc-plugin-shell bash
396
+ ```
397
+
398
+ Exit the shell without stopping the detached container. Reconnect with the
399
+ same `docker exec -it` command. When finished, remove the exact named container
400
+ and its Compose project resources:
401
+
402
+ ```bash
403
+ docker rm --force ecc-plugin-shell
404
+ docker compose -p ecc-plugin-session \
405
+ -f docker/plugin-setup/compose.yaml \
406
+ down --remove-orphans
407
+ ```
408
+
409
+ Host credentials are absent by default and credential directories are never
410
+ mounted. The default service also has no network access. When an authenticated
411
+ provider session genuinely needs a network, build `real-cli` first and then opt
412
+ in visibly with `docker compose --profile networked run real-cli-networked
413
+ shell`. Prefer authenticating inside that disposable session. If a CI run must
414
+ inherit a host environment credential, make that opt-in at invocation with an
415
+ explicit Compose `--env NAME` flag, understand that the value is inspectable
416
+ and can be exfiltrated for the container lifetime, and remove the exact named
417
+ container immediately after.
418
+
419
+ Run the same focused suite natively on the host:
420
+
421
+ ```bash
422
+ npm run test:plugin-setup-platform
423
+ ```
424
+
425
+ Inspect the produced identity and environment before trusting the image:
426
+
427
+ ```bash
428
+ docker image inspect ecc-plugin-setup:debian ecc-plugin-setup:ubuntu
429
+ ```
430
+
431
+ Clean each named test project without deleting unrelated volumes or images:
432
+
433
+ ```bash
434
+ docker compose -p ecc-plugin-debian-test \
435
+ -f docker/plugin-setup/compose.yaml down --remove-orphans
436
+ docker compose -p ecc-plugin-ubuntu-test \
437
+ -f docker/plugin-setup/compose.yaml down --remove-orphans
438
+ ```
439
+
440
+ ## .dockerignore
441
+
442
+ ```
443
+ node_modules
444
+ .git
445
+ .env
446
+ .env.*
447
+ dist
448
+ coverage
449
+ *.log
450
+ .next
451
+ .cache
452
+ docker-compose*.yml
453
+ Dockerfile*
454
+ README.md
455
+ tests/
456
+ ```
457
+
458
+ ## Debugging
459
+
460
+ ### Common Commands
461
+
462
+ ```bash
463
+ # View logs
464
+ docker compose logs -f app # Follow app logs
465
+ docker compose logs --tail=50 db # Last 50 lines from db
466
+
467
+ # Execute commands in running container
468
+ docker compose exec app sh # Shell into app
469
+ docker compose exec db psql -U postgres # Connect to postgres
470
+
471
+ # Inspect
472
+ docker compose ps # Running services
473
+ docker compose top # Processes in each container
474
+ docker stats # Resource usage
475
+
476
+ # Rebuild
477
+ docker compose up --build # Rebuild images
478
+ docker compose build --no-cache app # Force full rebuild
479
+
480
+ # Clean up
481
+ docker compose down # Stop and remove containers
482
+ docker compose down -v # Also remove volumes (DESTRUCTIVE)
483
+ docker system prune # Remove unused images/containers
484
+ ```
485
+
486
+ ### Debugging Network Issues
487
+
488
+ ```bash
489
+ # Check DNS resolution inside container
490
+ docker compose exec app nslookup db
491
+
492
+ # Check connectivity
493
+ docker compose exec app wget -qO- http://api:3000/health
494
+
495
+ # Inspect network
496
+ docker network ls
497
+ docker network inspect <project>_default
498
+ ```
499
+
500
+ ## Anti-Patterns
501
+
502
+ ```
503
+ # BAD: Using docker compose in production without orchestration
504
+ # Use Kubernetes, ECS, or Docker Swarm for production multi-container workloads
505
+
506
+ # BAD: Storing data in containers without volumes
507
+ # Containers are ephemeral -- all data lost on restart without volumes
508
+
509
+ # BAD: Running as root
510
+ # Always create and use a non-root user
511
+
512
+ # BAD: Using :latest tag
513
+ # Pin to specific versions for reproducible builds
514
+
515
+ # BAD: One giant container with all services
516
+ # Separate concerns: one process per container
517
+
518
+ # BAD: Putting secrets in docker-compose.yml
519
+ # Use .env files (gitignored) or Docker secrets
520
+ ```
@@ -0,0 +1,91 @@
1
+ ---
2
+ name: documentation-lookup
3
+ description: Use up-to-date library and framework docs via Context7 MCP instead of training data. Activates for setup questions, API references, code examples, or when the user names a framework (e.g. React, Next.js, Prisma).
4
+ metadata:
5
+ origin: ECC
6
+ ---
7
+
8
+ # Documentation Lookup (Context7)
9
+
10
+ When the user asks about libraries, frameworks, or APIs, fetch current documentation via the Context7 MCP (tools `resolve-library-id` and `query-docs`) instead of relying on training data.
11
+
12
+ ## Core Concepts
13
+
14
+ - **Context7**: MCP server that exposes live documentation; use it instead of training data for libraries and APIs.
15
+ - **resolve-library-id**: Returns Context7-compatible library IDs (e.g. `/vercel/next.js`) from a library name and query.
16
+ - **query-docs**: Fetches documentation and code snippets for a given library ID and question. Always call resolve-library-id first to get a valid library ID.
17
+
18
+ ## When to use
19
+
20
+ Activate when the user:
21
+
22
+ - Asks setup or configuration questions (e.g. "How do I configure Next.js middleware?")
23
+ - Requests code that depends on a library ("Write a Prisma query for...")
24
+ - Needs API or reference information ("What are the Supabase auth methods?")
25
+ - Mentions specific frameworks or libraries (React, Vue, Svelte, Express, Tailwind, Prisma, Supabase, etc.)
26
+
27
+ Use this skill whenever the request depends on accurate, up-to-date behavior of a library, framework, or API. Applies across harnesses that have the Context7 MCP configured (e.g. Claude Code, Cursor, Codex).
28
+
29
+ ## How it works
30
+
31
+ ### Step 1: Resolve the Library ID
32
+
33
+ Call the **resolve-library-id** MCP tool with:
34
+
35
+ - **libraryName**: The library or product name taken from the user's question (e.g. `Next.js`, `Prisma`, `Supabase`).
36
+ - **query**: The user's full question. This improves relevance ranking of results.
37
+
38
+ You must obtain a Context7-compatible library ID (format `/org/project` or `/org/project/version`) before querying docs. Do not call query-docs without a valid library ID from this step.
39
+
40
+ ### Step 2: Select the Best Match
41
+
42
+ From the resolution results, choose one result using:
43
+
44
+ - **Name match**: Prefer exact or closest match to what the user asked for.
45
+ - **Benchmark score**: Higher scores indicate better documentation quality (100 is highest).
46
+ - **Source reputation**: Prefer High or Medium reputation when available.
47
+ - **Version**: If the user specified a version (e.g. "React 19", "Next.js 15"), prefer a version-specific library ID if listed (e.g. `/org/project/v1.2.0`).
48
+
49
+ ### Step 3: Fetch the Documentation
50
+
51
+ Call the **query-docs** MCP tool with:
52
+
53
+ - **libraryId**: The selected Context7 library ID from Step 2 (e.g. `/vercel/next.js`).
54
+ - **query**: The user's specific question or task. Be specific to get relevant snippets.
55
+
56
+ Limit: do not call query-docs (or resolve-library-id) more than 3 times per question. If the answer is unclear after 3 calls, state the uncertainty and use the best information you have rather than guessing.
57
+
58
+ ### Step 4: Use the Documentation
59
+
60
+ - Answer the user's question using the fetched, current information.
61
+ - Include relevant code examples from the docs when helpful.
62
+ - Cite the library or version when it matters (e.g. "In Next.js 15...").
63
+
64
+ ## Examples
65
+
66
+ ### Example: Next.js middleware
67
+
68
+ 1. Call **resolve-library-id** with `libraryName: "Next.js"`, `query: "How do I set up Next.js middleware?"`.
69
+ 2. From results, pick the best match (e.g. `/vercel/next.js`) by name and benchmark score.
70
+ 3. Call **query-docs** with `libraryId: "/vercel/next.js"`, `query: "How do I set up Next.js middleware?"`.
71
+ 4. Use the returned snippets and text to answer; include a minimal `middleware.ts` example from the docs if relevant.
72
+
73
+ ### Example: Prisma query
74
+
75
+ 1. Call **resolve-library-id** with `libraryName: "Prisma"`, `query: "How do I query with relations?"`.
76
+ 2. Select the official Prisma library ID (e.g. `/prisma/prisma`).
77
+ 3. Call **query-docs** with that `libraryId` and the query.
78
+ 4. Return the Prisma Client pattern (e.g. `include` or `select`) with a short code snippet from the docs.
79
+
80
+ ### Example: Supabase auth methods
81
+
82
+ 1. Call **resolve-library-id** with `libraryName: "Supabase"`, `query: "What are the auth methods?"`.
83
+ 2. Pick the Supabase docs library ID.
84
+ 3. Call **query-docs**; summarize the auth methods and show minimal examples from the fetched docs.
85
+
86
+ ## Best Practices
87
+
88
+ - **Be specific**: Use the user's full question as the query where possible for better relevance.
89
+ - **Version awareness**: When users mention versions, use version-specific library IDs from the resolve step when available.
90
+ - **Prefer official sources**: When multiple matches exist, prefer official or primary packages over community forks.
91
+ - **No sensitive data**: Redact API keys, passwords, tokens, and other secrets from any query sent to Context7. Treat the user's question as potentially containing secrets before passing it to resolve-library-id or query-docs.