bigpowers 2.34.0 → 2.34.2

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 (42) hide show
  1. package/.pi/package.json +2 -2
  2. package/.pi/prompts/deploy.md +53 -28
  3. package/.pi/prompts/develop-tdd.md +5 -80
  4. package/.pi/prompts/migrate-spec.md +273 -197
  5. package/.pi/prompts/publish-package.md +125 -67
  6. package/.pi/prompts/release-branch.md +85 -69
  7. package/.pi/prompts/smoke-test.md +98 -58
  8. package/.pi/prompts/using-bigpowers.md +2 -2
  9. package/.pi/prompts/validate-contracts.md +169 -54
  10. package/.pi/prompts/wire-ci.md +147 -89
  11. package/.pi/skills/deploy/SKILL.md +53 -28
  12. package/.pi/skills/develop-tdd/SKILL.md +5 -80
  13. package/.pi/skills/migrate-spec/SKILL.md +273 -197
  14. package/.pi/skills/publish-package/SKILL.md +125 -67
  15. package/.pi/skills/release-branch/SKILL.md +85 -69
  16. package/.pi/skills/smoke-test/SKILL.md +98 -58
  17. package/.pi/skills/using-bigpowers/SKILL.md +2 -2
  18. package/.pi/skills/validate-contracts/SKILL.md +169 -54
  19. package/.pi/skills/wire-ci/SKILL.md +147 -89
  20. package/CHANGELOG.md +14 -0
  21. package/README.md +4 -4
  22. package/SKILL-INDEX.md +1 -1
  23. package/deploy/REFERENCE.md +82 -0
  24. package/deploy/SKILL.md +3 -63
  25. package/develop-tdd/SKILL.md +5 -80
  26. package/migrate-spec/REFERENCE.md +268 -0
  27. package/migrate-spec/SKILL.md +5 -199
  28. package/package.json +4 -3
  29. package/publish-package/REFERENCE.md +239 -0
  30. package/publish-package/SKILL.md +8 -192
  31. package/release-branch/REFERENCE.md +83 -0
  32. package/release-branch/SKILL.md +2 -69
  33. package/scripts/generate-reference-tables.sh +1 -0
  34. package/scripts/sync-skills.sh +4 -1
  35. package/skills-lock.json +9 -9
  36. package/smoke-test/REFERENCE.md +162 -0
  37. package/smoke-test/SKILL.md +5 -130
  38. package/using-bigpowers/SKILL.md +2 -2
  39. package/validate-contracts/REFERENCE.md +183 -0
  40. package/validate-contracts/SKILL.md +6 -77
  41. package/wire-ci/REFERENCE.md +257 -0
  42. package/wire-ci/SKILL.md +8 -210
package/skills-lock.json CHANGED
@@ -68,7 +68,7 @@
68
68
  },
69
69
  "deploy": {
70
70
  "description": "\"Build → verify artifact → deploy → wait → smoke deployment pipeline. Platform-agnostic (MCP or CLI), with configurable timeout, retry with exponential backoff, and integrated health-check. The deploy half of CI/CD: run after build to push to production.\"",
71
- "sha256": "260894aa4f869093",
71
+ "sha256": "304967c4f7d0ea13",
72
72
  "path": "deploy/SKILL.md"
73
73
  },
74
74
  "design-interface": {
@@ -78,7 +78,7 @@
78
78
  },
79
79
  "develop-tdd": {
80
80
  "description": "Test-driven development with red-green-refactor loop using vertical slices. Use for features (epic tasks) or bugs (specs/bugs/BUG-*.md).",
81
- "sha256": "e050f400da14eff3",
81
+ "sha256": "8a232210dc2c11d3",
82
82
  "path": "develop-tdd/SKILL.md"
83
83
  },
84
84
  "diagnose-root": {
@@ -163,7 +163,7 @@
163
163
  },
164
164
  "migrate-spec": {
165
165
  "description": "Detect GSD, spec-kit, or BMAD spec artifacts and transform them into bigpowers YAML layout (state.yaml, release-plan.yaml, epics/, requirements/, plans/, ADRs). Use when migrating foreign spec docs.",
166
- "sha256": "7636756cd3421b20",
166
+ "sha256": "84077c1eaa2ec40d",
167
167
  "path": "migrate-spec/SKILL.md"
168
168
  },
