opencode-skills-collection 3.0.46 → 3.0.47

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 (71) hide show
  1. package/bundled-skills/.antigravity-install-manifest.json +10 -1
  2. package/bundled-skills/2slides-ppt-generator/SKILL.md +1 -1
  3. package/bundled-skills/2slides-ppt-generator/scripts/create_pdf_slides.py +2 -1
  4. package/bundled-skills/2slides-ppt-generator/scripts/generate_narration.py +2 -1
  5. package/bundled-skills/2slides-ppt-generator/scripts/generate_slides.py +13 -7
  6. package/bundled-skills/android-dev/references/hybrid.md +7 -4
  7. package/bundled-skills/android-dev/references/react-native.md +5 -2
  8. package/bundled-skills/atlas-contract/SKILL.md +4 -4
  9. package/bundled-skills/atlas-ledger/SKILL.md +10 -7
  10. package/bundled-skills/bun-development/SKILL.md +1 -1
  11. package/bundled-skills/cloud-penetration-testing/SKILL.md +1 -1
  12. package/bundled-skills/codebase-to-wordpress-converter/SKILL.md +1 -0
  13. package/bundled-skills/docs/integrations/jetski-cortex.md +3 -3
  14. package/bundled-skills/docs/integrations/jetski-gemini-loader/README.md +1 -1
  15. package/bundled-skills/docs/maintainers/repo-growth-seo.md +3 -3
  16. package/bundled-skills/docs/maintainers/skills-update-guide.md +1 -1
  17. package/bundled-skills/docs/users/bundles.md +1 -1
  18. package/bundled-skills/docs/users/claude-code-skills.md +1 -1
  19. package/bundled-skills/docs/users/gemini-cli-skills.md +1 -1
  20. package/bundled-skills/docs/users/getting-started.md +1 -1
  21. package/bundled-skills/docs/users/kiro-integration.md +1 -1
  22. package/bundled-skills/docs/users/usage.md +4 -4
  23. package/bundled-skills/docs/users/visual-guide.md +4 -4
  24. package/bundled-skills/dos-verify-done-claims/SKILL.md +173 -0
  25. package/bundled-skills/ecl-harness-engineer/LICENSE +21 -0
  26. package/bundled-skills/ecl-harness-engineer/SKILL.md +714 -0
  27. package/bundled-skills/ecl-harness-engineer/agents/analyzer.md +119 -0
  28. package/bundled-skills/ecl-harness-engineer/agents/auditor.md +212 -0
  29. package/bundled-skills/ecl-harness-engineer/agents/creator-config.md +343 -0
  30. package/bundled-skills/ecl-harness-engineer/agents/creator-docs.md +201 -0
  31. package/bundled-skills/ecl-harness-engineer/agents/creator-linters.md +123 -0
  32. package/bundled-skills/ecl-harness-engineer/references/adapters/adapter-schema.md +204 -0
  33. package/bundled-skills/ecl-harness-engineer/references/adapters/generic.md +156 -0
  34. package/bundled-skills/ecl-harness-engineer/references/adapters/go.md +212 -0
  35. package/bundled-skills/ecl-harness-engineer/references/adapters/java.md +205 -0
  36. package/bundled-skills/ecl-harness-engineer/references/adapters/python.md +225 -0
  37. package/bundled-skills/ecl-harness-engineer/references/adapters/rust.md +220 -0
  38. package/bundled-skills/ecl-harness-engineer/references/adapters/typescript.md +245 -0
  39. package/bundled-skills/ecl-harness-engineer/references/architecture-diagrams.md +420 -0
  40. package/bundled-skills/ecl-harness-engineer/references/audit-templates.md +649 -0
  41. package/bundled-skills/ecl-harness-engineer/references/capability-registry.md +485 -0
  42. package/bundled-skills/ecl-harness-engineer/references/darwin-eval-prompts.md +373 -0
  43. package/bundled-skills/ecl-harness-engineer/references/documentation-templates.md +741 -0
  44. package/bundled-skills/ecl-harness-engineer/references/durability-patterns.md +423 -0
  45. package/bundled-skills/ecl-harness-engineer/references/ecl-harness.md +1431 -0
  46. package/bundled-skills/ecl-harness-engineer/references/environment-config-guide.md +534 -0
  47. package/bundled-skills/ecl-harness-engineer/references/environment-detection-guide.md +751 -0
  48. package/bundled-skills/ecl-harness-engineer/references/eval-templates.md +377 -0
  49. package/bundled-skills/ecl-harness-engineer/references/gc-templates.md +798 -0
  50. package/bundled-skills/ecl-harness-engineer/references/greenfield-templates.md +1385 -0
  51. package/bundled-skills/ecl-harness-engineer/references/linter-templates.md +448 -0
  52. package/bundled-skills/ecl-harness-engineer/references/observability-templates.md +315 -0
  53. package/bundled-skills/environment-setup-guide/SKILL.md +2 -2
  54. package/bundled-skills/evolution/SKILL.md +1 -1
  55. package/bundled-skills/gitops-workflow/SKILL.md +1 -1
  56. package/bundled-skills/linkerd-patterns/SKILL.md +1 -1
  57. package/bundled-skills/loki-mode/examples/todo-app-generated/frontend/package-lock.json +504 -1317
  58. package/bundled-skills/loki-mode/examples/todo-app-generated/frontend/package.json +2 -2
  59. package/bundled-skills/lovable-cleanup/SKILL.md +416 -0
  60. package/bundled-skills/monopoly/SKILL.md +397 -0
  61. package/bundled-skills/monopoly/patterns/SKILL.md +331 -0
  62. package/bundled-skills/monopoly/scale-benchmarks/SKILL.md +174 -0
  63. package/bundled-skills/monopoly/security-checklist/SKILL.md +69 -0
  64. package/bundled-skills/monopoly/tech-matrix/SKILL.md +268 -0
  65. package/bundled-skills/pagespeed-enhancer/SKILL.md +579 -0
  66. package/bundled-skills/polis-protocol/SKILL.md +6 -3
  67. package/bundled-skills/unship/SKILL.md +11 -5
  68. package/bundled-skills/uv-package-manager/resources/implementation-playbook.md +1 -1
  69. package/bundled-skills/varlock/SKILL.md +2 -2
  70. package/package.json +1 -1
  71. package/skills_index.json +204 -4
