diff --git a/README.md b/README.md index 5e9b30a9..e8b565bc 100644 --- a/README.md +++ b/README.md @@ -62,7 +62,7 @@ prepush-ci init `init` asks for the command that runs your full CI check, then writes `.prepush-ci.toml`, installs the git hooks (it finds `pre-commit`, husky and lefthook and edits their files instead of fighting them), writes a Claude Code SessionStart script that exports `PREPUSH_CI=full` in cloud sessions, and prints the CI gate snippet. Commit `.prepush-ci.toml` and the hook files you want shared. In a script, give it flags: `prepush-ci init --non-interactive --check "sh scripts/ci"`. -With pre-commit, the hooks `init` writes set `verbose: true`, so that pre-commit shows what they print. The `pre-push` hook then prints the whole output of your check on every push that runs it, however long that is. To keep it short, make the check command print a summary and write the detail to a file, or use a quiet mode of your test runner, such as `pytest -q`. +With pre-commit, the hooks `init` writes set `verbose: true`, so that pre-commit shows what they print. The `pre-push` hook then prints the whole output of your check on every push that runs it, however long that is. To keep it short, make the check command print a summary and write the detail to a file, or use a quiet mode of your test runner, such as `pytest -q`. A quiet mode is not always enough: `node --test` prints at least a line per test (up to Node 22, TAP when its output is not a terminal, as in an agent session), so one push can print thousands of lines. `verbose: true` stays, because `doctor` fails without it and `install` writes it back; a shorter output is a matter of the check command. In an agent session the simplest way is to cut the push's own output, such as `git push 2>&1 | tail -n 40`; the post-push hook recognizes a push in such a pipeline. ### 4. Opt in with `PREPUSH_CI=full` diff --git a/skills/prepush-ci-setup/SKILL.md b/skills/prepush-ci-setup/SKILL.md index 7e358bb2..048baa5b 100644 --- a/skills/prepush-ci-setup/SKILL.md +++ b/skills/prepush-ci-setup/SKILL.md @@ -47,7 +47,7 @@ Stop and ask the user: "What should happen with pre-push on your own machines? ( - **Keep the existing hooks** (the default): run `init` with the `--hooks` value you found (step 5). - Native hooks: `init` chains the existing hooks, which run first; leave the existing hook files as they are, never edit, move or remove `commit-msg` or `pre-push` in the hooks directory. - pre-commit: the only changes to `.pre-commit-config.yaml` are the block `init` writes and the keys `default_install_hook_types` and `default_stages`, every other line stays as it is. Commit these changes together with `.prepush-ci.toml`: committed, the session's `install` finds nothing to change. - - With pre-commit the hooks set `verbose: true`, and pre-commit then prints the whole output of the check on every push that runs it. In an agent session that output fills the context. Tell the user, and offer a check command that prints a summary and writes the detail to a file, or a quiet mode of the test runner such as `pytest -q`; change the check only with their yes. + - With pre-commit the hooks set `verbose: true`, and pre-commit then prints the whole output of the check on every push that runs it. In an agent session that output fills the context. Tell the user, and offer a check command that prints a summary and writes the detail to a file, or a quiet mode of the test runner such as `pytest -q`; change the check only with their yes. A quiet mode does not always help: `node --test` prints at least a line per test (up to Node 22, TAP when its output is not a terminal, as in an agent session). Keep `verbose: true`: `doctor` fails without it and `install` writes it back. In an agent session cut the push's own output instead, `git push 2>&1 | tail -n 40`; the post-push hook recognizes that form. - husky or lefthook: the only change to the files under `.husky/` or to `lefthook.yml` is the block `init` writes (a new hook file also starts with `#!/usr/bin/env sh`), every other line stays as it is. Commit the block together with `.prepush-ci.toml`. - **Cloud sessions only**: run `init` with `--hooks none`. It applies when no hook manager is in use: the hooks then exist only where the SessionStart script installs them. - **Fold into the check**: the tool cannot do this by itself. Show the user the hook file, move its steps into the check command first, and remove the file only after the user confirms it by name. Without that yes, change no hook file.