169
169
  "model-domain": {
@@ -198,7 +198,7 @@
198
198
  },
199
199
  "publish-package": {
200
200
  "description": "\"Package registry publishing for npm, crates.io, PyPI, and Homebrew. Verifies prerequisites, runs the publish command, confirms success, and surfaces actionable error hints on failure.\"",
201
- "sha256": "25ead1dd4d174d54",
201
+ "sha256": "39f5ba9b115cca6b",
202
202
  "path": "publish-package/SKILL.md"
203
203
  },
204
204
  "quick-fix": {
@@ -208,7 +208,7 @@
208
208
  },
209
209
  "release-branch": {
210
210
  "description": "Make the merge/PR/keep/discard decision for a feature branch, verify coverage gates, create the PR with gh, and clean up the worktree. Use when a feature is done and ready to ship, or when user says \"release\", \"merge\", or \"open a PR\".",
211
- "sha256": "5d1e07e58d1aff44",
211
+ "sha256": "fd5e968246ce07bd",
212
212
  "path": "release-branch/SKILL.md"
213
213
  },
214
214
  "request-review": {
@@ -283,7 +283,7 @@
283
283
  },
284
284
  "smoke-test": {
285
285
  "description": "\"Post-deploy health-check against a live URL. Validates HTTP status, response content, and critical endpoints. Runnable standalone OR as the final step of the deploy skill.\"",
286
- "sha256": "402c89c31ac4fd4c",
286
+ "sha256": "85d2de9e87e141f7",
287
287
  "path": "smoke-test/SKILL.md"
288
288
  },
289
289
  "spike-prototype": {
@@ -313,12 +313,12 @@
313
313
  },
314
314
  "using-bigpowers": {
315
315
  "description": "One-time bootstrap that introduces the bigpowers skills system, the PMBOK lifecycle arc, and tells you which skill to call first for your situation. Use when starting with bigpowers for the first time, when user asks \"where do I start?\", or when the skills system needs to be explained.",
316
- "sha256": "b150ea218b529f61",
316
+ "sha256": "3e73bdd359b49743",
317
317
  "path": "using-bigpowers/SKILL.md"
318
318
  },
319
319
  "validate-contracts": {
320
320
  "description": "\"Assert data shape consistency across system boundaries — live API responses against JSON Schema, key-set comparison across layers, data shape validation for migrations and exports. Catches silent data corruption before deploy.\"",
321
- "sha256": "17653c7ac211c5d8",
321
+ "sha256": "59cf618f642fa10c",
322
322
  "path": "validate-contracts/SKILL.md"
323
323
  },
324
324
  "validate-fix": {
@@ -338,7 +338,7 @@
338
338
  },
339
339
  "wire-ci": {
340
340
  "description": "\"CI pipeline setup with pre-built templates and local validation. Generates GitHub Actions workflows, validates YAML syntax and permissions, supports dry-run via act/gh. The CI equivalent of wire-observability.\"",
341
- "sha256": "dcbf6e1516f6b355",
341
+ "sha256": "cc3fd8faf2686be1",
342
342
  "path": "wire-ci/SKILL.md"
343
343
  },
