Back to list
videojs

api

by videojs

Technical preview of Video.js v10 - open source media player framework for Web and React.

108🍴 5📅 Jan 23, 2026

SKILL.md


name: api description: >- API design and developer experience for TypeScript libraries. Use when designing APIs, reviewing architecture, evaluating DX, or checking ergonomics. Covers extensibility, progressive disclosure, type inference, state patterns, and composition. For review, load review/workflow.md. Triggers: "design API", "review API", "check DX", "is this ergonomic", "review architecture", "middleware design", "how does this feel".

API Design & Developer Experience

Principles for designing TypeScript library APIs and evaluating developer experience.

Goal: APIs should feel obvious, fast, safe, and composable — with great defaults and great escape hatches.

Quick Reference

Foundational

  • Emergent extensibility — Best extension points look like well-designed APIs, not plugin systems
  • Composition over configurationdevtools(persist(fn)) beats { middlewares: [] }
  • Onion model — Transformative middleware innermost, observational outermost

API Surface

  • Config objects for 3+ parameters (no overloads)
  • Flat returns for independent values, namespaced for cohesive units
  • Rule of two — Tuples for 2 values, objects for 3+
  • Inference over annotation — If users annotate, types aren't flowing

Progressive Disclosure

  • Complexity grows with use case — Zero-config → Options → Composition → Headless → Core
  • Escape hatches compose — Don't require reimplementing defaults
  • Explicit contracts — Render props over implicit requirements

Developer Experience

  • Time-to-first-success — Minimize time from install to working code
  • Cognitive load — Fewer concepts > fewer keystrokes
  • Predictable outcomes — Match user mental models
  • Editor ergonomics — TypeScript inference should just work

Conflict Resolution

When principles conflict, prioritize:

  1. Correctness — wrong behavior > verbose API
  2. Type Safety — inference failures > extra generics
  3. Simplicity — fewer concepts > fewer keystrokes
  4. Consistency — match existing codebase patterns
  5. Bundle Size — tree-shaking matters, but not at DX cost

Anti-Patterns

Anti-PatternWhy It Fails
Function overloadsPoor errors, autocomplete confusion
Runtime plugin registrationLoses type safety, implicit ordering
Positional parameters (3+)Order confusion, breaking changes
Implicit contractsSilent breakage when requirements unmet
Per-module middlewareUnexpected interactions
Shotgun parsingValidation scattered, not at boundaries
Boolean trapsfn(true, false) — what do these mean?
Multiple competing APIsConfusing — which method to use?

Reference Files

FileContents
references/principles.mdCore design and DX principles
references/typescript.mdType inference patterns (author + consumer)
references/state.mdState management patterns and architecture
references/extensibility.mdPipelines, builders, adapters, lifecycles
references/anti-patterns.mdCommon mistakes to avoid
references/libraries.mdReference libraries and their patterns
references/voices.mdPractitioner heuristics and reference URLs

Loading by Domain

DomainLoad
General API workprinciples.md
TypeScript/typestypescript.md
State managementstate.md
Middleware/pluginsextensibility.md
Avoiding mistakesanti-patterns.md
Library comparisonslibraries.md, voices.md

Review

For reviewing APIs and architecture, load review/workflow.md.

FileContents
review/workflow.mdReview process and checklists
review/agents.mdSub-agent prompts
review/templates.mdIssue format, report template
review/checklist.mdQuick single-agent checklist
review/example.mdComplete example review
NeedUse
Building UI componentscomponent skill
Accessibility patternsaria skill
Documentationdocs skill

Score

Total Score

65/100

Based on repository quality metrics

SKILL.md

SKILL.mdファイルが含まれている

+20
LICENSE

ライセンスが設定されている

+10
説明文

100文字以上の説明がある

0/10
人気

GitHub Stars 100以上

+5
最近の活動

3ヶ月以内に更新がある

0/10
フォーク

10回以上フォークされている

0/5
Issue管理

オープンIssueが50未満

+5
言語

プログラミング言語が設定されている

+5
タグ

1つ以上のタグが設定されている

0/5

Reviews

💬

Reviews coming soon