chore(root): streamline agent guidance and skills

This commit is contained in:
Rahim
2026-07-14 15:49:05 -07:00
parent a9a09a7e52
commit b66b1ebf23
190 changed files with 1560 additions and 18335 deletions
+31
View File
@@ -0,0 +1,31 @@
---
name: commit-pr
description: Commit, push, and create or update a Video.js pull request. Use when the user explicitly requests repository publication or PR preparation.
---
# Commit and pull request
Preserve unrelated user changes. Do not stage or rewrite files you cannot attribute to the requested work.
## Workflow
1. Inspect `git status`, staged and unstaged diffs, branch name, and commits since the merge base.
2. Read the relevant reference only when needed:
- Commit wording: `references/commit.md`
- Scope selection: `references/scope.md`
- Branch naming: `references/branch.md`
- PR title/body: `references/pr.md`
3. Split changes into semantic commits when they represent independently reviewable purposes. Never use `git add .`; stage explicit paths or a reviewed set.
4. Run the checks appropriate to each commit before committing.
5. Use a conventional commit accepted by `commitlint.config.js`; treat that config and recent history as the current source of truth.
6. Push only when requested. Check for an existing PR before creating one.
7. Build the PR description from the complete branch diff, not only the last commit. Explain motivation, behavior, verification, and relevant issue links.
8. Report commit hashes, checks, and the PR URL.
Do not amend, force-push, change an existing PR title, or update an existing PR body without clear user authorization.
## Example
Input: “Commit these skill changes and open a draft PR.”
Output: Intentionally scoped commits, recorded checks, a pushed branch, and the draft PR URL.
+55
View File
@@ -0,0 +1,55 @@
# Branch Naming
Conventions for naming feature and fix branches.
## Format
```
type/short-description
```
- **type**: Same as commit type (`feat`, `fix`, `chore`, etc.)
- **short-description**: Kebab-case summary (2-4 words)
## Examples
| Branch | Purpose |
| --------------------------- | -------------------------------- |
| `feat/volume-slider` | New volume slider component |
| `feat/media-queries` | Add media query support |
| `fix/slider-drag-edge` | Fix edge case in slider dragging |
| `fix/state-sync-race` | Fix race condition in state sync |
| `refactor/store-cleanup` | Clean up store internals |
| `chore/bump-deps` | Dependency updates |
| `docs/readme-examples` | Update README examples |
| `test/slider-keyboard` | Add keyboard tests for slider |
| `rfc/request-api` | RFC for new request API design |
| `design/slice-store` | Design doc for slice/store arch |
| `plan/store-simplification` | Planning store architecture |
## Guidelines
1. **Keep it short** — branch names appear in many places
2. **Be descriptive** — should hint at the change
3. **Use kebab-case** — lowercase with hyphens
4. **Match commit type** — branch type should match eventual commit type
## Special Branches
| Branch | Purpose |
| ---------- | ---------------------------------- |
| `main` | Primary branch |
| `rfc/*` | Request for comments / proposals |
| `design/*` | Design docs (decisions you own) |
| `plan/*` | Planning and discovery work |
## Issue-Linked Branches
When working on a specific issue, you may include the issue number:
```
feat/42-volume-slider
fix/89-race-condition
```
This is optional but helps traceability.
+62
View File
@@ -0,0 +1,62 @@
# Commit Messages
Follow [Conventional Commits](https://www.conventionalcommits.org/) enforced by commitlint.
## Format
```
type(scope): lowercase description
```
- **type**: Category of change (required)
- **scope**: Package or area affected (required)
- **description**: Short summary in lowercase (required)
## Types
| Type | Use for |
| ---------- | -------------------------------------------- |
| `feat` | New feature |
| `fix` | Bug fix |
| `chore` | Maintenance (deps, configs, no prod changes) |
| `docs` | Documentation only |
| `refactor` | Code change that doesn't fix or add features |
| `perf` | Performance improvement |
| `test` | Adding or updating tests |
| `ci` | CI/CD changes |
| `build` | Build system changes |
| `style` | Code style (formatting, semicolons, etc.) |
## Breaking Changes
Use `!` suffix on type for breaking changes:
```
feat(core)!: remove deprecated API
refactor(store)!: rename feature methods
```
The `!` signals breaking changes in the changelog.
## Examples
```
feat(html): add volume slider component
fix(store): prevent race condition in state sync
chore(root): bump vitest to v3
docs(core): document request lifecycle
refactor(utils): simplify event listener cleanup
test(html): add slider interaction tests
```
## WIP Commits
Commits starting with `wip` (case-insensitive) bypass commitlint validation. Use sparingly for work-in-progress that will be squashed.
## No Co-Author Trailers
Do NOT add `Co-Authored-By` trailers to commit messages. The commit author is sufficient attribution.
## Authoritative Source
See `commitlint.config.js` for the enforced scope list.
+113
View File
@@ -0,0 +1,113 @@
# Pull Requests
Conventions for PR titles and descriptions.
## PR Title
Same as commit message format:
```
type(scope): lowercase description
```
**Exceptions:**
| Prefix | Use for |
| ------------ | ------------------------------------ |
| `[RFC]` | Request for comments / proposals |
| `Discovery:` | Exploration / research / prototyping |
**Note:** RFC PRs use `[RFC] Title` format while open. When merged, the squash commit uses `docs(rfc): title`.
## PR Body Template
```markdown
Refs #123
Closes #456
## Summary
[1-3 sentences: what changed and why]
## Changes
[Bullet points of meaningful changes — describe behavior, NOT file list]
<details>
<summary>Implementation details</summary>
[Only if complex: architecture decisions, tradeoffs, notable patterns]
</details>
## Testing
[How to verify: manual steps, test commands, or "covered by existing tests"]
```
## Issue Linking
| Keyword | Effect |
| -------- | ----------------------------------- |
| `Refs` | Links to related issue (stays open) |
| `Closes` | Closes issue when PR merges |
| `Fixes` | Closes issue when PR merges |
Place issue references at the top of the body, before Summary.
## Description Principles
1. **Progressive disclosure** — summary visible, details collapsed
2. **Why over what** — explain motivation, not mechanics
3. **Human-readable** — no file lists or auto-generated noise
4. **Concise** — reviewers should understand in 30 seconds
## What NOT to Include
- File lists (reviewers see the diff)
- Auto-generated changelogs
- Excessive implementation details (use `<details>` if needed)
- Screenshots unless UI change (prefer before/after if included)
## Examples
### Feature PR
```markdown
Closes #42
## Summary
Add volume slider component with keyboard support and ARIA labels.
## Changes
- Volume slider with drag and click interactions
- Keyboard control: arrow keys adjust by 5%, Page Up/Down by 10%
- Muted state toggle via slider or M key
- ARIA: `slider` role with proper labeling
## Testing
1. `pnpm -F @videojs/html test`
2. Manual: drag slider, use keyboard, verify screen reader announces changes
```
### Bug Fix PR
```markdown
Fixes #89
## Summary
Fix race condition where rapid play/pause could leave player in inconsistent state.
## Changes
- Add guard to debounce rapid play/pause calls
- Prevent redundant state transitions
## Testing
Covered by new test in `media-feature.test.ts`. Manual: rapidly click play/pause.
```
+62
View File
@@ -0,0 +1,62 @@
# Scope Inference
Infer commit scope from changed file paths.
## Path to Scope Mapping
| Path | Scope |
| ------------------------ | -------------- |
| `packages/core/` | `core` |
| `packages/store/` | `store` |
| `packages/utils/` | `utils` |
| `packages/html/` | `html` |
| `packages/react/` | `react` |
| `packages/react-native/` | `react-native` |
| `packages/icons/` | `icons` |
| `site/` | `site` |
| `rfc/` | `rfc` |
| `internal/design/` | `design` |
| `.claude/` | `claude` |
| `.github/workflows/` | `ci` |
| `.github/` | `cd` |
| Root config files | `root` |
## Multiple Packages
When changes span multiple packages:
1. **Single primary package**: Use that package's scope
2. **Related packages**: Use the most significant one
3. **Broad changes**: Use `packages` scope
## Allowed Scopes
From `commitlint.config.js`:
```
cd, ci, claude, core, design, docs, html, icons, packages,
plan, react-native, react, rfc, root, site, store,
test, utils
```
## Examples
```bash
# Single package
packages/store/src/feature.ts → store
# Multiple files in same package
packages/html/src/slider.ts
packages/html/src/button.ts → html
# Cross-package refactor
packages/store/src/slice.ts
packages/core/src/media.ts → packages (or primary one)
# Root configs
tsconfig.json
package.json → root
# CI changes
.github/workflows/test.yml → ci
```