Thanks for your interest in contributing to YTKit! This guide will help you get started.
- Fork the repository
- Clone your fork locally
- Use Node 22+ (
.nvmrcis included fornvm use) - Run
npm ci - If you are testing the userscript build, install Tampermonkey (Chrome) or Violentmonkey (Firefox)
Astra-Deck/
extension/ # MV3 extension source
core/ # Shared runtime utilities
ytkit.js # Main feature/content-script runtime
ytkit-main.js # MAIN-world bridge
background.js # Service worker
options.* # Options UI
popup.* # Toolbar popup UI
build-extension.js # Canonical packager for Chrome/Firefox/userscript artifacts
tests/ # Focused Node-based verification
YTKit.user.js # Repo-tracked userscript source
CHANGELOG.md # Public version history
CODEX-CHANGELOG.md # Agent repair ledger / handoff trail
The repo now ships both an MV3 extension and a userscript build. Most feature logic lives in extension/ytkit.js and follows the feature object pattern:
{
id: 'featureName',
name: 'Human Readable Name',
description: 'What this feature does',
group: 'Category', // Appearance, Playback, Interface, etc.
icon: 'lucide-icon-name',
init() { /* activate */ },
destroy() { /* clean up */ }
}- CSS-only features: Use
cssFeature()factory - DOM observation: Use
addMutationRule()/removeMutationRule() - SPA navigation: Use
addNavigateRule()/removeNavigateRule() - Settings storage: Use
StorageManager.get()/StorageManager.set() - Extension packaging: Use
build-extension.jsrather than ad-hoc zipping - Generated catalogs:
default-settings.jsonandsettings-meta.jsonare generated fromytkit.js
- Define your feature object in the
featuresarray inextension/ytkit.js - Add a default value in
settingsManager.defaults - Implement
init()to activate anddestroy()to fully clean up - Always remove event listeners, observers, and DOM elements in
destroy() - Test with the feature toggled on/off multiple times
Run these before sending changes:
npm test
npm run check
npm run build- Avoid new dependencies unless they solve a clear, high-value problem
- Use
cachedQuery()for frequently accessed DOM elements - Use
DebugManager.log()for debug output - Always clean up in
destroy()-- no leaked listeners or DOM nodes - Follow existing indentation (4 spaces)
- Create a feature branch:
git checkout -b feature/my-feature - Make your changes
- Run
npm test,npm run check, andnpm run build - Test thoroughly on YouTube (watch page, home, search, channels)
- Commit with a clear message
- Push and open a Pull Request
Use the Bug Report template and include:
- Browser + version
- Userscript manager + version
- YTKit version
- Steps to reproduce
- Console errors (F12 > Console)
By contributing, you agree that your contributions will be licensed under the MIT License.