From 019db5f9677902ba02d703a8554667d1b6e88f6b Mon Sep 17 00:00:00 2001 From: Craig Jennings Date: Sun, 19 Apr 2026 12:36:04 -0500 Subject: refactor: generalize testing.md, split Python specifics, DRY install MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit claude-rules/testing.md is now language-agnostic (TDD principles, test categories, coverage targets, anti-patterns). Scope header widened to **/*. Python-specific content (pytest, fixtures, parametrize, anyio, Django DB testing) moved to languages/python/claude/rules/python-testing.md. Added languages/python/ bundle (rules only so far; no CLAUDE.md template or hooks yet — Python validation tooling differs from Elisp). Added install-python shortcut to the Makefile. Updated scripts/install-lang.sh to copy claude-rules/*.md into each target project's .claude/rules/. Bundles no longer need to carry their own verification.md copy — deleted languages/elisp/claude/rules/verification.md. Single source of truth in claude-rules/, fans out via install. Elisp-testing.md now references testing.md as its base (matches the python-testing.md pattern). --- scripts/install-lang.sh | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/install-lang.sh b/scripts/install-lang.sh index f9b7a31..2ee4aa7 100755 --- a/scripts/install-lang.sh +++ b/scripts/install-lang.sh @@ -35,14 +35,22 @@ PROJECT="$(cd "$PROJECT" && pwd)" echo "Installing '$LANG' ruleset into $PROJECT" -# 1. .claude/ — rules, hooks, settings (authoritative, always overwrite) +# 1. Generic rules from claude-rules/ (shared across all languages) +if [ -d "$REPO_ROOT/claude-rules" ]; then + mkdir -p "$PROJECT/.claude/rules" + cp "$REPO_ROOT/claude-rules"/*.md "$PROJECT/.claude/rules/" 2>/dev/null || true + count=$(ls -1 "$REPO_ROOT/claude-rules"/*.md 2>/dev/null | wc -l) + echo " [ok] .claude/rules/ — $count generic rule(s) from claude-rules/" +fi + +# 2. .claude/ — language-specific rules, hooks, settings (authoritative, always overwrite) if [ -d "$SRC/claude" ]; then mkdir -p "$PROJECT/.claude" cp -rT "$SRC/claude" "$PROJECT/.claude" if [ -d "$PROJECT/.claude/hooks" ]; then find "$PROJECT/.claude/hooks" -type f -name '*.sh' -exec chmod +x {} \; fi - echo " [ok] .claude/ installed" + echo " [ok] .claude/ — language-specific content" fi # 2. githooks/ — pre-commit etc. -- cgit v1.2.3