Add global AI quality rules

This commit is contained in:
2026-06-01 16:42:58 +00:00
parent db2af1f7c8
commit 7814fdd5b2
2 changed files with 56 additions and 8 deletions

View File

@@ -14,6 +14,7 @@ fail() { echo "[FAIL] $1"; FAIL=$((FAIL+1)); }
GPT_SECTION=$(awk '/^cat > "\$BIN_DIR\/ai-gpt"/,/^GPTEOF/' "$SCRIPT")
KIMI_SECTION=$(awk '/^cat > "\$BIN_DIR\/ai-kimi"/,/^KIMIEOF/' "$SCRIPT")
GEMINI_SECTION=$(awk '/^cat > "\$BIN_DIR\/ai-gemini"/,/^GEMINIEOF/' "$SCRIPT")
HELPERS_SECTION=$(awk '/^cat > "\$HELPERS_FILE"/,/^HELPEREOF/' "$SCRIPT")
# ── ai-gpt: auto-install codex ────────────────────────────────────────────
test_gpt_autoinstall() {
@@ -72,6 +73,29 @@ test_gemini_native_launcher() {
fi
}
# ── global rules: Karpathy-style guidelines and native rule files ───────────
test_global_rules_include_quality_guidelines() {
if grep -q 'Инженерные правила качества' "$SCRIPT" \
&& grep -q 'multica-ai/andrej-karpathy-skills/CLAUDE.md' "$SCRIPT" \
&& grep -q 'Точечные изменения' "$SCRIPT"; then
ok "global rules: include Karpathy-style quality guidelines"
else
fail "global rules: missing Karpathy-style quality guidelines"
fi
}
test_native_rule_files_generated() {
if echo "$HELPERS_SECTION" | grep -q 'echo "$global_rendered" > "$HOME/.codex/AGENTS.md"' \
&& echo "$HELPERS_SECTION" | grep -q 'echo "$global_rendered" > "$HOME/.kimi-code/AGENTS.md"' \
&& echo "$HELPERS_SECTION" | grep -q 'echo "$global_rendered" > "$HOME/.claude/CLAUDE.md"' \
&& echo "$HELPERS_SECTION" | grep -q 'echo "$global_rendered" > "$HOME/.gemini/GEMINI.md"' \
&& ! echo "$HELPERS_SECTION" | grep -q 'echo "$rendered" >'; then
ok "global rules: native rule files contain only global_rules.md"
else
fail "global rules: native rule files must not include project prompt render"
fi
}
# ── Fix 7: trap quotes $TMP correctly ────────────────────────────────────────
test_fix7_trap_tmp() {
if grep -q "trap 'rm -rf \"\$TMP\"' EXIT" "$SCRIPT"; then
@@ -98,6 +122,8 @@ test_kimi_autoinstall
test_kimi_no_proxy
test_kimi_artemox_config
test_gemini_native_launcher
test_global_rules_include_quality_guidelines
test_native_rule_files_generated
test_fix7_trap_tmp
echo ""