11# Scripts Documentation
22
3- This directory contains utility scripts for managing and validating the AI Coding Stack project. Scripts are organized into three categories:
3+ This directory contains utility scripts for managing and validating the AI Coding Stack project. Scripts are organized into four categories:
44
55- ** ` generate/ ` ** - Generation scripts that create derived files
66- ** ` refactor/ ` ** - Refactoring scripts that reorganize or reformat data
77- ** ` fetch/ ` ** - Data fetching scripts that retrieve external data
8+ - ** ` validate/ ` ** - URL validation scripts that check website accessibility
89
910## Directory Structure
1011
@@ -21,7 +22,15 @@ scripts/
2122│ └── export-vendors.mjs
2223├── fetch/
2324│ ├── index.mjs # Entry point for all fetch scripts
24- │ └── fetch-github-stars.mjs
25+ │ ├── fetch-github-stars.mjs
26+ │ └── compare-models.mjs
27+ ├── validate/
28+ │ ├── visit-all-urls.mjs
29+ │ ├── visit-urls-en-static-all-slugs.mjs
30+ │ ├── visit-urls-en-static-one-slug.mjs
31+ │ ├── visit-urls-all-locales-static-all-slugs.mjs
32+ │ ├── visit-urls-all-locales-static-one-slug.mjs
33+ │ └── lib/ # Shared validation utilities
2534├── _shared/
2635│ └── runner.mjs # Shared script runner for entry points
2736└── temp/ # Temporary experimental scripts
@@ -45,6 +54,9 @@ npm run refactor
4554
4655# Run all fetch scripts
4756npm run fetch
57+
58+ # Run all validation scripts (manual execution)
59+ node scripts/validate/visit-all-urls.mjs
4860```
4961
5062### Running Individual Scripts
@@ -61,6 +73,11 @@ npm run refactor:sort-fields
6173
6274# Fetch scripts
6375npm run fetch:github-stars
76+
77+ # Validation scripts (run directly with node)
78+ node scripts/validate/visit-all-urls.mjs
79+ node scripts/validate/visit-urls-en-static-all-slugs.mjs
80+ node scripts/validate/visit-urls-all-locales-static-all-slugs.mjs
6481```
6582
6683Or directly using Node:
@@ -69,11 +86,17 @@ Or directly using Node:
6986# Run generation/fetch scripts
7087node scripts/generate/index.mjs metadata
7188node scripts/fetch/index.mjs github-stars
89+ node scripts/fetch/index.mjs compare-models
7290
7391# Run specific refactor scripts
7492node scripts/refactor/index.mjs sort-manifest-fields
7593node scripts/refactor/index.mjs sort-locales-fields
7694node scripts/refactor/index.mjs export-vendors
95+
96+ # Run validation scripts
97+ node scripts/validate/visit-all-urls.mjs
98+ node scripts/validate/visit-urls-en-static-all-slugs.mjs
99+ node scripts/validate/visit-urls-all-locales-static-all-slugs.mjs
77100```
78101
79102## Validation (Test-based)
@@ -242,6 +265,30 @@ node scripts/fetch/index.mjs github-stars
242265
243266** Note:** Without a GitHub token, you may hit rate limits (60 requests/hour).
244267
268+ ### compare-models.mjs
269+
270+ Compares model manifest data with API reference data to identify mismatches.
271+
272+ ``` bash
273+ node scripts/fetch/index.mjs compare-models
274+ # or
275+ node scripts/fetch/compare-models.mjs
276+ ```
277+
278+ ** What it does:**
279+ - Reads model manifests from ` manifests/models/ `
280+ - Compares with API reference data from ` tmp/models-dev-api.json `
281+ - Uses mapping from ` manifests/mapping.json ` to match vendors and models
282+ - Reports matched models, mismatched fields, and unmatched models
283+
284+ ** Output:**
285+ - Perfectly matched models (all fields match)
286+ - Matched models with field mismatches
287+ - Matched models with skipped fields (null in manifest)
288+ - Unmatched models (not found in API)
289+
290+ ** Note:** This script requires ` tmp/models-dev-api.json ` to be present. It's used for data validation and synchronization.
291+
245292## Additional Tools
246293
247294### Benchmark Fetcher
@@ -259,6 +306,87 @@ node .claude/skills/benchmark-fetcher/scripts/fetch-benchmarks.mjs
259306
260307For full documentation, see ` .claude/skills/benchmark-fetcher/SKILL.md `
261308
309+ ## URL Validation Scripts
310+
311+ The ` validate/ ` directory contains scripts for checking website URL accessibility. These scripts visit URLs and verify they return successful HTTP responses.
312+
313+ ### visit-all-urls.mjs
314+
315+ Visits all URLs on the website (all locales, all static pages, all slugs).
316+
317+ ``` bash
318+ node scripts/validate/visit-all-urls.mjs
319+ ```
320+
321+ ** What it does:**
322+ - Builds a comprehensive list of all website URLs
323+ - Visits each URL with HTTP HEAD requests
324+ - Reports success/failure status for each URL
325+ - Supports retries and timeout handling
326+
327+ ** Environment variables:**
328+ - ` BASE_URL ` - Base URL to test (default: ` http://localhost:3000 ` )
329+
330+ ### visit-urls-en-static-all-slugs.mjs
331+
332+ Visits URLs with specific configuration: English locale only, all static pages, all slugs per route type.
333+
334+ ``` bash
335+ node scripts/validate/visit-urls-en-static-all-slugs.mjs
336+ ```
337+
338+ ** Configuration:**
339+ - Locales: English only
340+ - Static pages: All
341+ - Dynamic routes: All slugs for each route type
342+
343+ ### visit-urls-en-static-one-slug.mjs
344+
345+ Visits URLs with specific configuration: English locale only, all static pages, one slug per route type.
346+
347+ ``` bash
348+ node scripts/validate/visit-urls-en-static-one-slug.mjs
349+ ```
350+
351+ ** Configuration:**
352+ - Locales: English only
353+ - Static pages: All
354+ - Dynamic routes: One slug per route type (for faster testing)
355+
356+ ### visit-urls-all-locales-static-all-slugs.mjs
357+
358+ Visits URLs with specific configuration: All locales, all static pages, all slugs per route type.
359+
360+ ``` bash
361+ node scripts/validate/visit-urls-all-locales-static-all-slugs.mjs
362+ ```
363+
364+ ** Configuration:**
365+ - Locales: All configured locales
366+ - Static pages: All
367+ - Dynamic routes: All slugs for each route type
368+
369+ ### visit-urls-all-locales-static-one-slug.mjs
370+
371+ Visits URLs with specific configuration: All locales, all static pages, one slug per route type.
372+
373+ ``` bash
374+ node scripts/validate/visit-urls-all-locales-static-one-slug.mjs
375+ ```
376+
377+ ** Configuration:**
378+ - Locales: All configured locales
379+ - Static pages: All
380+ - Dynamic routes: One slug per route type (for faster testing)
381+
382+ ** Common features:**
383+ - Concurrent requests (default: 5 concurrent)
384+ - Request timeout (default: 10 seconds)
385+ - Automatic retries (default: 2 retries)
386+ - Summary statistics
387+
388+ ** Note:** These scripts make HTTP requests and require the website to be running. They are useful for pre-deployment validation and CI/CD pipelines.
389+
262390## Build Process
263391
264392The build process runs validation tests and generation scripts automatically:
@@ -302,6 +430,9 @@ npm run refactor
302430
303431# Run all fetch scripts (if needed)
304432npm run fetch
433+
434+ # Run URL validation scripts (if needed)
435+ node scripts/validate/visit-all-urls.mjs
305436```
306437
307438Or run individual checks as needed:
@@ -313,6 +444,8 @@ npm run generate:metadata
313444npm run refactor:sort-fields
314445npm run refactor:sort-locales-fields
315446npm run fetch:github-stars
447+ node scripts/fetch/index.mjs compare-models
448+ node scripts/validate/visit-all-urls.mjs
316449```
317450
318451## Manual Execution
0 commit comments