Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions .agents/repo/commands.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# ref-0/plugins's commands

What the shared skills read for how to check and test `ref-0/plugins`. Run everything from the root.

## Install

pnpm runs the root, `pnpm install --frozen-lockfile`, which installs the commit-msg and pre-push hooks. The commit-msg hook checks the subject, as [`commits.md`](commits.md) says.

## Pre-push set

None: ref0 writes this repo's files, and ref0's pre-push set checks what writes them. Change them in ref0, not here. The pre-push hook runs only its guard, which refuses a force-push or delete of `main`, `deploy/*` or `release/*`. There's no pre-commit hook: a format pass would drift from ref0's generator.

1. Format and lint: none.
2. Types: none.
3. Type coverage: none.
4. Docs budget: none.
5. The changed tests: none.
6. Lint and size tests: none.
18 changes: 18 additions & 0 deletions .agents/repo/commits.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# ref-0/plugins's commit messages

Every commit on a branch, and every pull request's title, starts `type(scope): subject`, or `type: subject` for a change across the repo. A merge to main takes its pull request's title as its subject, so main reads the same way. `@ref0/workspace`'s README holds the rule and the types; the root `package.json`'s `"ref0-workspace"."commitScopes"` names the scopes.

| Scope | Names |
| ------------- | ------------------------------------------------- |
| `ref0` | `ref0/`, the plugin, and a release that writes it |
| `antigravity` | `antigravity/` |

ref0's release writes most commits here, pushing to main with no pull request. Its subject is `chore(ref0): release <version>`, which ref-0/ref0's `.github/workflows/release.yml` writes.

## Where it's checked

| Where | How |
| ----------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Each commit | `.vite-hooks/commit-msg` runs `ref0-workspace commit-message` on the message. The root `prepare` script installs it, as `pnpm install` runs it. git's own merge, autosquash and revert subjects pass. |
| Each pull request | `.github/workflows/title.yml` runs `ref0-workspace commit-message --title` on the title, on `opened`, `edited`, `synchronize` and `reopened`. A title takes none of git's own subjects. |
| Each release | Nothing here: ref0's release pushes without a pull request or this repo's hooks. ref-0/ref0's release step writes the subject. |
42 changes: 42 additions & 0 deletions .github/workflows/title.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Title

# The pull request's title in the format .agents/repo/commits.md says, since a merge takes it as
# main's subject. The only workflow here: no install, just the package.json that names the scopes
# and pins @ref0/workspace, and that one package from npm. An edited title starts a new run, which
# reads the title from its event. ref0's release pushes to main with no pull request, so this never
# sees its commit: ref0's release.yml writes that subject.

on:
pull_request:
branches: [main]
types: [opened, edited, synchronize, reopened]

permissions:
contents: read

concurrency:
group: title-${{ github.event.pull_request.number }}
cancel-in-progress: true

jobs:
title:
name: The title follows commits.md
runs-on: ubuntu-24.04
timeout-minutes: 3
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
with:
persist-credentials: false
sparse-checkout: package.json
sparse-checkout-cone-mode: false
- uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
with:
node-version: 24
# The title through env, never in the script's text.
- name: The title follows commits.md
env:
TITLE: ${{ github.event.pull_request.title }}
run: |
version=$(node -p "require('./package.json').devDependencies['@ref0/workspace'] ?? ''")
[ -n "$version" ] || { echo "::error::package.json pins no @ref0/workspace."; exit 1; }
npm exec --yes --package="@ref0/workspace@$version" -- ref0-workspace commit-message --title "$TITLE"
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules/
3 changes: 3 additions & 0 deletions .vite-hooks/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# The commit format, as .agents/repo/commits.md says: refuses a subject that isn't
# `type(scope): subject`. `vp config` installs it, from the root package.json's prepare script.
ref0-workspace commit-message "$1"
4 changes: 4 additions & 0 deletions .vite-hooks/pre-push
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Refuses a force-push or delete of main, deploy/* or release/*, then runs the checks the root
# package.json's "ref0-workspace"."prePush" names, as Q1129 says. `vp config` installs it, from the
# root package.json's prepare script.
ref0-workspace pre-push "$@"
21 changes: 21 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"private": true,
"type": "module",
"scripts": {
"prepare": "vp config --no-agent"
},
"devDependencies": {
"@ref0/workspace": "0.8.0",
"vite-plus": "1.7.0"
},
"engines": {
"node": ">=24"
},
"packageManager": "pnpm@12.21.0",
"ref0-workspace": {
"commitScopes": [
"ref0",
"antigravity"
]
}
}
Loading
Loading