Files
hermes-skillsharing/skills/software-development/gitea-repo-management/SKILL.md
T

6.2 KiB

name, description
name description
gitea-repo-management Use for gitea.mindboost.team repos, PRs and n8n layout.

Gitea (gitea.mindboost.team) repo work

Access: find the working account first

  • A browser URL returning 404 usually means "no access", not "missing". Check ~/.git-credentials (never print the secret; mask with sed) for the gitea accounts.
  • Test each account against GET /api/v1/user and GET /api/v1/repos/<owner>/<repo>. Different accounts see different repos; the first stored account is NOT necessarily the one with access. Git's credential helper picks the first match for the host, so clone with the working user embedded (https://USER:PW@host/...) and then git remote set-url origin to the clean URL so no password lands in .git/config.
  • SSH (git@gitea.mindboost.team) may be denied for the default key; the per-purpose aliases in ~/.ssh/config (gitea-*, port 222) are deploy keys scoped to single repos. HTTPS with the working account is the general path.
  • Token scopes limit actions: creating a repo inside an org needs write:organization; write:repository alone returns 403. Do not work around it (personal repo + transfer). Prepare everything locally and ask the user to create the empty repo or supply a token with the scope.

Pushing, PRs and CI via the API

  • Push with the working user embedded in the URL (https://USER:PW@host/...), mask the password in output with sed, and keep the stored remote URL clean. Put restructuring work on a feature/... branch and open a PR via POST /api/v1/repos/<owner>/<repo>/pulls (Basic auth with the same account) instead of pushing to main.
  • Check CI with GET .../actions/runs?limit=N (fields: path, event, conclusion) and .../actions/runs/<id>/jobs; secrets list is .../actions/secrets. The first push to main of a repo with an auto-deploy action runs it: without N8N_* secrets it fails harmlessly, but once secrets exist it deploys, so warn the user while another repo still deploys the same workflow ids.
  • empty: true in the repo API can be stale right after the first push; compare git rev-parse HEAD with the fetched remote head instead.
  • Protected main: A direct push is rejected (pre-receive hook declined ... protected branch), even when the user says "hotfix without PR". Do not touch branch protection. Take the lightest sanctioned route: push a hotfix/... branch (one commit), open the PR via API, poll .../commits/<branch>/status until the required checks are success (an earlier merge call returns 405 Not all required status checks successful), then POST .../pulls/<n>/merge with {"Do":"merge","delete_branch_after_merge":true}. Before pushing to a repo that auto-deploys, diff its workflow file against the live workflow so the deploy changes nothing but the intended value.

Splitting part of a repo into a new repo (keeping history)

Recipe and checks: references/repo-split.md. Short form: dependency analysis first, ask scope questions, git filter-repo on a throwaway single-branch clone, fix cross-repo paths, run the tests, only then create and push.

Restructuring a freshly split repo

  • Move files with git mv in one commit so history follows. Then rewrite path literals in tests, deploy registry and CI triggers, and run the whole test set; tests that lived outside the CI runner may fail silently otherwise.
  • A deploy script that maps registry entries to files needs a path-aware prefix check (use basename). Auto-deploy triggers must match the new folder glob.
  • Add a docs check (every workflow named in project-map and workflow doc, no dead links) and prove it with a negative test.
  • Do not move shared snapshots (copies of other repos' workflows) into the deploy folder.

n8n workflow exports: readable layout

Depth and recipe: references/n8n-layout.md. Always-on rules:

  • Never move nodes by hand. Generate positions and phase boxes (Zweck + Warum) from a spec file; the tool changes only positions and sticky notes. Prove it by diffing every node (minus position) and the connections against the previous commit.
  • "Readable" includes the edges, not only non-overlapping nodes: measure crossings, backward edges and edges through nodes before and after, and gate them with a budget in a test. Overlap-free alone was rejected by the user.
  • Cut phases along the real control flow and put parallel branches in lanes; stacking phases vertically creates long diagonal edges.
  • Write box texts from the code, not the node names.

Neue Teilworkflows ueber den n8n-MCP

Recipe: references/n8n-mcp-teilworkflow.md (MCP ohne geladene Tools nutzen, SDK-Code erzeugen, Phase herausloesen, Aequivalenztest). Always-on: der Nutzer will neue Workflows ueber den MCP geschrieben sehen, nicht ueber die CI und nicht per Overwrite; Bestand bleibt unberuehrt, neue ID, unveroeffentlicht. Nicht auf Rueckfragen zur Sitzung warten: Ist der MCP in der laufenden Sitzung nicht geladen, direkt den Skript-Weg aus der Referenz nehmen, statt den Nutzer neu starten zu lassen oder die Desktop-App per Bildschirmsteuerung zu bedienen. Bei Zielbeschreibungen ("automatisch verarbeiten ...") erst den Bestand gegen jeden Teilschritt pruefen, dann nur die echte Luecke bauen. Tests duerfen auf eigenen neuen Workflows und Hilfsworkflows laufen; in aktiven Bestandsworkflows (z. B. das gemeinsam genutzte Gateway) wird nichts geaendert, auch nicht ein Parameter, ohne ausdruecklich Okay: Fehler dort belegen, Folgen nennen, fragen. Schreibende Gateway-Operationen im Produktivsystem nur im Probelauf und im Fall "existiert schon" testen. Nichts nachbauen, was der Bestand schon robust kann (z. B. die mehrstufige SharePoint-Ordnersuche in KAF): den Bestand mit echtem Eingabematerial laufen lassen; fehlt nur das Material (ein PDF), den Nutzer nach dem konkreten Vertrag fragen, statt personenbezogene Ordner selbst zu durchsuchen. MCP-Skripte halten eine Verbindung fuer eine ganze Serie (Referenz, Abschnitt Rate-Limit), sonst sperrt n8n mit HTTP 429.

Conventions for this user

  • Do destructive or visible steps (removing files from the original repo, pushing, creating repos) only as agreed; default is: build the new repo first, remove from the old one later in a separate PR.
  • Write results in German; report what was verified (tests run) and what is still open.