@@ -0,0 +1,534 @@
1
+ # Environment Configuration Guide
2
+
3
+ Guide for collecting complete environment information and generating `harness/config/environment.json` during harness creation.
4
+
5
+ ## Overview
6
+
7
+ `environment.json` is the contract between ecl-harness-engineer and harness-executor. It describes everything the executor needs to know to start the application, set up dependencies, and run verification — but it does NOT define what to verify. Verification configuration (`verify.json`) is dynamically generated by harness-executor at task runtime.
8
+
9
+ > **Key principle**: ecl-harness-engineer answers "what does this project need to run?" — harness-executor answers "what should we check after making changes?"
10
+
11
+ ---
12
+
13
+ ## environment.json Schema (v2.0)
14
+
15
+ ```json
16
+ {
17
+ "version": "2.0",
18
+ "project": {
19
+ "name": "my-project",
20
+ "type": "web-api | cli | frontend | library | hybrid",
21
+ "language": "go | typescript | python | java | rust",
22
+ "description": "Brief project description"
23
+ },
24
+ "runtime": {
25
+ "language": "go",
26
+ "version": "1.22",
27
+ "package_manager": "go | npm | pnpm | yarn | pip | poetry | uv | maven | gradle",
28
+ "build_command": "go build ./...",
29
+ "test_command": "go test ./...",
30
+ "lint_command": "make lint-arch"
31
+ },
32
+ "startup": {
33
+ "command": "go run ./cmd/server",
34
+ "args": ["--port", "${PORT:-8080}"],
35
+ "working_dir": ".",
36
+ "env": {
37
+ "PORT": "${PORT:-8080}",
38
+ "ENV": "development",
39
+ "LOG_LEVEL": "${LOG_LEVEL:-debug}"
40
+ },
41
+ "readiness": {
42
+ "type": "http",
43
+ "config": {
44
+ "endpoint": "/health",
45
+ "port": "${PORT:-8080}",
46
+ "expected_status": 200,
47
+ "timeout_seconds": 30,
48
+ "poll_interval_ms": 500
49
+ }
50
+ }
51
+ },
52
+ "services": [
53
+ {
54
+ "name": "postgres",
55
+ "type": "database",
56
+ "required": true,
57
+ "image": "postgres:15",
58
+ "ports": ["5432:5432"],
59
+ "env": {
60
+ "POSTGRES_USER": "${DB_USER:-postgres}",
61
+ "POSTGRES_PASSWORD": "${DB_PASSWORD}",
62
+ "POSTGRES_DB": "${DB_NAME:-app}"
63
+ },
64
+ "health_check": "pg_isready -U ${DB_USER:-postgres}",
65
+ "connection": {
66
+ "url_env": "DATABASE_URL",
67
+ "default_url": "postgres://${DB_USER:-postgres}:${DB_PASSWORD}@localhost:5432/${DB_NAME:-app}?sslmode=disable"
68
+ },
69
+ "setup": {
70
+ "migration_command": "go run ./cmd/migrate up",
71
+ "seed_command": "go run ./cmd/seed"
72
+ }
73
+ }
74
+ ],
75
+ "env_vars": {
76
+ "required": {
77
+ "DATABASE_URL": {
78
+ "purpose": "PostgreSQL connection string",
79
+ "sensitive": true,
80
+ "example": "postgres://user:pass@localhost:5432/dbname"
81
+ },
82
+ "JWT_SECRET": {
83
+ "purpose": "JWT token signing key",
84
+ "sensitive": true,
85
+ "test_value_ok": true,
86
+ "test_value": "test-secret-do-not-use-in-production"
87
+ }
88
+ },
89
+ "optional": {
90
+ "PORT": {
91
+ "purpose": "HTTP server port",
92
+ "default": "8080",
93
+ "sensitive": false
94
+ },
95
+ "LOG_LEVEL": {
96
+ "purpose": "Logging verbosity",
97
+ "default": "info",
98
+ "sensitive": false
99
+ }
100
+ }
101
+ },
102
+ "endpoints": {
103
+ "health": "/health",
104
+ "base_url": "http://localhost:${PORT:-8080}"
105
+ },
106
+ "scripts": {
107
+ "setup": "harness/scripts/setup-env.sh",
108
+ "start": "harness/scripts/start-server.sh",
109
+ "teardown": "harness/scripts/teardown-env.sh"
110
+ },
111
+ "_meta": {
112
+ "generated_by": "ecl-harness-engineer",
113
+ "generated_at": "2026-03-30T10:00:00Z",
114
+ "schema_version": "2.0",
115
+ "requires_user_input": ["DATABASE_URL", "JWT_SECRET"],
116
+ "todos": [
117
+ "Confirm Redis connection if caching is needed"
118
+ ]
119
+ }
120
+ }
121
+ ```
122
+
123
+ ---
124
+
125
+ ## Detection Strategy (4-Step Pipeline)
126
+
127
+ ### Step 1: Detect Project Type and Language
128
+
129
+ ```bash
130
+ # Language detection (high confidence)
131
+ test -f go.mod && echo "go"
132
+ test -f package.json && echo "typescript/javascript"
133
+ test -f pyproject.toml && echo "python"
134
+ test -f requirements.txt && echo "python"
135
+ test -f Cargo.toml && echo "rust"
136
+ test -f pom.xml && echo "java-maven"
137
+ test -f build.gradle && echo "java-gradle"
138
+
139
+ # Project type detection (medium confidence)
140
+ # Server indicators
141
+ grep -rq "http.ListenAndServe\|gin.Default\|chi.NewRouter\|echo.New" --include="*.go" . && echo "web-api"
142
+ grep -q '"express"\|"fastify"\|"koa"\|"hono"\|"nest"' package.json 2>/dev/null && echo "web-api"
143
+ grep -rq "FastAPI\|Flask\|Django" --include="*.py" . && echo "web-api"
144
+
145
+ # CLI indicators
146
+ test -d cmd/cli && echo "cli"
147
+ grep -rq "cobra\|urfave/cli" --include="*.go" . && echo "cli"
148
+ grep -q '"commander"\|"yargs"\|"oclif"' package.json 2>/dev/null && echo "cli"
149
+
150
+ # Frontend indicators
151
+ grep -q '"react"\|"vue"\|"svelte"\|"next"\|"nuxt"' package.json 2>/dev/null && echo "frontend"
152
+
153
+ # Library indicators (no entry point, exports only)
154
+ grep -q '"main"\|"bin"' package.json 2>/dev/null || echo "library"
155
+ ```
156
+
157
+ ### Step 2: Detect Startup Command
158
+
159
+ **Priority order** — use the first successful detection:
160
+
161
+ | Priority | Source | Command |
162
+ |----------|--------|---------|
163
+ | 1 | Existing `harness/config/environment.json` | `jq .startup.command environment.json` |
164
+ | 2 | Dockerfile CMD/ENTRYPOINT | `grep -E "^(CMD|ENTRYPOINT)" Dockerfile` |
165
+ | 3 | docker-compose.yml command | `grep "command:" docker-compose.yml` |
166
+ | 4 | Makefile targets | `grep -E "^(run|start|serve|dev):" Makefile` |
167
+ | 5 | package.json scripts | `jq '.scripts.start // .scripts.dev' package.json` |
168
+ | 6 | Go cmd/ directory | `ls cmd/*/main.go` → `go run ./cmd/<name>` |
169
+ | 7 | Python main module | `test -f main.py && echo "python main.py"` |
170
+ | 8 | **User confirmation tool** | Required if all auto-detection fails; in Codex use `request_user_input` |
171
+
172
+ ```bash
173
+ # Go: Detect startup command
174
+ if test -d cmd/; then
175
+ SERVER_CMD=""
176
+ # Look for server-like directories
177
+ for dir in cmd/*/; do
178
+ name=$(basename "$dir")
179
+ if echo "$name" | grep -qiE "server|api|web|app|service"; then
180
+ SERVER_CMD="go run ./$dir"
181
+ break
182
+ fi
183
+ done
184
+ # If no server-like dir, check if only one cmd/ exists
185
+ if [ -z "$SERVER_CMD" ]; then
186
+ cmd_count=$(ls -d cmd/*/ 2>/dev/null | wc -l)
187
+ if [ "$cmd_count" -eq 1 ]; then
188
+ SERVER_CMD="go run ./$(ls -d cmd/*/)"
189
+ fi
190
+ fi
191
+ fi
192
+
193
+ # Node.js: Check package.json
194
+ if test -f package.json; then
195
+ DEV_CMD=$(jq -r '.scripts.dev // empty' package.json 2>/dev/null)
196
+ START_CMD=$(jq -r '.scripts.start // empty' package.json 2>/dev/null)
197
+ # Detect package manager
198
+ test -f pnpm-lock.yaml && PKG_MGR="pnpm"
199
+ test -f yarn.lock && PKG_MGR="yarn"
200
+ test -f bun.lockb && PKG_MGR="bun"
201
+ PKG_MGR="${PKG_MGR:-npm}"
202
+ fi
203
+
204
+ # Python: Check for framework
205
+ if grep -q "FastAPI\|Flask" requirements.txt pyproject.toml 2>/dev/null; then
206
+ # Look for uvicorn/gunicorn patterns
207
+ grep -rn "uvicorn\|gunicorn" --include="*.py" . | head -1
208
+ fi
209
+ ```
210
+
211
+ ### Step 3: Detect Service Dependencies
212
+
213
+ **Scan these sources for service dependencies:**
214
+
215
+ ```bash
216
+ # Docker Compose (highest confidence)
217
+ if test -f docker-compose.yml; then
218
+ # Extract service names and images
219
+ grep -E "^\s+\w+:" docker-compose.yml | grep -v "version\|services"
220
+ grep "image:" docker-compose.yml
221
+ fi
222
+
223
+ # Code imports (medium confidence)
224
+ # PostgreSQL
225
+ grep -rq "pgx\|pq\|database/sql.*postgres\|psycopg\|pg.*Pool\|sequelize.*postgres\|TypeORM.*postgres" . 2>/dev/null && echo "postgres detected"
226
+
227
+ # MySQL
228
+ grep -rq "mysql\|mariadb" --include="*.go" --include="*.py" --include="*.ts" . 2>/dev/null && echo "mysql detected"
229
+
230
+ # Redis
231
+ grep -rq "go-redis\|redigo\|redis\|ioredis\|bull" --include="*.go" --include="*.py" --include="*.ts" . 2>/dev/null && echo "redis detected"
232
+
233
+ # MongoDB
234
+ grep -rq "mongo\|bson\|mongoose" --include="*.go" --include="*.py" --include="*.ts" . 2>/dev/null && echo "mongodb detected"
235
+
236
+ # Kafka/RabbitMQ
237
+ grep -rq "kafka\|sarama\|confluent" . 2>/dev/null && echo "kafka detected"
238
+ grep -rq "rabbitmq\|amqp" . 2>/dev/null && echo "rabbitmq detected"
239
+ ```
240
+
241
+ ### Step 4: Detect Environment Variables
242
+
243
+ ```bash
244
+ # Scan .env.example or .env.sample
245
+ if test -f .env.example; then
246
+ cat .env.example
247
+ elif test -f .env.sample; then
248
+ cat .env.sample
249
+ fi
250
+
251
+ # Scan code for env var references
252
+ # Go
253
+ grep -rn "os.Getenv\|os.LookupEnv\|viper.Get" --include="*.go" . 2>/dev/null | head -30
254
+
255
+ # Node.js
256
+ grep -rn "process.env\." --include="*.ts" --include="*.js" . 2>/dev/null | head -30
257
+
258
+ # Python
259
+ grep -rn "os.environ\|os.getenv\|settings\." --include="*.py" . 2>/dev/null | head -30
260
+
261
+ # Detect sensitive variables
262
+ grep -rEi "(PASSWORD|SECRET|KEY|TOKEN|CREDENTIAL|AUTH)" --include="*.go" --include="*.ts" --include="*.py" . 2>/dev/null | grep -i "getenv\|environ\|process\.env\|viper" | head -20
263
+ ```
264
+
265
+ ---
266
+
267
+ ## Interactive Collection Flow (Mixed Mode)
268
+
269
+ ### Decision Matrix: When to Ask vs When to Auto-Fill vs When to Write TODO
270
+
271
+ | Information | Detectable? | Critical? | Action |
272
+ |-------------|-------------|-----------|--------|
273
+ | Startup command | Often yes | **Yes** | Auto-detect → if fail, ask with the platform user-confirmation tool immediately |
274
+ | Health endpoint | Sometimes | **Yes** | Auto-detect → if fail, ask with the platform user-confirmation tool |
275
+ | Port | Usually | No | Auto-detect → default 8080 |
276
+ | Database type | Often | **Yes** (if code uses DB) | Auto-detect → if fail, ask with the platform user-confirmation tool |
277
+ | DB connection URL | No | **Yes** | Mark `requires_user_input`, use `${DATABASE_URL}` |
278
+ | Redis/cache | Sometimes | No | Auto-detect → write TODO if unclear |
279
+ | API keys | No | Depends | Mark `requires_user_input`, use `${VAR_NAME}` |
280
+ | Log level | Yes (default) | No | Auto-fill with "info" |
281
+ | Feature flags | Sometimes | No | Write TODO placeholder |
282
+
283
+ ### User Confirmation Templates
284
+
285
+ In Codex, use `request_user_input`. On other platforms, use the equivalent user-confirmation
286
+ tool. If no confirmation tool is available, record assumptions and required follow-up in
287
+ `environment.json`.
288
+
289
+ **Template 1: Startup Command (critical, must ask if not detected)**
290
+
291
+ ```json
292
+ {
293
+ "question": "Unable to automatically detect how to start this project. How is the application started for development?",
294
+ "header": "Startup",
295
+ "options": [
296
+ {
297
+ "label": "Custom command",
298
+ "description": "I'll provide the specific command (e.g., 'go run ./cmd/server', 'npm run dev')"
299
+ },
300
+ {
301
+ "label": "Docker Compose",
302
+ "description": "The project uses docker-compose up to start everything"
303
+ },
304
+ {
305
+ "label": "Makefile target",
306
+ "description": "There's a Makefile with run/start/dev targets"
307
+ },
308
+ {
309
+ "label": "Not applicable",
310
+ "description": "This is a library/package — no startup command needed"
311
+ }
312
+ ]
313
+ }
314
+ ```
315
+
316
+ **Template 2: Database Dependency (critical if DB usage detected in code)**
317
+
318
+ ```json
319
+ {
320
+ "question": "Detected database usage in code ({detected_db_type}). Please confirm the database setup:",
321
+ "header": "Database",
322
+ "options": [
323
+ {
324
+ "label": "Docker container",
325
+ "description": "Use Docker to run {db_type} locally (recommended for development)"
326
+ },
327
+ {
328
+ "label": "Local installation",
329
+ "description": "Database is installed directly on this machine"
330
+ },
331
+ {
332
+ "label": "Remote/cloud",
333
+ "description": "Database is hosted remotely (staging/dev environment)"
334
+ },
335
+ {
336
+ "label": "SQLite/embedded",
337
+ "description": "Use an embedded database for development/testing"
338
+ }
339
+ ]
340
+ }
341
+ ```
342
+
343
+ **Template 3: Sensitive Configuration (always ask if detected)**
344
+
345
+ ```json
346
+ {
347
+ "question": "Detected sensitive environment variables in code: {var_list}. These are needed for the application to run. How should they be configured?",
348
+ "header": "Secrets",
349
+ "options": [
350
+ {
351
+ "label": "Environment variables (recommended)",
352
+ "description": "Reference via ${VAR_NAME} — you set them in your shell profile"
353
+ },
354
+ {
355
+ "label": "Safe test values available",
356
+ "description": "Some of these have safe test/development values that can be used"
357
+ },
358
+ {
359
+ "label": "Config file reference",
360
+ "description": "Reference a local config file like ~/.config/app/secrets.json"
361
+ },
362
+ {
363
+ "label": "Skip for now",
364
+ "description": "Mark as TODO — fill in later before running verification"
365
+ }
366
+ ]
367
+ }
368
+ ```
369
+
370
+ ---
371
+
372
+ ## Startup Scripts Generation
373
+
374
+ ### setup-env.sh
375
+
376
+ ```bash
377
+ #!/usr/bin/env bash
378
+ # Environment setup script — starts required services
379
+ # Generated by ecl-harness-engineer, consumed by harness-executor
380
+ set -euo pipefail
381
+
382
+ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
383
+ PROJECT_ROOT="$(cd "$SCRIPT_DIR/../.." && pwd)"
384
+
385
+ echo "=== Setting up environment for {project_name} ==="
386
+
387
+ # Start services via Docker (if docker-compose exists)
388
+ if [ -f "$PROJECT_ROOT/docker-compose.yml" ]; then
389
+ echo "Starting services via docker-compose..."
390
+ docker-compose -f "$PROJECT_ROOT/docker-compose.yml" up -d
391
+ fi
392
+
393
+ # Or start individual services
394
+ # {auto-generated based on detected services}
395
+
396
+ # Wait for services to be ready
397
+ echo "Waiting for services..."
398
+ # {auto-generated health checks}
399
+
400
+ # Run migrations (if applicable)
401
+ # {auto-generated migration commands}
402
+
403
+ echo "=== Environment ready ==="
404
+ ```
405
+
406
+ ### start-server.sh
407
+
408
+ ```bash
409
+ #!/usr/bin/env bash
410
+ # Application startup script
411
+ # Generated by ecl-harness-engineer, consumed by harness-executor
412
+ set -euo pipefail
413
+
414
+ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
415
+ PROJECT_ROOT="$(cd "$SCRIPT_DIR/../.." && pwd)"
416
+
417
+ cd "$PROJECT_ROOT"
418
+
419
+ # Set default environment variables
420
+ export PORT="${PORT:-8080}"
421
+ export ENV="${ENV:-development}"
422
+ export LOG_LEVEL="${LOG_LEVEL:-debug}"
423
+
424
+ # Start the application
425
+ echo "Starting {project_name} on port $PORT..."
426
+ {startup_command}
427
+ ```
428
+
429
+ ### teardown-env.sh
430
+
431
+ ```bash
432
+ #!/usr/bin/env bash
433
+ # Environment teardown script
434
+ # Generated by ecl-harness-engineer, consumed by harness-executor
435
+ set -euo pipefail
436
+
437
+ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
438
+ PROJECT_ROOT="$(cd "$SCRIPT_DIR/../.." && pwd)"
439
+
440
+ echo "=== Tearing down environment ==="
441
+
442
+ # Stop Docker services
443
+ if [ -f "$PROJECT_ROOT/docker-compose.yml" ]; then
444
+ docker-compose -f "$PROJECT_ROOT/docker-compose.yml" down -v
445
+ fi
446
+
447
+ # Clean up optional runtime verification artifacts when advanced tracing is enabled
448
+ if [ -d "$PROJECT_ROOT/harness/trace" ]; then
449
+ rm -rf "$PROJECT_ROOT/harness/trace/verify-report.json" 2>/dev/null
450
+ rm -rf "$PROJECT_ROOT/harness/trace/verification-report.json" 2>/dev/null
451
+ fi
452
+
453
+ echo "=== Environment cleaned up ==="
454
+ ```
455
+
456
+ ---
457
+
458
+ ## Readiness Check Types
459
+
460
+ | Type | When to Use | Config |
461
+ |------|-------------|--------|
462
+ | `http` | Web API with health endpoint | `{ "endpoint": "/health", "port": 8080, "expected_status": 200 }` |
463
+ | `tcp` | Service that listens on a port but no HTTP | `{ "host": "localhost", "port": 5432 }` |
464
+ | `log_pattern` | Service that logs a "ready" message | `{ "pattern": "Server listening on", "timeout_seconds": 30 }` |
465
+ | `process` | Just check the process is running | `{ "command": "pgrep -f 'my-app'" }` |
466
+ | `none` | Library or no startup needed | (omit readiness section) |
467
+
468
+ ---
469
+
470
+ ## Sensitive Configuration Security
471
+
472
+ > **Core rule: never hardcode sensitive values in environment.json or scripts.**
473
+
474
+ ### Safe Patterns
475
+
476
+ | Pattern | Syntax | Example |
477
+ |---------|--------|---------|
478
+ | Environment variable | `${VAR_NAME}` | `"password": "${DB_PASSWORD}"` |
479
+ | With default | `${VAR_NAME:-default}` | `"port": "${PORT:-8080}"` |
480
+ | Config file ref | `$file:path:key` | `"key": "$file:~/.config/app/secrets.json:api.key"` |
481
+
482
+ ### Detection and Marking
483
+
484
+ When sensitive variables are detected in code, mark them in `_meta.requires_user_input`:
485
+
486
+ ```json
487
+ {
488
+ "_meta": {
489
+ "requires_user_input": ["DATABASE_URL", "JWT_SECRET", "API_KEY"],
490
+ "todos": [
491
+ "Set DATABASE_URL environment variable before running verification",
492
+ "Configure JWT_SECRET for authentication testing"
493
+ ]
494
+ }
495
+ }
496
+ ```
497
+
498
+ ### What NOT to Put in environment.json
499
+
500
+ - Actual passwords, API keys, tokens
501
+ - Connection strings with embedded credentials
502
+ - Test credentials that might be valid
503
+ - Internal URLs that should not be in version control
504
+
505
+ ---
506
+
507
+ ## Autonomous Mode (User Confirmation Tool Not Available)
508
+
509
+ When no user-confirmation tool is available:
510
+
511
+ 1. **Auto-detect everything possible** — use all detection strategies above
512
+ 2. **Apply conservative defaults** — use most common values
513
+ 3. **Mark unknowns as TODO** — never guess at critical config
514
+ 4. **Document assumptions** — explain what was detected and what's assumed
515
+
516
+ ```json
517
+ {
518
+ "_meta": {
519
+ "generated_by": "ecl-harness-engineer",
520
+ "mode": "autonomous",
521
+ "assumptions": [
522
+ "Startup command inferred from cmd/server/main.go",
523
+ "Port 8080 assumed (most common for Go web servers)",
524
+ "PostgreSQL detected from pgx import in internal/storage/"
525
+ ],
526
+ "requires_user_input": ["DATABASE_URL"],
527
+ "todos": [
528
+ "Verify startup command is correct",
529
+ "Confirm PostgreSQL connection details",
530
+ "Set DATABASE_URL environment variable"
531
+ ]
532
+ }
533
+ }
534
+ ```