agents-gitflow-guard 0.0.26 → 0.0.27

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.de.md ADDED
@@ -0,0 +1,211 @@
1
+ # agents-gitflow-guard
2
+
3
+ > **Sind Sie es leid, dass KI-Agenten Ihren GitFlow umgehen?**
4
+
5
+ Ein konfigurierbarer Branch-Rollen-Guard für KI-Coding-Agenten — [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness) (DSH), Claude Code, Codex, OpenCode, Antigravity und Pi.
6
+ Sie definieren Ihre eigenen Branches — **integration** (Features werden über PR/MR zusammengeführt), **preview** (Umgebungs-Endpunkte), **production** (Produktion), **archive** (Archiv) — jeweils mit eigenen Aktualisierungsregeln. Agenten können den Flow nicht überspringen, und sensible Merges bleiben in Ihrer Hand.
7
+
8
+ [English](README.md) · [简体中文](README.zh.md) · [繁體中文](README.zh-tw.md) · [日本語](README.ja.md) · [한국어](README.ko.md) · [Deutsch](README.de.md) · [Français](README.fr.md) · [Italiano](README.it.md) · [Português](README.pt.md) · [Español](README.es.md) · [Русский](README.ru.md) · [Lizenz](LICENSE)
9
+
10
+ [![ko-fi](https://img.shields.io/badge/ko--fi-FF5E5B?style=flat-square&logo=ko-fi&logoColor=white)](https://ko-fi.com/keanz21)
11
+
12
+ ---
13
+
14
+ ## Inhaltsverzeichnis
15
+
16
+ - [Schnellstart — In 30 Sekunden zu einem geschützten Repository](#schnellstart--in-30-sekunden-zu-einem-geschützten-repository)
17
+ - [Warum — Das Problem, das dieses Plugin löst](#warum--das-problem-das-dieses-plugin-löst)
18
+ - [Zielgruppe — Szenarien & Teams](#zielgruppe--szenarien--teams)
19
+ - [Funktionen — Was es tut](#funktionen--was-es-tut)
20
+ - [Einschränkungen — Was es NICHT tut](#einschränkungen--was-es-nicht-tut)
21
+ - [Server-seitiger Schutz vs. dieses Plugin](#server-seitiger-schutz-vs-dieses-plugin)
22
+ - [Funktionsweise — Der Mechanismus in drei Zeilen](#funktionsweise--der-mechanismus-in-drei-zeilen)
23
+ - [Konfigurationsreferenz](#konfigurationsreferenz)
24
+ - [Gate-Matrix — Was blockiert wird, was durchgelassen wird](#gate-matrix--was-blockiert-wird-was-durchgelassen-wird)
25
+ - [Menschliche Kontrolle — Wo der Entwickler die Kontrolle behält](#menschliche-kontrolle--wo-der-entwickler-die-kontrolle-behält)
26
+ - [Installation im Detail](#installation-im-detail)
27
+ - [FAQ](#faq)
28
+ - [Glossar](#glossar)
29
+ - [Roadmap](#roadmap)
30
+ - [Unterstützung](#unterstützung)
31
+ - [Entwicklung](#entwicklung)
32
+ - [Lizenz](#lizenz)
33
+
34
+ ---
35
+
36
+ ## Schnellstart — In 30 Sekunden zu einem geschützten Repository
37
+
38
+ **Schritt 1 — Installieren.** Alle sechs Clients verwenden dasselbe npm-Paket `agents-gitflow-guard` — wählen Sie Ihren Client:
39
+
40
+ ```bash
41
+ # DSH — In-Process-Plugin (DSH danach neu starten; Plugins werden beim Start geladen)
42
+ dsh plugin --profile web add agents-gitflow-guard
43
+ ```
44
+
45
+ ```bash
46
+ # Claude Code · Codex · OpenCode · Antigravity — Eigenständige Hooks (kein DSH erforderlich)
47
+ npm i -g agents-gitflow-guard
48
+ ```
49
+
50
+ ```bash
51
+ # Pi — In-Process-Erweiterung
52
+ npm i -D agents-gitflow-guard
53
+ ```
54
+
55
+ > **Hinweis**: Ein einfaches `add` oder `npm i` installiert die neueste Version aus der npm-Registry. Falls Ihr Registry-Spiegel Cache-Verzögerungen aufweist oder Sie eine feste Version benötigen, hängen Sie `@<version>` an (z. B. `npm i -g agents-gitflow-guard@<version>`). (DSH-Benutzer: Die pnpm Peer-Dependency-*Warnung* ist normal — DSH stellt `@deepseek-ai/cordis` / `@deepseek-ai/dsh-tools` beim Start bereit; das Plugin funktioniert regulär.)
56
+ >
57
+ > Die Hook-basierten Clients (Claude Code · Codex · OpenCode · Antigravity) erfordern nach der Installation einen einzigen Verdrahtungs-Befehl (**ein Befehl pro Client**, siehe unten). Pi benötigt das Kopieren einer Datei. DSH wird bei der Installation automatisch eingebunden.
58
+
59
+ **Schritt 2 — Client verdrahten (keine Konfigurationsdatei erforderlich).** Der Guard bringt **integrierte Standardeinstellungen mit, die `develop` (Integration) + `main` (Archiv) schützen** — null Konfigurationsaufwand, standardmäßig aktiv. Sie müssen Ihrem KI-Client lediglich mitteilen, den Guard aufzurufen:
60
+
61
+ ```bash
62
+ # Claude Code → .claude/settings.json dieses Repositories
63
+ gitflow-guard wire --client claude --project --yes
64
+ ```
65
+
66
+ ```bash
67
+ # Codex / OpenCode / Antigravity (jeweils eigene Konfigurationsdatei; --yes überspringt die Bestätigung)
68
+ gitflow-guard wire --client codex --project --yes
69
+ gitflow-guard wire --client opencode --project --yes
70
+ gitflow-guard wire --client antigravity --project --yes
71
+ ```
72
+
73
+ ```bash
74
+ # Vorschau (ohne Schreiben) / Entfernen / Interaktiver Assistent:
75
+ gitflow-guard wire --client claude --dry-run
76
+ gitflow-guard wire --client claude --unwire
77
+ gitflow-guard setup
78
+ ```
79
+
80
+ `wire` fügt den Hook **zerstörungsfrei** in Ihre bestehende Konfiguration ein (vorhandene Hooks bleiben unberührt) und schreibt standardmäßig in das **Projektverzeichnis**. `--global` (für alle Repositories auf diesem Rechner) erfordert immer eine Bestätigung oder `--yes`. Die genauen Pfade und Formate finden Sie unter [Installation im Detail](#installation-im-detail).
81
+
82
+ > ⚠️ **main ist standardmäßig geschützt.** Entwickler, die Trunk-basiert arbeiten (direkter Push auf einen einzigen Branch), werden bei direkten Pushes auf `main` blockiert, bis sie den Guard deaktivieren — erstellen Sie dazu eine `gitflow-guard.config.json` mit `{ "enabled": false }` oder definieren Sie eigene Branch-Zuordnungen (siehe [Konfigurationsreferenz](#konfigurationsreferenz)). `gitflow-guard status` weist darauf hin, wenn die Standardeinstellungen aktiv sind.
83
+
84
+ **Schritt 3 — Überprüfen.** Weisen Sie den Agenten an, `git push origin develop` auszuführen. Der Aufruf wird blockiert:
85
+
86
+ ```text
87
+ Error: [gitflow-guard] blocked: Protected branch "develop" forbids direct push
88
+ Next: Integration branch (develop) is updated via PR/MR from a feature branch: push the feature first, then `gh pr create --base develop` / `glab mr create --target-branch develop`.
89
+ ```
90
+
91
+ Nachrichten werden standardmäßig auf Englisch ausgegeben; über `"locale": "zh"` kann auf Chinesisch gewechselt werden (siehe [Konfigurationsreferenz](#konfigurationsreferenz)).
92
+
93
+ **Fertig.** Der Guard ist mit den Standardeinstellungen aktiv. Für weitere Stages (`preview` / `production`) oder andere Branch-Namen erstellen Sie einfach eine `gitflow-guard.config.json` mit den gewünschten Feldern. Die vollständige Entscheidungstabelle finden Sie in der [Gate-Matrix](#gate-matrix--was-blockiert-wird-was-durchgelassen-wird).
94
+
95
+ ---
96
+
97
+ ## Warum — Das Problem, das dieses Plugin löst
98
+
99
+ KI-Coding-Agenten arbeiten direkt in Ihrem Repository. Ihnen wird über System-Prompts und Projektdateien (`AGENTS.md`, `CLAUDE.md` etc.) mitgeteilt, wie der Branching-Flow aussieht.
100
+
101
+ **Dies sind jedoch weiche Regeln.** Agenten überspringen oder „vergessen“ diese Regeln gelegentlich — nicht aus böser Absicht, sondern weil Textanweisungen für ein Sprachmodell unverbindlich sind.
102
+
103
+ Dieses Plugin verwandelt weiche Anweisungen in **harte Mechanismen**. Jede Git-Operation wird vor der Ausführung gegen den tatsächlichen lokalen Repository-Zustand geprüft. Verstöße werden blockiert, bevor der Befehl ausgeführt wird.
104
+
105
+ Niemand muss sich Regeln merken — die Regeln werden technisch durchgesetzt.
106
+
107
+ ---
108
+
109
+ ## Zielgruppe — Szenarien & Teams
110
+
111
+ - Sie haben einen definierten Branch-Flow (von einem einfachen `develop`-Zweig bis zu mehrstufigen Preview/Production-Pipelines).
112
+ - Ein Agent hat bereits einmal direkt auf einen geschützten Branch gepusht oder unerlaubt gemergt.
113
+ - Sie möchten Branch-Schutz nicht rein menschlicher Aufmerksamkeit überlassen.
114
+ - Mehrere Features werden parallel entwickelt und in geteilten Umgebungen zusammengeführt.
115
+
116
+ ---
117
+
118
+ ## Funktionen — Was es tut
119
+
120
+ - **Blockiert vor der Ausführung**: Direkte Pushes, Force-Pushes und Löschungen geschützter Branches (integration / preview / production / archive) sowie Agenten-Merges in production/archive.
121
+ - **Rollenbasiert & flexibel konfigurierbar**: `integration` (Standard: `develop`) als Kernrolle; `preview`, `production`, `archive` optional konfigurierbar.
122
+ - **Menschliche Freigabe (Merge-by-user)**: Merges in Produktions- und Archiv-Branches sind Agenten verwehrt — nur der Klick des Entwicklers im PR führt den Merge durch.
123
+ - **Vollständiges Audit-Log**: Jeder abgewiesene Befehl wird in `~/.local/state/gitflow-guard/` protokolliert — außerhalb des Repositories und manipulationssicher.
124
+ - **Plattformunabhängig**: Arbeitet rein mit lokalem Git; unterstützt optional `gh` (GitHub) oder `glab` (GitLab).
125
+
126
+ ---
127
+
128
+ ## Einschränkungen — Was es NICHT tut
129
+
130
+ - **Keine absolute Sicherheitsgrenze**: Die Befehlsanalyse basiert auf Heuristiken. Absichtlich stark verschleierte Befehle können die Textanalyse umgehen.
131
+ - **Kein Ersatz für Server-Branch-Protection**: Echter Schutz im Team gehört zusätzlich in die GitHub/GitLab-Einstellungen.
132
+ - **Kein Ersatz für den Workflow selbst**: Das Repository muss mindestens einen `integration`-Branch aufweisen.
133
+
134
+ ---
135
+
136
+ ## Konfigurationsreferenz
137
+
138
+ ### Standardeinstellungen & Deep-Merge
139
+
140
+ Der Guard ist **ohne Konfigurationsdatei standardmäßig aktiv**:
141
+
142
+ | Standard | Rolle | Regel |
143
+ |---|---|---|
144
+ | `develop` | **integration** | Kein direkter Push; Aktualisierung über PR/MR (`update: "pr"`) |
145
+ | `main` | **archive** | Kein direkter Push / kein Agenten-Merge (`mergeBy: "user"`) |
146
+
147
+ Benutzerdefinierte Felder in `gitflow-guard.config.json` überschreiben die Standardwerte per **Deep-Merge**:
148
+
149
+ ```jsonc
150
+ {
151
+ "enabled": true,
152
+ "featurePattern": "feature/[\\w-]+",
153
+ "branches": {
154
+ "integration": ["develop"],
155
+ "preview": ["staging", "preview-[\\w-]+"],
156
+ "production": { "branches": ["prod"], "update": "pr", "mergeBy": "user" },
157
+ "archive": ["main"]
158
+ }
159
+ }
160
+ ```
161
+
162
+ ---
163
+
164
+ ## Gate-Matrix — Was blockiert wird, was durchgelassen wird
165
+
166
+ | Agenten-Aktion | Entscheidung |
167
+ |---|---|
168
+ | commit / push auf Feature-Branch / sync / rebase | ✅ allow (erlaubt) |
169
+ | Direkter push / force-push / Löschen von integration / preview / production / archive | 🚫 block (blockiert) |
170
+ | PR/MR: Feature → integration / preview | ✅ allow (erlaubt) |
171
+ | PR/MR: Feature → production | ✅ Erstellung erlaubt; **Merge blockiert** (Entwickler führt Merge aus) |
172
+ | PR/MR → archive | ✅ Erstellung erlaubt; 🚫 **Merge blockiert** (Entwickler führt Merge aus) |
173
+ | Lokales `git merge feature/x` auf integration / preview | 🚫 block (PR/MR erforderlich; `update: flexible` erlaubt es) |
174
+ | Verkettete Befehle (`checkout develop && merge feature/x`) | 🚫 block (Branch-Wechsel wird pro Segment simuliert) |
175
+ | Erzwingen des Zurücksetzens geschützter Branches (`git checkout -B/-C`) | 🚫 block (ref-update Gate) |
176
+ | `git symbolic-ref` Änderungen auf geschützten Branches | 🚫 block (ref-update Gate) |
177
+ | `git cherry-pick` / `git revert` auf geschützten Branches | 🚫 block (Verlaufsänderung auf geschütztem Branch verhindert) |
178
+ | Mit `sudo` gewrappte Git-Befehle | 🚫 Wrapper wird entfernt (`sudo -u …` inkl.) und Git-Befehl geprüft |
179
+
180
+ ---
181
+
182
+ ## Installation im Detail
183
+
184
+ **Voraussetzung**: **Node.js ≥ 22** auf Ihrem `PATH`.
185
+
186
+ ```bash
187
+ # Global installieren
188
+ npm i -g agents-gitflow-guard
189
+
190
+ # Client konfigurieren (Wire)
191
+ gitflow-guard wire --client claude --project --yes
192
+ gitflow-guard wire --client codex --project --yes
193
+ gitflow-guard wire --client opencode --project --yes
194
+ gitflow-guard wire --client antigravity --project --yes
195
+ ```
196
+
197
+ ---
198
+
199
+ ## FAQ
200
+
201
+ ### Kann ich abweichende Branch-Namen verwenden?
202
+ Ja. Branch-Namen sind vollständig frei wählbar und werden über `gitflow-guard.config.json` definiert.
203
+
204
+ ### Blockiert das Plugin meine normale Entwicklungsarbeit?
205
+ Nein. Sämtliche reguläre Feature-Branch-Arbeiten (Commits, Pushes, Rebase, Tests) laufen ohne jede Einschränkung.
206
+
207
+ ---
208
+
209
+ ## Lizenz
210
+
211
+ [MIT](LICENSE) © FeatureAgents
package/README.es.md ADDED
@@ -0,0 +1,137 @@
1
+ # agents-gitflow-guard
2
+
3
+ > **¿Cansado de que los agentes de IA ignoren tu GitFlow?**
4
+
5
+ Un guardián configurable para roles de ramas Git, diseñado para agentes de programación de IA — [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness) (DSH), Claude Code, Codex, OpenCode, Antigravity y Pi.
6
+ Define tus propias ramas — **integration** (las funcionalidades se integran mediante PR/MR), **preview** (entornos de prueba), **production** (producción), **archive** (archivo) — cada una con sus propias reglas de actualización. Los agentes no pueden eludir el flujo y los merges críticos permanecen bajo tu control humano.
7
+
8
+ [English](README.md) · [简体中文](README.zh.md) · [繁體中文](README.zh-tw.md) · [日本語](README.ja.md) · [한국어](README.ko.md) · [Deutsch](README.de.md) · [Français](README.fr.md) · [Italiano](README.it.md) · [Português](README.pt.md) · [Español](README.es.md) · [Русский](README.ru.md) · [Licencia](LICENSE)
9
+
10
+ [![ko-fi](https://img.shields.io/badge/ko--fi-FF5E5B?style=flat-square&logo=ko-fi&logoColor=white)](https://ko-fi.com/keanz21)
11
+
12
+ ---
13
+
14
+ ## Índice
15
+
16
+ - [Inicio Rápido — 30 segundos para proteger tu repositorio](#inicio-rápido--30-segundos-para-proteger-tu-repositorio)
17
+ - [Por qué — El problema que resuelve este plugin](#por-qué--el-problema-que-resuelve-este-plugin)
18
+ - [Para quién es — Escenarios y equipos](#para-quién-es--escenarios-y-equipos)
19
+ - [Qué hace — Capacidades](#qué-hace--capacidades)
20
+ - [Qué NO hace — Límites](#qué-no-hace--límites)
21
+ - [Protección del lado del servidor vs este plugin](#protección-del-lado-del-servidor-vs-este-plugin)
22
+ - [Cómo funciona — El mecanismo en tres líneas](#cómo-funciona--el-mecanismo-en-tres-líneas)
23
+ - [Referencia de Configuración](#referencia-de-configuración)
24
+ - [Matriz de Decisión — Qué se bloquea y qué se permite](#matriz-de-decisión--qué-se-bloquea-y-qué-se-permite)
25
+ - [Dónde el humano mantiene el control](#dónde-el-humano-mantiene-el-control)
26
+ - [Instalación Detallada](#instalación-detallada)
27
+ - [Preguntas Frecuentes (FAQ)](#preguntas-frecuentes-faq)
28
+ - [Glosario](#glosario)
29
+ - [Hoja de Ruta (Roadmap)](#hoja-de-ruta-roadmap)
30
+ - [Soporte](#soporte)
31
+ - [Desarrollo](#desarrollo)
32
+ - [Licencia](#licencia)
33
+
34
+ ---
35
+
36
+ ## Inicio Rápido — 30 segundos para proteger tu repositorio
37
+
38
+ **Paso 1 — Instalación.** Los seis clientes utilizan el mismo paquete npm `agents-gitflow-guard`:
39
+
40
+ ```bash
41
+ # DSH — Plugin en proceso (reiniciar DSH después de la instalación)
42
+ dsh plugin --profile web add agents-gitflow-guard
43
+ ```
44
+
45
+ ```bash
46
+ # Claude Code · Codex · OpenCode · Antigravity — Hooks autónomos (sin necesidad de DSH)
47
+ npm i -g agents-gitflow-guard
48
+ ```
49
+
50
+ ```bash
51
+ # Pi — Extensión en proceso
52
+ npm i -D agents-gitflow-guard
53
+ ```
54
+
55
+ **Paso 2 — Conectar el cliente (sin necesidad de archivo de configuración).** El plugin viene con **valores predeterminados integrados que protegen `develop` (integración) + `main` (archivo)** — activado por defecto con cero configuración:
56
+
57
+ ```bash
58
+ # Claude Code → .claude/settings.json de este repositorio
59
+ gitflow-guard wire --client claude --project --yes
60
+ ```
61
+
62
+ ```bash
63
+ # Codex / OpenCode / Antigravity (archivos dedicados por cliente)
64
+ gitflow-guard wire --client codex --project --yes
65
+ gitflow-guard wire --client opencode --project --yes
66
+ gitflow-guard wire --client antigravity --project --yes
67
+ ```
68
+
69
+ ```bash
70
+ # Vista previa sin escribir / Desinstalación / Asistente interactivo:
71
+ gitflow-guard wire --client claude --dry-run
72
+ gitflow-guard wire --client claude --unwire
73
+ gitflow-guard setup
74
+ ```
75
+
76
+ `wire` inserta la configuración de forma **no destructiva** en tus archivos existentes.
77
+
78
+ > ⚠️ **main está protegido por defecto.** Para flujos de tipo Trunk-based, desactiva el guard estableciendo `{ "enabled": false }` en `gitflow-guard.config.json`.
79
+
80
+ **Paso 3 — Verificación.** Pide al agente que ejecute `git push origin develop`. La operación será bloqueada:
81
+
82
+ ```text
83
+ Error: [gitflow-guard] blocked: Protected branch "develop" forbids direct push
84
+ Next: Integration branch (develop) is updated via PR/MR from a feature branch: push the feature first, then `gh pr create --base develop` / `glab mr create --target-branch develop`.
85
+ ```
86
+
87
+ ---
88
+
89
+ ## Por qué — El problema que resuelve este plugin
90
+
91
+ Los agentes de programación de IA trabajan directamente en tu repositorio. Las instrucciones en prompts y archivos de documentación (`AGENTS.md`, `CLAUDE.md`, etc.) son **reglas flexibles**: los modelos pueden ignorarlas u olvidarlas.
92
+
93
+ Este plugin transforma reglas de texto en **mecanismos rígidos de sistema**. Cada comando Git intentado por el agente es interceptado y validado contra el estado real del repositorio local antes de su ejecución.
94
+
95
+ ---
96
+
97
+ ## Qué hace — Capacidades
98
+
99
+ - **Bloqueo previo a la ejecución**: Push directo, force push y eliminación de ramas protegidas (integration, preview, production, archive) se bloquean antes de ejecutarse.
100
+ - **Merge exclusivo por humanos (Merge-by-user)**: Los agentes pueden crear PR/MR hacia producción o archivo, pero el merge efectivo está reservado al usuario.
101
+ - **Registro de auditoría seguro**: Cada denegación se registra en `~/.local/state/gitflow-guard/` fuera del repositorio.
102
+
103
+ ---
104
+
105
+ ## Matriz de Decisión — Qué se bloquea y qué se permite
106
+
107
+ | Acción del Agente | Decisión |
108
+ |---|---|
109
+ | commit / push en rama feature / sync / rebase | ✅ allow (permitido) |
110
+ | Push directo / force push / eliminación en integration / preview / production / archive | 🚫 block (bloqueado) |
111
+ | Creación de PR/MR: feature → integration / preview | ✅ allow (permitido) |
112
+ | Creación de PR/MR: feature → production | ✅ Creación permitida; **Merge bloqueado** (el usuario realiza el merge) |
113
+ | Creación de PR/MR → archive | ✅ Creación permitida; 🚫 **Merge bloqueado** (el usuario realiza el merge) |
114
+ | `git merge feature/x` local en integration / preview | 🚫 block (PR/MR obligatorio) |
115
+ | Comandos encadenados (`checkout develop && merge feature/x`) | 🚫 block (simulación por segmento) |
116
+ | `git checkout -B` / `git switch -C` hacia ramas protegidas | 🚫 block |
117
+ | Comandos Git ejecutados con `sudo` | 🚫 Envoltura eliminada y comando subyacente validado |
118
+
119
+ ---
120
+
121
+ ## Instalación Detallada
122
+
123
+ **Requisito previo**: **Node.js ≥ 22** en tu `PATH`.
124
+
125
+ ```bash
126
+ npm i -g agents-gitflow-guard
127
+ gitflow-guard wire --client claude --project --yes
128
+ gitflow-guard wire --client codex --project --yes
129
+ gitflow-guard wire --client opencode --project --yes
130
+ gitflow-guard wire --client antigravity --project --yes
131
+ ```
132
+
133
+ ---
134
+
135
+ ## Licencia
136
+
137
+ [MIT](LICENSE) © FeatureAgents
package/README.fr.md ADDED
@@ -0,0 +1,138 @@
1
+ # agents-gitflow-guard
2
+
3
+ > **Vous en avez assez que les agents IA contournent votre GitFlow ?**
4
+
5
+ Un garde-fou configurable pour les rôles de branches Git, conçu pour les agents de codage IA — [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness) (DSH), Claude Code, Codex, OpenCode, Antigravity et Pi.
6
+ Définissez vos propres branches — **integration** (les fonctionnalités sont intégrées via PR/MR), **preview** (environnements de test), **production**, **archive** — chacune avec ses propres règles. Les agents ne peuvent pas contourner le processus et les fusions sensibles restent sous contrôle humain.
7
+
8
+ [English](README.md) · [简体中文](README.zh.md) · [繁體中文](README.zh-tw.md) · [日本語](README.ja.md) · [한국어](README.ko.md) · [Deutsch](README.de.md) · [Français](README.fr.md) · [Italiano](README.it.md) · [Português](README.pt.md) · [Español](README.es.md) · [Русский](README.ru.md) · [Licence](LICENSE)
9
+
10
+ [![ko-fi](https://img.shields.io/badge/ko--fi-FF5E5B?style=flat-square&logo=ko-fi&logoColor=white)](https://ko-fi.com/keanz21)
11
+
12
+ ---
13
+
14
+ ## Table des matières
15
+
16
+ - [Démarrage rapide — 30 secondes pour protéger un dépôt](#démarrage-rapide--30-secondes-pour-protéger-un-dépôt)
17
+ - [Pourquoi — Le problème résolu par ce plugin](#pourquoi--le-problème-résolu-par-ce-plugin)
18
+ - [Pour qui — Cas d'usage et équipes](#pour-qui--cas-dusage-et-équipes)
19
+ - [Fonctionnalités — Ce que fait le plugin](#fonctionnalités--ce-que-fait-le-plugin)
20
+ - [Ce que le plugin ne fait PAS — Limites](#ce-que-le-plugin-ne-fait-pas--limites)
21
+ - [Protection côté serveur vs ce plugin](#protection-côté-serveur-vs-ce-plugin)
22
+ - [Fonctionnement — Le mécanisme en trois lignes](#fonctionnement--le-mécanisme-en-trois-lignes)
23
+ - [Référence de configuration](#référence-de-configuration)
24
+ - [Matrice de décision — Ce qui est bloqué ou autorisé](#matrice-de-décision--ce-qui-est-bloqué-ou-autorisé)
25
+ - [Le contrôle reste humain](#le-contrôle-reste-humain)
26
+ - [Installation détaillée](#installation-détaillée)
27
+ - [Foire aux questions (FAQ)](#foire-aux-questions-faq)
28
+ - [Glossaire](#glossaire)
29
+ - [Feuille de route](#feuille-de-route)
30
+ - [Support](#support)
31
+ - [Développement](#développement)
32
+ - [Licence](#licence)
33
+
34
+ ---
35
+
36
+ ## Démarrage rapide — 30 secondes pour protéger un dépôt
37
+
38
+ **Étape 1 — Installation.** Les six clients utilisent le même paquet npm `agents-gitflow-guard` :
39
+
40
+ ```bash
41
+ # DSH — Plugin interne au processus (redémarrer DSH après installation)
42
+ dsh plugin --profile web add agents-gitflow-guard
43
+ ```
44
+
45
+ ```bash
46
+ # Claude Code · Codex · OpenCode · Antigravity — Hooks autonomes (sans DSH)
47
+ npm i -g agents-gitflow-guard
48
+ ```
49
+
50
+ ```bash
51
+ # Pi — Extension interne
52
+ npm i -D agents-gitflow-guard
53
+ ```
54
+
55
+ > **Remarque** : Une commande standard installe la dernière version. Pour figer une version spécifique, ajoutez `@<version>` (ex: `npm i -g agents-gitflow-guard@<version>`).
56
+
57
+ **Étape 2 — Connexion du client (aucun fichier de configuration requis).** Le plugin intègre des **valeurs par défaut qui protègent `develop` (intégration) + `main` (archive)** — activé d'office avec zéro configuration :
58
+
59
+ ```bash
60
+ # Claude Code → .claude/settings.json de ce dépôt
61
+ gitflow-guard wire --client claude --project --yes
62
+ ```
63
+
64
+ ```bash
65
+ # Codex / OpenCode / Antigravity (fichiers de configuration dédiés)
66
+ gitflow-guard wire --client codex --project --yes
67
+ gitflow-guard wire --client opencode --project --yes
68
+ gitflow-guard wire --client antigravity --project --yes
69
+ ```
70
+
71
+ ```bash
72
+ # Aperçu sans écriture / Désinstallation / Assistant interactif :
73
+ gitflow-guard wire --client claude --dry-run
74
+ gitflow-guard wire --client claude --unwire
75
+ gitflow-guard setup
76
+ ```
77
+
78
+ `wire` insère la configuration de façon **non destructive** dans vos fichiers existants.
79
+
80
+ > ⚠️ **main est protégé par défaut.** Pour les flux de type Trunk-based (où tout le monde pousse sur une branche unique), désactivez le garde avec `{ "enabled": false }` dans `gitflow-guard.config.json`.
81
+
82
+ **Étape 3 — Vérification.** Demandez à l'agent d'exécuter `git push origin develop`. L'opération sera bloquée :
83
+
84
+ ```text
85
+ Error: [gitflow-guard] blocked: Protected branch "develop" forbids direct push
86
+ Next: Integration branch (develop) is updated via PR/MR from a feature branch: push the feature first, then `gh pr create --base develop` / `glab mr create --target-branch develop`.
87
+ ```
88
+
89
+ ---
90
+
91
+ ## Pourquoi — Le problème résolu par ce plugin
92
+
93
+ Les agents IA de codage travaillent directement dans votre dépôt. Les instructions dans les fichiers Markdown (`AGENTS.md`, `CLAUDE.md`, etc.) sont des **règles souples** : les modèles peuvent les ignorer ou les oublier.
94
+
95
+ Ce plugin transforme les consignes textuelles en **mécanismes rigides**. Toute commande Git exécutée par l'agent est interceptée et validée par rapport à l'état réel du dépôt local avant exécution.
96
+
97
+ ---
98
+
99
+ ## Fonctionnalités — Ce que fait le plugin
100
+
101
+ - **Blocage pré-exécution** : Pousser directement, forcer le push ou supprimer des branches protégées (integration, preview, production, archive) est bloqué.
102
+ - **Fusion par l'humain uniquement (Merge-by-user)** : Les agents peuvent créer des PR/MR vers la production et l'archive, mais la fusion effective est réservée à l'humain.
103
+ - **Journal d'audit inviolable** : Chaque refus est consigné dans `~/.local/state/gitflow-guard/` en dehors du dépôt.
104
+
105
+ ---
106
+
107
+ ## Matrice de décision — Ce qui est bloqué ou autorisé
108
+
109
+ | Action de l'agent | Décision |
110
+ |---|---|
111
+ | commit / push sur branche feature / rebase / sync | ✅ allow (autorisé) |
112
+ | Push direct / force push / suppression sur integration / preview / production / archive | 🚫 block (bloqué) |
113
+ | Création de PR/MR : feature → integration / preview | ✅ allow (autorisé) |
114
+ | Création de PR/MR : feature → production | ✅ Création autorisée ; **Fusion bloquée** (réservée à l'humain) |
115
+ | Création de PR/MR → archive | ✅ Création autorisée ; 🚫 **Fusion bloquée** (réservée à l'humain) |
116
+ | `git merge feature/x` localement sur integration / preview | 🚫 block (PR/MR requis) |
117
+ | `git checkout -B` / `git switch -C` ciblant une branche protégée | 🚫 block |
118
+ | Commandes Git encapsulées dans `sudo` | 🚫 Enveloppe retirée et commande sous-jacente vérifiée |
119
+
120
+ ---
121
+
122
+ ## Installation détaillée
123
+
124
+ **Prérequis** : **Node.js ≥ 22** dans votre `PATH`.
125
+
126
+ ```bash
127
+ npm i -g agents-gitflow-guard
128
+ gitflow-guard wire --client claude --project --yes
129
+ gitflow-guard wire --client codex --project --yes
130
+ gitflow-guard wire --client opencode --project --yes
131
+ gitflow-guard wire --client antigravity --project --yes
132
+ ```
133
+
134
+ ---
135
+
136
+ ## Licence
137
+
138
+ [MIT](LICENSE) © FeatureAgents
package/README.it.md ADDED
@@ -0,0 +1,137 @@
1
+ # agents-gitflow-guard
2
+
3
+ > **Sei stanco che gli agenti IA ignorino il tuo GitFlow?**
4
+
5
+ Un guardiano configurabile per i ruoli dei branch Git, progettato per gli agenti di sviluppo IA — [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness) (DSH), Claude Code, Codex, OpenCode, Antigravity e Pi.
6
+ Definisci i tuoi branch — **integration** (le funzionalità vengono integrate tramite PR/MR), **preview** (ambienti di test), **production** (produzione), **archive** (archivio) — ciascuno con le proprie regole di aggiornamento. Gli agenti non possono saltare il flusso e i merge critici rimangono sotto il tuo controllo.
7
+
8
+ [English](README.md) · [简体中文](README.zh.md) · [繁體中文](README.zh-tw.md) · [日本語](README.ja.md) · [한국어](README.ko.md) · [Deutsch](README.de.md) · [Français](README.fr.md) · [Italiano](README.it.md) · [Português](README.pt.md) · [Español](README.es.md) · [Русский](README.ru.md) · [Licenza](LICENSE)
9
+
10
+ [![ko-fi](https://img.shields.io/badge/ko--fi-FF5E5B?style=flat-square&logo=ko-fi&logoColor=white)](https://ko-fi.com/keanz21)
11
+
12
+ ---
13
+
14
+ ## Indice
15
+
16
+ - [Guida rapida — 30 secondi per proteggere il repository](#guida-rapida--30-secondi-per-proteggere-il-repository)
17
+ - [Perché — Il problema risolto da questo plugin](#perché--il-problema-risolto-da-questo-plugin)
18
+ - [Per chi è pensato — Scenari e team](#per-chi-è-pensato--scenari-e-team)
19
+ - [Funzionalità — Cosa fa il plugin](#funzionalità--cosa-fa-il-plugin)
20
+ - [Cosa NON fa — Limiti](#cosa-non-fa--limiti)
21
+ - [Protezione lato server vs questo plugin](#protezione-lato-server-vs-questo-plugin)
22
+ - [Come funziona — Il meccanismo in tre righe](#come-funziona--il-meccanismo-in-tre-righe)
23
+ - [Riferimento configurazione](#riferimento-configurazione)
24
+ - [Matrice decisionale — Cosa viene bloccato e cosa consentito](#matrice-decisionale--cosa-viene-bloccato-e-cosa-consentito)
25
+ - [Il controllo umano](#il-controllo-umano)
26
+ - [Installazione dettagliata](#installazione-dettagliata)
27
+ - [Domande frequenti (FAQ)](#domande-frequenti-faq)
28
+ - [Glossario](#glossario)
29
+ - [Tabella di marcia](#tabella-di-marcia)
30
+ - [Supporto](#supporto)
31
+ - [Sviluppo](#sviluppo)
32
+ - [Licenza](#licenza)
33
+
34
+ ---
35
+
36
+ ## Guida rapida — 30 secondi per proteggere il repository
37
+
38
+ **Passo 1 — Installazione.** Tutti e sei i client utilizzano lo stesso pacchetto npm `agents-gitflow-guard`:
39
+
40
+ ```bash
41
+ # DSH — Plugin in-process (riavviare DSH dopo l'installazione)
42
+ dsh plugin --profile web add agents-gitflow-guard
43
+ ```
44
+
45
+ ```bash
46
+ # Claude Code · Codex · OpenCode · Antigravity — Hook autonomi (senza DSH)
47
+ npm i -g agents-gitflow-guard
48
+ ```
49
+
50
+ ```bash
51
+ # Pi — Estensione in-process
52
+ npm i -D agents-gitflow-guard
53
+ ```
54
+
55
+ **Passo 2 — Configurazione del client (nessun file di configurazione richiesto).** Il plugin include **valori predefiniti integrati per proteggere `develop` (integrazione) + `main` (archivio)** — attivo per impostazione predefinita senza alcuna configurazione iniziale:
56
+
57
+ ```bash
58
+ # Claude Code → .claude/settings.json di questo repository
59
+ gitflow-guard wire --client claude --project --yes
60
+ ```
61
+
62
+ ```bash
63
+ # Codex / OpenCode / Antigravity (file dedicati per ciascun client)
64
+ gitflow-guard wire --client codex --project --yes
65
+ gitflow-guard wire --client opencode --project --yes
66
+ gitflow-guard wire --client antigravity --project --yes
67
+ ```
68
+
69
+ ```bash
70
+ # Anteprima senza scrittura / Rimozione / Configurazione guidata:
71
+ gitflow-guard wire --client claude --dry-run
72
+ gitflow-guard wire --client claude --unwire
73
+ gitflow-guard setup
74
+ ```
75
+
76
+ `wire` applica le modifiche in modo **non distruttivo** ai file di configurazione esistenti.
77
+
78
+ > ⚠️ **main è protetto per impostazione predefinita.** Per i flussi di tipo Trunk-based, disattiva il plugin impostando `{ "enabled": false }` in `gitflow-guard.config.json`.
79
+
80
+ **Passo 3 — Verifica.** Chiedi all'agente di eseguire `git push origin develop`. L'operazione verrà bloccata:
81
+
82
+ ```text
83
+ Error: [gitflow-guard] blocked: Protected branch "develop" forbids direct push
84
+ Next: Integration branch (develop) is updated via PR/MR from a feature branch: push the feature first, then `gh pr create --base develop` / `glab mr create --target-branch develop`.
85
+ ```
86
+
87
+ ---
88
+
89
+ ## Perché — Il problema risolto da questo plugin
90
+
91
+ Gli agenti IA lavorano direttamente nel repository. Le istruzioni nei prompt di sistema e nei file di progetto (`AGENTS.md`, `CLAUDE.md`, ecc.) sono **regole flessibili**: i modelli possono dimenticarle o ignorarle.
92
+
93
+ Questo plugin trasforma le regole testuali in **vincoli rigidi di sistema**. Ogni comando Git tentato dall'agente viene intercettato e verificato rispetto allo stato reale del repository locale prima dell'esecuzione.
94
+
95
+ ---
96
+
97
+ ## Funzionalità — Cosa fa il plugin
98
+
99
+ - **Blocco pre-esecuzione**: Push diretti, force push e cancellazioni su branch protetti (integration, preview, production, archive) vengono bloccati prima dell'esecuzione.
100
+ - **Merge riservato all'umano (Merge-by-user)**: Gli agenti possono creare PR/MR verso la produzione o l'archivio, ma il merge effettivo è riservato all'utente.
101
+ - **Audit log protetto**: Tutte le operazioni respinte vengono registrate in `~/.local/state/gitflow-guard/` al di fuori del repository.
102
+
103
+ ---
104
+
105
+ ## Matrice decisionale — Cosa viene bloccato e cosa consentito
106
+
107
+ | Azione dell'agente | Decisione |
108
+ |---|---|
109
+ | commit / push su branch feature / sync / rebase | ✅ allow (consentito) |
110
+ | Push diretto / force push / cancellazione su integration / preview / production / archive | 🚫 block (bloccato) |
111
+ | Creazione PR/MR: feature → integration / preview | ✅ allow (consentito) |
112
+ | Creazione PR/MR: feature → production | ✅ Creazione consentita; **Merge bloccato** (eseguito dall'utente) |
113
+ | Creazione PR/MR → archive | ✅ Creazione consentita; 🚫 **Merge bloccato** (eseguito dall'utente) |
114
+ | `git merge feature/x` locale su integration / preview | 🚫 block (PR/MR richiesto) |
115
+ | Comandi concatenati (`checkout develop && merge feature/x`) | 🚫 block (simulazione per segmento) |
116
+ | `git checkout -B` / `git switch -C` verso branch protetti | 🚫 block |
117
+ | Comandi Git eseguiti con `sudo` | 🚫 Wrapper rimosso e comando sottostante verificato |
118
+
119
+ ---
120
+
121
+ ## Installazione dettagliata
122
+
123
+ **Prerequisiti**: **Node.js ≥ 22** nel tuo `PATH`.
124
+
125
+ ```bash
126
+ npm i -g agents-gitflow-guard
127
+ gitflow-guard wire --client claude --project --yes
128
+ gitflow-guard wire --client codex --project --yes
129
+ gitflow-guard wire --client opencode --project --yes
130
+ gitflow-guard wire --client antigravity --project --yes
131
+ ```
132
+
133
+ ---
134
+
135
+ ## Licenza
136
+
137
+ [MIT](LICENSE) © FeatureAgents