memory-journal-mcp 7.3.0 → 7.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.
@@ -0,0 +1,262 @@
1
+ ---
2
+ name: docker
3
+ description: |
4
+ Production-grade Docker and container best practices. Use when writing
5
+ Dockerfiles, configuring Docker Compose, optimizing image size and build
6
+ speed, implementing security hardening, or debugging container issues.
7
+ Triggers on "Docker", "Dockerfile", "container", "Compose", "BuildKit",
8
+ "multi-stage build", "image size", "docker-compose".
9
+ ---
10
+
11
+ # Docker & Container Engineering Standards
12
+
13
+ This skill codifies 2026 Docker best practices — secure, minimal, reproducible container images using BuildKit, multi-stage builds, and Compose v2.
14
+
15
+ ## 1. Dockerfile Fundamentals
16
+
17
+ ### Always Start With BuildKit Syntax
18
+
19
+ ```dockerfile
20
+ # syntax=docker/dockerfile:1
21
+ ```
22
+
23
+ Place this as the **first line** of every Dockerfile. It enables:
24
+
25
+ - Parallel stage execution
26
+ - Cache mounts (`--mount=type=cache`)
27
+ - Secret mounts (`--mount=type=secret`)
28
+ - Reproducible builds across Docker versions
29
+
30
+ ### Base Image Selection
31
+
32
+ | Use Case | Recommended Base | Why |
33
+ | ----------- | ------------------------- | --------------------------------------- |
34
+ | **Node.js** | `node:22-slim` | Debian Slim — small, has essential libs |
35
+ | **Python** | `python:3.13-slim` | Minimal Debian, no build tools |
36
+ | **Go** | `scratch` or `distroless` | Static binary needs nothing |
37
+ | **General** | `debian:bookworm-slim` | Stable, well-patched, small |
38
+
39
+ - **NEVER** use `:latest` — always pin to a specific version tag
40
+ - **Prefer `-slim` variants** over full images to reduce attack surface
41
+ - **Consider `distroless`** for production — no shell, no package manager = minimal attack surface
42
+
43
+ ## 2. Multi-Stage Builds (Required for Production)
44
+
45
+ Multi-stage builds are **mandatory** for any production image. They separate build-time dependencies from runtime.
46
+
47
+ ```dockerfile
48
+ # syntax=docker/dockerfile:1
49
+
50
+ # ── Stage 1: Build ─────────────────────────────
51
+ FROM node:22-slim AS builder
52
+ WORKDIR /app
53
+ COPY package.json pnpm-lock.yaml ./
54
+ RUN corepack enable && pnpm install --frozen-lockfile
55
+ COPY . .
56
+ RUN pnpm run build
57
+
58
+ # ── Stage 2: Runtime ───────────────────────────
59
+ FROM node:22-slim AS runtime
60
+ WORKDIR /app
61
+ ENV NODE_ENV=production
62
+
63
+ # Create non-root user
64
+ RUN groupadd -r appgroup && useradd -r -g appgroup appuser
65
+
66
+ # Copy ONLY production artifacts
67
+ COPY --from=builder /app/dist ./dist
68
+ COPY --from=builder /app/node_modules ./node_modules
69
+ COPY --from=builder /app/package.json ./
70
+
71
+ USER appuser
72
+ EXPOSE 3000
73
+ CMD ["node", "dist/index.js"]
74
+ ```
75
+
76
+ ### Key Rules
77
+
78
+ - **Name every stage**: `FROM ... AS builder` — makes builds readable and targetable
79
+ - **Copy only artifacts**: Use `COPY --from=builder` to cherry-pick built files
80
+ - **Never install dev dependencies in the runtime stage**
81
+ - **The runtime stage should have ZERO build tools** (no compilers, no git, no curl)
82
+
83
+ ## 3. Security Hardening
84
+
85
+ ### Non-Root Execution (Mandatory)
86
+
87
+ ```dockerfile
88
+ # Create a system user with no home directory, no login shell
89
+ RUN groupadd -r appgroup && useradd -r -g appgroup -s /usr/sbin/nologin appuser
90
+
91
+ # Switch to the non-root user BEFORE CMD
92
+ USER appuser
93
+ ```
94
+
95
+ - **NEVER** run containers as root in production
96
+ - **NEVER** use `--privileged` flag unless absolutely required
97
+ - **Set `USER` as late as possible** — after all `RUN` commands that need root
98
+
99
+ ### Secret Handling
100
+
101
+ ```dockerfile
102
+ # ✅ Good: BuildKit secret mount (never stored in layers)
103
+ RUN --mount=type=secret,id=npm_token \
104
+ NPM_TOKEN=$(cat /run/secrets/npm_token) \
105
+ npm config set //registry.npmjs.org/:_authToken=$NPM_TOKEN
106
+
107
+ # ❌ Bad: ARG/ENV secrets (visible in image history)
108
+ ARG NPM_TOKEN
109
+ ENV NPM_TOKEN=$NPM_TOKEN
110
+ ```
111
+
112
+ - **NEVER** use `ARG` or `ENV` for secrets — they are baked into image layers
113
+ - **NEVER** `COPY` `.env` files into the image
114
+ - Use `--mount=type=secret` (BuildKit) for build-time secrets
115
+ - Use Docker Compose `secrets:` or orchestrator secrets for runtime
116
+
117
+ ### Vulnerability Scanning
118
+
119
+ ```bash
120
+ docker scout cves <image> # Docker Scout
121
+ trivy image <image> # Trivy (open source)
122
+ grype <image> # Grype (Anchore)
123
+ ```
124
+
125
+ - Run scanning in CI — **hard-fail** on HIGH/CRITICAL vulnerabilities
126
+ - Never use `continue-on-error: true` for security gates
127
+
128
+ ## 4. Layer Optimization
129
+
130
+ ### Instruction Ordering
131
+
132
+ Docker caches each layer. Order instructions from **least-changing to most-changing**:
133
+
134
+ ```dockerfile
135
+ # 1. Base image (rarely changes)
136
+ FROM node:22-slim
137
+
138
+ # 2. System deps (changes infrequently)
139
+ RUN apt-get update && apt-get install -y --no-install-recommends \
140
+ dumb-init \
141
+ && rm -rf /var/lib/apt/lists/*
142
+
143
+ # 3. Application deps (changes when lock file changes)
144
+ COPY package.json pnpm-lock.yaml ./
145
+ RUN pnpm install --frozen-lockfile
146
+
147
+ # 4. Application code (changes most frequently)
148
+ COPY . .
149
+ RUN pnpm build
150
+ ```
151
+
152
+ ### Cache Mounts (BuildKit)
153
+
154
+ ```dockerfile
155
+ # Cache package manager downloads between builds
156
+ RUN --mount=type=cache,target=/root/.cache/pip \
157
+ pip install -r requirements.txt
158
+ ```
159
+
160
+ ### `.dockerignore` (Required)
161
+
162
+ Create a `.dockerignore` in every project with a Dockerfile:
163
+
164
+ ```
165
+ .git
166
+ .github
167
+ node_modules
168
+ dist
169
+ *.md
170
+ .env*
171
+ .vscode
172
+ .idea
173
+ tmp/
174
+ coverage/
175
+ ```
176
+
177
+ - **ALWAYS** exclude `.git` — it can be hundreds of MB
178
+ - **ALWAYS** exclude `node_modules` — reinstall inside the container
179
+ - **ALWAYS** exclude `.env*` — prevents secret leaks
180
+
181
+ ## 5. Docker Compose v2
182
+
183
+ ### Structure
184
+
185
+ ```yaml
186
+ # docker-compose.yml
187
+ services:
188
+ app:
189
+ build:
190
+ context: .
191
+ dockerfile: Dockerfile
192
+ target: runtime # Target a specific stage
193
+ ports:
194
+ - '3000:3000'
195
+ environment:
196
+ NODE_ENV: production
197
+ depends_on:
198
+ db:
199
+ condition: service_healthy
200
+ restart: unless-stopped
201
+
202
+ db:
203
+ image: postgres:17-alpine
204
+ volumes:
205
+ - pgdata:/var/lib/postgresql/data
206
+ environment:
207
+ POSTGRES_PASSWORD_FILE: /run/secrets/db_password
208
+ secrets:
209
+ - db_password
210
+ healthcheck:
211
+ test: ['CMD-SHELL', 'pg_isready -U postgres']
212
+ interval: 10s
213
+ timeout: 5s
214
+ retries: 5
215
+
216
+ volumes:
217
+ pgdata:
218
+
219
+ secrets:
220
+ db_password:
221
+ file: ./secrets/db_password.txt
222
+ ```
223
+
224
+ ### Best Practices
225
+
226
+ - **Use `depends_on` with health checks** — not just service start order
227
+ - **Use named volumes** for persistent data — never bind-mount the entire project in production
228
+ - **Use environment files** (`env_file:`) for non-secret config
229
+ - **Use `secrets:`** for credentials — they are mounted as files, not env vars
230
+ - **Pin image versions** — `postgres:17-alpine`, not `postgres:latest`
231
+
232
+ ## 6. CI/CD Integration
233
+
234
+ ### GitHub Actions Pattern
235
+
236
+ ```yaml
237
+ - name: Build and push
238
+ uses: docker/build-push-action@<sha>
239
+ with:
240
+ context: .
241
+ push: true
242
+ tags: ghcr.io/${{ github.repository }}:${{ github.sha }}
243
+ cache-from: type=gha
244
+ cache-to: type=gha,mode=max
245
+ ```
246
+
247
+ - **Use GitHub Actions cache** (`type=gha`) for CI builds
248
+ - **Tag with commit SHA** — never `:latest` for production
249
+ - **Scan before push** — run vulnerability scanning as a build step
250
+
251
+ ## 7. Anti-Patterns (Never Do These)
252
+
253
+ | Anti-Pattern | Why It's Wrong | Do This Instead |
254
+ | -------------------------- | --------------------------------------- | ----------------------------------------------- |
255
+ | `FROM ubuntu:latest` | Unpinned, large, unpredictable | Pin version, use `-slim` |
256
+ | `RUN apt-get update` alone | Cache goes stale across builds | Combine with `install` in one `RUN` |
257
+ | `ADD` for local files | Unpredictable (auto-extracts) | Use `COPY` explicitly |
258
+ | Multiple `RUN apt-get` | Creates unnecessary layers | Chain with `&&` in one `RUN` |
259
+ | `COPY . .` before deps | Breaks layer cache on every code change | Copy lock file first, install, then copy source |
260
+ | Running as root | Security vulnerability | Create and switch to `appuser` |
261
+ | Secrets in `ENV`/`ARG` | Visible in image history | Use `--mount=type=secret` |
262
+ | No `.dockerignore` | Bloated context, potential secret leaks | Always create one |
@@ -0,0 +1,315 @@
1
+ ---
2
+ name: github-actions
3
+ description: |
4
+ Master GitHub Actions CI/CD workflows with production-grade security and
5
+ performance patterns. Use when writing workflow YAML, configuring CI/CD
6
+ pipelines, setting up matrix strategies, caching dependencies, managing
7
+ artifacts, or implementing reusable workflows. Triggers on "GitHub Actions",
8
+ "CI/CD", "workflow", "actions/checkout", "matrix strategy", "reusable
9
+ workflow", "SHA pinning", ".github/workflows".
10
+ ---
11
+
12
+ # GitHub Actions CI/CD Engineering Standards
13
+
14
+ This skill codifies 2026 GitHub Actions best practices — secure supply chains, efficient caching, reusable workflows, and hardened permission models.
15
+
16
+ ## 1. Security: SHA Pinning (Mandatory)
17
+
18
+ ### Pin Every Third-Party Action to a Commit SHA
19
+
20
+ ```yaml
21
+ # ✅ Good: SHA-pinned (immutable, auditable)
22
+ - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.2.2
23
+ - uses: actions/setup-node@1d0ff469b7ec7b3cb9d8673fde8c81c89c3166c0 # v4.2.0
24
+
25
+ # ❌ Bad: Tag-pinned (mutable, vulnerable to supply chain attacks)
26
+ - uses: actions/checkout@v4
27
+ - uses: actions/setup-node@v4
28
+ ```
29
+
30
+ - **ALWAYS** pin to full-length commit SHAs — tags are mutable and can be hijacked
31
+ - **ALWAYS** add a trailing comment with the version for human readability
32
+ - **Use tools** like `step-security/harden-runner` or `pin-github-action` CLI to automate SHA resolution
33
+ - **Audit quarterly** — review all pinned SHAs when updating workflow dependencies
34
+
35
+ ### Permission Hardening
36
+
37
+ ```yaml
38
+ # Set restrictive defaults at the workflow level
39
+ permissions:
40
+ contents: read
41
+
42
+ jobs:
43
+ build:
44
+ runs-on: ubuntu-latest
45
+ # Grant specific permissions per-job
46
+ permissions:
47
+ contents: read
48
+ packages: write
49
+ ```
50
+
51
+ - **ALWAYS** set `permissions:` at the workflow level — use `read-all` or specify individually
52
+ - **NEVER** use `permissions: write-all` — it grants maximum privileges
53
+ - **Grant write only where needed** — per-job, not per-workflow
54
+
55
+ ## 2. Workflow Structure
56
+
57
+ ### Standard CI Template
58
+
59
+ ```yaml
60
+ name: CI
61
+
62
+ on:
63
+ push:
64
+ branches: [main]
65
+ pull_request:
66
+ branches: [main]
67
+
68
+ permissions:
69
+ contents: read
70
+
71
+ concurrency:
72
+ group: ${{ github.workflow }}-${{ github.ref }}
73
+ cancel-in-progress: true
74
+
75
+ jobs:
76
+ lint:
77
+ runs-on: ubuntu-latest
78
+ steps:
79
+ - uses: actions/checkout@<sha> # v4
80
+ - uses: actions/setup-node@<sha> # v4
81
+ with:
82
+ node-version-file: .node-version
83
+ cache: pnpm
84
+ - run: pnpm install --frozen-lockfile
85
+ - run: pnpm run lint
86
+ - run: pnpm run typecheck
87
+
88
+ test:
89
+ runs-on: ubuntu-latest
90
+ needs: lint
91
+ steps:
92
+ - uses: actions/checkout@<sha> # v4
93
+ - uses: actions/setup-node@<sha> # v4
94
+ with:
95
+ node-version-file: .node-version
96
+ cache: pnpm
97
+ - run: pnpm install --frozen-lockfile
98
+ - run: pnpm test
99
+
100
+ build:
101
+ runs-on: ubuntu-latest
102
+ needs: test
103
+ steps:
104
+ - uses: actions/checkout@<sha> # v4
105
+ - uses: actions/setup-node@<sha> # v4
106
+ with:
107
+ node-version-file: .node-version
108
+ cache: pnpm
109
+ - run: pnpm install --frozen-lockfile
110
+ - run: pnpm run build
111
+ ```
112
+
113
+ ### Key Structural Rules
114
+
115
+ - **ALWAYS** set `concurrency` with `cancel-in-progress: true` to prevent stale runs
116
+ - **Use `needs:`** to create a dependency chain: lint → test → build → deploy
117
+ - **Use `.node-version`** or `.python-version` files — never hardcode versions in workflows
118
+ - **Use `--frozen-lockfile`** — never let CI modify the lock file
119
+
120
+ ## 3. Caching
121
+
122
+ ### Package Manager Caching
123
+
124
+ ```yaml
125
+ # Node.js (pnpm)
126
+ - uses: actions/setup-node@<sha>
127
+ with:
128
+ node-version-file: .node-version
129
+ cache: pnpm
130
+
131
+ # Python (uv)
132
+ - uses: actions/setup-python@<sha>
133
+ with:
134
+ python-version-file: .python-version
135
+ - run: pip install uv
136
+ - uses: actions/cache@<sha>
137
+ with:
138
+ path: ~/.cache/uv
139
+ key: uv-${{ runner.os }}-${{ hashFiles('uv.lock') }}
140
+ restore-keys: uv-${{ runner.os }}-
141
+
142
+ # Go
143
+ - uses: actions/setup-go@<sha>
144
+ with:
145
+ go-version-file: go.mod
146
+ cache: true
147
+ ```
148
+
149
+ ### Custom Caching Rules
150
+
151
+ - **Key on lock file hash** — `${{ hashFiles('pnpm-lock.yaml') }}`
152
+ - **Use `restore-keys`** for fallback to partial cache hits
153
+ - **Cache the package manager's global cache**, not `node_modules` directly
154
+ - **Don't cache everything** — simplicity trumps marginal speedup
155
+
156
+ ## 4. Matrix Strategy
157
+
158
+ ### Basic Matrix
159
+
160
+ ```yaml
161
+ jobs:
162
+ test:
163
+ strategy:
164
+ fail-fast: false
165
+ matrix:
166
+ os: [ubuntu-latest, macos-latest, windows-latest]
167
+ node: [20, 22]
168
+ exclude:
169
+ - os: windows-latest
170
+ node: 20
171
+ runs-on: ${{ matrix.os }}
172
+ steps:
173
+ - uses: actions/setup-node@<sha>
174
+ with:
175
+ node-version: ${{ matrix.node }}
176
+ ```
177
+
178
+ ### Dynamic Matrix
179
+
180
+ ```yaml
181
+ jobs:
182
+ prepare:
183
+ runs-on: ubuntu-latest
184
+ outputs:
185
+ matrix: ${{ steps.set.outputs.matrix }}
186
+ steps:
187
+ - id: set
188
+ run: |
189
+ echo 'matrix={"include":[{"project":"api"},{"project":"web"}]}' >> "$GITHUB_OUTPUT"
190
+
191
+ build:
192
+ needs: prepare
193
+ strategy:
194
+ matrix: ${{ fromJSON(needs.prepare.outputs.matrix) }}
195
+ runs-on: ubuntu-latest
196
+ steps:
197
+ - run: echo "Building ${{ matrix.project }}"
198
+ ```
199
+
200
+ ### Rules
201
+
202
+ - **Use `fail-fast: false`** for test matrices — you want to see all failures, not just the first
203
+ - **Use `include`/`exclude`** to fine-tune — don't generate invalid combinations
204
+ - **Use `max-parallel`** if jobs contend for shared resources (APIs, databases)
205
+
206
+ ## 5. Reusable Workflows
207
+
208
+ ### Defining a Reusable Workflow
209
+
210
+ ```yaml
211
+ # .github/workflows/reusable-build.yml
212
+ name: Reusable Build
213
+
214
+ on:
215
+ workflow_call:
216
+ inputs:
217
+ node-version:
218
+ type: string
219
+ default: '22'
220
+ secrets:
221
+ NPM_TOKEN:
222
+ required: true
223
+
224
+ permissions:
225
+ contents: read
226
+
227
+ jobs:
228
+ build:
229
+ runs-on: ubuntu-latest
230
+ steps:
231
+ - uses: actions/checkout@<sha>
232
+ - uses: actions/setup-node@<sha>
233
+ with:
234
+ node-version: ${{ inputs.node-version }}
235
+ registry-url: https://registry.npmjs.org
236
+ - run: pnpm install --frozen-lockfile
237
+ - run: pnpm build
238
+ env:
239
+ NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
240
+ ```
241
+
242
+ ### Calling a Reusable Workflow
243
+
244
+ ```yaml
245
+ jobs:
246
+ build:
247
+ uses: ./.github/workflows/reusable-build.yml
248
+ with:
249
+ node-version: '22'
250
+ secrets:
251
+ NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
252
+ ```
253
+
254
+ ### Rules
255
+
256
+ - **Pass secrets explicitly** — avoid `secrets: inherit` (grants broader access than needed)
257
+ - **Pin reusable workflows** to SHA or tag in production
258
+ - **Use `workflow_call` inputs** for all configuration — don't rely on `env` or file conventions
259
+ - **Separate concerns**: reusable workflows = entire jobs; composite actions = reusable steps
260
+
261
+ ## 6. Artifacts (v4)
262
+
263
+ ```yaml
264
+ # Upload
265
+ - uses: actions/upload-artifact@<sha> # v4
266
+ with:
267
+ name: build-output
268
+ path: dist/
269
+ retention-days: 7
270
+ compression-level: 6
271
+
272
+ # Download (in a different job)
273
+ - uses: actions/download-artifact@<sha> # v4
274
+ with:
275
+ name: build-output
276
+ path: dist/
277
+ ```
278
+
279
+ ### Rules
280
+
281
+ - **v4 artifacts are immutable** — you cannot overwrite the same artifact name
282
+ - **Use unique names per job** — don't upload from parallel matrix jobs to the same name
283
+ - **Set `retention-days`** — don't rely on org defaults (storage costs add up)
284
+ - **Use `compression-level: 0`** for already-compressed files (`.zip`, `.tar.gz`)
285
+ - **v3 and v4 are incompatible** — do not mix upload-artifact@v3 with download-artifact@v4
286
+
287
+ ## 7. Environment Protection
288
+
289
+ ```yaml
290
+ jobs:
291
+ deploy:
292
+ runs-on: ubuntu-latest
293
+ environment:
294
+ name: production
295
+ url: https://myapp.example.com
296
+ steps:
297
+ - run: echo "Deploying to production"
298
+ ```
299
+
300
+ - **Use `environment:`** for production deployments — enables approval gates
301
+ - **Configure required reviewers** in repo Settings → Environments
302
+ - **Use environment-scoped secrets** — production secrets should not be accessible in CI
303
+
304
+ ## 8. Anti-Patterns (Never Do These)
305
+
306
+ | Anti-Pattern | Why It's Wrong | Do This Instead |
307
+ | ------------------------------------------- | --------------------------------- | ------------------------------------ |
308
+ | `uses: action@v4` | Mutable tag, supply chain risk | Pin to full commit SHA |
309
+ | `permissions: write-all` | Maximum privilege, dangerous | Explicit per-job permissions |
310
+ | `continue-on-error: true` on security steps | Suppresses critical failures | Hard-fail on security gates |
311
+ | `secrets: inherit` | Over-broad secret access | Pass secrets explicitly |
312
+ | Hardcoded `node-version: 22` | Version drift across workflows | Use `.node-version` file |
313
+ | No `concurrency:` | Stale runs waste minutes | Always set with `cancel-in-progress` |
314
+ | `if: always()` on non-cleanup steps | Runs even after critical failures | Use `if: success()` (default) |
315
+ | Caching `node_modules` directly | Fragile, platform-specific | Cache package manager global cache |
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "neverinfamous-agent-skills",
3
- "version": "1.0.8",
3
+ "version": "1.1.1",
4
4
  "description": "Foundational AI agent metacognitive skills and workflows for the Adamic ecosystem.",
5
5
  "type": "module",
6
6
  "main": "README.md",
@@ -12,17 +12,21 @@
12
12
  "README.md",
13
13
  "autonomous-dev/",
14
14
  "bun/",
15
+ "docker/",
16
+ "github-actions/",
15
17
  "github-commander/",
16
18
  "gitlab/",
17
19
  "golang/",
18
20
  "mysql/",
19
21
  "playwright-standard/",
20
22
  "postgres/",
23
+ "python/",
21
24
  "react-best-practices/",
22
25
  "rust/",
23
26
  "shadcn-ui/",
24
27
  "skill-builder/",
25
28
  "sqlite/",
29
+ "tailwind-css/",
26
30
  "typescript/",
27
31
  "vitest-standard/"
28
32
  ],