Add global AI quality rules
This commit is contained in:
@@ -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 ""
|
||||
|
||||
Reference in New Issue
Block a user