refactor(rules): simplify global agent guidance

This commit is contained in:
Виталий Никитенко
2026-08-08 21:02:00 +03:00
parent 4723d21693
commit ee32371d30
3 changed files with 61 additions and 95 deletions

View File

@@ -114,20 +114,14 @@ test_cursor_native_launcher() {
fi
}
# ── global rules: Karpathy-style guidelines and native rule files ───────────
test_global_rules_include_quality_guidelines() {
karpathy_line=$(grep -n '^## 1\. Think Before Coding$' "$GLOBAL_RULES_SOURCE" | head -1 | cut -d: -f1)
global_line=$(grep -n '^# Global Rules for All AI Agents$' "$GLOBAL_RULES_SOURCE" | head -1 | cut -d: -f1)
if [ -n "$karpathy_line" ] \
&& [ -n "$global_line" ] \
&& [ "$karpathy_line" -lt "$global_line" ] \
&& grep -q 'Always reply in Russian' "$GLOBAL_RULES_SOURCE" \
&& grep -q 'Plain git diff visibility' "$GLOBAL_RULES_SOURCE" \
# ── global rules: source and native rule files ───────────────────────
test_global_rules_source_installed() {
if [ -s "$GLOBAL_RULES_SOURCE" ] \
&& grep -q 'GLOBAL_RULES_SOURCE=' "$SCRIPT" \
&& grep -q 'cp "$GLOBAL_RULES_SOURCE" "$CONFIG_DIR/global_rules.md"' "$SCRIPT"; then
ok "global rules: source file includes English Karpathy guidelines before user rules"
ok "global rules: non-empty source file is installed as global_rules.md"
else
fail "global rules: missing source file, English Karpathy guidelines, or user rules"
fail "global rules: missing source file or installation wiring"
fi
}
@@ -298,7 +292,7 @@ test_glm_claude_launcher
test_glm_official_api
test_gemini_native_launcher
test_cursor_native_launcher
test_global_rules_include_quality_guidelines
test_global_rules_source_installed
test_native_rule_files_generated
test_codex_sound_hooks_detach_stdio
test_fix7_trap_tmp