Back to Bilibili Evolved

Bilibili Evolved Dev Server

.agents/skills/bilibili-evolved-dev-server/SKILL.md

2.11.03.4 KB
Original Source

Bilibili Evolved Dev Server

Core Model

  • Read AGENTS.md and CONTRIBUTING.md before making repo changes.
  • Use PowerShell syntax on Windows.
  • Use pnpm; do not use npm.
  • Start the local dev server with:
powershell
pnpm tsx dev-tools/dev-server/index.ts
  • HTTP serves static resources only, but requesting /registry/dist/components/<id>.js or /registry/dist/plugins/<id>.js may trigger build-on-request before serving the file.
  • WebSocket is the control plane for explicit commands such as build, watch, stop, create, and session query.
  • dist/, registry/dist/, and generated feature docs are not normal development changes.

Feature Commands

Use these commands when the dev server is already running:

powershell
pnpm tsx dev-tools/dev-server/command.ts sessions
pnpm tsx dev-tools/dev-server/command.ts build component style/hide/banner
pnpm tsx dev-tools/dev-server/command.ts build plugin video/player/speed
pnpm tsx dev-tools/dev-server/command.ts watch component style/hide/banner
pnpm tsx dev-tools/dev-server/command.ts stop component style/hide/banner
  • build compiles one feature once without creating a watcher.
  • watch starts or reuses one feature watcher.
  • stop stops one watcher.
  • sessions prints active watched feature paths.
  • Prefer these commands over full registry builds when validating one component or plugin.

Creating Features

Create new registry component/plugin scaffolds through the dev server command:

powershell
pnpm tsx dev-tools/dev-server/command.ts create component style/my-feature myFeature "My Feature" "Author Name" "https://example.com" "Feature description."
pnpm tsx dev-tools/dev-server/command.ts create plugin video/player/my-plugin myPlugin "My Plugin" "Author Name" "https://example.com" "Plugin description."

After creation, inspect and edit the generated index.ts and index.md. Keep component/plugin names specific and camelCase, include author metadata for contributor-created features, and keep descriptions in index.md.

DevClient

  • DevClient connects to ws://localhost:<port>.
  • Starting debug from the settings panel rewrites the feature update URL to the local /registry/dist/... URL and relies on HTTP build-on-request.
  • Stopping debug, losing the dev server, or seeing a feature session disappear should restore the original update URL.
  • If debugging state looks wrong, query sessions first, then inspect DevClient devRecords and auto-update URLs.

Browser Checks

  • Bilibili Evolved depends on a userscript manager extension such as Tampermonkey. The built-in browser and Playwright do not provide that extension environment and are not reliable for runtime behavior checks.
  • If real browser validation is useful and available, try controlling the user's Chrome browser because it can use the installed userscript manager, extension permissions, login state, and real Bilibili pages.
  • Browser validation is optional for this skill. If Chrome, the userscript manager, account state, or the target page is unavailable, continue the dev server workflow and report that browser validation was not performed.

Validation

  • For TypeScript changes, run pnpm run type.
  • For lint-sensitive changes, run pnpm run lint-check.
  • For core userscript changes, run pnpm run build-core.
  • For registry-wide confidence, run pnpm run build-features.
  • For one feature, prefer pnpm tsx dev-tools/dev-server/command.ts build <component|plugin> <id> while the dev server is running.