diff options
| author | Craig Jennings <c@cjennings.net> | 2026-05-07 19:23:19 -0500 |
|---|---|---|
| committer | Craig Jennings <c@cjennings.net> | 2026-05-07 19:23:19 -0500 |
| commit | 288b59380dd37da2216ad98bc08397b6174c63b4 (patch) | |
| tree | 6359a700848fc823369c5a5285e128c6f59373ff /claude-rules | |
| parent | 46cf5b4c3e10aec4293297d05e4abfe3caac71eb (diff) | |
| download | rulesets-288b59380dd37da2216ad98bc08397b6174c63b4.tar.gz rulesets-288b59380dd37da2216ad98bc08397b6174c63b4.zip | |
fix(commits): anchor .ai/ detection to repo root with :/ pathspec
The detection command for personal vs. general voice mode used `git ls-files .ai/`, which returns no matches when run from a subdirectory of the repo, even when `.ai/` is tracked at the root. That silently misclassified projects as personal-voice when they should have been general-voice.
Switching to `git ls-files :/.ai/` anchors the search to the repo root via the `:/` pathspec, so the command works correctly from any cwd.
I hit this myself today: ran the check from `claude-rules/` inside the rulesets repo, got an empty result, and applied `/voice personal` to a commit that should have used `/voice` (general mode).
Diffstat (limited to 'claude-rules')
| -rw-r--r-- | claude-rules/commits.md | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/claude-rules/commits.md b/claude-rules/commits.md index a8ddb88..84f408b 100644 --- a/claude-rules/commits.md +++ b/claude-rules/commits.md @@ -246,12 +246,14 @@ enough to skip review" exemption on top of it. ### Step 2: draft, review, publish -**Voice mode and approval gate.** Before drafting, run a single command from the repo root to decide which mode applies: +**Voice mode and approval gate.** Before drafting, run this command to decide which mode applies: ``` -git ls-files .ai/ 2>/dev/null | head -1 +git ls-files :/.ai/ 2>/dev/null | head -1 ``` +The `:/` pathspec anchors the search to the repo root, so the command works from any subdirectory. Without it, running from a subdir returns no matches even when `.ai/` is tracked at the repo root, which silently misclassifies the project. + - **No output** — `.ai/` is gitignored, missing, or empty. **Personal-voice mode**: drafts run through `/voice personal` (39 patterns including the 8 personal-only ones), and the **approval gate applies**. Write to `/tmp`, run the voice pass, print inline, ask approve / request changes / open in editor, then publish only on explicit approval. - **Any output** — one or more files under `.ai/` are tracked. The `.ai/` layer is shared with the team, so the personal voice patterns (first-person rewrite, contraction enforcement, semicolon swap, etc.) don't fit. **General-voice mode**: drafts run through `/voice` (general mode, 31 patterns; the 8 personal-only patterns are skipped), and the **approval gate is skipped**. Write to `/tmp`, run the voice pass, print inline, publish immediately. |
