From 0815708e02bda92a9de95fc86df47da760699e39 Mon Sep 17 00:00:00 2001 From: Krzysztof kuhy Rudnicki Date: Mon, 24 Aug 2026 15:53:43 +0200 Subject: [PATCH] Adopt the four markdown namespaces and gate them Renames this repo's markdown onto README.md / CLAUDE*.md / DOCS*.md / TODO*.md so a future session can tell a live task from a finished record without reading the file to find out. TODO files carry the literal "REMOVE ME AFTER FINISH" and are deleted when the work lands. Enforced by the md-naming pre-commit hook and CI workflow, both delegating to the shared gate in kuhyx/utils so this repo's idea of a valid name cannot drift from every other repo's. Co-Authored-By: Claude Opus 5 (1M context) Claude-Session: https://claude.ai/code/session_01A47aX5DJwmA3QFn3pkEWi7 --- _installer_import/.pre-commit-config.yaml | 17 ++++++++++ ...claude_todo.md => TODO-file-length-250.md} | 0 _installer_import/scripts/check_md_naming.sh | 32 +++++++++++++++++++ 3 files changed, 49 insertions(+) create mode 100644 _installer_import/.pre-commit-config.yaml rename _installer_import/{refactor_claude_todo.md => TODO-file-length-250.md} (100%) create mode 100755 _installer_import/scripts/check_md_naming.sh diff --git a/_installer_import/.pre-commit-config.yaml b/_installer_import/.pre-commit-config.yaml new file mode 100644 index 0000000..4c6b62e --- /dev/null +++ b/_installer_import/.pre-commit-config.yaml @@ -0,0 +1,17 @@ +# Pre-commit hooks for this repo. +# +# Created when the shared markdown-naming gate was rolled out. The checks +# are `language: system` because they are plain bash already on this +# machine; pre-commit must not build an isolated env for them. +repos: + - repo: local + hooks: + # Four markdown namespaces (README / CLAUDE* / DOCS* / TODO*), plus the + # rule that a TODO carries "REMOVE ME AFTER FINISH" and nothing else may. + # Shared gate in ~/utils owns the namespaces and the exemption list, so + # one repo's idea of a valid name cannot drift from every other repo's. + - id: md-naming + name: markdown naming convention + entry: scripts/check_md_naming.sh + language: system + files: \.(md|markdown)$ diff --git a/_installer_import/refactor_claude_todo.md b/_installer_import/TODO-file-length-250.md similarity index 100% rename from _installer_import/refactor_claude_todo.md rename to _installer_import/TODO-file-length-250.md diff --git a/_installer_import/scripts/check_md_naming.sh b/_installer_import/scripts/check_md_naming.sh new file mode 100755 index 0000000..50deaa0 --- /dev/null +++ b/_installer_import/scripts/check_md_naming.sh @@ -0,0 +1,32 @@ +#!/bin/bash + +# ============================================================================ +# Fail if any markdown file breaks the shared naming convention. +# +# Thin delegate to the shared gate in ~/utils, which owns the four namespaces +# (README / CLAUDE* / DOCS* / TODO*), the "REMOVE ME AFTER FINISH" marker rule +# and the exemption list. Copying that logic here is what lets one repo's idea +# of a valid name drift from every other repo's -- so this script only locates +# the shared checker and forwards its arguments. +# +# Usage: +# scripts/check_md_naming.sh [ ...] # pre-commit passes these +# scripts/check_md_naming.sh --all # whole tree, from cwd +# ============================================================================ + +set -euo pipefail + +readonly SHARED_GATE="${UTILS_ROOT:-$HOME/utils}/scripts/check_md_naming.sh" + +main() { + if [[ ! -x "$SHARED_GATE" ]]; then + echo "Error: shared markdown-naming gate not found at $SHARED_GATE" >&2 + echo " Clone github.com/kuhyx/utils to ~/utils, or set" >&2 + echo " UTILS_ROOT to where it lives." >&2 + exit 1 + fi + + exec bash "$SHARED_GATE" "$@" +} + +main "$@"