Skip to content

Commit 32b993b

Browse files
committed
docs(contributor): streamline create-pr verification
1 parent 720bee9 commit 32b993b

6 files changed

Lines changed: 61 additions & 28 deletions

File tree

.agents/skills/nemoclaw-contributor-create-pr/SKILL.md

Lines changed: 35 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -35,27 +35,47 @@ Before creating a PR, verify the branch.
3535
git status
3636
```
3737

38-
## Step 2: Run Pre-PR Checks
38+
## Step 2: Choose Efficient Pre-PR Checks
3939

40-
Choose checks based on the files changed.
40+
Do not rerun the whole local gate just to create a PR when Git hooks already supplied that evidence.
41+
Use the checks that match the diff and the verification you already have.
4142

42-
For code changes, run both checks and confirm they pass before proceeding:
43+
### Hook Evidence
44+
45+
If the commits were created normally and the branch was pushed normally, count the installed hooks as verification:
46+
47+
- `pre-commit` runs file fixers, formatters, linters, docs-to-skills dry-run validation, and changed-surface Vitest hooks.
48+
- `commit-msg` runs commitlint.
49+
- `pre-push` runs TypeScript build and type-check gates.
50+
51+
If hooks were skipped with `--no-verify`, were not installed, failed, or you cannot tell whether they ran, run a manual diff-scoped fallback before creating the PR:
4352

4453
```bash
45-
npx prek run --all-files
46-
npm test
54+
npx prek run --from-ref main --to-ref HEAD
4755
```
4856

49-
For doc-only changes, do not run the full test suite unless the docs change requires it.
50-
Run the docs and hook checks instead:
57+
Use `npx prek run --all-files` only when you need a whole-repository baseline, such as changing hook configuration, formatter configuration, generated-check scripts, or other repo-wide validation behavior.
58+
59+
### Targeted Tests
60+
61+
Run the smallest meaningful tests for changed behavior:
62+
63+
- CLI or root `src/`, `bin/`, `scripts/`, or `test/` changes: `npx vitest run --project cli` or the directly affected test file.
64+
- Plugin changes under `nemoclaw/src/`: `npx vitest run --project plugin` or the directly affected plugin test file.
65+
- E2E support changes under `test/e2e-scenario/support-tests/`: `npx vitest run --project e2e-vitest-support`.
66+
- Installer behavior changes: run the relevant installer integration project only when the local environment supports it.
67+
68+
Reserve full `npm test` for broad runtime changes, test harness changes, or cases where targeted coverage is hard to justify.
69+
Do not run the full test suite for doc-only changes unless the docs change code samples or generated behavior in a way that needs runtime validation.
70+
71+
For doc-only changes, run the docs build before opening the PR:
5172

5273
```bash
53-
npx prek run --all-files
5474
npm run docs
5575
```
5676

5777
If a required check fails, fix the issue before creating the PR.
58-
When preparing the PR body for a doc-only change, leave the `npm test` verification box unchecked unless you actually ran it.
78+
When preparing the PR body, check only the verification boxes backed by hooks, manual commands, or CI evidence you actually have.
5979

6080
## Step 3: Push the Branch
6181

@@ -129,8 +149,9 @@ Use the exact template structure below. Fill in each section based on the diff (
129149

130150
## Verification
131151
<!-- Check each item you ran and confirmed. Leave unchecked items you skipped. Doc-only changes do not require npm test unless you ran it. -->
132-
- [ ] `npx prek run --all-files` passes
133-
- [ ] `npm test` passes
152+
- [ ] Git hooks passed during commit and push, or `npx prek run --from-ref main --to-ref HEAD` passes
153+
- [ ] Targeted tests pass for changed behavior
154+
- [ ] Full `npm test` passes (broad runtime changes only)
134155
- [ ] Tests added or updated for new or changed behavior
135156
- [ ] No secrets, API keys, or credentials committed
136157
- [ ] Docs updated for user-facing behavior changes
@@ -151,7 +172,7 @@ Follow these rules when filling in the template:
151172
- **Related Issue:** Include `Fixes #NNN` or `Closes #NNN` if an issue exists. Remove the section entirely if there is no related issue.
152173
- **Changes:** Bullet list of key changes. Be specific — reference file names, commands, or behaviors that changed.
153174
- **Type of Change:** Check exactly one box. Use `[x]` for checked, `[ ]` for unchecked.
154-
- **Verification:** Check only the boxes for steps you actually ran and confirmed passing. Do not check boxes for steps you skipped or did not verify. For doc-only changes, `npm test` is not required; leave it unchecked unless you ran it.
175+
- **Verification:** Check only the boxes for steps you actually ran and confirmed passing, or for Git hooks that passed during normal commit and push. Do not check boxes for steps you skipped or did not verify. For doc-only changes, `npm test` is not required; leave it unchecked unless you ran it.
155176
- **DCO Sign-Off:** Replace `{name}` and `{email}` with values from `git config user.name` and `git config user.email`.
156177

