aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorCraig Jennings <c@cjennings.net>2026-04-19 12:36:04 -0500
committerCraig Jennings <c@cjennings.net>2026-04-19 12:36:04 -0500
commit019db5f9677902ba02d703a8554667d1b6e88f6b (patch)
tree37c7991c7e29b443348996f1c2407030b3571026 /scripts
parent18fcaf9f27d03849487078b30f667c3b574e6554 (diff)
downloadrulesets-019db5f9677902ba02d703a8554667d1b6e88f6b.tar.gz
rulesets-019db5f9677902ba02d703a8554667d1b6e88f6b.zip
refactor: generalize testing.md, split Python specifics, DRY install
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).
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/install-lang.sh12
1 files changed, 10 insertions, 2 deletions
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.