diff --git a/.cursor/rules/00-always-read-rules.mdc b/.cursor/rules/00-always-read-rules.mdc deleted file mode 100644 index 35460ae..0000000 --- a/.cursor/rules/00-always-read-rules.mdc +++ /dev/null @@ -1,28 +0,0 @@ ---- -description: Перед работой — прочитай все применимые rules -alwaysApply: true ---- - -# Всегда читай правила - -Перед **любой** задачей (код, git, push, релиз, ответ пользователю): - -1. **Прочитай все применимые rules** — user rules, workspace `.cursor/rules/`, особенно с `alwaysApply: true`. -2. **Не начинай работу**, пока не понял ограничения из rules (git, Cursor в репо, version-bump, язык ответа и т.д.). -3. **При конфликте** запроса пользователя и rule — остановись, объясни конфликт, спроси подтверждение. - -## Обязательные проверки по типу задачи - -| Задача | Перед действием прочитай / проверь | -|--------|-------------------------------------| -| `git commit` / `push` | `no-cursor-in-repositories` — нет `.cursor/` в staged; `.gitignore` содержит `.cursor/` | -| Push в `home` | `gitea-home-api` — сначала API, потом SSH push | -| Bump версии | `version-bump` (+ `version-bump-rdp` / `version-bump-ssh` для агентских мониторов) | -| Коммит | `git log -1 --format=fuller` — нет `cursoragent`, `Co-authored-by: Cursor` | - -## Если rule нарушен - -- **Не push**, не «доделывай быстрее». -- Исправь (amend / filter / commit-tree), затем снова проверь лог. - -Правила важнее скорости выполнения задачи. \ No newline at end of file diff --git a/.cursor/rules/01-context-control.mdc b/.cursor/rules/01-context-control.mdc deleted file mode 100644 index b1f0ebc..0000000 --- a/.cursor/rules/01-context-control.mdc +++ /dev/null @@ -1,24 +0,0 @@ ---- -description: Git, контекст файлов и формат ответов -alwaysApply: true ---- - -# Контекст и дисциплина - -## Git - -- **Не** `git commit` / **не** `git push` без явной команды пользователя. -- Перед commit: покажи `git diff --stat`, дождись подтверждения. -- Conventional Commits: `feat:`, `fix:`, `docs:`, `refactor:`. - -## Контекст - -- Файлы: `@`, открытые вкладки, явные пути — не сканируй весь репо без запроса. -- Не грузи файлы >500 строк без необходимости. -- Локальные копии; не качай пакеты/URL без ошибки сборки или явного запроса. - -## Ответы - -- Язык: **русский** (если пользователь не переключился). -- По коду — diff/фрагменты, не дублируй неизменённые блоки. -- Без воды, но достаточно полно для понимания (не обрезай сложные ответы до одной строки). diff --git a/.cursor/rules/agent-monitors-version-bump.mdc b/.cursor/rules/agent-monitors-version-bump.mdc deleted file mode 100644 index 1e69d89..0000000 --- a/.cursor/rules/agent-monitors-version-bump.mdc +++ /dev/null @@ -1,18 +0,0 @@ ---- -description: Bump версии RDP/SSH агентов — иначе ПК не обновятся -globs: **/Login_Monitor.ps1,**/Deploy-LoginMonitor.ps1,**/Sac-Client.ps1,**/ssh-monitor,**/sac-client.sh,**/update_ssh_monitor.sh -alwaysApply: false ---- - -# Версии агентских мониторов - -Любая **существенная правка** без bump **не доедет** до компьютеров. - -| Стек | Файлы | Поле / файл версии | -|------|-------|-------------------| -| RDP | `Login_Monitor.ps1`, `version.txt` | `$ScriptVersion` = `version.txt` | -| SSH | `ssh-monitor`, `version.txt` | `SSH_MONITOR_VERSION` = `version.txt` | - -Подробности: `version-bump-rdp.mdc`, `version-bump-ssh.mdc`. - -**SAC backend:** `backend/app/version.py` (`APP_VERSION`) — отдельный релиз, на агенты ПК не влияет. diff --git a/.cursor/rules/csharp-spec.mdc b/.cursor/rules/csharp-spec.mdc deleted file mode 100644 index f49a451..0000000 --- a/.cursor/rules/csharp-spec.mdc +++ /dev/null @@ -1,12 +0,0 @@ ---- -description: Краткий C# без лишних токенов в выводе -globs: **/*.cs -alwaysApply: false ---- - -# C# — компактный вывод - -- File-scoped namespaces, pattern matching, target-typed `new()`, primary constructors где уместно. -- Без XML-комментариев, `#region`, лишних `using`. -- Без `Console.WriteLine` / debug-log, если задача не про логирование. -- Expression-bodied members, где читаемо. diff --git a/.cursor/rules/gitea-home-api.mdc b/.cursor/rules/gitea-home-api.mdc deleted file mode 100644 index f2e74f1..0000000 --- a/.cursor/rules/gitea-home-api.mdc +++ /dev/null @@ -1,37 +0,0 @@ ---- -description: Gitea home — репо через API, не вручную в вебе -alwaysApply: true ---- - -# Gitea home (papatramp) - -При push в **`home`**, настройке remotes или первом заливе — **через Gitea API**. Не проси создать репо вручную при `Push to create is not enabled` / `Cannot find repository`. - -## Пути (локально, не в git-репо) - -| Назначение | Путь | -|------------|------| -| Конфиг API (секреты) | `$HOME\CursorRules\local\papatramp-gitea.conf` | -| Remotes | `$HOME\CursorRules\scripts\Set-GitRemotes.ps1` | -| Создать репо на home | `$HOME\CursorRules\scripts\Ensure-GiteaHomeRepo.ps1` | - -`init-cursor` копирует в репо **только `*.mdc`**. - -SSH **`home`**: `ssh://git@git.papatramp.lan:2222/PapaTramp/.git` - -## Алгоритм - -1. `GET {GiteaApiUrl}/api/v1/repos/PapaTramp/{RepoName}` — Basic Auth из конфига. -2. Если **404** — `POST {GiteaApiUrl}/api/v1/user/repos` (или `.../orgs/PapaTramp/repos`), тело: `{ "name": "", "private": true, "auto_init": false }`. - Или: `Ensure-GiteaHomeRepo.ps1 -RepoName `. -3. `git push home ` (SSH). - -## Запрещено - -- «Создайте репо в Gitea сами» без попытки API. -- Коммитить `papatramp-gitea.conf`, пароли, временные скрипты с credentials. -- HTTPS/`origin` для home вместо remote **`home`**. - -## API недоступен - -Сообщи, что LAN/API (`192.168.128.48:3000`) недоступен — VPN/сеть. Не отправляй в веб-интерфейс. diff --git a/.cursor/rules/repo-policy.mdc b/.cursor/rules/repo-policy.mdc deleted file mode 100644 index cfeca78..0000000 --- a/.cursor/rules/repo-policy.mdc +++ /dev/null @@ -1,18 +0,0 @@ ---- -description: Политика remotes и push — kalinamall/home/github -alwaysApply: true ---- - -# Git remotes (kalinamall.ru) - -- **kalinamall** — основной Gitea, полный код и секреты. `git push kalinamall main`. -- **home** — домашний Gitea, полная копия. -- **github** — только резерв **без секретов**. Перед push: `check-no-secrets.sh`. -- Remotes только **SSH** (`ssh://`, `git@`). HTTPS и `origin` не использовать. -- Не коммитить в GitHub: `.env`, ключи, пароли, токены, `google-services.json`, prod credentials. -- См. `docs/repo-policy.md` в reverse-proxy. - -# Cursor - -- Отвечать на русском, если пользователь пишет по-русски. -- Коммиты только по явной просьбе пользователя. diff --git a/.cursorignore b/.cursorignore deleted file mode 100644 index 80d8e9c..0000000 --- a/.cursorignore +++ /dev/null @@ -1,52 +0,0 @@ -node_modules/ -bower_components/ -jspm_packages/ -.npm/ -vendor/ -.pnpm-store/ -.venv/ -venv/ -env/ -ENV/ -.env/ -dist/ -build/ -out/ -.next/ -.nuxt/ -.docusaurus/ -.cache/ -.sass-cache/ -.turbo/ -target/ -bin/ -obj/ -.git/ -.svn/ -.idea/ -.vscode/ -.cursor/ -*.log -*.png -*.jpg -*.jpeg -*.gif -*.svg -*.ico -*.mp4 -*.mp3 -*.pdf -*.zip -*.tar.gz -*.rar -*.exe -*.dll -*.woff -*.woff2 -*.ttf -*.eot -package-lock.json -yarn.lock -pnpm-lock.yaml -poetry.lock - diff --git a/.gitignore b/.gitignore index c82221a..3fbf6e3 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,4 @@ -# Android / Gradle +# Android / Gradle *.iml .gradle/ /local.properties @@ -27,3 +27,7 @@ app/src/main/java/ru/kalinamall/seaca/ui/screens/DevConnectDefaults.kt # Env .env .env.* + +# Cursor (не в git — см. repo-policy) +.cursor/ +.cursorignore diff --git a/scripts/push-remotes.sh b/scripts/push-remotes.sh index 6fae790..06cfb1c 100755 --- a/scripts/push-remotes.sh +++ b/scripts/push-remotes.sh @@ -26,7 +26,10 @@ sync_remote() { fi done - git add -A + rm -rf .cursor .cursorignore + + git add -u . + git add README.md if git diff --cached --quiet; then echo "[push-remotes] $remote: без изменений" else