- git-pr.md: self-merge разрешён для Mera/Ptica (solo+pipeline, любой scope, зелёный CI); balance_platform = stage only; tripwires (secret / guard-files) остаются human-only - CLAUDE.md: qa-tester + deep-code-reviewer добавлены в subagent-таблицу (rule #7 / merge-authority) - frontend.md: codegen path src/types/openapi.ts -> src/lib/api-types.ts (реальный out) - deploy.md: GHA -> Forgejo Actions; синк path-триггеров (caddy/**, data/sql/**, ops/glitchtip-auth-forwarder/**, deploy-tradein.yml) - work-as-reviewer/analyst: cadence в body синхронизирован с frontmatter (5m->2m / 30m->15m) Audit 2026-06-27 + решение юзера по split commit/merge-автономии.
64 lines
5 KiB
Markdown
64 lines
5 KiB
Markdown
# GenDesign
|
||
|
||
Site Finder (AI-подбор инвест-участков) + Generative Design (концепции застройки) для девелоперов РФ.
|
||
Live: `https://gendsgn.ru/` — Свердловская обл. (ЕКБ, ПЗЗ, МСК-66).
|
||
|
||
## Stack
|
||
|
||
| Слой | Stack |
|
||
|---|---|
|
||
| Backend | Python 3.12, FastAPI, SQLAlchemy 2.0, GeoAlchemy2, Pydantic v2, Celery + Redis, httpx, Shapely 2 |
|
||
| DB | PostgreSQL 16 + PostGIS 3.4 (~50 таблиц, partitioned `rosreestr_deals`, GIST на geom) |
|
||
| Frontend | Next.js 15 app router, React 19, TypeScript 5 strict, Tailwind 4, TanStack Query |
|
||
| Export | WeasyPrint (PDF), ezdxf (DXF), openpyxl (Excel) |
|
||
| Tooling | uv, ruff, mypy strict (selective), pytest, pre-commit, prettier |
|
||
| Deploy | Beget VPS · Forgejo Actions → GHCR → SSH → docker-compose · Caddy |
|
||
| Knowledge | Obsidian vault `obsidian.gendsgn.ru` (CouchDB LiveSync) |
|
||
|
||
## Critical rules
|
||
|
||
1. **Knowledge = Obsidian vault only.** `mcp__obsidian__*` tools. Local mirror: `C:\Users\user\Documents\gendesign-memory`. Deprecated: `memory/memory-gendesign.jsonl` — не читай, не пиши.
|
||
|
||
2. **Branch + PR mandatory.** Никаких direct push в main. `feat/...` / `fix/...` / `refactor/...` / `docs/...` / `chore/...` → ветка от `forgejo/main` → `mcp__forgejo__create_pull_request` → PR URL пользователю. После PR create — сразу `Skill loop` polling. `gh` CLI bypassed (2026-05-16). **Полные правила: `.claude/rules/git-pr.md`**.
|
||
|
||
3. **Agent-first workflow.** Main session orchestrates ONLY — не пишет код inline. Любая задача >1 файл / >50 строк → subagent. Pre-push: spawn `code-reviewer` subagent на staged changes. Post-push review — внешнее окно Claude (НЕ дублировать).
|
||
|
||
4. **psycopg v3 only.** `import psycopg2` → ModuleNotFoundError. `CAST(:x AS type)` в SQL — никогда `:x::type`. **Полные правила: `.claude/rules/backend.md` + `sql.md`**.
|
||
|
||
5. **No `--no-verify` / `--force` / `--amend`.** Pre-commit hooks обязательны. Hook падает → fix root cause.
|
||
|
||
6. **Vault обновляется вместе с кодом** — в той же сессии. **Используй `/vault-write`** для новой записи (auto-routes через inbox → vault-overlord → правильная папка). НЕ пиши напрямую в `fixes/` / `decisions/` / `code/modules/`. Periodic cleanup: `/sort-inbox` (раскладка inbox), `/retention-pass` (архив устаревшего active в `old/`). Полные правила: `meta/02_claude_usage.md` + `inbox/README.md` в vault.
|
||
|
||
7. **Тестируй каждый merge** — `mcp__playwright__*` или curl ДО/сразу после deploy (post-deploy spawn `qa-tester`). Не доверяй "тесты прошли" без verify.
|
||
|
||
## Subagents (`.claude/agents/`)
|
||
|
||
| Agent | Scope |
|
||
|---|---|
|
||
| `tech-analyst` | Нечёткая / cross-domain задача → план |
|
||
| `backend-engineer` | `backend/app/**` — FastAPI, Celery, scrapers, services |
|
||
| `frontend-engineer` | `frontend/src/**` — Next.js, React, hooks |
|
||
| `database-expert` | `data/sql/**.sql`, Alembic, EXPLAIN ANALYZE |
|
||
| `devops-engineer` | `docker-compose*.yml`, `Caddyfile`, `.github/workflows/**`, `.forgejo/workflows/**` |
|
||
| `code-reviewer` | Pre-push lint (security, correctness, conventions) |
|
||
| `deep-code-reviewer` | Тщательный review критичных PR (миграции / auth / scrapers) + merge authority при ✅ APPROVE |
|
||
| `qa-tester` | Post-deploy smoke (playwright / curl / SQL) сразу после merge+deploy — rule #7 |
|
||
|
||
**Routing:** тривиально (typo, 1-line) → main session. Single-domain clear → worker. Cross-domain / нечётко → `tech-analyst` first. Worker → `code-reviewer` → main commits → push → PR.
|
||
|
||
## Where to look
|
||
|
||
- **Path-scoped rules:** `.claude/rules/` (backend, frontend, sql, git-pr, deploy, ui-tokens, ui-conventions, ui-microcopy) — auto-loaded при работе с соответствующими файлами через `paths:` frontmatter
|
||
- **Personal preferences:** `~/.claude/CLAUDE.md` (cross-project: no auto-commit, no Co-Authored-By, no @claude)
|
||
- **Workflow memory:** `~/.claude/projects/<repo>/memory/MEMORY.md` index
|
||
- **Vault MOCs:** `meta/`, `domains/<area>/<area>-MOC.md`, `decisions/`, `fixes/`, `limitations/`, `code/patterns/`
|
||
- **DB access:** SSH tunnel `ssh -N gendesign` → `localhost:15432` · Credentials: vault `meta/00_credentials.md`
|
||
|
||
## Don't (cross-domain — specifics → `.claude/rules/`)
|
||
|
||
- ❌ Direct push в main / merge без approval
|
||
- ❌ `--no-verify` / `--amend` / `git push --force`
|
||
- ❌ Knowledge-файлы вне vault (`docs/research/`, `notes/`, `wiki/`)
|
||
- ❌ Hardcode credentials в коде / коммитах
|
||
|
||
<!-- Maintenance: обновляется когда меняется tech stack или critical rules. Цель ≤100 lines. Детали → .claude/rules/ или vault. -->
|