Add Gitea Expert-IT skill for Cursor and Hermes agents.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -0,0 +1,229 @@
|
|||||||
|
---
|
||||||
|
name: gitea-skill-expert-it
|
||||||
|
description: >-
|
||||||
|
Połączenie z Gitea Expert-IT (gitea.expert-it.agency-ai.dev): credentials,
|
||||||
|
clone, pull, push, API. Używaj na początku nowej sesji agenta przy pracy z
|
||||||
|
repozytoriami na tym hoście Gitea.
|
||||||
|
---
|
||||||
|
|
||||||
|
# Gitea Expert-IT — skill operacyjny
|
||||||
|
|
||||||
|
**Instancja:** https://gitea.expert-it.agency-ai.dev
|
||||||
|
**API base:** `https://gitea.expert-it.agency-ai.dev/api/v1/`
|
||||||
|
**Wersja Gitea:** 1.26.x
|
||||||
|
**Właściciel repozytoriów (user/org):** `tomasz-syn-grzegorza`
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Credentials (lokalna maszyna dev)
|
||||||
|
|
||||||
|
| Pole | Wartość |
|
||||||
|
|------|---------|
|
||||||
|
| **Gitea user** | `tomasz-syn-grzegorza` |
|
||||||
|
| **Gitea PAT** | z `~/.git-credentials` (lokalnie; **nie commituj** do git) |
|
||||||
|
| **Plik zapisu** | `~/.git-credentials` (chmod 600) |
|
||||||
|
| **Git credential helper** | `store` |
|
||||||
|
|
||||||
|
### Szybki export (każda nowa sesja terminala / agenta)
|
||||||
|
|
||||||
|
```bash
|
||||||
|
export GITEA_USER="tomasz-syn-grzegorza"
|
||||||
|
export GITEA_PAT="$(python3 - <<'PY'
|
||||||
|
import re, pathlib
|
||||||
|
c = pathlib.Path.home() / ".git-credentials"
|
||||||
|
for line in c.read_text().splitlines():
|
||||||
|
m = re.search(r"gitea\.expert-it\.agency-ai\.dev.*:([^@]+)@", line)
|
||||||
|
if m:
|
||||||
|
print(m.group(1))
|
||||||
|
break
|
||||||
|
PY
|
||||||
|
)"
|
||||||
|
export GITEA_BASE="https://gitea.expert-it.agency-ai.dev"
|
||||||
|
export GITEA_API="$GITEA_BASE/api/v1"
|
||||||
|
```
|
||||||
|
|
||||||
|
**Nigdy nie commituj PAT do git.** Ten plik leży poza repozytoriami projektów (`Pulpit/cursor/`).
|
||||||
|
|
||||||
|
### Nagłówek API (obowiązkowy format)
|
||||||
|
|
||||||
|
```
|
||||||
|
Authorization: token $GITEA_PAT
|
||||||
|
```
|
||||||
|
|
||||||
|
**NIE używaj** `Bearer` — Gitea zwróci 401.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Znane repozytoria
|
||||||
|
|
||||||
|
| Projekt | Repo | Lokalna ścieżka (dev) |
|
||||||
|
|---------|------|------------------------|
|
||||||
|
| One Gateway | `tomasz-syn-grzegorza/one-gateway` | `/home/tomasz-syn-grzegorza/Pulpit/cursor/one-gateway` |
|
||||||
|
| Site Slavic Pulse | `tomasz-syn-grzegorza/site-slavic-pulse-com` | `/home/tomasz-syn-grzegorza/Pulpit/cursor/site-slavic-pulse-com` |
|
||||||
|
| Site Agencja AI | `tomasz-syn-grzegorza/site-agencja-ai-com` | `/home/tomasz-syn-grzegorza/Pulpit/cursor/site-agencja-ai-com` |
|
||||||
|
| Cursor Deploy Appwrite | `tomasz-syn-grzegorza/cursor-deploy-appwrite` | `/home/tomasz-syn-grzegorza/Pulpit/docker/cursor-deploy-appwrite` |
|
||||||
|
|
||||||
|
URL klonowania (HTTPS):
|
||||||
|
|
||||||
|
```
|
||||||
|
https://gitea.expert-it.agency-ai.dev/tomasz-syn-grzegorza/<repo>.git
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Procedura agenta — nowa sesja
|
||||||
|
|
||||||
|
1. **Załaduj credentials**
|
||||||
|
```bash
|
||||||
|
export GITEA_USER="tomasz-syn-grzegorza"
|
||||||
|
export GITEA_PAT="$(python3 - <<'PY'
|
||||||
|
import re, pathlib
|
||||||
|
c = pathlib.Path.home() / ".git-credentials"
|
||||||
|
for line in c.read_text().splitlines():
|
||||||
|
m = re.search(r"gitea\.expert-it\.agency-ai\.dev.*:([^@]+)@", line)
|
||||||
|
if m:
|
||||||
|
print(m.group(1))
|
||||||
|
break
|
||||||
|
PY
|
||||||
|
)"
|
||||||
|
export GITEA_BASE="https://gitea.expert-it.agency-ai.dev"
|
||||||
|
```
|
||||||
|
|
||||||
|
2. **Wejdź do projektu**
|
||||||
|
```bash
|
||||||
|
cd /home/tomasz-syn-grzegorza/Pulpit/cursor/one-gateway # lub inny projekt z tabeli
|
||||||
|
```
|
||||||
|
|
||||||
|
3. **Sprawdź stan**
|
||||||
|
```bash
|
||||||
|
git status -sb
|
||||||
|
git fetch origin
|
||||||
|
git log origin/main..HEAD --oneline # lokalne commity nie na serwerze
|
||||||
|
```
|
||||||
|
|
||||||
|
4. **Pobierz zmiany (pull)**
|
||||||
|
```bash
|
||||||
|
git pull --rebase origin main
|
||||||
|
```
|
||||||
|
Dla repo ze gałęzią `master`: `git pull --rebase origin master`
|
||||||
|
|
||||||
|
5. **Wypchnij zmiany (push)** — tylko gdy użytkownik poprosi o commit/push
|
||||||
|
```bash
|
||||||
|
git add <pliki>
|
||||||
|
git commit -m "opis zmian"
|
||||||
|
git push -u origin main
|
||||||
|
```
|
||||||
|
|
||||||
|
6. **Jeśli push wisi** (brak promptu hasła)
|
||||||
|
```bash
|
||||||
|
git remote set-url origin "https://$GITEA_USER:$GITEA_PAT@gitea.expert-it.agency-ai.dev/tomasz-syn-grzegorza/one-gateway.git"
|
||||||
|
git push -u origin main
|
||||||
|
git remote set-url origin "https://gitea.expert-it.agency-ai.dev/tomasz-syn-grzegorza/one-gateway.git"
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Clone (pierwszy raz)
|
||||||
|
|
||||||
|
```bash
|
||||||
|
cd /home/tomasz-syn-grzegorza/Pulpit/cursor
|
||||||
|
git clone "https://$GITEA_USER:$GITEA_PAT@gitea.expert-it.agency-ai.dev/tomasz-syn-grzegorza/one-gateway.git"
|
||||||
|
cd one-gateway
|
||||||
|
git remote set-url origin "https://gitea.expert-it.agency-ai.dev/tomasz-syn-grzegorza/one-gateway.git"
|
||||||
|
```
|
||||||
|
|
||||||
|
Publiczne repo można klonować bez tokenu; prywatne wymagają PAT w URL lub `credential.helper store`.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## API — typowe operacje
|
||||||
|
|
||||||
|
### Sprawdź repo
|
||||||
|
|
||||||
|
```bash
|
||||||
|
curl -sS "$GITEA_API/repos/tomasz-syn-grzegorza/one-gateway" \
|
||||||
|
-H "Authorization: token $GITEA_PAT" | python3 -m json.tool
|
||||||
|
```
|
||||||
|
|
||||||
|
### Utwórz repo
|
||||||
|
|
||||||
|
```bash
|
||||||
|
curl -sS -X POST "$GITEA_API/user/repos" \
|
||||||
|
-H "Authorization: token $GITEA_PAT" \
|
||||||
|
-H "Content-Type: application/json" \
|
||||||
|
-d '{"name":"nowy-projekt","description":"...","private":false}'
|
||||||
|
```
|
||||||
|
|
||||||
|
Endpoint **`/api/v1/user/repos`** — nie `/repos/create` (404).
|
||||||
|
|
||||||
|
### Zmień nazwę repo
|
||||||
|
|
||||||
|
```bash
|
||||||
|
curl -sS -X PATCH "$GITEA_API/repos/tomasz-syn-grzegorza/stara-nazwa" \
|
||||||
|
-H "Authorization: token $GITEA_PAT" \
|
||||||
|
-H "Content-Type: application/json" \
|
||||||
|
-d '{"name":"nowa-nazwa"}'
|
||||||
|
```
|
||||||
|
|
||||||
|
### Container registry (obrazy Docker)
|
||||||
|
|
||||||
|
```
|
||||||
|
gitea.expert-it.agency-ai.dev/tomasz-syn-grzegorza/<image>:latest
|
||||||
|
```
|
||||||
|
|
||||||
|
Logowanie (CI / lokalnie):
|
||||||
|
|
||||||
|
```bash
|
||||||
|
echo "$GITEA_PAT" | docker login gitea.expert-it.agency-ai.dev -u "$GITEA_USER" --password-stdin
|
||||||
|
```
|
||||||
|
|
||||||
|
Sekrety CI w repo (Gitea Actions): `GITEA_USER`, `GITEA_TOKEN` — ustawiane w ustawieniach repo, nie w git.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Gałęzie i konwencja
|
||||||
|
|
||||||
|
| Gałąź | Zastosowanie |
|
||||||
|
|-------|----------------|
|
||||||
|
| `main` | One Gateway, większość projektów |
|
||||||
|
| `master` | site-slavic-pulse-com, site-agencja-ai-com |
|
||||||
|
| `feature/*` | nowe funkcje |
|
||||||
|
| `fix/*` | poprawki |
|
||||||
|
| `infra/*` | docker, deploy, CI |
|
||||||
|
|
||||||
|
Przed pracą: `git pull`. Po pracy: commit + push tylko na prośbę użytkownika.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Pułapki
|
||||||
|
|
||||||
|
1. **Auth:** `Authorization: token <PAT>` — nie `Bearer`
|
||||||
|
2. **Create repo:** `POST /api/v1/user/repos` — nie `/repos/create`
|
||||||
|
3. **SSH:** na niektórych hostach zablokowany — używaj HTTPS
|
||||||
|
4. **LRC hook (Hermes):** przed pierwszym commitem w nowym repo: `mkdir -p .git/lrc && touch .git/lrc/disabled-git`
|
||||||
|
5. **Nie commituj:** `.env` z sekretami, PAT, RTX API keys
|
||||||
|
6. **Stara nazwa:** `one-gateway-cursor` została przemianowana na **`one-gateway`**
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Checklist push (agent)
|
||||||
|
|
||||||
|
- [ ] `git status` — świadomie wybrane pliki (bez `.env`, bez sekretów)
|
||||||
|
- [ ] `git diff` — sensowny zakres zmian
|
||||||
|
- [ ] commit message opisuje *dlaczego*
|
||||||
|
- [ ] `git push origin <branch>`
|
||||||
|
- [ ] po pushu: `git status -sb` → bez `ahead`
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Powiązane pliki w projektach
|
||||||
|
|
||||||
|
| Plik | Opis |
|
||||||
|
|------|------|
|
||||||
|
| `cursor/one-gateway/GITEA.md` | Push one-gateway |
|
||||||
|
| `cursor/one-gateway/packages/agency-gitea-collaboration/SKILL.md` | Protokół Hermes + Cursor |
|
||||||
|
| `cursor/one-gateway/deploy/docs/INSTALL.md` | Instalacja produkcyjna |
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
*Skill lokalny — credentials z `~/.git-credentials`. Nie commituj tego pliku do publicznych repo.*
|
||||||
Reference in New Issue
Block a user