Files
Felitendo e40b2e69d2 docs: put the project guide where an agent already looks
The guide has always been the first thing to read here and the last thing that
actually gets read. It lived in AGENTS.md, with CLAUDE.md holding a single line
pointing at it, and a pointer is a step somebody has to decide to take. What is
skipped along with it are the rules that cannot be derived from the code:
finished work is committed and pushed to main rather than offered, a commit
message on the default branch is published on a page anyone can load, and the
two Live Activity extensions must never share a derived data path.

So the guide is CLAUDE.md now, which loads by itself, and AGENTS.md is the
pointer for whoever looks for that name instead. The text is unchanged apart
from the paragraph that described the old arrangement. Nothing is duplicated: a
second copy drifts from the first, which is the whole reason the pointer existed.

The two nested guides move the same way, and every link, README line, source
comment and hook message naming the old path follows. One of those links was
also aimed at an anchor that had been renamed out from under it.
2026-09-01 08:42:03 +02:00

53 lines
2.3 KiB
Bash
Executable File

#!/bin/sh
# commit-msg — refuse a message that names a locale.
#
# Every commit message on `main` is published verbatim on ftstore.app: the
# subject in the activity list, the body in the popup behind it. Naming the
# language a string was translated into says roughly where the person writing it
# lives, which is the one thing the whole "nothing about the author" rule in
# the project guide exists to prevent. See the section "Commit messages on `main` are
# PUBLIC" there for the reasoning.
#
# This hook exists because that rule was the only one in the guide with no way
# to check it, and it got broken twice in one session by someone who had read
# it. Prose that describes a rule is not the same as a thing that enforces one.
#
# Escape hatch: `git commit --no-verify`. It is here because a hook that cannot
# be overridden gets deleted rather than argued with, not because there is a
# good reason to name a locale.
msg_file="$1"
[ -f "$msg_file" ] || exit 0
# Strip comments and the diff `--verbose` appends, so neither can trip this.
body=$(sed -e '/^#/d' -e '/^diff --git /,$d' "$msg_file")
# Language names, whole word, case-insensitive. Locale *codes* are deliberately
# not matched: "de" and "en" appear inside ordinary words often enough that the
# false alarms would train everyone to pass --no-verify by reflex.
languages='German|Deutsch|English|Englisch|French|Français|Francais|Spanish|Español|Espanol|Italian|Italiano|Portuguese|Português|Portugues|Brazilian|Russian|Русский|Turkish|Türkçe|Turkce|Polish|Polski|Czech|Čeština|Cestina|Arabic|العربية|Persian|Farsi|فارسی|Thai|ไทย|Vietnamese|Việt|Indonesian|Bahasa|Chinese|中文|Mandarin|Simplified|Japanese|日本語|Korean|한국어'
hits=$(printf '%s\n' "$body" | grep -inE "\\b($languages)\\b" || true)
if [ -n "$hits" ]; then
cat >&2 <<EOF
This commit message names a language:
$(printf '%s\n' "$hits" | sed 's/^/ /')
Commit messages on main are published word for word on ftstore.app, and a
named locale points at a country. Say what landed, not who it is for:
"translate the remaining UI strings" not "add german strings"
"adds 4 strings in every locale it ships" not "in english and german"
See CLAUDE.md, "Commit messages on \`main\` are PUBLIC".
Override with: git commit --no-verify
EOF
exit 1
fi
exit 0