Skip to content

chore: share one pre-commit body with cloud and marketing - #603

Merged
theCodeDrift merged 1 commit into
mainfrom
chore/pre-commit-shared-body
Nov 2, 2026
Merged

theCodeDrift merged 1 commit into
mainfrom
chore/pre-commit-shared-body

Conversation

@theCodeDrift

Copy link
Copy Markdown
Member

Makes .husky/pre-commit the same body taskless/taskless#426 and taskless/marketing#88 use, and documents it in the worktrees-pnpm skill so all three repos run one hook.

  • sh "$guard" || exit 1. The old one-line sh <guard> stopped a refused commit only because Husky 9 runs hooks as sh -e. As a raw git hook, the same lines carry on into lint-staged, and its passing exit lets the commit through.
  • A missing-file check says to run pnpm install (or pnpm dotagents install) instead of failing with a bare sh error.
  • pnpm exec lint-staged in place of npx lint-staged.

Measured in a scratch repo, with lint-staged stubbed to pass:

Body Runner Primary checkout Worktree
Old raw git hook commits (exit 0) n/a
Old Husky refused n/a
New raw git hook refused commits
New Husky refused commits
New, guard file missing raw git hook refused, with the install hint n/a

This commit was made through the new hook from a worktree, so pnpm exec lint-staged resolves here.

No changeset: repo tooling, nothing ships.

The hook ran the guard as a bare `sh` line, which stopped a refused
commit only because Husky 9 runs hooks with `sh -e`. As a raw git hook
the same lines carried on into lint-staged, whose passing exit let the
refused commit through. `|| exit 1` stops it without depending on the
runner, and a missing-file check says what to run instead of a bare
`sh` error.

This is the body taskless/taskless#426 and taskless/marketing#88 use,
so all three repos run the same hook; the skill documents it.
@theCodeDrift

Copy link
Copy Markdown
Member Author

@claude /review

@github-actions

github-actions Bot commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @theCodeDrift's task in 1m 18s —— View job


Review mode: incremental — read 0 prior review thread(s) before reviewing.

.prior-review.json contained no review threads, review summaries, or prior top-level comments (only the @claude /review trigger comment itself) — this is the first review of this PR.

Summary

The change is a correct, well-reasoned fix. I traced through both files plus the unchanged refuse-main-checkout.sh guard script to verify the logic:

  • .husky/pre-commit — The old sh <guard) / npx lint-staged body only stopped a refused commit because Husky 9 runs the hook under sh -e; as a raw git hook (no -e), sh's non-zero exit wouldn't propagate and lint-staged would still run and pass, letting the commit through. The new sh "$guard" || exit 1 fixes that for any runner, Husky or raw. ✅
  • Missing-guard check — [ ! -f "$guard" ] before invoking it turns a cryptic sh: file not found into an actionable message pointing at pnpm install / pnpm dotagents install. I confirmed dotagents is a real script in package.json ("dotagents": "dotagents --project", also invoked from postinstall), so the hint is accurate. ✅
  • pnpm exec lint-staged replacing npx lint-staged — consistent with the rest of the repo's pnpm-based tooling. ✅
  • Guard script itself (refuse-main-checkout.sh) is unchanged and untouched by this diff; its set -eu and explicit GITHUB_ACTIONS skip are unaffected by the caller changes. ✅
  • SKILL.md code block is byte-for-byte identical to the new .husky/pre-commit content, so the documentation and the real hook won't drift apart. ✅

Findings

  • [New] Minor prose nit on .agents/skills/worktrees-pnpm/SKILL.md line 156 (posted inline): "This is the body taskless/cli, taskless/taskless and taskless/marketing share:" is missing "that" — reads as "This is the body that taskless/cli, ... share:". Cosmetic only.

No correctness, security, or test-adequacy issues found. This is a tooling/docs-only change (no runtime code, no changeset needed, as the PR description notes).

Comment thread .agents/skills/worktrees-pnpm/SKILL.md Resolved
@theCodeDrift

Copy link
Copy Markdown
Member Author

Re: @github-actions — "Claude finished @theCodeDrift's task in 1m 18s … Review mode: incremental"
#603 (comment)

No correctness findings; the one prose nit is answered inline and declined. Merging.

— AI Coding Agent

@theCodeDrift
theCodeDrift merged commit bdd995e into main Nov 2, 2026
9 checks passed
@theCodeDrift
theCodeDrift deleted the chore/pre-commit-shared-body branch November 2, 2026 02:38
theCodeDrift added a commit that referenced this pull request Nov 2, 2026
Repos that install the worktrees-pnpm skill through dotagents skip that
install under CI, so on a runner the guard file may not exist, and the
missing-file check from #603 would block every automated commit before
the guard's own GITHUB_ACTIONS skip could run. taskless/marketing#88's
review caught it; taskless/taskless#426 carries the same fix.

taskless/cli tracks the guard in git, so it is always present here, but
the body is adopted anyway so all three repos run one byte-identical
hook, and the skill documents why the check sits inside the test.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant