thumbgate 1.5.0 → 1.5.2

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.md CHANGED
@@ -1,22 +1,32 @@
1
1
  # ThumbGate
2
2
 
3
- **Stop AI agents before they make costly mistakes.**
3
+ **Your AI coding bill has a leak.**
4
4
 
5
- ThumbGate checks risky commands, file edits, deploys, API calls, and other agent actions before they run. Thumbs-up/down feedback becomes remembered lessons, repeated failures become Pre-Action Gates, and the next bad action gets blocked instead of becoming another cleanup bill.
5
+ **Stop paying $ for the same AI mistake.**
6
+
7
+ Every retry loop, every hallucinated import, every *"let me try a different approach"* — those are billable tokens on every LLM vendor's bill. Thumbs-down once; ThumbGate blocks that exact mistake on every future call. Across Claude Code, Cursor, Codex, Gemini, Amp, OpenCode — any MCP-compatible agent, forever.
8
+
9
+ Under the hood: your thumbs-down becomes a **Pre-Action Gate** that physically blocks the pattern **permanently** on every future call — across every session, every model, every agent. It is **self-improving agent governance**: every correction promotes a fresh prevention rule, and your library of Pre-Action Gates grows stronger with every lesson. Works with Claude Code, Cursor, Codex, Gemini CLI, Amp, OpenCode, and any MCP-compatible agent. The monthly Anthropic / OpenAI bill stops paying for the same lesson over and over — local-first enforcement, zero tokens spent on repeats.
10
+
11
+ > **Prevent expensive AI mistakes. Make AI stop repeating mistakes. Turn a smart assistant into a reliable operator.**
12
+
13
+ > **Mission:** make AI coding affordable by making sure you never pay for the same mistake twice.
6
14
 
7
15
  [![CI](https://github.com/IgorGanapolsky/ThumbGate/actions/workflows/ci.yml/badge.svg)](https://github.com/IgorGanapolsky/ThumbGate/actions/workflows/ci.yml)
8
16
  [![npm](https://img.shields.io/npm/v/thumbgate)](https://www.npmjs.com/package/thumbgate)
9
17
  [![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)](LICENSE)
10
- [![Start Sprint](https://img.shields.io/badge/Workflow%20Hardening%20Sprint-Start%20Intake%20→-16a34a?style=for-the-badge)](https://thumbgate-production.up.railway.app/?utm_source=github&utm_medium=readme&utm_campaign=badge_cta#workflow-sprint-intake)
11
- [![Open ThumbGate GPT](https://img.shields.io/badge/ChatGPT-Open%20ThumbGate%20GPT-10a37f?style=for-the-badge&logo=openai&logoColor=white)](https://thumbgate-production.up.railway.app/go/gpt?utm_source=github&utm_medium=readme&utm_campaign=badge_cta&cta_id=readme_badge_open_gpt&cta_placement=readme_badge)
12
18
 
13
- **[Workflow Hardening Sprint](https://thumbgate-production.up.railway.app/?utm_source=github&utm_medium=readme&utm_campaign=top_cta#workflow-sprint-intake)** · **[Open ThumbGate GPT](https://thumbgate-production.up.railway.app/go/gpt?utm_source=github&utm_medium=readme&utm_campaign=top_cta&cta_id=readme_open_gpt&cta_placement=readme_top)** · **[ChatGPT Actions setup](adapters/chatgpt/INSTALL.md)** · **[Install Claude Desktop Extension](https://github.com/IgorGanapolsky/ThumbGate/releases/latest/download/thumbgate-claude-desktop.mcpb)** · **[Claude Plugin Guide](docs/CLAUDE_DESKTOP_EXTENSION.md)** · **[Install Codex Plugin](https://github.com/IgorGanapolsky/ThumbGate/releases/latest/download/thumbgate-codex-plugin.zip)** · **[ThumbGate Bench](docs/THUMBGATE_BENCH.md)** · **[Perplexity Command Center](docs/PERPLEXITY_MAX_COMMAND_CENTER.md)** · **[Live Dashboard](https://thumbgate-production.up.railway.app/dashboard?utm_source=github&utm_medium=readme&utm_campaign=top_cta)** · **[Pro Page](https://thumbgate-production.up.railway.app/pro?utm_source=github&utm_medium=readme&utm_campaign=pro_page)**
19
+ ---
14
20
 
15
- **Popular buyer questions:** **[Stop repeated AI agent mistakes](https://thumbgate-production.up.railway.app/guides/stop-repeated-ai-agent-mistakes?utm_source=github&utm_medium=readme&utm_campaign=buyer_questions)** · **[Cursor guardrails](https://thumbgate-production.up.railway.app/guides/cursor-agent-guardrails?utm_source=github&utm_medium=readme&utm_campaign=buyer_questions)** · **[Codex CLI guardrails](https://thumbgate-production.up.railway.app/guides/codex-cli-guardrails?utm_source=github&utm_medium=readme&utm_campaign=buyer_questions)** · **[Gemini CLI memory + enforcement](https://thumbgate-production.up.railway.app/guides/gemini-cli-feedback-memory?utm_source=github&utm_medium=readme&utm_campaign=buyer_questions)**
21
+ ## 🎬 90-second demo
22
+
23
+ Watch the force-push scenario: agent tries to `git push --force`, one thumbs-down, next session it's blocked — zero tokens spent on the repeat.
16
24
 
17
- **Running Claude Desktop?** **[Download Claude bundle](https://github.com/IgorGanapolsky/ThumbGate/releases/latest/download/thumbgate-claude-desktop.mcpb)** · **[Install + submission guide](docs/CLAUDE_DESKTOP_EXTENSION.md)** · **[Review packet zip](https://github.com/IgorGanapolsky/ThumbGate/releases/latest/download/thumbgate-claude-plugin-review.zip)**
25
+ [**▶ Watch the 90-second demo**](https://thumbgate-production.up.railway.app/#demo?utm_source=github&utm_medium=readme&utm_campaign=demo_video) · [Script](docs/marketing/demo-video-script.md) · [ElevenLabs narration: `npm run demo:voiceover`](scripts/generate-demo-voiceover.js)
18
26
 
19
- **Running Codex?** **[Download the standalone Codex plugin bundle](https://github.com/IgorGanapolsky/ThumbGate/releases/latest/download/thumbgate-codex-plugin.zip)** · **[Codex install guide](plugins/codex-profile/INSTALL.md)**
27
+ <!-- Video embed lives on the landing page and YouTube. Script + voiceover automation ship with the repo so anyone can re-record. -->
28
+
29
+ ---
20
30
 
21
31
  ## First-dollar activation path
22
32
 
@@ -29,65 +39,116 @@ If someone is not already bought into ThumbGate, do not lead with architecture.
29
39
 
30
40
  The buying question is simple: **what repeated AI mistake would be worth blocking before the next tool call?**
31
41
 
32
- ## ThumbGate GPT: start here
42
+ ---
43
+
44
+ ## The Problem — the bill nobody talks about
33
45
 
34
- **Use ThumbGate in ChatGPT now:** **[Open the live ThumbGate GPT](https://thumbgate-production.up.railway.app/go/gpt?utm_source=github&utm_medium=readme&utm_campaign=gpt_intro&cta_id=readme_intro_open_gpt&cta_placement=readme_intro)**, paste the action your AI agent wants to run, and ask whether to allow, block, or checkpoint it before the mistake becomes expensive.
46
+ Frontier-model calls are not cheap. Sonnet 4.5 is ~$3 / 1M input tokens and ~$15 / 1M output tokens. Opus is that. Every time your agent:
35
47
 
36
- Try this first prompt:
48
+ - hallucinates a function name and you have to correct it,
49
+ - retries the same failing tool call until it gives up,
50
+ - regenerates a 4,000-token plan you already approved last session,
51
+ - repeats a destructive command you blocked manually yesterday,
37
52
 
38
- ```text
39
- Check this agent action before it runs: git push --force --tags
53
+ …you are paying for that round-trip. *Twice if it retries. Three times if you re-prompt.* And the agent has no memory across sessions, so the meter resets every Monday.
54
+
55
+ ```
56
+ Session 1: Agent force-pushes to main. You fix it. +4,200 tokens
57
+ Session 2: Agent force-pushes again. You fix it. +4,200 tokens
58
+ Session 3: Same mistake. Again. You lose 45m. +5,800 tokens
40
59
  ```
41
60
 
42
- **No, users do not have to keep chatting inside the ThumbGate GPT to use ThumbGate.** The GPT is the fast demo, guided setup path, and thumbs-up/down memory surface for ChatGPT users. Think of the GPT as advice and checkpointing; the hard enforcement layer still runs where the work happens: your local coding agent, CI workflow, or MCP-compatible runtime after `npx thumbgate init`.
61
+ That's ~$0.21 in tokens just to fix the same mistake three times multiplied by every developer, every repeated-mistake class, every week. The math gets ugly fast.
62
+
63
+ ## The Solution — fix it once, the bill never sees it again
64
+
65
+ ```
66
+ Session 1: Agent force-pushes to main. You 👎 it. +4,200 tokens
67
+ Session 2: ⛔ Gate blocks the force-push. Zero round-trip. +0 tokens
68
+ Session 3+: Never happens again. +0 tokens
69
+ ```
43
70
 
44
- Developers can import the prepared **[GPT Actions OpenAPI spec](adapters/chatgpt/openapi.yaml)** with the **[ChatGPT Actions setup guide](adapters/chatgpt/INSTALL.md)**. Regular ChatGPT users should just open the GPT and type what happened.
71
+ One thumbs-down. The PreToolUse hook intercepts the call **before** it reaches the model — no input tokens, no output tokens, no retry loop. The dashboard tracks **tokens saved this week** as a live counter so you can see exactly what your prevention rules are worth.
45
72
 
46
- **Official directory pending review?** Claude Code users can install today with `/plugin marketplace add IgorGanapolsky/ThumbGate` then `/plugin install thumbgate@thumbgate-marketplace`.
73
+ ThumbGate doesn't make your agent smarter. It makes your agent *cheaper to be wrong with.*
47
74
 
48
- **Using Perplexity Max?** ThumbGate ships a **[Perplexity Command Center](docs/PERPLEXITY_MAX_COMMAND_CENTER.md)** that runs AI-search visibility checks, Search API lead discovery, Agent API strategy briefs, and official Perplexity MCP config generation. It is scheduled in GitHub Actions and uploads artifacts without committing runtime `.thumbgate` state.
75
+ ---
49
76
 
50
- **Need proof that gates improve safety without killing capability?** Run **[ThumbGate Bench](docs/THUMBGATE_BENCH.md)**:
77
+ ## Quick Start
51
78
 
52
79
  ```bash
53
- npm run thumbgate:bench
80
+ npx thumbgate init # auto-detects your agent, wires everything
81
+ npx thumbgate capture "Never run DROP on production tables"
54
82
  ```
55
83
 
56
- It scores deterministic GitHub, npm, database, Railway, shell, and filesystem scenarios with `unsafeActionRate`, `capabilityRate`, `positivePromotionRate`, and `replayStability` so teams can inspect the Reliability Gateway before a Workflow Hardening Sprint.
84
+ That single command creates a gate rule. Next time any AI agent tries to run `DROP` on production:
85
+
86
+ ```
87
+ ⛔ Gate blocked: "Never run DROP on production tables"
88
+ Pattern: DROP.*production
89
+ Verdict: BLOCK
90
+ ```
57
91
 
58
92
  ---
59
93
 
60
- ## What problem does this solve?
94
+ ## Architecture
61
95
 
62
- AI agents repeat expensive mistakes. You fix the same problem in session after session — force-push to main, broken migrations, unauthorized file edits, risky deploys — because the agent has no durable memory of your feedback and no gate before execution.
96
+ ThumbGate operates as a 4-layer enforcement stack between your AI agent and your codebase:
63
97
 
64
- ThumbGate sells three concrete outcomes:
98
+ ![ThumbGate Architecture](docs/diagrams/thumbgate_architecture.png)
65
99
 
66
- - **Prevent expensive AI mistakes** — catch bad commands, destructive database actions, unsafe publishes, and risky API calls before they run.
67
- - **Make AI stop repeating mistakes** fix it once, turn the lesson into a rule, and block the repeat before the next tool call lands.
68
- - **Turn AI into a reliable operator** — move from a smart assistant that apologizes after damage to a production-ready operator with checkpoints, proof, and enforcement.
100
+ ### Layer 1: Feedback Capture
101
+ Your thumbs-up/down reactions are captured via MCP protocol, CLI, or the ChatGPT GPT surface. Each reaction is stored as a structured lesson with context, timestamp, and severity.
69
102
 
70
- ```
71
- ┌─────────────────────────────────────────────────────────────┐
72
- │ THE PROBLEM │
73
- │ │
74
- │ Session 1: Agent breaks something. You fix it.
75
- │ Session 2: Agent breaks it again. You fix it again. │
76
- │ Session 3: Same thing. Again. │
77
- │ │
78
- │ THE SOLUTION │
79
- │ │
80
- │ Session 1: Agent breaks something. You 👎 it. │
81
- │ Session 2: ⛔ Gate blocks the mistake before it happens.
82
- │ Session 3+: Never see it again. │
83
- └─────────────────────────────────────────────────────────────┘
84
- ```
103
+ ### Layer 2: Gate Engine
104
+ The gate engine converts lessons into enforceable rules using pattern matching, semantic similarity (via LanceDB vectors), and Thompson Sampling for adaptive rule selection. Rules are stored locally in `.thumbgate/gates/`.
105
+
106
+ ### Layer 3: Pre-Action Interception
107
+ Before any agent action executes, ThumbGate's `PreToolUse` hook intercepts the command and evaluates it against all active gates. This happens at the MCP protocol level — the agent physically cannot bypass it.
108
+
109
+ ### Layer 4: Multi-Agent Distribution
110
+ Gates are distributed across all connected agents via MCP stdio protocol. One correction in Claude Code protects Cursor, Codex, Gemini CLI, and any MCP-compatible agent.
111
+
112
+ Prompt engineering still matters, but it is only the starting point. ThumbGate adds prompt evaluation on top: proof lanes, benchmarks, and self-heal checks tell you whether your prompt and workflow actually held up under execution instead of leaving you to guess from vibes.
113
+
114
+ ![Feedback Pipeline](docs/diagrams/feedback_pipeline.png)
115
+
116
+ ![Agent Integration](docs/diagrams/agent_integration.png)
117
+
118
+ ---
119
+
120
+ ## Install for Your Agent
121
+
122
+ | Agent | Command |
123
+ |-------|---------|
124
+ | **Claude Code** | `npx thumbgate init --agent claude-code` |
125
+ | **Cursor** | `npx thumbgate init --agent cursor` |
126
+ | **Codex** | `npx thumbgate init --agent codex` |
127
+ | **Gemini CLI** | `npx thumbgate init --agent gemini` |
128
+ | **Amp** | `npx thumbgate init --agent amp` |
129
+ | **Claude Desktop** | [Download extension bundle](https://github.com/IgorGanapolsky/ThumbGate/releases/latest/download/thumbgate-claude-desktop.mcpb) |
130
+ | **Any MCP agent** | `npx thumbgate serve` |
131
+
132
+ Works with **Claude Code, Cursor, Codex, Gemini CLI, Amp, OpenCode**, and any MCP-compatible agent.
133
+
134
+ ### Status bar proof
135
+
136
+ ![Claude Code ThumbGate footer](public/assets/claude-thumbgate-statusbar.svg)
137
+
138
+ ![Codex ThumbGate test lane](public/assets/codex-thumbgate-statusbar-test.svg)
85
139
 
86
- ThumbGate is the **Reliability Gateway** for AI coding agents turning your feedback into **enforced rules**, not suggestions.
140
+ Claude renders the live ThumbGate footer today. `npx thumbgate init --agent codex` now installs the full Codex hook bundle and writes the ThumbGate `statusLine` target into `~/.codex/config.json` so you can test it on your local Codex build immediately.
141
+
142
+ ### Install Codex Plugin
143
+
144
+ Download the standalone Codex plugin bundle and follow the install guide:
145
+
146
+ 1. Download: [thumbgate-codex-plugin.zip](https://github.com/IgorGanapolsky/ThumbGate/releases/latest/download/thumbgate-codex-plugin.zip)
147
+ 2. Follow: [plugins/codex-profile/INSTALL.md](plugins/codex-profile/INSTALL.md)
87
148
 
88
149
  ---
89
150
 
90
- ## How It Works in 3 Steps
151
+ ## How It Works
91
152
 
92
153
  ```
93
154
  STEP 1 STEP 2 STEP 3
@@ -102,46 +163,75 @@ ThumbGate is the **Reliability Gateway** for AI coding agents — turning your f
102
163
  agent action reinforced (or ✅ allowed)
103
164
  ```
104
165
 
105
- That's it. No manual rule-writing. No config files to maintain. Your reactions teach the agent what your team actually wants.
166
+ No manual rule-writing. No config files. Your reactions teach the agent what your team actually wants.
167
+
168
+ ---
169
+
170
+ ThumbGate sells three concrete outcomes:
171
+
172
+ - **Prevent expensive AI mistakes** — catch bad commands, destructive database actions, unsafe publishes, and risky API calls before they run.
173
+ - **Make AI stop repeating mistakes** — fix it once, turn the lesson into a rule, and block the repeat before the next tool call lands.
174
+ - **Turn AI into a reliable operator** — move from a smart assistant that apologizes after damage to a production-ready operator with checkpoints, proof, and enforcement.
175
+ - **Measure prompts instead of rewriting them blindly** — use proof lanes, ThumbGate Bench, and `self-heal:check` to evaluate whether prompts and workflows actually improved behavior.
106
176
 
107
177
  ---
108
178
 
109
- ## Before / After
179
+ ## Use Cases
180
+
181
+ - **Stop force-push to main** — Gate blocks `git push --force` on protected branches before it runs
182
+ - **Prevent repeated migration failures** — Each mistake becomes a searchable lesson that fires before the next attempt
183
+ - **Block unauthorized file edits** — Control which files agents can touch with path-based rules
184
+ - **Memory across sessions** — The agent remembers your feedback from yesterday
185
+ - **Shared team safety** — One developer's thumbs-down protects the whole team
186
+ - **Auto-improving without feedback** — Self-improvement mode evaluates outcomes and generates rules automatically
187
+
188
+ ---
189
+
190
+ ## Built-in Gates
110
191
 
111
192
  ```
112
- WITHOUT THUMBGATE │ WITH THUMBGATE
113
- ───────────────────────────────┼───────────────────────────────
114
- Session 1: │ Session 1:
115
- Agent force-pushes to main. │ Agent force-pushes to main.
116
- You correct it manually. │ You 👎 it.
117
-
118
- Session 2: │ Session 2:
119
- Agent force-pushes again. │ ⛔ Gate blocks force-push.
120
- It learned nothing. │ Agent uses safe push instead.
121
-
122
- Session 3: │ Session 3+:
123
- Same mistake. Again. │ Permanently fixed.
124
- And again. │
193
+ force-push → blocks git push --force
194
+ ⛔ protected-branch → blocks direct push to main
195
+ unresolved-threads blocks push with open reviews
196
+ package-lock-reset → blocks destructive lock edits
197
+ env-file-edit → blocks .env secret exposure
198
+
199
+ + custom gates in config/gates/custom.json
125
200
  ```
126
201
 
127
202
  ---
128
203
 
129
- ## The Feedback Loop
204
+ ## CLI Reference
130
205
 
131
- ```
132
- ┌──────────┐ ┌──────────┐ ┌──────────┐ ┌──────────┐ ┌──────────┐
133
- Capture │───►│ Learn │───►│ Remember │───►│ Rule │───►│ Gate │
134
- │ │ │ │ │ │ │ │ │ │
135
- 👍 / 👎 │ Feedback │ │ Stored │ │ Auto- │ │ Blocks │
136
- │ │ │ becomes │ lessons │ │ generated│ │ bad │
137
- │ │ │ a lesson │ │ & search │ │ from │ │ actions │
138
- │ │ │ │ │ │ │ feedback │ │ live │
139
- └──────────┘ └──────────┘ └──────────┘ └──────────┘ └──────────┘
206
+ ```bash
207
+ npx thumbgate init # detect agent, wire hooks
208
+ npx thumbgate doctor # health check
209
+ npx thumbgate capture # create a gate from text
210
+ npx thumbgate lessons # see what's been learned
211
+ npx thumbgate explore # terminal explorer for lessons, gates, stats
212
+ npx thumbgate dashboard # open local dashboard
213
+ npx thumbgate serve # start MCP server on stdio
214
+ npx thumbgate bench # run reliability benchmark
140
215
  ```
141
216
 
142
217
  ---
143
218
 
144
- ## Get Started
219
+ ## Pricing
220
+
221
+ | | Free | Pro ($19/mo) | Team ($49/seat/mo) |
222
+ |---|---|---|---|
223
+ | Local CLI + enforced gates | ✅ | ✅ | ✅ |
224
+ | Feedback captures/day | 3 | Unlimited | Unlimited |
225
+ | Prevention rules | 1 | Unlimited | Unlimited |
226
+ | Agent connections | 1 | Unlimited | Unlimited |
227
+ | Personal dashboard | — | ✅ | ✅ |
228
+ | DPO export (model fine-tuning) | — | ✅ | ✅ |
229
+ | Team lesson export/import | — | ✅ | ✅ |
230
+ | Shared hosted lesson DB | — | — | ✅ |
231
+ | Org-wide dashboard | — | — | ✅ |
232
+ | Approval + audit proof | — | — | ✅ |
233
+
234
+ The free tier gives you 3 feedback captures, 1 rule, and 1 agent — enough to prove the enforcement loop works. Pro is $19/mo or $149/yr for unlimited everything plus a dashboard and history-aware lesson recall. Team is $49/seat/mo with shared hosted lesson DB, org dashboard, and shared enforcement. Pro and Team include open_feedback_session, append_feedback_context, and finalize_feedback_session for structured multi-turn feedback capture.
145
235
 
146
236
  **Best first paid motion for teams:** the **Workflow Hardening Sprint** — qualify one repeated failure before committing to a full rollout. **[Start intake →](https://thumbgate-production.up.railway.app/?utm_source=github&utm_medium=readme&utm_campaign=team_rollout#workflow-sprint-intake)**
147
237
 
@@ -149,223 +239,161 @@ Session 3: │ Session 3+:
149
239
 
150
240
  **Paid path for individual operators:** [ThumbGate Pro](https://thumbgate-production.up.railway.app/pro?utm_source=github&utm_medium=readme&utm_campaign=pro_page) is the self-serve side lane for a personal dashboard and export-ready evidence.
151
241
 
152
- **Plain product line:** GPT preview = advice and checkpointing. Free local CLI (3 daily feedback captures, 5 daily lesson searches) = basic enforcement on one machine. Pro ($19/mo or $149/yr) = personal enforcement proof, dashboard, and exports. Team = shared hosted lesson DB, org dashboard, and shared enforcement so one correction protects every seat.
242
+ **[Start free](https://thumbgate-production.up.railway.app/?utm_source=github&utm_medium=readme)** · **[See Pro](https://thumbgate-production.up.railway.app/pro?utm_source=github&utm_medium=readme)** · **[Team Sprint intake](https://thumbgate-production.up.railway.app/?utm_source=github&utm_medium=readme#workflow-sprint-intake)**
153
243
 
154
244
  ---
155
245
 
156
- ## Quick Start
246
+ ## Team Lesson Sharing (Pro + Team)
157
247
 
158
- ```bash
159
- npx thumbgate init # detects your agent and wires everything up
160
- npx thumbgate doctor # health check
161
- npx thumbgate lessons # see what's been learned
162
- npx thumbgate explore # terminal explorer for lessons, gates, and stats
163
- npx thumbgate dashboard # open local dashboard
164
- ```
248
+ One team's hard-won lessons shouldn't stay trapped on one laptop. ThumbGate Pro and Team can export lessons as portable bundles and import them into any other ThumbGate instance — so a mistake caught by Team A becomes a prevention rule for Team B.
165
249
 
166
- Or wire MCP directly: `claude mcp add thumbgate -- npx --yes --package thumbgate thumbgate serve`
167
-
168
- Works with **Claude Code, Cursor, Codex, Gemini CLI, Amp, OpenCode**, and any MCP-compatible agent.
169
-
170
- ---
171
-
172
- ## Install for Your Agent
250
+ **Export lessons from one project:**
173
251
 
174
- ### Claude Code
175
252
  ```bash
176
- npx thumbgate init --agent claude-code
253
+ curl -X POST http://localhost:3456/v1/lessons/export \
254
+ -H "Authorization: Bearer $THUMBGATE_API_KEY" \
255
+ -H "Content-Type: application/json" \
256
+ -d '{"outputPath": "./lessons-export.json"}'
177
257
  ```
178
- Wires hooks automatically. Works immediately.
179
258
 
180
- ### Cursor
181
- ```bash
182
- npx thumbgate init --agent cursor
183
- ```
184
- Installs as a Cursor extension with 4 skills: capture feedback, manage rules, search lessons, recall context.
185
-
186
- ### Codex
187
- ```bash
188
- npx thumbgate init --agent codex
189
- ```
190
- Bridges to Codex CLI with 6 skills including adversarial review and second-pass analysis.
259
+ Filter by signal or tags:
191
260
 
192
- ### Gemini CLI
193
261
  ```bash
194
- npx thumbgate init --agent gemini
262
+ curl -X POST http://localhost:3456/v1/lessons/export \
263
+ -H "Authorization: Bearer $THUMBGATE_API_KEY" \
264
+ -H "Content-Type: application/json" \
265
+ -d '{"signal": "down", "tags": ["push-notifications", "ci"]}'
195
266
  ```
196
267
 
197
- ### Amp
198
- ```bash
199
- npx thumbgate init --agent amp
200
- ```
268
+ **Import into another team's ThumbGate:**
201
269
 
202
- ### Any MCP-Compatible Agent
203
270
  ```bash
204
- npx thumbgate serve
205
- ```
206
- Starts the MCP server on stdio. Connect from any MCP-compatible client.
207
-
208
- ### Claude Desktop
209
- Add to your `claude_desktop_config.json`:
210
- ```json
211
- {
212
- "mcpServers": {
213
- "thumbgate": {
214
- "command": "npx",
215
- "args": ["--yes", "--package", "thumbgate", "thumbgate", "serve"]
216
- }
217
- }
218
- }
271
+ curl -X POST http://localhost:3456/v1/lessons/import \
272
+ -H "Authorization: Bearer $THUMBGATE_API_KEY" \
273
+ -H "Content-Type: application/json" \
274
+ -d @lessons-export.json
219
275
  ```
220
- Or [download the packaged extension bundle](https://github.com/IgorGanapolsky/ThumbGate/releases/latest/download/thumbgate-claude-desktop.mcpb) and install directly.
221
276
 
222
- ---
277
+ What happens on import:
278
+ - **Deduplication** — lessons with the same ID or title+signal are skipped
279
+ - **Provenance tracking** — every imported lesson is tagged `team-import` with original source project, export timestamp, and original ID
280
+ - **No overwrite** — import is additive; existing lessons are never modified
223
281
 
224
- ## Use Cases
282
+ The export bundle includes full lesson metadata: signal, title, context, tags, failure type, skill, structured rules, and diagnosis. It's the same data you see in the lesson detail dashboard — portable as JSON.
225
283
 
226
- - **Stop force-push to main** — A gate blocks `git push --force` on protected branches before it runs
227
- - **Prevent repeated migration failures** Each mistake becomes a searchable lesson that fires before the next attempt
228
- - **Block unauthorized file edits** Control which files agents can touch with path-based rules
229
- - **Memory across sessions** The agent remembers your feedback from yesterday without any manual rule-writing
230
- - **Shared team safety** One developer's thumbs-down protects the whole team from the same mistake
231
- - **Auto-improving without feedback** — Self-improvement mode evaluates outcomes and generates rules automatically
284
+ **Use cases:**
285
+ - Share enforcement patterns across repos in the same org
286
+ - Onboard a new team with pre-built lessons from a mature project
287
+ - Export lessons before a project handoff so institutional knowledge transfers
288
+ - Feed lessons from multiple teams into a centralized DPO training pipeline
232
289
 
233
290
  ---
234
291
 
235
- ## Feedback Sessions
292
+ ## DPO Export for Fine-Tuning (Pro + Team)
236
293
 
237
- Give the agent more context when a thumbs-down isn't enough:
294
+ Every thumbs-up and thumbs-down becomes a training signal. ThumbGate Pro exports your captured feedback as DPO (Direct Preference Optimization) pairs — ready to feed into a LoRA fine-tune so your model stops repeating known mistakes at the weight level, not just the gate level.
238
295
 
296
+ **Export DPO pairs:**
297
+
298
+ ```bash
299
+ curl -X POST http://localhost:3456/v1/dpo/export \
300
+ -H "Authorization: Bearer $THUMBGATE_API_KEY" \
301
+ -o dpo-pairs.jsonl
239
302
  ```
240
- 👎 thumbs down
241
- └─► open_feedback_session
242
- └─► "you lied about deployment" (append_feedback_context)
243
- └─► "tests were actually failing" (append_feedback_context)
244
- └─► finalize_feedback_session
245
- └─► lesson inferred from full conversation
246
- ```
247
303
 
248
- ThumbGate uses up to 8 prior conversation entries to turn vague, history-aware negative signals into specific, actionable lessons. A 60-second follow-up window stays open for additional context via `open_feedback_session` → `append_feedback_context` → `finalize_feedback_session`.
304
+ **What you get:** JSONL where each line is a preference pair:
305
+ - `chosen` — the agent action you thumbed up
306
+ - `rejected` — the action you thumbed down for the same task context
307
+ - `prompt` — the originating user intent
308
+
309
+ **Use cases:**
310
+ - Fine-tune Llama 3 / Mistral / local models with a LoRA adapter trained on your real mistakes
311
+ - Feed into RLAIF or KTO pipelines (KTO export also available via `/v1/kto/export`)
312
+ - Build a model that natively avoids your team's known failure patterns — no gate at inference time needed
249
313
 
250
- Free and self-hosted users can invoke `search_lessons` directly through MCP, and via the CLI with `npx thumbgate lessons`.
314
+ **Why this matters:** Gates block mistakes. Fine-tuning prevents them from being attempted. Combine both for belt-and-suspenders governance.
251
315
 
252
316
  ---
253
317
 
254
- ## Built-in Gates
318
+ ## Tech Stack
255
319
 
256
- ```
257
- ┌─────────────────────────────────────────────────────────┐
258
- │ ENFORCEMENT LAYER │
259
- │ │
260
- │ ⛔ force-push → blocks git push --force │
261
- │ ⛔ protected-branch → blocks direct push to main │
262
- │ ⛔ unresolved-threads → blocks push with open reviews
263
- │ ⛔ package-lock-reset → blocks destructive lock edits │
264
- │ ⛔ env-file-edit → blocks .env secret exposure │
265
- │ │
266
- │ + custom gates in config/gates/custom.json │
267
- └─────────────────────────────────────────────────────────┘
268
- ```
320
+ | Layer | Technology |
321
+ |-------|-----------|
322
+ | **Storage** | SQLite + FTS5, LanceDB vectors, JSONL logs |
323
+ | **Capture** | 3 feedback capture/day (free), unlimited (Pro) |
324
+ | **Intelligence** | MemAlign dual recall, Thompson Sampling |
325
+ | **Enforcement** | PreToolUse hook engine, Gates config |
326
+ | **Interfaces** | MCP stdio, HTTP API, CLI (Node.js >=18) |
327
+ | **Billing** | Stripe |
328
+ | **Execution** | Railway, Cloudflare Workers, Docker Sandboxes |
329
+ | **Governance** | Workflow Sentinel, control plane, Docker Sandboxes |
330
+
331
+ Every Changeset is tied to the exact `main` merge commit and generates Verification Evidence for Release Confidence.
269
332
 
270
333
  ---
271
334
 
272
- ## Pricing
335
+ **Popular buyer questions:** **[Stop repeated AI agent mistakes](https://thumbgate-production.up.railway.app/guides/stop-repeated-ai-agent-mistakes?utm_source=github&utm_medium=readme&utm_campaign=buyer_questions)** · **[Cursor guardrails](https://thumbgate-production.up.railway.app/guides/cursor-agent-guardrails?utm_source=github&utm_medium=readme&utm_campaign=buyer_questions)** · **[Codex CLI guardrails](https://thumbgate-production.up.railway.app/guides/codex-cli-guardrails?utm_source=github&utm_medium=readme&utm_campaign=buyer_questions)** · **[Gemini CLI memory + enforcement](https://thumbgate-production.up.railway.app/guides/gemini-cli-feedback-memory?utm_source=github&utm_medium=readme&utm_campaign=buyer_questions)**
273
336
 
274
- ```
275
- ┌──────────────────┬──────────────────────────────┬──────────────────────┐
276
- │ FREE │ TEAM $99/seat/mo (min 3) │ PRO $19/mo · $149/yr│
277
- ├──────────────────┼──────────────────────────────┼──────────────────────┤
278
- │ Local CLI │ Workflow Hardening Sprint │ Personal dashboard │
279
- │ Enforced gates │ Shared hosted lesson DB │ Export feedback data │
280
- │ 3 captures/day │ Org-wide dashboard │ Review-ready exports │
281
- │ 5 searches/day │ Approval + audit proof │ │
282
- │ Unlimited recall │ Isolated execution guidance │ │
283
- └──────────────────┴──────────────────────────────┴──────────────────────┘
284
- ```
337
+ **[Workflow Hardening Sprint](https://thumbgate-production.up.railway.app/?utm_source=github&utm_medium=readme&utm_campaign=top_cta#workflow-sprint-intake)** · **[Live Dashboard](https://thumbgate-production.up.railway.app/dashboard?utm_source=github&utm_medium=readme&utm_campaign=top_cta)**
285
338
 
286
- **[Start Workflow Hardening Sprint](https://thumbgate-production.up.railway.app/?utm_source=github&utm_medium=readme&utm_campaign=top_cta#workflow-sprint-intake)** · **[Live Dashboard](https://thumbgate-production.up.railway.app/dashboard?utm_source=github&utm_medium=readme&utm_campaign=top_cta)** · **[See Pro](https://thumbgate-production.up.railway.app/pro?utm_source=github&utm_medium=readme&utm_campaign=pro_page)**
339
+ ---
340
+
341
+ ## Integrations
287
342
 
288
- **Where to start:**
289
- - **Teams:** Begin with the Workflow Hardening Sprint prove one costly repeat failure can be blocked before committing to a full rollout
290
- - **Solo operators:** ThumbGate Pro adds personal enforcement proof, a gate debugger, and export-ready evidence
291
- - **Individuals & open source:** Free CLI tier, self-hosted, with local Pre-Action Gates after install
343
+ - **[Open ThumbGate GPT](https://thumbgate-production.up.railway.app/go/gpt?utm_source=github&utm_medium=readme&utm_campaign=readme_gpt)** — ThumbGate GPT: start here. Paste agent actions, get advice + checkpointing. No, users do not have to keep chatting inside the ThumbGate GPT to use ThumbGate — the hard enforcement layer still runs where the work happens.
344
+ - **[Claude Desktop Extension](https://github.com/IgorGanapolsky/ThumbGate/releases/latest/download/thumbgate-claude-desktop.mcpb)**One-click install for Claude Desktop
345
+ - **[Codex Plugin](https://github.com/IgorGanapolsky/ThumbGate/releases/latest/download/thumbgate-codex-plugin.zip)** Standalone bundle for Codex CLI
346
+ - **[Perplexity Command Center](docs/PERPLEXITY_MAX_COMMAND_CENTER.md)** AI-search visibility + lead discovery
347
+ - **[ThumbGate Bench](docs/THUMBGATE_BENCH.md)** — Reliability benchmark for gate evaluation
348
+ - **[Manus AI Skill](skills/thumbgate/SKILL.md)** — ThumbGate integration for Manus AI agents
292
349
 
293
350
  ---
294
351
 
295
- ## Tech Stack
352
+ ## Feedback Sessions
353
+
354
+ Give the agent more context when a thumbs-down isn't enough:
296
355
 
297
356
  ```
298
- ┌──────────────────────┬──────────────────────┬──────────────────────┐
299
- │ STORAGE │ INTELLIGENCE │ ENFORCEMENT │
300
- │ │ │ │
301
- SQLite + FTS5 │ MemAlign dual recall │ PreToolUse hook │
302
- LanceDB vectors │ Thompson Sampling │ engine │
303
- JSONL logs │ (adaptive lesson │ Gates config │
304
- │ File-based context │ selection) │ Hook wiring │
305
- │ │ │ │
306
- │ │ │ │
307
- ├──────────────────────┼──────────────────────┼──────────────────────┤
308
- │ INTERFACES │ BILLING │ EXECUTION │
309
- │ │ │ │
310
- │ MCP stdio │ Stripe │ Railway │
311
- │ HTTP API │ │ Cloudflare Workers │
312
- │ CLI │ │ Docker Sandboxes │
313
- │ Node.js >=18 │ │ │
314
- └──────────────────────┴──────────────────────┴──────────────────────┘
357
+ 👎 thumbs down
358
+ └─► open_feedback_session
359
+ └─► "you lied about deployment" (append_feedback_context)
360
+ └─► "tests were actually failing" (append_feedback_context)
361
+ └─► finalize_feedback_session
362
+ └─► lesson inferred from full conversation
315
363
  ```
316
364
 
365
+ Free and self-hosted users can invoke `search_lessons` directly through MCP, and via the CLI with `npx thumbgate lessons`. History-aware feedback sessions give the agent full context for each lesson.
366
+
317
367
  ---
318
368
 
319
369
  ## FAQ
320
370
 
321
371
  **Is ThumbGate a model fine-tuning tool?**
322
- No. ThumbGate does not update model weights in frontier LLMs. It captures your feedback, stores lessons, injects context at runtime, and blocks bad actions before they execute.
372
+ No. ThumbGate does not update model weights. It captures feedback, stores lessons, injects context at runtime, and blocks bad actions before they execute.
323
373
 
324
374
  **How is this different from CLAUDE.md or .cursorrules?**
325
375
  Those are suggestions the agent can ignore. ThumbGate gates are enforced — they physically block the action before it runs. They also auto-generate from feedback instead of requiring manual writing.
326
376
 
327
377
  **Does it work with my agent?**
328
- Yes. It's MCP-compatible and works with Claude Code, Claude Desktop, Cursor, Codex, Gemini CLI, Amp, OpenCode, and any agent that supports MCP or pre-action hooks.
329
-
330
- **What's self-improvement mode?**
331
- ThumbGate can watch for failure signals (test failures, reverted edits, error patterns) and auto-generate prevention rules — no thumbs-down required. Your agent gets smarter every session.
378
+ If it supports MCP or pre-action hooks, yes. Claude Code, Claude Desktop, Cursor, Codex, Gemini CLI, Amp, OpenCode all work out of the box.
332
379
 
333
380
  **Is it free?**
334
- Free tier: **3 daily feedback captures**, **5 daily lesson searches**, unlimited recall, enforced gates. History-aware distillation turns vague feedback into specific lessons. Pro is $19/mo or $149/yr for a personal dashboard and exports. Team rollout starts at $99/seat/mo (3-seat minimum) with shared hosted lesson DB, org dashboard, approval + audit proof, and isolated execution guidance.
335
-
336
- ---
337
-
338
- ## Enterprise Story
339
-
340
- ThumbGate is the control plane for AI coding agents:
341
-
342
- - Feedback becomes enforcement — repeated failures stop at the gate instead of reappearing in review.
343
- - **Workflow Sentinel** scores blast radius before execution, so risky PR, release, and publish flows are visible early.
344
- - High-risk local actions route into **Docker Sandboxes**; hosted team automations use a signed isolated sandbox lane.
345
- - Team rollout stays tied to [Verification Evidence](docs/VERIFICATION_EVIDENCE.md) instead of trust-me operator claims.
346
-
347
- ## Release Confidence
348
-
349
- - Every PR must carry a **Changeset** entry — each shipped version has a customer-readable explanation before publish.
350
- - Version-sync checks keep `package.json`, `CHANGELOG.md`, plugin manifests, and installer metadata aligned.
351
- - Final close-out requires verifying the exact `main` merge commit, with proof anchored in [Verification Evidence](docs/VERIFICATION_EVIDENCE.md).
352
-
353
- See [Release Confidence](docs/RELEASE_CONFIDENCE.md) for the full trust chain.
381
+ The free tier gives you 3 captures/day, 1 rule, and 1 agent enough to prove the enforcement loop works. Pro is $19/mo or $149/yr for unlimited everything plus a dashboard. Team is $49/seat/mo with shared hosted lesson DB, org dashboard, and shared enforcement.
354
382
 
355
383
  ---
356
384
 
357
385
  ## Docs
358
386
 
359
- - [Commercial Truth](docs/COMMERCIAL_TRUTH.md) — pricing, claims, what we don't say
360
- - [Changeset Strategy](docs/CHANGESET_STRATEGY.md) — how release notes and version bumps are enforced
361
387
  - [First Dollar Playbook](docs/FIRST_DOLLAR_PLAYBOOK.md) — turning one painful workflow into the next booked pilot
362
- - [Release Confidence](docs/RELEASE_CONFIDENCE.md) — how changesets, version checks, and proof lanes make publishes inspectable
363
- - [SemVer Policy](docs/SEMVER_POLICY.md) — stable vs prerelease channel rules
388
+ - [Commercial Truth](docs/COMMERCIAL_TRUTH.md) — pricing, claims, what we don't say
389
+ - [Changeset Strategy](docs/CHANGESET_STRATEGY.md) — release notes and version bump enforcement
390
+ - [Release Confidence](docs/RELEASE_CONFIDENCE.md) — changesets, version checks, proof lanes
364
391
  - [Verification Evidence](docs/VERIFICATION_EVIDENCE.md) — proof artifacts
365
- - [WORKFLOW.md](WORKFLOW.md) — agent-run contract (scope, hard stops, proof commands)
366
- - [Ready-for-agent issue template](.github/ISSUE_TEMPLATE/ready-for-agent.yml) — intake for agent tasks
367
-
368
- Pro overlay: [`thumbgate-pro`](https://github.com/IgorGanapolsky/thumbgate-pro) — separate repo/package inheriting from this base.
392
+ - [Claude Desktop Extension Guide](docs/CLAUDE_DESKTOP_EXTENSION.md)
393
+ - [Agent Workflow Contract](WORKFLOW.md) — the agent-run contract for all ThumbGate operations
394
+ - [Ready for Agent Intake](https://github.com/IgorGanapolsky/ThumbGate/issues/new?template=ready-for-agent.yml) — ready-for-agent intake template
395
+ - [SEO Guide: Claude Code Guardrails](docs/learn/claude-code-guardrails.md)
396
+ - [Pro Overlay Repository](https://github.com/IgorGanapolsky/thumbgate-pro) — paid overlay code in the separate `thumbgate-pro` repo/package
369
397
 
370
398
  ---
371
399