344
344
  "wire-observability": {
@@ -0,0 +1,162 @@
1
+ # Smoke Test — Reference
2
+
3
+ ## Runner script
4
+
5
+ A ready-to-use runner is provided for standalone operation:
6
+
7
+ ```bash
8
+ bash scripts/run-smoke.sh [url] [smoke-checks-file]
9
+ ```
10
+
11
+ The runner:
12
+ 1. Uses `$DEPLOY_URL`, `$SMOKE_CHECKS_FILE`, or CLI arguments
13
+ 2. Runs all defined checks
14
+ 3. Prints a pass/fail summary
15
+ 4. Exits 0 on all pass, non-zero on any failure
16
+
17
+
18
+ ---
19
+
20
+ ## Configuration reference
21
+
22
+ | Variable | Default | Description |
23
+ |----------|---------|-------------|
24
+ | `SMOKE_CHECKS_FILE` | `smoke-checks.yaml` | Path to smoke checks YAML |
25
+ | `DEPLOY_URL` / `BASE_URL` | *(required)* | Base URL for all checks |
26
+ | `SMOKE_TIMEOUT` | `30` | Per-check timeout (seconds) |
27
+ | `SMOKE_RETRIES` | `0` | Number of retries on failure |
28
+
29
+
30
+ ---
31
+
32
+ ## Verification
33
+
34
+ → verify: `test -f smoke-test/SKILL.md && grep -q 'name: smoke-test' smoke-test/SKILL.md && echo OK`
35
+ → verify: `grep -qi 'smoke.checks.yaml\|checklist\|expected_status\|content_signal' smoke-test/SKILL.md && echo OK`
36
+ → verify: `grep -ci 'pass\|fail\|summary\|report' smoke-test/SKILL.md | awk '{if($1>=2) print "OK"; else print "FAIL"}'`
37
+ → verify: `grep -q 'smoke-test' SKILL-INDEX.md && echo OK`
38
+
39
+ ---
40
+
41
+ ## Reference block 1
42
+
43
+ ```yaml
44
+ # smoke-checks.yaml — auto-loaded if present at project root
45
+ base_url: "https://example.com"
46
+ checks:
47
+ - name: "Homepage"
48
+ path: "/"
49
+ method: GET
50
+ expected_status: 200
51
+ content_signal: "bigpowers"
52
+ max_response_time_ms: 3000
53
+
54
+ - name: "API Health"
55
+ path: "/api/health"
56
+ method: GET
57
+ expected_status: 200
58
+ content_signal: "ok|healthy"
59
+
60
+ - name: "API Jogos"
61
+ path: "/api/jogos"
62
+ method: GET
63
+ expected_status: 200
64
+ content_signal: "jogos|games"
65
+
66
+ - name: "Not Found handling"
67
+ path: "/nonexistent"
68
+ method: GET
69
+ expected_status: 404
70
+ content_signal: "not found|404"
71
+ ```
72
+
73
+ ---
74
+
75
+ ## Reference block 2
76
+
77
+ ```bash
78
+ SMOKE_CHECKS_FILE="${SMOKE_CHECKS_FILE:-smoke-checks.yaml}"
79
+ BASE_URL="${DEPLOY_URL:-$BASE_URL}"
80
+
81
+ if [ -f "$SMOKE_CHECKS_FILE" ]; then
82
+ echo "Loaded smoke checks from $SMOKE_CHECKS_FILE"
83
+ elif [ -n "$BASE_URL" ]; then
84
+ echo "No smoke-checks.yaml found. Using single URL check against $BASE_URL"
85
+ else
86
+ echo "ERROR: No smoke-checks.yaml found and no DEPLOY_URL/BASE_URL set."
87
+ exit 1
88
+ fi
89
+ ```
90
+
91
+ ---
92
+
93
+ ## Reference block 3
94
+
95
+ ```bash
96
+ url="${BASE_URL}${path}"
97
+ start_time=$(python3 -c 'import time; print(int(time.time() * 1000))')
98
+
99
+ # Perform the HTTP request
100
+ response=$(curl -s -o /tmp/smoke_body.txt -w "%{http_code}" "$url")
101
+ response_time=$(( $(python3 -c 'import time; print(int(time.time() * 1000))') - start_time ))
102
+ status=$response
103
+ body=$(cat /tmp/smoke_body.txt)
104
+ ```
105
+
106
+ ---
107
+
108
+ ## Reference block 4
109
+
110
+ ```bash
111
+ checks_passed=0
112
+ checks_failed=0
113
+ failures=""
114
+
115
+ # Assert status code
116
+ if [ "$status" -ne "${expected_status:-200}" ]; then
117
+ echo " FAIL: expected status ${expected_status} but got $status"
118
+ checks_failed=$((checks_failed + 1))
119
+ failures="${failures} - $name: HTTP $status (expected ${expected_status})\n"
120
+ else
121
+ echo " PASS: HTTP $status"
122
+ fi
123
+
124
+ # Assert content signal
125
+ if [ -n "$content_signal" ]; then
126
+ if echo "$body" | grep -qiE "$content_signal"; then
127
+ echo " PASS: body contains \"$content_signal\""
128
+ else
129
+ echo " FAIL: body does not contain \"$content_signal\""
130
+ checks_failed=$((checks_failed + 1))
131
+ failures="${failures} - $name: missing content signal \"$content_signal\"\n"
132
+ fi
133
+ fi
134
+
135
+ # Assert response time
136
+ if [ -n "$max_response_time_ms" ] && [ "$response_time" -gt "$max_response_time_ms" ]; then
137
+ echo " FAIL: response time ${response_time}ms exceeds ${max_response_time_ms}ms"
138
+ checks_failed=$((checks_failed + 1))
139
+ failures="${failures} - $name: response time ${response_time}ms (max ${max_response_time_ms}ms)\n"
140
+ fi
141
+ ```
142
+
143
+ ---
144
+
145
+ ## Reference block 5
146
+
147
+ ```bash
148
+ total=$((checks_passed + checks_failed))
149
+ echo ""
150
+ echo "=== Smoke Test Summary ==="
151
+ echo "Total: $total | Passed: $checks_passed | Failed: $checks_failed"
152
+
153
+ if [ "$checks_failed" -gt 0 ]; then
154
+ echo ""
155
+ echo "Failures:"
156
+ echo -e "$failures"
157
+ exit 1
158
+ else
159
+ echo "All checks passed."
160
+ exit 0
161
+ fi
162
+ ```
@@ -21,35 +21,7 @@ Can be run standalone for quick health checks or chained as the final step of th
21
21
 
22
22
  Smoke checks are defined in `smoke-checks.yaml` at the project root:
23
23
 
24
- ```yaml
25
- # smoke-checks.yaml — auto-loaded if present at project root
26
- base_url: "https://example.com"
27
- checks:
28
- - name: "Homepage"
29
- path: "/"
30
- method: GET
31
- expected_status: 200
32
- content_signal: "bigpowers"
33
- max_response_time_ms: 3000
34
-
35
- - name: "API Health"
36
- path: "/api/health"
37
- method: GET
38
- expected_status: 200
39
- content_signal: "ok|healthy"
40
-
41
- - name: "API Jogos"
42
- path: "/api/jogos"
43
- method: GET
44
- expected_status: 200
45
- content_signal: "jogos|games"
46
-
47
- - name: "Not Found handling"
48
- path: "/nonexistent"
49
- method: GET
50
- expected_status: 404
51
- content_signal: "not found|404"
52
- ```
24
+ See [REFERENCE.md](REFERENCE.md)
53
25
 
54
26
  Checks can also be specified inline via environment variables or CLI arguments for ad-hoc use.
55
27
 
@@ -68,102 +40,21 @@ Checks can also be specified inline via environment variables or CLI arguments f
68
40
 
69
41
  ### 1. Load smoke checks
70
42
 
71
- ```bash
72
- SMOKE_CHECKS_FILE="${SMOKE_CHECKS_FILE:-smoke-checks.yaml}"
73
- BASE_URL="${DEPLOY_URL:-$BASE_URL}"
74
-
75
- if [ -f "$SMOKE_CHECKS_FILE" ]; then
76
- echo "Loaded smoke checks from $SMOKE_CHECKS_FILE"
77
- elif [ -n "$BASE_URL" ]; then
78
- echo "No smoke-checks.yaml found. Using single URL check against $BASE_URL"
79
- else
80
- echo "ERROR: No smoke-checks.yaml found and no DEPLOY_URL/BASE_URL set."
81
- exit 1
82
- fi
83
- ```
43
+ See [REFERENCE.md](REFERENCE.md)
84
44
 
85
45
  ### 2. Run each check
86
46
 
87
47
  For each check in the configuration, perform an HTTP request:
88
48
 
89
- ```bash
90
- url="${BASE_URL}${path}"
91
- start_time=$(python3 -c 'import time; print(int(time.time() * 1000))')
92
-
93
- # Perform the HTTP request
94
- response=$(curl -s -o /tmp/smoke_body.txt -w "%{http_code}" "$url")
95
- response_time=$(( $(python3 -c 'import time; print(int(time.time() * 1000))') - start_time ))
96
- status=$response
97
- body=$(cat /tmp/smoke_body.txt)
98
- ```
49
+ See [REFERENCE.md](REFERENCE.md)
99
50
 
100
51
  ### 3. Assert results
101
52
 
102
- ```bash
103
- checks_passed=0
104
- checks_failed=0
105
- failures=""
106
-
107
- # Assert status code
108
- if [ "$status" -ne "${expected_status:-200}" ]; then
109
- echo " FAIL: expected status ${expected_status} but got $status"
110
- checks_failed=$((checks_failed + 1))
111
- failures="${failures} - $name: HTTP $status (expected ${expected_status})\n"
112
- else
113
- echo " PASS: HTTP $status"
114
- fi
115
-
116
- # Assert content signal
117
- if [ -n "$content_signal" ]; then
118
- if echo "$body" | grep -qiE "$content_signal"; then
119
- echo " PASS: body contains \"$content_signal\""
120
- else
121
- echo " FAIL: body does not contain \"$content_signal\""
122
- checks_failed=$((checks_failed + 1))
123
- failures="${failures} - $name: missing content signal \"$content_signal\"\n"
124
- fi
125
- fi
126
-
127
- # Assert response time
128
- if [ -n "$max_response_time_ms" ] && [ "$response_time" -gt "$max_response_time_ms" ]; then
129
- echo " FAIL: response time ${response_time}ms exceeds ${max_response_time_ms}ms"
130
- checks_failed=$((checks_failed + 1))
131
- failures="${failures} - $name: response time ${response_time}ms (max ${max_response_time_ms}ms)\n"
132
- fi
133
- ```
53
+ See [REFERENCE.md](REFERENCE.md)
134
54
 
135
55
  ### 4. Generate report
136
56
 
137
- ```bash
138
- total=$((checks_passed + checks_failed))
139
- echo ""
140
- echo "=== Smoke Test Summary ==="
141
- echo "Total: $total | Passed: $checks_passed | Failed: $checks_failed"
142
-
143
- if [ "$checks_failed" -gt 0 ]; then
144
- echo ""
145
- echo "Failures:"
146
- echo -e "$failures"
147
- exit 1
148
- else
149
- echo "All checks passed."
150
- exit 0
151
- fi
152
- ```
153
-
154
- ## Runner script
155
-
156
- A ready-to-use runner is provided for standalone operation:
157
-
158
- ```bash
159
- bash scripts/run-smoke.sh [url] [smoke-checks-file]
160
- ```
161
-
162
- The runner:
163
- 1. Uses `$DEPLOY_URL`, `$SMOKE_CHECKS_FILE`, or CLI arguments
164
- 2. Runs all defined checks
165
- 3. Prints a pass/fail summary
166
- 4. Exits 0 on all pass, non-zero on any failure
57
+ See [REFERENCE.md](REFERENCE.md)
167
58
 
168
59
  ## Integration with deploy skill
169
60
 
@@ -173,19 +64,3 @@ The `deploy` skill references `smoke-test` as its final verification step:
173
64
  # In deploy workflow — after successful deploy
174
65
  DEPLOY_URL="$DEPLOY_URL" bash scripts/run-smoke.sh
175
66
  ```
176
-
177
- ## Configuration reference
178
-
179
- | Variable | Default | Description |
180
- |----------|---------|-------------|
181
- | `SMOKE_CHECKS_FILE` | `smoke-checks.yaml` | Path to smoke checks YAML |
182
- | `DEPLOY_URL` / `BASE_URL` | *(required)* | Base URL for all checks |
183
- | `SMOKE_TIMEOUT` | `30` | Per-check timeout (seconds) |
184
- | `SMOKE_RETRIES` | `0` | Number of retries on failure |
185
-
186
- ## Verification
187
-
188
- → verify: `test -f smoke-test/SKILL.md && grep -q 'name: smoke-test' smoke-test/SKILL.md && echo OK`
189
- → verify: `grep -qi 'smoke.checks.yaml\|checklist\|expected_status\|content_signal' smoke-test/SKILL.md && echo OK`
190
- → verify: `grep -ci 'pass\|fail\|summary\|report' smoke-test/SKILL.md | awk '{if($1>=2) print "OK"; else print "FAIL"}'`
191
- → verify: `grep -q 'smoke-test' SKILL-INDEX.md && echo OK`
@@ -8,7 +8,7 @@ description: One-time bootstrap that introduces the bigpowers skills system, the
8
8
  > **HARD GATE** — **HARD GATE** — This skill is the entry point. Do NOT skip it when onboarding new users or starting a new session. It establishes the bigpowers methodology, lifecycle phases, and conventions.
9
9
 
10
10
 
11
- Welcome to **bigpowers** — a lifecycle of **61** agent skills for production-ready, TDD-driven software by solo developers.
11
+ Welcome to **bigpowers** — a lifecycle of **70** agent skills for production-ready, TDD-driven software by solo developers.
12
12
 
13
13
  ## Install
14
14
 
@@ -99,7 +99,7 @@ Start the HTTP dashboard with `visual-dashboard` → `GET /api/status?projectDir
99
99
  - **Integrate:** team default is `gh pr` (team-pr); solo profile uses `land-branch.sh`. Never create GitHub issues from skills — use local Markdown files instead.
100
100
  - **One skill, one thing.** If you're unsure which skill to call, call `survey-context` — it reads your current state and recommends the next step.
101
101
  - **verify: every step.** Every epic task must have `verify: <runnable command>`. Evidence over claims.
102
- - **61 skills.** See `SKILL-INDEX.md`; find skills with `search-skills`.
102
+ - **70 skills.** See `SKILL-INDEX.md`; find skills with `search-skills`.
103
103
 
104
104
  ## After this
105
105
 
@@ -0,0 +1,183 @@
1
+ # Validate Contracts — Reference
2
+
3
+ ## Integration
4
+
5
+ - **Pre-deploy gate:** The `deploy` skill runs `validate-contracts` before smoke-test.
6
+ - **CI pipeline:** JSON Lines output is CI-friendly; pipe to `jq` for assertions.
7
+ - **Pre-migration:** Run `validate-contracts --shape` before consuming migration output.
8
+
9
+
10
+ ---
11
+
12
+ ## Configuration
13
+
14
+ | Variable | Default | Description |
15
+ |----------|---------|-------------|
16
+ | `CONTRACTS_DIR` | `specs/contracts/` | Directory containing contract YAML files |
17
+ | `VALIDATE_ALL` | `false` | If true, run all contracts in the directory |
18
+ | `STRICT_MODE` | `false` | Treat warnings as failures |
19
+ | `OUTPUT_FORMAT` | `text` | `text` or `json` |
20
+
21
+
22
+ ---
23
+
24
+ ## Verification
25
+
26
+ → verify: `test -f validate-contracts/SKILL.md && grep -q 'name: validate-contracts' validate-contracts/SKILL.md && echo OK`
27
+ → verify: `grep -qi 'specs/contracts\|JSON Schema\|key.set\|data.shape' validate-contracts/SKILL.md && echo OK`
28
+ → verify: `grep -ci 'divergence\|missing key\|type mismatch\|diff\|conforms\|column' validate-contracts/SKILL.md | awk '{if($1>=3) print "OK"; else print "FAIL"}'`
29
+ → verify: `grep -ci 'JSON Lines\|machine.parse\|CI\|deploy.*gate\|pre.deploy' validate-contracts/SKILL.md | awk '{if($1>=2) print "OK"; else print "FAIL"}'`
30
+ → verify: `grep -q 'validate-contracts' SKILL-INDEX.md && echo OK`
31
+
32
+ ---
33
+
34
+ ## Reference block 1
35
+
36
+ ```yaml
37
+ # specs/contracts/users.schema.yaml
38
+ endpoint: /api/users
39
+ method: GET
40
+ schema:
41
+ type: object
42
+ required: [id, name, email]
43
+ properties:
44
+ id: { type: number }
45
+ name: { type: string }
46
+ email: { type: string, format: email }
47
+ ```
48
+
49
+ ---
50
+
51
+ ## Reference block 2
52
+
53
+ ```yaml
54
+ # specs/contracts/migration-output.yaml
55
+ file: data/users-export.json
56
+ format: json
57
+ fields:
58
+ - name: user_id
59
+ type: number
60
+ required: true
61
+ - name: full_name
62
+ type: string
63
+ required: true
64
+ - name: created_at
65
+ type: string
66
+ format: date-time
67
+ required: false
68
+ ```
69
+
70
+ ---
71
+
72
+ ## Example 1
73
+
74
+ ```
75
+ specs/contracts/
76
+ ├── users.schema.yaml # API response schema
77
+ ├── i18n-keys.yaml # Key-set comparison
78
+ ├── migration-output.yaml # Data shape contract
79
+ └── README.md # Local conventions
80
+ ```
81
+
82
+ ---
83
+
84
+ ## Example 2
85
+
86
+ ```yaml
87
+ # specs/contracts/users.schema.yaml
88
+ endpoint: /api/users
89
+ method: GET
90
+ schema:
91
+ type: object
92
+ required: [id, name, email]
93
+ properties:
94
+ id: { type: number }
95
+ name: { type: string }
96
+ email: { type: string, format: email }
97
+ ```
98
+
99
+ ---
100
+
101
+ ## Example 3
102
+
103
+ ```yaml
104
+ # specs/contracts/i18n-keys.yaml
105
+ sources:
106
+ reference: src/frontend/locales/en.json
107
+ target: src/backend/messages/en.json
108
+ mode: subset # all target keys must exist in reference
109
+ ```
110
+
111
+ ---
112
+
113
+ ## Example 4
114
+
115
+ ```bash
116
+ validate-contracts --key-set specs/contracts/i18n-keys.yaml
117
+ # → missing: 2 keys in reference not found in target: ['settings.privacy', 'help.faq']
118
+ # → added: 1 key in target not in reference: ['deprecated.field']
119
+ # → exit 1 (divergence)
120
+ ```
121
+
122
+ ---
123
+
124
+ ## Example 5
125
+
126
+ ```yaml
127
+ # specs/contracts/migration-output.yaml
128
+ file: data/users-export.json
129
+ format: json
130
+ fields:
131
+ - name: user_id
132
+ type: number
133
+ required: true
134
+ - name: full_name
135
+ type: string
136
+ required: true
137
+ - name: created_at
138
+ type: string
139
+ format: date-time
140
+ required: false
141
+ ```
142
+
143
+ ---
144
+
145
+ ## Example 6
146
+
147
+ ```bash
148
+ validate-contracts --shape specs/contracts/migration-output.yaml
149
+ # → PASS: 3/3 fields validated, 5000 rows OK
150
+ # → WARN: field 'full_name' has 12 null values (0.24%)
151
+ # → FAIL: field 'user_id' has 3 rows with type string (expected number)
152
+ ```
153
+
154
+ ---
155
+
156
+ ## Integration
157
+
158
+ - **Pre-deploy gate:** The `deploy` skill runs `validate-contracts` before smoke-test.
159
+ - **CI pipeline:** JSON Lines output is CI-friendly; pipe to `jq` for assertions.
160
+ - **Pre-migration:** Run `validate-contracts --shape` before consuming migration output.
161
+
162
+
163
+ ---
164
+
165
+ ## Configuration
166
+
167
+ | Variable | Default | Description |
168
+ |----------|---------|-------------|
169
+ | `CONTRACTS_DIR` | `specs/contracts/` | Directory containing contract YAML files |
170
+ | `VALIDATE_ALL` | `false` | If true, run all contracts in the directory |
171
+ | `STRICT_MODE` | `false` | Treat warnings as failures |
172
+ | `OUTPUT_FORMAT` | `text` | `text` or `json` |
173
+
174
+
175
+ ---
176
+
177
+ ## Verification
178
+
179
+ → verify: `test -f validate-contracts/SKILL.md && grep -q 'name: validate-contracts' validate-contracts/SKILL.md && echo OK`
180
+ → verify: `grep -qi 'specs/contracts\|JSON Schema\|key.set\|data.shape' validate-contracts/SKILL.md && echo OK`
181
+ → verify: `grep -ci 'divergence\|missing key\|type mismatch\|diff\|conforms\|column' validate-contracts/SKILL.md | awk '{if($1>=3) print "OK"; else print "FAIL"}'`
182
+ → verify: `grep -ci 'JSON Lines\|machine.parse\|CI\|deploy.*gate\|pre.deploy' validate-contracts/SKILL.md | awk '{if($1>=2) print "OK"; else print "FAIL"}'`
183
+ → verify: `grep -q 'validate-contracts' SKILL-INDEX.md && echo OK`