-
Notifications
You must be signed in to change notification settings - Fork 10
chore: mirror every Claude skill into .agents and guard the parity #1373
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
27e77c0
chore: mirror every Claude skill into .agents and guard the parity
vivek7405 aeefe38
chore: correct the enforcement facts in the workspace rules
vivek7405 2e47614
chore: state the enforcement workflow instead of the hook regexes
vivek7405 59588bc
fix: close the deferred drift this PR had left for later
vivek7405 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,81 @@ | ||
| # Workspace rules for agents that read `.agents/rules/` | ||
|
|
||
| These project-level rules govern all operations inside this workspace. Antigravity loads every markdown file in `.agents/rules/`; the repo-root `AGENTS.md` remains the full contract and this file does not replace it. | ||
|
|
||
| ## Commit Per Logical Unit, Do Not Batch | ||
| - **Commit per logical unit as soon as it is complete.** | ||
| - **Push after each commit.** | ||
| - Do not batch unrelated changes into one end-of-session commit. | ||
| - A logical unit is one feature, one fix, one rename, one doc rewrite. | ||
| - Checkpoint commit triggers: | ||
| - A bug fix that produced green tests. | ||
| - A new feature that has tests passing. | ||
| - A rename or refactor that is mechanically complete. | ||
| - A doc rewrite that touches a coherent surface. | ||
| - Anything that finishes a tracked task on the TaskList. | ||
| - **Heuristic:** If more than 5 unstaged files span more than one logical concern, stop and commit the already-complete units before continuing. | ||
|
|
||
| ## Concise by Default | ||
| - Answer directly. Skip preamble, skip restating the question, skip exhaustive analysis when a short answer suffices. | ||
| - For most questions, two to four sentences is the right length. | ||
| - If unsure whether the question needs a long or short answer, default short and offer to expand. | ||
|
|
||
| ## Branch, Merge, and Push Guards | ||
| - **Never push to `main` / `master`.** Always push to the feature branch and create a PR via `gh pr create`. | ||
| - **Never edit or write code on `main` / `master`.** If on `main`/`master`, **STOP** and create a feature branch first (`git checkout -b feature/<name>`). | ||
| - When merging to `main`, the workflow is `gh pr create` -> confirm -> `gh pr merge`. Never do a local `git merge` + push. | ||
| - **Merge Approval:** Never merge without permission. Ask exactly: "Ready to merge `<branch>` into `<target>`? After merging, should `<branch>` be deleted or kept?" and wait for both answers. | ||
| - **Command Guard:** Ask the user before running any `git merge` command or `git push` targeting `main`/`master`. | ||
|
|
||
| ## Commit Integrity | ||
| - **No AI attribution in commits.** Never add `Co-Authored-By: Claude`, `Generated by AI`, `AI-assisted`, or similar trailers / prefixes. | ||
| - **Imperative-mood commit subjects under 72 chars.** The body explains the reason for the change, not the diff. | ||
| - **Run tests before committing** when the project has them. Respect pre-commit hooks, do not pass `--no-verify`. | ||
|
|
||
| ## One Task Per Git Worktree | ||
| - **One task per git worktree, ALWAYS.** There is no lone-agent exception: this repo is worked by multiple agents at once, and "no other agent is active right now" is unverifiable mid-task, since another session can start any minute. Never share one working directory across tasks. | ||
| - Two agents in one checkout collide: a `git checkout` in one moves `HEAD` under the other, so the next commit lands on the WRONG branch. Git enforces one branch per worktree, which is what makes the collision impossible. | ||
| - Give each task its own worktree: | ||
| ```sh | ||
| git worktree add -b <branch> ../<repo>-<slug> origin/main | ||
| cd ../<repo>-<slug> | ||
| ``` | ||
| And clean it up after merge: | ||
| ```sh | ||
| git worktree remove ../<repo>-<slug> | ||
| ``` | ||
| - Before every commit, confirm `git branch --show-current` is still the branch you created. If it moved, you are colliding with another session, so stop and move the work into its own worktree. | ||
| - The primary checkout stays an untouched mirror of `main`. Do all work in the task's worktree, never there. | ||
|
|
||
| ## Custom Skills Usage | ||
| - These skills are symlinked into `.agents/skills/` from `.claude/skills/`, so both engines load one copy. Every entry here must have a matching symlink, and every symlink must have an entry here; `test/repo-health/agent-skill-parity.test.mjs` enforces both directions. | ||
| - `webjs-start-work`: Trigger when starting a tracked issue on the WebJs project board. | ||
| - `webjs-ready-for-dev`: Trigger when planning tracked issues into an implementable shape with verified plans. | ||
| - `webjs-file-issue`: Trigger to file a grounded issue on the board. | ||
| - `webjs-list-todos`: Trigger to check the list of TODOs. | ||
| - `webjs-research-record`: Trigger to search and record findings. | ||
| - `webjs-doc-sync`: Trigger when documenting new public surfaces or finding doc gaps or drift. | ||
| - `webjs-scaffold-sync`: Trigger when changing the CLI generators, the scaffold templates, or the agent teaching skill. | ||
| - `webjs-blog-write`: Trigger when writing, drafting, or editing a WebJs blog post under `blog/`. | ||
| - `webjs-instagram-post`: Trigger when publishing an SEO post to the WebJs Instagram account. | ||
| - `use-railway`: Trigger when interacting with Railway deploys. | ||
| - The framework teaching skill at `.agents/skills/webjs/` is a real directory rather than a symlink, and is the reference for building WebJs apps rather than a workflow trigger. | ||
| - Always use the `view_file` tool on the matched skill's `SKILL.md` before executing its tasks. | ||
|
|
||
| ## Enforcement gates | ||
|
|
||
| Everything under `.claude/hooks/` fires only inside Claude Code, and that is more than the blocking gates: seven `PreToolUse` hooks that can refuse a tool call, one `UserPromptSubmit` skill router, and three `PostToolUse` hooks. None of it runs here. Two gates bind every agent regardless of engine, and neither is optional. | ||
|
vivek7405 marked this conversation as resolved.
|
||
|
|
||
| - `.hooks/pre-commit` runs on every commit. It blocks a direct commit to `main` or `master` and blocks a published-library version bump on any branch that is not `chore/release-*`. Never pass `git commit --no-verify`. | ||
| - `.github/workflows/ci.yml` is the test gate. Branch protection blocks a merge until the five REQUIRED checks pass: `Conventions (webjs check)`, `Unit + integration (node --test)`, `Browser (web-test-runner / Playwright)`, `E2E (Puppeteer against the blog example)`, and `Build (@webjsdev/core dist)`. The workflow defines more jobs than those five, the Bun matrix among them, so a green required set is not the same as green CI. Read every check rather than trusting the merge button to have judged for you. `.hooks/pre-commit` deliberately does not run the suite because CI does. | ||
|
vivek7405 marked this conversation as resolved.
|
||
|
|
||
| Because the tool-call gates do not fire here, self-check the workflow they enforce before every commit. Root `AGENTS.md` carries the full contract under Code workflow, and each gate has its own trigger conditions, so read the rules there rather than assuming a given change trips all of them. What those gates would otherwise have caught: | ||
|
vivek7405 marked this conversation as resolved.
|
||
|
|
||
| - Tests for every layer the change touches, staged with the change. | ||
| - The doc surfaces that change with it. | ||
| - A scaffold surface, when a feature under `packages/core`, `packages/server`, or `packages/cli` source changes what `webjs create` generates. | ||
| - A `test/bun/**` cross-runtime assertion, when the change touches a runtime-sensitive surface (the serializer, the listener and request path, SSR, action or CSRF dispatch, streams, `node:crypto`, the TypeScript stripper, auth, session, or cors). | ||
| - In an APP component, extending `WebComponent(...)` rather than raw `HTMLElement`. Framework source under `packages/` is exempt. | ||
|
vivek7405 marked this conversation as resolved.
|
||
| - One task per worktree, and invariant 11 on prose punctuation plus `WebJs` brand casing. These two bind every task and every edit. | ||
|
|
||
| The first four have a documented opt-out for a change that genuinely does not need them (`WEBJS_NO_TEST_GATE`, `WEBJS_NO_DOC_GATE`, `WEBJS_NO_SCAFFOLD_GATE`, `WEBJS_BUN_VERIFIED`), and root `AGENTS.md` states when each applies. Reaching for one to skip work the change actually needs is the misuse they exist despite. | ||
|
vivek7405 marked this conversation as resolved.
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| ../../.claude/skills/webjs-instagram-post |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| ../../.claude/skills/webjs-ready-for-dev |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| ../../.claude/skills/webjs-scaffold-sync |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.