hancrafted/markdown-harness / .agents/skills/commit
commit
VerifiedAuthor a commit message and commit it — Conventional Commits header, Keep a Changelog body, Source trailer, enforced by a commit-time husky gate if setup (--setup-husky). Use before every `git commit`, whether a human or an agent initiates it, including a run split across commits.
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 9.2 KB |
| assets/research.md | markdown | 13.1 KB |
| assets/setup-husky.md | markdown | 6.7 KB |
| scripts/commit-msgexecutable | script | 3.9 KB |
| scripts/lib/git.sh | script | 2.3 KB |
| scripts/lib/hook.sh | script | 1.9 KB |
| scripts/lib/report.sh | script | 2.6 KB |
| scripts/lib/rules.sh | script | 6.0 KB |
| scripts/setup-huskyexecutable | script | 5.0 KB |
scripts/lib/report.sh
View on GitHub# How the gate explains itself. Diagnostics go to stderr so nothing here can be
# mistaken for part of the commit message.
#
# A rejection has to be actionable without guessing: it names which of the three
# conditions failed, what that condition wants, and what was actually written.
#
# Sourced by ../commit-msg. Not executable on its own.
gate_rejected=0
# Locals are not POSIX, so everything a sourced function keeps is prefixed to
# stay out of the entrypoint's namespace.
# gate_warn <line>... — non-blocking; the commit still goes through.
gate_warn() {
for _report_line in "$@"; do
printf '⚠ %s\n' "$_report_line" >&2
done
}
# gate_reject <condition> <what-it-wants> [detail] — record and print one failed
# condition. Called once per condition, so a message failing two conditions is
# told about both.
gate_reject() {
if [ "$gate_rejected" -eq 0 ]; then
printf '✖ Commit message rejected by the commit gate.\n' >&2
gate_rejected=1
fi
printf '\n ✖ %s — %s\n' "$1" "$2" >&2
if [ "$#" -ge 3 ]; then
printf '%s\n' "$3" | sed 's/^/ /' >&2
fi
}
# gate_abort <line>... — the gate could not run at all. Distinct from a
# rejection: nothing was judged.
gate_abort() {
printf '✖ %s\n' "$1" >&2
shift
for _report_line in "$@"; do
printf ' %s\n' "$_report_line" >&2
done
exit 1
}
# gate_footer — printed once, after every condition has had its say.
gate_footer() {
printf '\n The contract is documented in the `commit` skill: skills/commit/SKILL.md\n' >&2
}
# report_header_failure <message> — shows line 1 always, and line 2 as well when
# that is the part that broke.
report_header_failure() {
_report_detail="types: $(printf '%s' "$GATE_TYPES" | tr '|' ' ')
got line 1: $(rules_line "$1" 1)"
_report_second=$(rules_line "$1" 2)
if [ -n "$_report_second" ]; then
_report_detail="$_report_detail
got line 2: $_report_second (must be blank)"
fi
gate_reject 'Header' 'Conventional Commits `type(scope)!?: subject`, then a blank line' "$_report_detail"
}
# report_body_failure <message> <problem> — echoes the body back so the mismatch
# is visible directly. Where the body starts is rules.sh's business.
report_body_failure() {
gate_reject 'Body' 'at least one `### <category>` heading, each with a numbered item' "$2
got:
$(rules_body "$1")"
}
# report_source_failure <problem>
report_source_failure() {
gate_reject 'Source trailer' "a usable \`Source:\` trailer git can actually parse" "$1
value: <canonical ref> | <prompt summary> (either part alone is fine, not neither)
the trailer block must be the last paragraph, preceded by a blank line"
}
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| rea-changelog-updatemorluto/reaPrepare or rewrite REA release changelogs and GitHub release notes from pinned Git history, with verified contributor thanks and Release Please synchronization. | Stars: 467k | Updated | Claude CodeCodex | Verified | Install |
| academy-guideanthropics/skillsStop and check this skill before finishing any reply to a question about how to use Claude or a Claude product — it recommends matching courses, tutorials, and use cases from Claude Academy (academy.claude.com), Anthropic's learning hub. Trigger on: "how do I", "how can I", "getting started with", "what can Claude do", "teach me", "learn to use"; questions about artifacts, projects, skills, plugins, connectors, MCP; requests about rolling Claude out to a team, class, or organization; and any ask for training materials, onboarding content, or learning resources. Use it when the user is learning how to use a feature or product — not when they are mid-task and just want the task done. This skill composes with other skills: after consulting product documentation to answer how a Claude feature works, also check here for a matching course or tutorial — a docs-grounded answer and an Academy recommendation belong together. Only recommend on a strong match; never invent Academy content. | Stars: 196k | Updated | Claude CodeCodex | Verified | Install |
| claude-apianthropics/skillsReference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER — read BEFORE opening the target file; don't skip because it "looks like a one-liner" — whenever: the prompt names Claude/Anthropic in any form (Claude, Anthropic, Fable, Opus, Sonnet, Haiku, `anthropic`, `@anthropic-ai`, `claude-*`, `us.anthropic.*`, `[1m]`); the user asks about an LLM (pricing/model choice/limits/caching) — never answer from memory; OR the task is LLM-shaped with provider unstated (agent/MCP/tool-definition/multi-agent/RAG/LLM-judge/computer-use; generate/summarize/extract/classify/rewrite/converse over NL; debugging refusals/cutoffs/streaming/tool-calls/tokens). SKIP only when another provider is being worked on (overrides all triggers): OpenAI/GPT/Gemini/Llama/Mistral/Cohere/Ollama named in the query; OR `grep -rE 'openai|langchain_openai|google.generativeai|genai|mistralai|cohere|ollama'` over the project hits (run this grep FIRST if no provider named — don't Read the file). | Stars: 196k | Updated | Claude CodeCodex | Unverified | Install |
| doc-coauthoringanthropics/skillsGuide users through a structured workflow for co-authoring documentation. Use when user wants to write documentation, proposals, technical specs, decision docs, or similar structured content. This workflow helps users efficiently transfer context, refine content through iteration, and verify the doc works for readers. Trigger when user mentions writing docs, creating proposals, drafting specs, or similar documentation tasks. | Stars: 196k | Updated | Claude CodeCodex | Verified | Install |