chore: update agent rules, skills and workflows

This commit is contained in:
Zuev
2026-02-19 20:33:47 +03:00
parent 64d85eab55
commit ed8668c599
7 changed files with 123 additions and 123 deletions

View File

@@ -1,23 +1,23 @@
# Git Sync Skill
# Навык Git Sync
## Description
This skill allows the agent to check the remote Git repository for updates. It automatically pulls changes if a new version is available on the remote server.
## Описание
Этот навык позволяет агенту проверять удаленный Git-репозиторий на наличие обновлений. Он автоматически подтягивает изменения, если на удаленном сервере доступна новая версия.
## Triggers
Activate this skill when the user asks:
- "Проверь обновления" (Check for updates)
- "Загрузи новую версию" (Download new version)
- "Синхронизируй с гитом" (Sync with git)
- "Есть ли изменения?" (Are there changes?)
## Триггеры
Активируйте этот навык, когда пользователь спрашивает:
- "Проверь обновления"
- "Загрузи новую версию"
- "Синхронизируй с гитом"
- "Есть ли изменения?"
## Execution
To run this skill, execute the bash script:
## Выполнение
Для запуска этого навыка выполните bash-скрипт:
```bash
/bin/bash .agent/skills/git-sync/scripts/check_and_pull.sh
```
## Response Guidelines
1. **Success**: If the script says "Successfully updated", inform the user the project is now on the latest version.
2. **No Updates**: If the script says "Up-to-date", tell the user no changes were found.
3. **Error**: If the script fails or reports conflicts, ask the user to check git status manually.
## Рекомендации по ответам
1. **Успех**: Если скрипт говорит "Successfully updated", сообщите пользователю, что проект обновлен до последней версии.
2. **Нет обновлений**: Если скрипт говорит "Up-to-date", сообщите пользователю, что изменений не найдено.
3. **Ошибка**: Если скрипт завершился с ошибкой или сообщает о конфликтах, попросите пользователя проверить статус git вручную.

View File

@@ -1,24 +1,17 @@
#!/bin/bash
# --- НАСТРОЙКИ ---
SERVER="root@192.168.1.87"
REMOTE_PATH="/root/magistr/program"
# -----------------
echo "📡 Checking for updates locally..."
echo "📡 Connecting to remote server ($SERVER)..."
# 1. Запускаем fetch прямо на сервере
# Флаг -o BatchMode=yes запрещает спрашивать пароль (чтобы скрипт не завис)
ssh -o BatchMode=yes -o ConnectTimeout=10 "$SERVER" "cd $REMOTE_PATH && git fetch origin"
# 1. Запускаем fetch локально
git fetch origin
if [ $? -ne 0 ]; then
echo "❌ Connection failed."
echo "Make sure SSH keys are set up and the server is reachable."
echo "❌ Fetch failed. Check your internet connection and git remote settings."
exit 1
fi
# 2. Проверяем количество новых коммитов (HEAD..@{u})
BEHIND_COUNT=$(ssh "$SERVER" "cd $REMOTE_PATH && git rev-list --count HEAD..@{u} 2>/dev/null")
BEHIND_COUNT=$(git rev-list --count HEAD..@{u} 2>/dev/null)
# Если переменная пустая — значит ошибка в гите
if [ -z "$BEHIND_COUNT" ]; then
@@ -28,16 +21,16 @@ fi
# 3. Логика обновления
if [ "$BEHIND_COUNT" -gt 0 ]; then
echo "⬇️ Found $BEHIND_COUNT new commit(s). Pulling on server..."
echo "⬇️ Found $BEHIND_COUNT new commit(s). Pulling changes..."
# Выполняем git pull на сервере
ssh "$SERVER" "cd $REMOTE_PATH && git pull"
# Выполняем git pull
git pull
if [ $? -eq 0 ]; then
echo "✅ Server successfully updated!"
echo "✅ Successfully updated!"
else
echo "❌ Update failed (merge conflicts?)."
fi
else
echo "✨ Server is already up to date."
echo "✨ Already up to date."
fi