157178
## Step 6: Create the PR
@@ -198,7 +219,8 @@ Created PR [#NNN](https://github.com/NVIDIA/NemoClaw/pull/NNN)
198219
- **Do not invent your own PR body format.** Use the template from Step 5 exactly.
199220
- **Do not omit sections.** Even if a section is not applicable, keep it with the "Skip if..." comment.
200221
- **Do not check boxes for steps you did not run.** If you did not run `npm run docs`, leave that box unchecked.
201-
- **Do not run the full test suite for doc-only changes by default.** Run docs and hook checks instead, and leave `npm test` unchecked unless you actually ran it.
222+
- **Do not rerun hook-covered checks by default.** Normal commit and push hooks are valid verification. Use `npx prek run --from-ref main --to-ref HEAD` as the fallback when hooks were skipped, missing, or uncertain.
223+
- **Do not run the full test suite for doc-only changes by default.** Run the docs build instead, and leave `npm test` unchecked unless you actually ran it.
202224
- **Do not forget the DCO sign-off.** CI will reject the PR without it.
203225
- **Do not forget `--assignee @me`.** Every PR must be assigned to its creator.
204226
- **Do not create PRs from main.** Always use a feature branch.

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,9 @@
1717

1818
## Verification
1919
<!-- Check each item you ran and confirmed. Leave unchecked items you skipped. Doc-only changes do not require npm test unless you ran it. -->
20-
- [ ] `npx prek run --all-files` passes
21-
- [ ] `npm test` passes
20+
- [ ] Git hooks passed during commit and push, or `npx prek run --from-ref main --to-ref HEAD` passes
21+
- [ ] Targeted tests pass for changed behavior
22+
- [ ] Full `npm test` passes (broad runtime changes only)
2223
- [ ] Tests added or updated for new or changed behavior
2324
- [ ] No secrets, API keys, or credentials committed
2425
- [ ] Docs updated for user-facing behavior changes

AGENTS.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,9 @@ All hooks managed by [prek](https://prek.j178.dev/) (installed via `npm install`
195195
## PR Requirements
196196

197197
- Create feature branch from `main`
198-
- Run `make check` and `npm test` before submitting
198+
- Let normal commit and push hooks provide hook verification before submitting
199+
- Run targeted tests for changed behavior, and run `npm run docs` for doc changes
200+
- Use `npx prek run --from-ref main --to-ref HEAD` if hooks were skipped or unavailable
199201
- Follow PR template (`.github/PULL_REQUEST_TEMPLATE.md`)
200202
- No secrets, API keys, or credentials committed
201203
- Limit open PRs to fewer than 10

CONTRIBUTING.md

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -138,27 +138,32 @@ All git hooks are managed by [prek](https://prek.j178.dev/), a fast, single-bina
138138
| **commit-msg** | commitlint (Conventional Commits) |
139139
| **pre-push** | TypeScript type check (`tsc --noEmit` for plugin, JS, and CLI) |
140140

141-
For a full manual check: `npx prek run --all-files`. For scoped runs: `npx prek run --from-ref <base> --to-ref HEAD`.
141+
For PR preparation, normal commit and push hooks are valid verification when they ran without `--no-verify`.
142+
If hooks were skipped, missing, failed, or uncertain, use a scoped fallback: `npx prek run --from-ref <base> --to-ref HEAD`.
143+
Reserve `npx prek run --all-files` for whole-repository baselines, such as hook, formatter, generated-check, or repo-wide validation changes.
142144

143145
For TypeScript changes under `src/`, `test/`, `scripts/`, `bin/`, or
144-
`nemoclaw-blueprint/scripts/` (and for `tsconfig.cli.json` updates), also run
145-
`npm run typecheck:cli` before opening a PR. CI runs this unconditionally, and the
146-
pre-push hook runs it with `tsconfig.cli.json` before pushes.
146+
`nemoclaw-blueprint/scripts/` (and for `tsconfig.cli.json` updates), the pre-push
147+
hook runs `npm run typecheck:cli` before the branch is pushed.
148+
CI runs this unconditionally.
149+
If the pre-push hook was skipped or unavailable, run `npm run typecheck:cli`
150+
manually before opening a PR.
147151

148152
If you still have `core.hooksPath` set from an old Husky setup, Git will ignore `.git/hooks`. Run `git config --unset core.hooksPath` in this repo, then `npm install` so `prek install` (via `prepare`) can register the hooks.
149153

150154
`make check` remains the primary documented linter entry point.
151155

152156
For doc-only changes, you do not need to run the full test suite by default.
153-
Run the docs and hook checks instead:
157+
Commit and push normally so the hooks run, then run the docs build:
154158

155159
```bash
156-
npx prek run --all-files
157160
npm run docs
158161
```
159162

160163
Leave `npm test` unchecked in the PR verification checklist unless you actually ran it.
161-
Run `npm test` when the change touches code, generated behavior, or anything that affects runtime behavior.
164+
If hooks were skipped or unavailable, run `npx prek run --from-ref main --to-ref HEAD` before opening the PR.
165+
For code changes, run targeted tests for the changed behavior.
166+
Reserve full `npm test` for broad runtime changes, test harness changes, or cases where targeted coverage is hard to justify.
162167

163168
## Project Structure
164169

@@ -241,7 +246,9 @@ Follow these steps to submit a pull request.
241246

242247
1. Create a feature branch from `main`.
243248
2. Make your changes with tests.
244-
3. Run the relevant checks. For code changes, run `make check` and `npm test`. For doc-only changes, run `npx prek run --all-files` and `npm run docs`.
249+
3. Run the relevant checks.
250+
Let normal commit and push hooks provide hook verification, run targeted tests for changed behavior, and run `npm run docs` for doc changes.
251+
If hooks were skipped or unavailable, run `npx prek run --from-ref main --to-ref HEAD`.
245252
4. Open a PR.
246253

247254
### Commit Messages

docs/AGENTS.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,5 +43,6 @@ Treat `docs/` as the source of truth for published content and generated user sk
4343

4444
- Run `npm run docs:sync-agent-variants` after editing shared variant source pages or navigation.
4545
- Run `npm run docs` before opening a PR for docs or Fern changes.
46-
- For doc-only PRs, run `npx prek run --all-files` unless the user asks for a narrower draft.
46+
- For doc-only PRs, rely on normal commit and push hooks when they ran.
47+
If hooks were skipped or unavailable, run `npx prek run --from-ref main --to-ref HEAD`.
4748
- Leave `npm test` unchecked in the PR verification checklist unless you actually ran it.

docs/CONTRIBUTING.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -129,15 +129,15 @@ Do not convert route-style links to `.mdx` file links just to satisfy a local fi
129129
## Doc-Only PR Verification
130130

131131
Doc-only pull requests do not need the full test suite by default.
132-
Before opening a doc-only PR, run:
132+
Commit and push normally so the Git hooks run, then run:
133133

134134
```bash
135-
npx prek run --all-files
136135
npm run docs
137136
```
138137

139138
Leave `npm test` unchecked in the PR verification checklist unless you actually ran it.
140-
Run the full tests only when the change also touches code, generated behavior, or runtime behavior.
139+
If hooks were skipped or unavailable, run `npx prek run --from-ref main --to-ref HEAD` before opening the PR.
140+
Run targeted tests only when the change also touches code, generated behavior, or runtime behavior.
141141

142142
## Writing Conventions
143143

0 commit comments

Comments
 (0)