Skip to content

Unit tests for lib/skills.ts and lib/clawhub.ts (SOL-7)#11

Open
VisionaireLabs wants to merge 1 commit into
masterfrom
agent/engineer/4066c314
Open

Unit tests for lib/skills.ts and lib/clawhub.ts (SOL-7)#11
VisionaireLabs wants to merge 1 commit into
masterfrom
agent/engineer/4066c314

Conversation

@VisionaireLabs

Copy link
Copy Markdown
Collaborator

What

Adds unit-test coverage for the skills catalog data layer, plus a zero-dependency test harness.

Test harness

  • npm test runs Node's native test runner (node --test) over test/**/*.test.ts.
  • No new dependencies — relies on Node's built-in TypeScript type-stripping. A 15-line resolve hook (test/resolve-ts.mjs) maps the lib sources' extensionless relative imports to .ts.

Coverage (30 tests)

Catalog parsing — combined catalog and the ClawHub set load and each record is well-formed: required string fields present, slugs and ids unique, platforms/categories non-empty, dates parse.

Count derivationSTATS.totalSkills equals catalog length; originals + listings partition exactly; indexedInstalls equals the real sum of skills.sh telemetry only; CATEGORIES is the deduped, sorted union; getSkillBySlug round-trips; getFeaturedSkills matches.

Schema integritykind / license / status / provenance validated against the type system's label maps; originals are first-party, listings are not; ClawHub entries are indexed + external with clawhub: source attribution and never claim Solid State authorship.

No fabricated installs — any non-zero install/star count must carry a valid fetchedAt timestamp; first-party originals carry no install count.

Incidental

  • Three type-only imports switched to import type (required for Node type-stripping; also recommended under isolatedModules).
  • test/ excluded from the app tsconfig and ESLint surface so the build/lint surface is unchanged.

All 30 tests pass locally.

🤖 Generated with Claude Code

Zero-dependency test harness using Node's native test runner and
TypeScript type-stripping (node --test). A tiny resolve hook
(test/resolve-ts.mjs) handles the lib/ sources' extensionless imports.

Coverage:
- Catalog parsing: combined catalog + ClawHub set load and every record
  is well-formed (required fields, unique slugs/ids, valid dates).
- Count derivation: STATS.totalSkills/originals/listings partition,
  indexedInstalls = real sum of skills.sh telemetry, CATEGORIES is the
  deduped sorted union, getSkillBySlug/getFeatured consistency.
- Schema integrity: kind/license/status/provenance against the type
  system; originals are first-party, listings are not; ClawHub source
  attribution; no fabricated installs (any count must carry a fetchedAt
  and first-party originals carry none).

Also switches three type-only imports to `import type` (required for
Node's type-stripping and recommended under isolatedModules), excludes
test/ from the app tsconfig and ESLint surface.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-authored-by: multica-agent <github@multica.ai>
@vercel

vercel Bot commented Jun 3, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
solidstate.cc Error Error Jun 3, 2026 10:28pm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant