Skip to content

Commit e01e25c

Browse files
committed
docs: clarify expected generated diffs from pre-commit
1 parent 8fb0337 commit e01e25c

2 files changed

Lines changed: 32 additions & 4 deletions

File tree

AGENTS.md

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,29 @@ Only proceed with the commit if it passes. If it fails, fix the issues first.
88

99
**Exception:** If the commit contains only documentation and markdown changes (`.md` files), you may skip `just pre-commit`.
1010

11-
`just pre-commit` now runs the opencode generation flow (`packages/opencode/script/generate.ts`), which also runs formatting/linting steps in the submodule. It is expected that this can modify files you did not directly edit.
11+
`just pre-commit` intentionally runs generation and formatting steps that may modify files you did not edit directly (including markdown). Treat these diffs as expected outputs of the check pipeline.
1212

13-
When this happens, review those extra diffs before committing and confirm they are mechanical generation/format/lint changes (no unintended behavior changes).
13+
If those diffs are mechanical (generation/format/lint output only), they should be committed with the related change. Do not treat them as noise and do not leave them uncommitted.
14+
15+
Common expected examples (non-exhaustive):
16+
- `packages/opencode/packages/sdk/openapi.json`
17+
- `packages/opencode/README.md` (including normalized markdown formatting / generated sections)
18+
- `packages/core/README.md` (synced by hook)
19+
- `bun.lock` files
20+
21+
Required post-`just pre-commit` checklist:
22+
1. Check `git status` (superproject) and `git -C packages/opencode status` (submodule).
23+
2. Review all newly changed files and confirm they are mechanical (no unintended behavior changes).
24+
3. Commit/push submodule generated changes first when present.
25+
4. Run `just update-opencode-commit`.
26+
5. Commit/push the superproject pointer + Dockerfile pin update when changed.
1427

1528
## Bun Lockfile Updates
1629

1730
`bun.lock` file updates are expected in this repository across all `bun.lock` files when changing versions of our own packages (for example `packages/cli-node`, `packages/core`, and related workspace packages). They can also be produced by normal `just pre-commit`/build flows.
1831

1932
When these `bun.lock` changes are tied to intended package/version updates, they are valid and should be committed with the related change. Do not treat them as unexpected noise.
33+
This same expected-and-commit rule applies to other mechanical formatter/generator outputs from `just pre-commit`, including markdown rewrites.
2034

2135
## Project Structure
2236

CLAUDE.md

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,29 @@ Only proceed with the commit if it passes. If it fails, fix the issues first.
88

99
**Exception:** If the commit contains only documentation and markdown changes (`.md` files), you may skip `just pre-commit`.
1010

11-
`just pre-commit` now runs the opencode generation flow (`packages/opencode/script/generate.ts`), which also runs formatting/linting steps in the submodule. It is expected that this can modify files you did not directly edit.
11+
`just pre-commit` intentionally runs generation and formatting steps that may modify files you did not edit directly (including markdown). Treat these diffs as expected outputs of the check pipeline.
1212

13-
When this happens, review those extra diffs before committing and confirm they are mechanical generation/format/lint changes (no unintended behavior changes).
13+
If those diffs are mechanical (generation/format/lint output only), they should be committed with the related change. Do not treat them as noise and do not leave them uncommitted.
14+
15+
Common expected examples (non-exhaustive):
16+
- `packages/opencode/packages/sdk/openapi.json`
17+
- `packages/opencode/README.md` (including normalized markdown formatting / generated sections)
18+
- `packages/core/README.md` (synced by hook)
19+
- `bun.lock` files
20+
21+
Required post-`just pre-commit` checklist:
22+
1. Check `git status` (superproject) and `git -C packages/opencode status` (submodule).
23+
2. Review all newly changed files and confirm they are mechanical (no unintended behavior changes).
24+
3. Commit/push submodule generated changes first when present.
25+
4. Run `just update-opencode-commit`.
26+
5. Commit/push the superproject pointer + Dockerfile pin update when changed.
1427

1528
## Bun Lockfile Updates
1629

1730
`bun.lock` file updates are expected in this repository across all `bun.lock` files when changing versions of our own packages (for example `packages/cli-node`, `packages/core`, and related workspace packages). They can also be produced by normal `just pre-commit`/build flows.
1831

1932
When these `bun.lock` changes are tied to intended package/version updates, they are valid and should be committed with the related change. Do not treat them as unexpected noise.
33+
This same expected-and-commit rule applies to other mechanical formatter/generator outputs from `just pre-commit`, including markdown rewrites.
2034

2135
## Project Structure
2236

0 commit comments

Comments
 (0)