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
This commit is contained in:
parent
8b9d3a3a19
commit
437244c611
@ -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).
|
[commit-atomic-jj/message-format.md](../commit-atomic-jj/message-format.md).
|
||||||
Install real enforcement once per repo:
|
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).
|
`$JJ_SKILL` = `commit-atomic-jj`'s own base directory (a sibling of this
|
||||||
Copies the checker to `.githooks/commit-msg` and sets `core.hooksPath` —
|
skill's, e.g. `~/.claude/skills/commit-atomic-jj`) — never a path
|
||||||
teammates each run `git config core.hooksPath .githooks` once after
|
relative to the repo being committed in. This is a real `git commit-msg`
|
||||||
pulling that directory, since the setting itself isn't versioned.
|
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
|
### 4. Docs travel with the code
|
||||||
Same commit includes: updated docstring for a changed public signature;
|
Same commit includes: updated docstring for a changed public signature;
|
||||||
|
|||||||
@ -53,15 +53,17 @@ The same `jj describe` must include any of:
|
|||||||
|
|
||||||
```
|
```
|
||||||
jj diff # 1. read every line
|
jj diff # 1. read every line
|
||||||
S=skills/productivity/commit-atomic-jj/scripts/commit-msg-check
|
$SKILL/scripts/commit-msg-check <(printf '%s' "$MSG") # 2. validate (jj has no hook)
|
||||||
$S <(printf '%s' "$MSG") # 2. validate structure (jj has no hook)
|
|
||||||
jj describe -m "$MSG" # 3. one concern? seal it (foreground)
|
jj describe -m "$MSG" # 3. one concern? seal it (foreground)
|
||||||
jj diff --revision @- # 4. verify the message matches what shipped
|
jj diff --revision @- # 4. verify the message matches what shipped
|
||||||
jj new -m 'WIP' # 5. open a fresh empty @ for the next unit
|
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
|
`$SKILL` = **this skill's own base directory** — the path the harness
|
||||||
(nothing in `jj help` or `jj config schema` as of 0.38), so the skill
|
reports when loading `commit-atomic-jj` (e.g. `~/.claude/skills/commit-atomic-jj`),
|
||||||
itself is the only enforcement point.
|
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
|
Mixed diff (more than one concern) → split **before** describing, minding
|
||||||
which side the selected paths land on ([anti-patterns.md](anti-patterns.md)):
|
which side the selected paths land on ([anti-patterns.md](anti-patterns.md)):
|
||||||
|
|||||||
@ -77,6 +77,11 @@ Module grew too big to review well. Splitting keeps each piece small.
|
|||||||
|
|
||||||
## Enforcement
|
## 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 <message-file>` validates structure; all violations
|
`commit-msg-check <message-file>` validates structure; all violations
|
||||||
are hard errors, no warning tier. `commit-msg-check --install-hook
|
are hard errors, no warning tier. `commit-msg-check --install-hook
|
||||||
[repo-dir]` copies the script to `<repo>/.githooks/commit-msg` and sets
|
[repo-dir]` copies the script to `<repo>/.githooks/commit-msg` and sets
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user