---
name: gitea-work
description: Use when working with Basti's Gitea server via the tea CLI.
version: 0.1.0
author: Hermes
license: MIT
metadata:
  hermes:
    tags: [gitea, tea, git, code-review, issues, pulls]
    related_skills: []
---

# Gitea work via tea

## When to Use

Any task touching Basti's private Gitea (`git.cloud.schroll-it.de`): listing or filing issues, reviewing/creating pull requests, browsing repos, any Schroll-IT org interaction — plus first-time tea setup or login repair.

## Always-on rules

- All Gitea tasks (issues, PRs, repos, comments, reviews) on `git.cloud.schroll-it.de` run through the **tea CLI** (`tea`, on PATH; binary at `~/.local/bin/tea`) — Basti's explicit preference. Use the REST API (`curl -H 'Authorization: token …'`) only for one-off queries tea cannot answer.
- One login exists: **`schroll-it`** (also the default) → user `Hermes` (Bot account, token auth, git credential helper configured). Org is **Schroll-IT**; visible repos: BiteBudget, heim-learning.
- **Labels beim Erstellen von Issues/PRs:** Immer passende **vorhandene** Labels setzen — vorher per `tea labels ls --repo Schroll-IT/BiteBudget --limit 100` die verfügbaren Namen abfragen und exakt übernehmen (Scheme: `Area/*`, `Type/*`, `Priority/*`, `Update/*`). **Nie** selbst Labels anlegen (`tea labels create` ist tabu); fehlt ein passendes Label, ohne Label auskommen und Basti darauf hinweisen.
- **Default-Repo: Immer `Schroll-IT/BiteBudget`**, sofern Basti kein anderes Repo explizit nennt — keine Repo-Liste abfragen, keine Rückfrage, einfach BiteBudget nehmen.
- git HTTPS remotes authenticate via the credential helper tea registered; `~/.git-credentials` also holds the token (`credential.helper store`). **Credentials embedded in the remote URL win over every helper** — a stale `user:token@` in `origin`'s URL shadows the valid one (see Pitfalls).

## Procedure

1. **Kein Preflight:** nicht standardmäßig `tea login status` aufrufen — direkt losarbeiten. Nur wenn ein tea-Aufruf mit `invalid username, password or token` (oder ähnlichem Auth-Fehler) fehlschlägt: dann `tea login status` prüfen und fehlgeschlagene/andere Einträge vor jedem weiteren Versuch entfernen: `tea login rm <name>` (kein Confirm-Flag, siehe Pitfalls).
2. **Locate work:** `tea repos`, `tea issues` (cross-repo), `tea issues ls --repo <owner>/<name>`, `tea pulls`.
3. **Act:** `tea issues create|comment|close`, `tea pulls create|checkout` — check `tea <cmd> --help` for flags; issues/PRs support `--output json` for parsing.
4. **Verify after any write** by reading back (`tea issues ls` / `tea pulls ls` on the target repo) before reporting success.

## Issue-/PR-Übersichten (Bastis bevorzugtes Ergebnisformat)

