Public
Like
3
claude-plugins-registry
Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data – all from the browser, and deployed in milliseconds.
Viewing readonly version of main branch: v610View latest version
Consolidates three separate cron jobs into one efficient skill-health.ts job:
| Old Job | Purpose | Status |
|---|---|---|
refresh-skills.ts | Marks deleted skills | DEPRECATED - merged into skill-health |
deduplicate.ts | Re-hashes and marks duplicates | DEPRECATED - trust indexer's hash |
track-change-history.ts | Backfills firstCommitAt | DEPRECATED - merged into skill-health |
- Only checks originals (non-duplicate skills) - ~47K instead of ~94K
- Checks if skill still exists via HEAD request
- When original is deleted, promotes oldest duplicate to become new original
- Backfills
firstCommitAtif missing - Tracks
lastCheckedAtto skip recently-checked skills
- Added to
skillstable - Indexed for efficient queries
- Run migration before deploying:
database/run-migrations.ts
- Only processes skills not checked in last 24 hours
- Orders by oldest-checked-first
- 500 skills per run
| Metric | Before | After |
|---|---|---|
| GitHub API calls/cycle | ~280K (3 jobs × 94K) | ~47K |
| Jobs to maintain | 4 | 2 (indexer + health) |
| Duplicate re-validation | Every cycle | Never |
- Run migration:
database/run-migrations.ts - Deploy
skill-health.ts - Set interval (recommended: every 15 minutes)
- Monitor for 24-48 hours
- Disable old jobs:
cron/refresh-skills.tscron/deduplicate.tscron/track-change-history.ts
When an original skill is deleted:
Original (deleted) ──┬── Duplicate A (firstCommit: Jan 5) ← promoted to original
├── Duplicate B (firstCommit: Jan 8) ← stays duplicate of A
└── Duplicate C (firstCommit: Jan 10) ← stays duplicate of A
The oldest duplicate by firstCommitAt becomes the new original. Other duplicates remain duplicates (now of the promoted skill).
-
Content change detection: Currently we don't detect if skill content changed. Could add
If-Modified-Sinceheaders to detect updates. -
Duplicate chain cleanup: When original is deleted and promoted, the "duplicate of" relationship isn't explicitly stored. All duplicates with same
contentHashare treated as peers. -
Verified skill priority: Could prioritize verified skills when promoting instead of oldest.