feat: commit-convention-aware docs-sync commits - #1
Merged
Merged
Conversation
Design for detecting the calling repo's commit convention (commitlint, commit templates, commitizen/cocogitto/gitlint) and shaping the sync commit subject + body to match, with a tunable fallback body line width.
compose-message.sh now peels an optional 'Subject:' line off the auditor summary, validates it (single line, <=100 chars, static fallback), and emits it as the commit subject and a new pr_title output. The skip marker moves from the subject to a footer trailer so it never trips a commit rule.
The auditor now scans for commitlint/commit-template/commitizen configs
and shapes its Subject line and body wrap to match, falling back to the
injected {{COMMIT_BODY_LINE_LENGTH}} width when no convention is found.
New workflow input (default 100) is validated and substituted into the auditor prompt in both audit jobs; the rolling docs-sync PR title now uses the auditor's proposed subject (steps.compose.outputs.pr_title).
heysanil
added a commit
that referenced
this pull request
Jul 14, 2026
Detect the calling repo's commit convention (commitlint / commit templates / commitizen-cocogitto-gitlint) and shape the sync commit's subject + body to match. - compose-message.sh: peel/validate an optional Subject: line from the auditor summary, emit it as the commit subject + new pr_title output; move [skip docs-sentinel] to a footer trailer. - prompt-skeleton.md: convention-detection section + Subject: output contract. - audit.yml: new commit-body-line-length input (default 100), validated + substituted into the prompt in both audit jobs; sync-PR title now uses the auditor's proposed subject. - README / AGENT_SETUP: document the input and behavior. - docs/superpowers: design spec + implementation plan.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What & why
The docs-sync commit's subject (
docs: sync documentation with code changes) and PR titlewere hardcoded strings, and the commit body had no line-length discipline. In repos that lint
their commit history (commitlint, gitlint, cocogitto, …) this can fail the calling repo's own commit
lint — e.g.
@commitlint/config-conventionalenforcesbody-max-line-length: 100at error level,and a repo whose
type-enumomitsdocsor requires a scope rejects the hardcoded subject.This makes the sync commit/PR detect the calling repo's commit convention and shape its subject +
body to match, with a tunable fallback body line width.
Design
Hybrid ownership — the shell keeps every safety guarantee; the auditor only shapes prose:
[skip docs-sentinel]loop-breakerSubject:line; shell uses it only if non-empty and ≤100 chars, else falls back to the static subject.Precedence for the wrap width: detected repo
body-max-line-length> thecommit-body-line-lengthfallback (default 100). So linted repos get their real value; unlinted repos get sane plain-text
hygiene.
Changes
engine/compose-message.sh— peel/validate an optionalSubject:line off the auditorsummary; emit it as the commit subject + new
pr_titlestep output; move the skip marker to afooter trailer.
engine/prompt-skeleton.md— new "Matching the repo's commit convention" section(glob-cheap detection of commitlint / commit templates / commitizen-cocogitto-gitlint) + the
Subject:output contract..github/workflows/audit.yml— newcommit-body-line-lengthinput (default100), validatedas a positive integer and substituted into the prompt in both audit jobs; sync-PR
title:nowuses
steps.compose.outputs.pr_title.README.md/AGENT_SETUP.md— document the input + behavior.docs/superpowers/.Testing
Local run of the three CI gates — all clean:
shellcheck engine/*.shbats tests— 24/24 (new cases: subject extraction, footer-marker placement,pr_titleoutput,empty/over-long subject fallback)
actionlintPlus an end-to-end run of
compose-message.shwith aSubject:line, and a simulation of theworkflow's prompt substitution + input validation.
Integration caveat: the subject-detection path runs the real Claude Code CLI in CI, so it can
only be fully exercised on a live PR — the local suite covers the shell contract, not the model's
output.