- **Nur offene Items immer** — Issues *und* PRs mit `--state open` (plus `--limit 100`). Geschlossene/gemergte NIE mitschleppen, auch nicht wenn Basti "alle issues" schreibt: dieses "alle" meint "alle offenen" und zählt ausdrücklich **nicht** als Nachfrage nach Closed (Rückmeldung 16.10.2026). Closed nur listen, wenn explizit "auch geschlossene" / "geschlossene" / "closed dazu" dasteht — im Zweifel vorher nachfragen oder nur offene liefern.
- Ein Issue-Überblick ist immer eine **schlanke Tabelle**: Spalte `#` (als Klick-Link), Titel, Labels, ein Einzeiler, worum es geht — kein Fließtext, keine zweite Tabelle daneben.
- **PR-Überblick im selben Format wie Issues**, mit zusätzlicher CI-Spalte ganz links als Emoji: `✅` = success, `❌` = failure, `🟡` = pending/laufend, `⚪` = sonstige/keine Angabe. CI-Status kommt aus dem `ci`-Feld von `tea pulls ls --fields …,ci` (Werte u. a. `success`/`failure`/`pending`), nicht aus Status-Checks einzeln nachschlagen. Sonst gleiche Regeln: nur offene PRs, schlanke Tabelle, Dashboard-Issues/Deps unterdrücken, jq zuerst.
- **Renovate-/Dependency-Dashboard-Issues (z. B. #47) IMMER vollständig unterdrücken — in JEDEM Kontext: nicht auflisten, nicht als Fußnote/„davon ausgeblendet“/Hinweis erwähnen, ihre Existenz überhaupt nicht andeuten, nicht in Summen/Counts/Base mitzählen.** Auch „es gab noch ein Dashboard-Issue“ ist verboten. Die/Base zählt still nur das nicht-Dashboard-Ergebnis. Andere Bot-Issues nur aus der Hauptliste nehmen; kurze Fußnote ist dort ok.
- **jq ist immer die erste Wahl:** jedes `tea … --output json` direkt in der Shell mit jq filtern/formaten, bevor etwas in den Kontext kommt (z. B. `tea issues ls … --output json | jq -r '.[] | select(.title | test("Dependency Dashboard") | not) | "#\(.index) \(.state) \(.title)"'`). Kein Python/execute_code für Parsing, das jq schafft — Token-Effizienz hat Vorrang. Python erst, wenn jq für die Logik wirklich nicht reicht. `--fields` liefert `labels`/`comments` als space-separierte **Strings**, nicht als Arrays.
- Für solche Antworten **eine** Liste holen, alles drin: `tea issues ls --repo <owner>/<name> --state open --limit 100 --fields index,title,body,labels,author,comments --output json` — `body` direkt mitabfragen und selbst auf einen Einzeiler kürzen, statt eine zweite Runde pro Issue zu brauchen.
- jq ist installiert (`~/.local/bin/jq`, v1.8.2).
- Bevor eine Summe ("insgesamt N", "alle offenen") herausgegeben wird, `--state` und `--limit` explizit gesetzt haben — die Defaults von `tea issues ls` sind `open` bzw. **30 pro Seite** und kürzen lange Listen still.

## Pitfalls

- A stale/broken login is silently chosen as **fallback in non-interactive mode**, killing every command with `invalid username, password or token` — run `tea login status` first and remove failures; the error points at auth, not at the command you ran.
- **`git fetch/push` fails with `Failed to authenticate user` even though `tea login status` shows ✔:** `origin`'s URL embeds `user:token@`, and URL-embedded credentials take precedence over all helpers, so the valid `store`/tea token never reaches the server. Fix: `git remote set-url origin https://git.cloud.schroll-it.de/<owner>/<repo>` (URL without credentials), then the helper takes over. Diagnose by comparing token lengths/equality booleans only — never print tokens or read credential files into output.
- `tea login add` fails with `no password set` when `--user` is combined with `--token` (the `--user` path is basic-auth and wants a password). Pass only `--token --url --name` (+ `--git-credentials`).
- `tea login rm` has **no confirm flag** (`--yes` etc. aborts with a usage error); call it bare: `tea login rm <name>`.
- Write access comes from a Bot account named Hermes: comments/issues are attributed to "Hermes AI Bot", not Basti — say so when attribution matters.
- `tea pulls ls --fields` kennt kein `user` (nur `author`/`author-id`); unbekannte Felder sind ein harter Error. Für Listen reicht das Default-Feldset.
- **Output-Shape prüfen, bevor etwas behauptet wird:** tea meldet unbekannte Subkommandos nicht immer als Fehler — ein falsches Subkommando kann die Liste des Elternkommandos ausgeben, und die Issue-Detail-JSON liefert für `comments` ein leeres Array, während der Zähler nur im Listen-Feld steht. Vor jedem "X hat N Kommentare/Prüfungen": das Kommando per `tea <cmd> --help` bestätigen und die Zahl aus dem Feld nehmen, das sie wirklich führt.

## Setup / recovery

See `references/setup.md` for the tea install recipe (checksum-verified), PATH wiring, and login re-creation.
