From 437244c611934aee7affe4a089c5a9f2c2c027ea Mon Sep 17 00:00:00 2001 From: Lukasz Boryn Date: Wed, 23 Sep 2026 14:36:16 +0200 Subject: [PATCH] fix(commit-lint): resolve commit-msg-check from skill dir not cwd The workflow snippets hardcoded a repo-relative path, which only resolved when cwd was octobot itself, breaking in any other repo. * fix(commit-atomic-jj): use skill's own base dir for commit-msg-check * fix(commit-atomic-git): same fix for the --install-hook line * docs(commit-atomic-jj): note the resolution rule in message-format.md Claude-Session: https://claude.ai/code/session_01VZH57yueT8apHdFXffmffE --- skills/productivity/commit-atomic-git/SKILL.md | 13 ++++++++----- skills/productivity/commit-atomic-jj/SKILL.md | 12 +++++++----- .../productivity/commit-atomic-jj/message-format.md | 5 +++++ 3 files changed, 20 insertions(+), 10 deletions(-) diff --git a/skills/productivity/commit-atomic-git/SKILL.md b/skills/productivity/commit-atomic-git/SKILL.md index b05f5f5..4cc7460 100644 --- a/skills/productivity/commit-atomic-git/SKILL.md +++ b/skills/productivity/commit-atomic-git/SKILL.md @@ -45,12 +45,15 @@ scope bullets. Full grammar, ticket refs, and blueprint citations: [commit-atomic-jj/message-format.md](../commit-atomic-jj/message-format.md). Install real enforcement once per repo: ``` -skills/productivity/commit-atomic-jj/scripts/commit-msg-check --install-hook . +$JJ_SKILL/scripts/commit-msg-check --install-hook . ``` -This is a real `git commit-msg` hook (unlike jj, plain git fires it). -Copies the checker to `.githooks/commit-msg` and sets `core.hooksPath` — -teammates each run `git config core.hooksPath .githooks` once after -pulling that directory, since the setting itself isn't versioned. +`$JJ_SKILL` = `commit-atomic-jj`'s own base directory (a sibling of this +skill's, e.g. `~/.claude/skills/commit-atomic-jj`) — never a path +relative to the repo being committed in. This is a real `git commit-msg` +hook (unlike jj, plain git fires it). Copies the checker to +`.githooks/commit-msg` and sets `core.hooksPath` — teammates each run +`git config core.hooksPath .githooks` once after pulling that directory, +since the setting itself isn't versioned. ### 4. Docs travel with the code Same commit includes: updated docstring for a changed public signature; diff --git a/skills/productivity/commit-atomic-jj/SKILL.md b/skills/productivity/commit-atomic-jj/SKILL.md index cd80317..6cee0e0 100644 --- a/skills/productivity/commit-atomic-jj/SKILL.md +++ b/skills/productivity/commit-atomic-jj/SKILL.md @@ -53,15 +53,17 @@ The same `jj describe` must include any of: ``` jj diff # 1. read every line -S=skills/productivity/commit-atomic-jj/scripts/commit-msg-check -$S <(printf '%s' "$MSG") # 2. validate structure (jj has no hook) +$SKILL/scripts/commit-msg-check <(printf '%s' "$MSG") # 2. validate (jj has no hook) jj describe -m "$MSG" # 3. one concern? seal it (foreground) jj diff --revision @- # 4. verify the message matches what shipped jj new -m 'WIP' # 5. open a fresh empty @ for the next unit ``` -Step 2 is mandatory, not optional — jj has no native hook to enforce it -(nothing in `jj help` or `jj config schema` as of 0.38), so the skill -itself is the only enforcement point. +`$SKILL` = **this skill's own base directory** — the path the harness +reports when loading `commit-atomic-jj` (e.g. `~/.claude/skills/commit-atomic-jj`), +never a path relative to the repo you're committing in; the target repo +usually isn't octobot. Step 2 is mandatory, not optional — jj has no +native hook to enforce it (nothing in `jj help` or `jj config schema` as +of 0.38), so the skill itself is the only enforcement point. Mixed diff (more than one concern) → split **before** describing, minding which side the selected paths land on ([anti-patterns.md](anti-patterns.md)): diff --git a/skills/productivity/commit-atomic-jj/message-format.md b/skills/productivity/commit-atomic-jj/message-format.md index 0d79838..2a7884a 100644 --- a/skills/productivity/commit-atomic-jj/message-format.md +++ b/skills/productivity/commit-atomic-jj/message-format.md @@ -77,6 +77,11 @@ Module grew too big to review well. Splitting keeps each piece small. ## Enforcement +Lives at `scripts/commit-msg-check` in *this skill's own* base +directory — resolve it from the path the harness reports when +`commit-atomic-jj` loads, not from the repo being committed in; that +repo usually isn't octobot. + `commit-msg-check ` validates structure; all violations are hard errors, no warning tier. `commit-msg-check --install-hook [repo-dir]` copies the script to `/.githooks/commit-msg` and sets