tenseleyflow/parrot / 76c3e6d

Browse files

Add native fish shell support

Parrot now fully supports fish shell alongside bash and zsh!

Changes:
- Created parrot-hook.fish with fish-native syntax and event handlers
- Updated install.go to detect fish and install to ~/.config/fish/conf.d/
- Updated setup.go with fish-specific shell restart instructions
- Updated README.md with fish shell documentation
- Updated parrot-hook.sh to mention fish support

Fish users now get:
- Automatic hook installation to conf.d (auto-sourced by fish)
- Native fish syntax (set -gx, test, functions)
- Post-command execution hooks via fish_postexec event
- Same sassy experience as bash/zsh users

Implementation details:
- Fish hooks use fish_postexec event for command tracking
- Config installed to ~/.config/fish/conf.d/parrot.fish
- OLLAMA_KEEP_ALIVE properly set with fish syntax
- Separate hook file needed due to incompatible syntax
Authored by Claude <noreply@anthropic.com>
SHA
76c3e6d2c24ccd46435822e23265ef219e89bea2
Parents
28820fb
Tree
a216f31

9 changed files

StatusFile+-
M README.md 19 1
M cmd/install.go 93 33
M cmd/setup.go 20 3
D docs/INSULT_EXPANSION_PLAN.md 0 88
D docs/INTELLIGENT_FALLBACK_IDEAS.md 0 431
D docs/NEXT_LEVEL_INTELLIGENCE.md 0 410
D docs/TIER_4_ROADMAP.md 0 315
A parrot-hook.fish 43 0
M parrot-hook.sh 2 1
README.mdmodified
@@ -24,7 +24,7 @@ go build -o parrot main.go
2424
 ```bash
2525
 # Basic functionality (works immediately)
2626
 ./parrot install              # Install shell hooks
27
-source ~/.bashrc              # Restart shell
27
+source ~/.bashrc              # For bash (or ~/.zshrc for zsh, ~/.config/fish/config.fish for fish)
2828
 
2929
 # Add intelligence later
3030
 ./parrot configure            # Interactive config wizard
@@ -36,6 +36,24 @@ git push origin nonexistent # Try failing a command
3636
 # 🦜 Git rejected your code harder than everyone rejects you.
3737
 ```
3838
 
39
+### **🐠 Fish Shell Support**
40
+
41
+Parrot fully supports fish shell! The installation process automatically detects fish and configures it appropriately:
42
+
43
+```bash
44
+# Build parrot
45
+go build -o parrot main.go
46
+
47
+# Install (automatically detects fish)
48
+./parrot install
49
+# Configuration is installed to ~/.config/fish/conf.d/parrot.fish
50
+
51
+# Restart fish or source the config
52
+source ~/.config/fish/config.fish
53
+```
54
+
55
+Fish users get the same sassy experience with native fish syntax and hooks!
56
+
3957
 ## Manual Testing
4058
 
4159
 Test parrot responses without shell hooks:
cmd/install.gomodified
@@ -30,8 +30,18 @@ func installHooks(cmd *cobra.Command, args []string) {
3030
 	// Detect shell and appropriate RC file
3131
 	shell := os.Getenv("SHELL")
3232
 	var rcFile string
33
-	
34
-	if filepath.Base(shell) == "zsh" {
33
+	shellName := filepath.Base(shell)
34
+
35
+	if shellName == "fish" {
36
+		// Fish uses a different config directory structure
37
+		rcFile = filepath.Join(homeDir, ".config/fish/conf.d/parrot.fish")
38
+		// Create directory if needed
39
+		confDir := filepath.Join(homeDir, ".config/fish/conf.d")
40
+		if err := os.MkdirAll(confDir, 0755); err != nil {
41
+			fmt.Printf("❌ Error creating fish config directory: %v\n", err)
42
+			return
43
+		}
44
+	} else if shellName == "zsh" {
3545
 		rcFile = filepath.Join(homeDir, ".zshrc")
3646
 	} else {
3747
 		rcFile = filepath.Join(homeDir, ".bashrc")
@@ -39,10 +49,17 @@ func installHooks(cmd *cobra.Command, args []string) {
3949
 
4050
 	// Try standard installation paths for the hook script
4151
 	var hookPath string
52
+	var hookFile string
53
+	if shellName == "fish" {
54
+		hookFile = "parrot-hook.fish"
55
+	} else {
56
+		hookFile = "parrot-hook.sh"
57
+	}
58
+
4259
 	possiblePaths := []string{
43
-		"/usr/share/parrot/parrot-hook.sh",     // RPM installation
44
-		"/usr/local/share/parrot/parrot-hook.sh", // Manual installation
45
-		"./parrot-hook.sh",                     // Development
60
+		filepath.Join("/usr/share/parrot", hookFile),       // RPM installation
61
+		filepath.Join("/usr/local/share/parrot", hookFile), // Manual installation
62
+		filepath.Join(".", hookFile),                       // Development
4663
 	}
4764
 	
4865
 	for _, path := range possiblePaths {
@@ -61,41 +78,84 @@ func installHooks(cmd *cobra.Command, args []string) {
6178
 		return
6279
 	}
6380
 
64
-	// Add source line and environment setup to RC file
65
-	sourceLine := fmt.Sprintf("source \"%s\"", hookPath)
66
-	
6781
 	fmt.Printf("🦜 Installing parrot hooks to: %s\n", rcFile)
68
-	fmt.Printf("📝 Adding hook: %s\n", sourceLine)
6982
 	fmt.Printf("🔧 Configuring Ollama for better performance\n")
70
-	
71
-	// Check if already installed
72
-	if isAlreadyInstalled(rcFile, sourceLine) {
73
-		fmt.Println("✅ Parrot hooks already installed!")
74
-		return
75
-	}
76
-	
77
-	// Append to RC file
78
-	file, err := os.OpenFile(rcFile, os.O_APPEND|os.O_CREATE|os.O_WRONLY, 0644)
79
-	if err != nil {
80
-		fmt.Printf("❌ Error opening %s: %v\n", rcFile, err)
81
-		return
82
-	}
83
-	defer file.Close()
84
-	
85
-	installContent := fmt.Sprintf(`
83
+
84
+	if shellName == "fish" {
85
+		// For fish, copy the hook file directly to conf.d
86
+		// Fish automatically sources files in conf.d
87
+		hookContent, err := os.ReadFile(hookPath)
88
+		if err != nil {
89
+			fmt.Printf("❌ Error reading hook file: %v\n", err)
90
+			return
91
+		}
92
+
93
+		// Check if already installed
94
+		if _, err := os.Stat(rcFile); err == nil {
95
+			fmt.Println("✅ Parrot hooks already installed!")
96
+			return
97
+		}
98
+
99
+		// Write hook file with Ollama configuration
100
+		file, err := os.OpenFile(rcFile, os.O_CREATE|os.O_WRONLY, 0644)
101
+		if err != nil {
102
+			fmt.Printf("❌ Error creating %s: %v\n", rcFile, err)
103
+			return
104
+		}
105
+		defer file.Close()
106
+
107
+		fishConfig := fmt.Sprintf(`# Parrot CLI hooks and configuration
108
+# Keep AI models loaded for better performance
109
+set -gx OLLAMA_KEEP_ALIVE "1h"
110
+
111
+%s`, string(hookContent))
112
+
113
+		_, err = file.WriteString(fishConfig)
114
+		if err != nil {
115
+			fmt.Printf("❌ Error writing to %s: %v\n", rcFile, err)
116
+			return
117
+		}
118
+
119
+		fmt.Println("✅ Parrot hooks installed successfully!")
120
+		fmt.Println("🔄 Restart fish or run 'source ~/.config/fish/config.fish' to activate.")
121
+	} else {
122
+		// For bash/zsh, add source line to RC file
123
+		sourceLine := fmt.Sprintf("source \"%s\"", hookPath)
124
+		fmt.Printf("📝 Adding hook: %s\n", sourceLine)
125
+
126
+		// Check if already installed
127
+		if isAlreadyInstalled(rcFile, sourceLine) {
128
+			fmt.Println("✅ Parrot hooks already installed!")
129
+			return
130
+		}
131
+
132
+		// Append to RC file
133
+		file, err := os.OpenFile(rcFile, os.O_APPEND|os.O_CREATE|os.O_WRONLY, 0644)
134
+		if err != nil {
135
+			fmt.Printf("❌ Error opening %s: %v\n", rcFile, err)
136
+			return
137
+		}
138
+		defer file.Close()
139
+
140
+		installContent := fmt.Sprintf(`
86141
 # Parrot CLI hooks and configuration
87142
 export OLLAMA_KEEP_ALIVE="1h"  # Keep AI models loaded for better performance
88143
 %s
89144
 `, sourceLine)
90
-	
91
-	_, err = file.WriteString(installContent)
92
-	if err != nil {
93
-		fmt.Printf("❌ Error writing to %s: %v\n", rcFile, err)
94
-		return
145
+
146
+		_, err = file.WriteString(installContent)
147
+		if err != nil {
148
+			fmt.Printf("❌ Error writing to %s: %v\n", rcFile, err)
149
+			return
150
+		}
151
+
152
+		fmt.Println("✅ Parrot hooks installed successfully!")
153
+		if shellName == "zsh" {
154
+			fmt.Println("🔄 Run 'source ~/.zshrc' to activate, or start a new shell session.")
155
+		} else {
156
+			fmt.Println("🔄 Run 'source ~/.bashrc' to activate, or start a new shell session.")
157
+		}
95158
 	}
96
-	
97
-	fmt.Println("✅ Parrot hooks installed successfully!")
98
-	fmt.Println("🔄 Run 'source ~/.bashrc' (or ~/.zshrc) to activate, or start a new shell session.")
99159
 }
100160
 
101161
 func isAlreadyInstalled(rcFile, sourceLine string) bool {
cmd/setup.gomodified
@@ -163,7 +163,16 @@ func runSetup(cmd *cobra.Command, args []string) {
163163
 	fmt.Println("───────────────────")
164164
 	fmt.Println("To automatically roast failed commands:")
165165
 	fmt.Println("   1. Run: parrot install")
166
-	fmt.Println("   2. Restart your shell or run: source ~/.bashrc")
166
+
167
+	shell := os.Getenv("SHELL")
168
+	if filepath.Base(shell) == "fish" {
169
+		fmt.Println("   2. Restart your shell or run: source ~/.config/fish/config.fish")
170
+	} else if filepath.Base(shell) == "zsh" {
171
+		fmt.Println("   2. Restart your shell or run: source ~/.zshrc")
172
+	} else {
173
+		fmt.Println("   2. Restart your shell or run: source ~/.bashrc")
174
+	}
175
+
167176
 	fmt.Println("   3. Try failing a command and watch parrot respond!")
168177
 	
169178
 	// Step 5: Final tips
@@ -283,10 +292,18 @@ func installShellHooks(cfg *config.Config) {
283292
 	if response == "" || response == "y" || response == "Y" {
284293
 		// Simulate parrot install command
285294
 		fmt.Println("   Running: parrot install")
286
-		
295
+
287296
 		// Call the actual install logic (we'd need to refactor install command)
288297
 		fmt.Println("✅ Shell hooks installed!")
289
-		fmt.Println("2. 🔄 Restart your shell or run: source ~/.bashrc")
298
+
299
+		shell := os.Getenv("SHELL")
300
+		if filepath.Base(shell) == "fish" {
301
+			fmt.Println("2. 🔄 Restart your shell or run: source ~/.config/fish/config.fish")
302
+		} else if filepath.Base(shell) == "zsh" {
303
+			fmt.Println("2. 🔄 Restart your shell or run: source ~/.zshrc")
304
+		} else {
305
+			fmt.Println("2. 🔄 Restart your shell or run: source ~/.bashrc")
306
+		}
290307
 	} else {
291308
 		fmt.Println("⏭️  Skipped - run 'parrot install' later to enable auto-roasting")
292309
 	}
docs/INSULT_EXPANSION_PLAN.mddeleted
@@ -1,88 +0,0 @@
1
-# 1000+ INSULT EXPANSION PLAN
2
-
3
-## Current Database Analysis:
4
-
5
-### Small Categories (need expansion):
6
-- ssh: 25 → 75 (add 50)
7
-- rust: 25 → 75 (add 50)
8
-- go: 30 → 80 (add 50)
9
-- ruby: 29 → 79 (add 50)
10
-- php: 30 → 80 (add 50)
11
-- c: 28 → 78 (add 50)
12
-- java: 35 → 85 (add 50)
13
-- python: 50 → 100 (add 50)
14
-- git: 85 → 135 (add 50)
15
-- docker: 60 → 110 (add 50)
16
-
17
-**Subtotal: 500 new insults**
18
-
19
----
20
-
21
-## New Categories (20 new):
22
-
23
-### Major Categories (50 each):
24
-1. **kubernetes** (50): k8s, pods, deployments, helm, istio
25
-2. **mobile** (50): iOS, Android, React Native, Flutter
26
-3. **web** (50): HTML, CSS, JavaScript, responsive design
27
-4. **shell_scripting** (50): bash, zsh, scripts, automation
28
-5. **algorithms** (50): Big-O, data structures, optimization
29
-6. **architecture** (50): design patterns, microservices, monoliths
30
-
31
-**Subtotal: 300 new insults**
32
-
33
-### Medium Categories (30 each):
34
-7. **refactoring** (30): code cleanup gone wrong
35
-8. **documentation** (30): README, comments, wikis
36
-9. **code_review** (30): PR comments, review culture
37
-10. **meetings** (30): standups, planning, retros
38
-11. **estimates** (30): sprint planning, deadlines
39
-12. **legacy_code** (30): old code, technical debt
40
-13. **junior_dev** (30): junior mistakes
41
-14. **senior_dev** (30): senior arrogance
42
-15. **manager** (30): technical management
43
-16. **startup** (30): startup culture
44
-17. **enterprise** (30): corporate bureaucracy
45
-18. **remote_work** (30): WFH failures
46
-19. **time_management** (30): procrastination
47
-20. **learning** (30): tutorials, bootcamps
48
-
49
-**Subtotal: 420 new insults**
50
-
51
----
52
-
53
-## GRAND TOTAL: 1,220 NEW INSULTS
54
-
55
-### Total Database After Expansion:
56
-- Current: ~2,570 insults
57
-- Adding: 1,220 insults
58
-- **NEW TOTAL: ~3,790 INSULTS**
59
-
60
----
61
-
62
-## Intelligence Improvements Identified:
63
-
64
-1. **Command chaining detection**: Detect pipes and command chains for meta-commentary
65
-2. **Sudo abuse detection**: Track unnecessary sudo usage
66
-3. **Copy-paste detection**: Detect Stack Overflow patterns
67
-4. **Comment density**: Detect lack of comments in commits
68
-5. **File size awareness**: Mock huge files or tiny fixes
69
-6. **Commit message quality**: Analyze commit messages like "fix", "update", "asdf"
70
-
71
-These can be implemented in a future tier (Tier 5?) but for now: INSULTS!
72
-
73
----
74
-
75
-## Insult Quality Guidelines:
76
-
77
-✅ Brutal and savage
78
-✅ Tech-specific references
79
-✅ Varied sentence structure
80
-✅ Mix of short punches and long burns
81
-✅ References to real tools/concepts
82
-✅ Career-ending implications
83
-✅ Team impact mentions
84
-✅ Self-aware meta-commentary
85
-
86
----
87
-
88
-*"We're not just roasting code. We're roasting careers."*
docs/INTELLIGENT_FALLBACK_IDEAS.mddeleted
@@ -1,431 +0,0 @@
1
-# Intelligent Fallback Generator - Design Ideas
2
-
3
-## Phase 2: Making Fallbacks Smarter
4
-
5
-This document outlines ideas for enhancing the fallback system to be more context-aware and intelligent, moving beyond simple pre-generated insults to command-specific mockery.
6
-
7
----
8
-
9
-## Current State (Phase 1)
10
-
11
-✅ **Completed:**
12
-- Expanded fallback database with 600+ brutal insults
13
-- Categorized by command type (git, nodejs, docker, python, rust, etc.)
14
-- Pseudo-random selection for variety
15
-- Better command type detection
16
-
17
-**Limitations:**
18
-- No awareness of actual command content
19
-- Can't parse error patterns
20
-- Doesn't understand command arguments
21
-- Same insult for different failures of same command type
22
-
23
----
24
-
25
-## Phase 2 Goals: Context-Aware Fallbacks
26
-
27
-### 1. **Command Pattern Analysis**
28
-
29
-Parse the actual command to understand what the user was trying to do.
30
-
31
-#### Git Examples:
32
-```go
33
-// Detect specific git operations
34
-"git push" → "Remote rejected you (literally and figuratively)"
35
-"git pull" → "Merge conflicts incoming! Your code vs. reality"
36
-"git commit" → "Even git doesn't want to commit to your code"
37
-"git rebase" → "Rewriting history won't fix your present"
38
-"git merge" → "Can't merge competence into incompetence"
39
-"git clone" → "Cloning failures: Your specialty"
40
-"git checkout" → "Checking out from reality again?"
41
-"git branch" → "Creating branches in your career path to nowhere"
42
-"git reset --hard" → "Wish you could reset your career this easily"
43
-"git stash" → "Stashing problems for later. Classic you."
44
-```
45
-
46
-#### Docker Examples:
47
-```bash
48
-"docker build" → "Build failed: Can't dockerize disaster"
49
-"docker run" → "Container refuses to run from you"
50
-"docker-compose up" → "Composing a symphony of failure"
51
-"docker push" → "Registry rejected your image (and your code)"
52
-"docker exec" → "Can't exec into competence"
53
-```
54
-
55
-### 2. **Exit Code Intelligence**
56
-
57
-Different insults based on common exit codes:
58
-
59
-```go
60
-exitCodeInsults := map[int][]string{
61
-    1:   {"Generic failure. Generic developer."},
62
-    2:   {"Misuse of shell command. Misuse of developer title."},
63
-    126: {"Command not executable. Neither are your plans."},
64
-    127: {"Command not found. Neither is your competence."},
65
-    128: {"Invalid exit argument. Invalid career argument."},
66
-    130: {"Ctrl+C? Can't escape your mistakes that easily."},
67
-    137: {"SIGKILL: Someone had to stop you."},
68
-    139: {"Segfault: Your logic segfaulted first."},
69
-    255: {"Exit code overflow: Like your error overflow."},
70
-}
71
-```
72
-
73
-### 3. **Error Pattern Recognition**
74
-
75
-Parse common error patterns from stderr to provide specific mockery:
76
-
77
-#### Permission Errors:
78
-```
79
-"permission denied" → "Even sudo can't give you competence"
80
-"access forbidden" → "Denied access to success"
81
-"insufficient privileges" → "Insufficient everything"
82
-```
83
-
84
-#### Network Errors:
85
-```
86
-"connection refused" → "Server ghosted you"
87
-"timeout" → "Timed out waiting for your skill to load"
88
-"host unreachable" → "Your goals are unreachable too"
89
-"certificate error" → "Your certifications are invalid too"
90
-```
91
-
92
-#### File/Path Errors:
93
-```
94
-"no such file" → "No such competence either"
95
-"directory not empty" → "Of failures"
96
-"file exists" → "Your file of mistakes exists"
97
-"disk full" → "Full of your mistakes"
98
-```
99
-
100
-### 4. **Command Argument Awareness**
101
-
102
-Understand what arguments mean for better context:
103
-
104
-```go
105
-// Git branch operations
106
-"git push -f" → "Force push? Forcing failure down everyone's throat"
107
-"git commit -m" → "Commit message won't save you from commit mistakes"
108
-"git reset --hard HEAD~1" → "Undo won't undo your career choices"
109
-
110
-// Docker operations
111
-"docker run -d" → "Detached mode: Like your detachment from reality"
112
-"docker build --no-cache" → "No cache can save you"
113
-"docker-compose down" → "Down like your employment prospects"
114
-
115
-// Package managers
116
-"npm install --production" → "Production? You're not ready for development"
117
-"pip install --upgrade" → "Can't upgrade incompetence"
118
-```
119
-
120
-### 5. **Command History Analysis**
121
-
122
-Track repeated failures for escalating mockery:
123
-
124
-```go
125
-type FailureTracker struct {
126
-    commandCounts map[string]int
127
-    recentFailures []string
128
-}
129
-
130
-// First failure
131
-"npm install" → "NPM install failed. Try again?"
132
-
133
-// Third failure (same command)
134
-"npm install" → "Third time's the charm? Not for you apparently."
135
-
136
-// Tenth failure
137
-"npm install" → "Einstein defined insanity as... oh wait, you're beyond that."
138
-```
139
-
140
-### 6. **Time-of-Day Awareness**
141
-
142
-Contextual mockery based on when failures happen:
143
-
144
-```go
145
-func getTimeBasedInsult() string {
146
-    hour := time.Now().Hour()
147
-
148
-    switch {
149
-    case hour >= 0 && hour < 6:
150
-        return "Failing at 3 AM? Sleep won't fix your code."
151
-    case hour >= 9 && hour < 17:
152
-        return "Failing during work hours? At least you're consistent."
153
-    case hour >= 17 && hour < 23:
154
-        return "Still here? Commitment to failure is impressive."
155
-    case hour == 23:
156
-        return "11 PM failure? Tomorrow won't be better."
157
-    }
158
-}
159
-```
160
-
161
-### 7. **Contextual Command Chaining**
162
-
163
-Detect related command sequences:
164
-
165
-```bash
166
-# User runs:
167
-$ npm install
168
-# fails
169
-$ rm -rf node_modules
170
-$ npm install
171
-# fails again
172
-
173
-Parrot: "Deleting node_modules won't delete your incompetence."
174
-```
175
-
176
-### 8. **Project Context Detection**
177
-
178
-Read project files for better context:
179
-
180
-```go
181
-// If package.json exists
182
-"npm install" → "634 dependencies. 635 problems."
183
-
184
-// If Dockerfile exists
185
-"docker build" → "FROM disaster AS production"
186
-
187
-// If .git exists with many branches
188
-"git push" → "42 branches. 0 working."
189
-
190
-// If requirements.txt has many packages
191
-"pip install" → "Your dependency list is longer than your employment history."
192
-```
193
-
194
-### 9. **Smart Template System**
195
-
196
-Template-based generation with variable substitution:
197
-
198
-```go
199
-templates := []string{
200
-    "{{command}} failed? {{reason}} not found.",
201
-    "Error in {{command}}: {{error_type}} detected at {{location}}.",
202
-    "{{command}} rejected by {{service}}: {{witty_reason}}.",
203
-}
204
-
205
-variables := map[string][]string{
206
-    "reason": {"Competence", "Logic", "Skill", "Talent", "Ability"},
207
-    "error_type": {"Stupidity", "Incompetence", "Chaos", "Disaster"},
208
-    "location": {"keyboard-chair interface", "brain", "neural network"},
209
-    "service": {"reality", "common sense", "basic standards"},
210
-    "witty_reason": {"standards exist", "quality matters", "not today"},
211
-}
212
-```
213
-
214
-### 10. **Machine Learning Approach** (Future)
215
-
216
-Build a small ML model trained on:
217
-- Common error messages
218
-- Command patterns
219
-- Successful insult patterns
220
-- User response (if they re-run quickly, insult was good!)
221
-
222
-Could use a tiny transformer model or Markov chain for:
223
-- Context-aware insult generation
224
-- Pattern recognition in error messages
225
-- Learning what insults work best for which failures
226
-
227
----
228
-
229
-## Implementation Priorities
230
-
231
-### **High Priority** (Phase 2.1)
232
-1. ✅ Command argument parsing
233
-2. ✅ Exit code specific insults
234
-3. ✅ Basic error pattern recognition
235
-4. ✅ Enhanced command type detection
236
-
237
-### **Medium Priority** (Phase 2.2)
238
-5. Command history tracking
239
-6. Time-of-day context
240
-7. Project context detection
241
-8. Template-based generation
242
-
243
-### **Low Priority** (Phase 2.3)
244
-9. Command chaining detection
245
-10. ML-based generation
246
-
247
----
248
-
249
-## Technical Architecture
250
-
251
-```
252
-┌─────────────────────────────────────────────────────────┐
253
-│                  Smart Fallback System                   │
254
-└─────────────────────────────────────────────────────────┘
255
-                            ↓
256
-┌─────────────────────────────────────────────────────────┐
257
-│              Context Analysis Layer                      │
258
-│  ┌──────────────┐  ┌──────────────┐  ┌──────────────┐  │
259
-│  │  Command     │  │  Error       │  │  Environment │  │
260
-│  │  Parser      │  │  Pattern     │  │  Detector    │  │
261
-│  └──────────────┘  └──────────────┘  └──────────────┘  │
262
-└─────────────────────────────────────────────────────────┘
263
-                            ↓
264
-┌─────────────────────────────────────────────────────────┐
265
-│           Insult Generation Strategy                     │
266
-│  ┌──────────────┐  ┌──────────────┐  ┌──────────────┐  │
267
-│  │  Pattern     │  │  Template    │  │  Database    │  │
268
-│  │  Match       │  │  Fill        │  │  Lookup      │  │
269
-│  └──────────────┘  └──────────────┘  └──────────────┘  │
270
-└─────────────────────────────────────────────────────────┘
271
-                            ↓
272
-┌─────────────────────────────────────────────────────────┐
273
-│              Response Ranking & Selection                │
274
-└─────────────────────────────────────────────────────────┘
275
-```
276
-
277
----
278
-
279
-## Example: Intelligent Fallback Flow
280
-
281
-```
282
-User runs: git push origin main
283
-Exit code: 1
284
-Stderr: "rejected (fetch first)"
285
-
286
-Step 1: Parse command
287
-- Command: "git"
288
-- Subcommand: "push"
289
-- Args: ["origin", "main"]
290
-- Type: "git-push"
291
-
292
-Step 2: Analyze error
293
-- Pattern: "rejected"
294
-- Reason: "fetch first"
295
-- Category: "out-of-sync"
296
-
297
-Step 3: Generate context-aware insult
298
-Options:
299
-a) "Git rejected your push. Did you forget to pull? Amateur."
300
-b) "Remote is ahead. So is everyone else in your field."
301
-c) "Fetch first? You should've fetched competence first."
302
-
303
-Step 4: Select based on:
304
-- Recent history (if repeated: escalate)
305
-- Time of day (if late: add time mockery)
306
-- Personality setting (savage mode: option C)
307
-
308
-Final output: "Fetch first? You should've fetched competence first."
309
-```
310
-
311
----
312
-
313
-## Data Structures
314
-
315
-```go
316
-type ContextualFallback struct {
317
-    // Command context
318
-    Command     string
319
-    Subcommand  string
320
-    Arguments   []string
321
-    ExitCode    int
322
-
323
-    // Error context
324
-    StderrSnippet string
325
-    ErrorPattern  string
326
-    ErrorCategory string
327
-
328
-    // Environment context
329
-    ProjectType   string  // "nodejs", "python", "rust", etc.
330
-    TimeOfDay     int
331
-    IsWeekend     bool
332
-
333
-    // History context
334
-    FailureCount  int
335
-    LastFailure   time.Time
336
-    SameCommand   bool
337
-}
338
-
339
-type InsultGenerator interface {
340
-    Generate(ctx ContextualFallback) string
341
-    Rank(insults []string, ctx ContextualFallback) []string
342
-}
343
-```
344
-
345
----
346
-
347
-## Testing Strategy
348
-
349
-Create test cases for intelligent fallbacks:
350
-
351
-```go
352
-func TestIntelligentFallback(t *testing.T) {
353
-    tests := []struct{
354
-        command  string
355
-        exitCode int
356
-        stderr   string
357
-        expected string  // should contain
358
-    }{
359
-        {
360
-            command:  "git push origin main",
361
-            exitCode: 1,
362
-            stderr:   "rejected",
363
-            expected: "rejected", // insult should mention rejection
364
-        },
365
-        {
366
-            command:  "docker build .",
367
-            exitCode: 1,
368
-            stderr:   "no such file",
369
-            expected: "file", // should mention file issue
370
-        },
371
-    }
372
-}
373
-```
374
-
375
----
376
-
377
-## Future Enhancements
378
-
379
-1. **User Preferences**: Allow users to configure insult intensity
380
-2. **Learning Mode**: Adapt to user's most common failures
381
-3. **Streaks**: Track failure/success streaks
382
-4. **Achievements**: "100 git push failures in a row!"
383
-5. **Statistics**: `parrot stats` showing failure patterns
384
-6. **Insult API**: External service for fresh insults
385
-7. **Community Insults**: User-submitted insult database
386
-8. **Language Support**: Multilingual mockery
387
-
388
----
389
-
390
-## Performance Considerations
391
-
392
-- Context analysis should be < 10ms
393
-- Database lookup: O(1) hash-based
394
-- Template generation: Pre-compiled templates
395
-- Error pattern matching: Regex compilation cached
396
-- History tracking: Ring buffer (last 100 failures)
397
-
398
----
399
-
400
-## Backwards Compatibility
401
-
402
-- Keep expanded database as fallback-of-fallbacks
403
-- Smart fallback is opt-in via config flag
404
-- Graceful degradation if parsing fails
405
-- All new features behind feature flags
406
-
407
-```toml
408
-[features]
409
-smart_fallback = true
410
-context_aware_insults = true
411
-command_history_tracking = true
412
-project_detection = true
413
-```
414
-
415
----
416
-
417
-## Metrics to Track
418
-
419
-- Fallback usage rate
420
-- Context detection success rate
421
-- Most common failure patterns
422
-- Average insult length
423
-- User engagement (re-run speed)
424
-
425
----
426
-
427
-## Conclusion
428
-
429
-Phase 2 will transform fallbacks from simple pre-generated insults into an intelligent, context-aware mockery system that understands what users are trying to do and why they're failing, delivering brutally specific feedback that's both entertaining and (accidentally) educational.
430
-
431
-The foundation is in place with 600+ insults. Now we build intelligence on top.
docs/NEXT_LEVEL_INTELLIGENCE.mddeleted
@@ -1,410 +0,0 @@
1
-# Next-Level Intelligence: Advanced Fallback Features
2
-
3
-## What's On The Table 🎯
4
-
5
-Here are the intelligence upgrades we can implement RIGHT NOW:
6
-
7
----
8
-
9
-## ✅ TIER 1: Quick Wins (Implement Now)
10
-
11
-### 1. **Environment Variable Detection**
12
-Detect environment and mock accordingly:
13
-
14
-```bash
15
-CI=true → "Breaking CI? Breaking everyone's day."
16
-PROD=true → "Testing in production? Bold strategy."
17
-DEBUG=true → "Debug mode can't debug your brain."
18
-NODE_ENV=development → "Development environment for underdeveloped skills."
19
-HOME=/root → "Running as root? Root of all problems."
20
-```
21
-
22
-**Implementation:** ~30 lines, instant value
23
-
24
----
25
-
26
-### 2. **Working Directory Awareness**
27
-Mock based on where the failure happened:
28
-
29
-```bash
30
-/tmp → "Even temporary directories don't want your code long-term."
31
-/home/user/Downloads → "Coding in Downloads? Your career is downloading too."
32
-/var/log → "Belongs in logs: Your code, your career."
33
-/opt → "Optional directory for optional competence."
34
-/ → "Root directory disaster: You affect everything."
35
-```
36
-
37
-**Implementation:** ~40 lines, path pattern matching
38
-
39
----
40
-
41
-### 3. **Time-of-Day Intelligence**
42
-Different insults for different hours:
43
-
44
-```bash
45
-00:00-06:00 → "3 AM debugging? Tomorrow won't fix today's code."
46
-06:00-09:00 → "Morning failures set the tone for the day."
47
-09:00-17:00 → "Failing during work hours? Consistently inconsistent."
48
-17:00-23:00 → "Evening failure: Overtime making more bugs."
49
-Friday PM → "Friday deploy failed? Weekend ruined."
50
-```
51
-
52
-**Implementation:** ~50 lines, time-based selection
53
-
54
----
55
-
56
-### 4. **Repeated Failure Detection**
57
-Track failures in memory (per shell session):
58
-
59
-```bash
60
-1st fail: "Git push failed. Try again?"
61
-3rd fail: "Third time's NOT the charm for you."
62
-5th fail: "5 failures. Definition of insanity?"
63
-10th fail: "TEN FAILURES. Stop. Just stop."
64
-```
65
-
66
-**Implementation:** ~60 lines, in-memory counter
67
-
68
----
69
-
70
-### 5. **File Extension Detection**
71
-Parse command for file extensions:
72
-
73
-```bash
74
-".rs" file → "Rust file failed: Your code can't rust, it's already corroded."
75
-".go" file → "Go file failed: Stop. Don't go. Just don't."
76
-".java" file → "Java failed: Your code needs more than coffee."
77
-".cpp" file → "C++ segfault: C you later, career."
78
-".sh" file → "Shell script failed: Script kiddie confirmed."
79
-```
80
-
81
-**Implementation:** ~50 lines, regex pattern matching
82
-
83
----
84
-
85
-### 6. **Command Length Intelligence**
86
-Mock based on command complexity:
87
-
88
-```bash
89
-len < 10 chars → "Short command, short career."
90
-len > 100 chars → "Command longer than your competence."
91
-Pipe chains (|) → "Piping disasters together."
92
-Multiple && → "Chaining failures sequentially."
93
-```
94
-
95
-**Implementation:** ~30 lines, length and character checks
96
-
97
----
98
-
99
-### 7. **Numeric Argument Detection**
100
-Recognize numbers in commands:
101
-
102
-```bash
103
-port :8080 → "Port 8080: Gateway to failure."
104
-port :3000 → "Port 3000: Three thousand problems."
105
-port :22 → "SSH on 22: 22 ways to fail."
106
-chmod 777 → "777 permissions: Maximum chaos enabled."
107
-chmod 000 → "000 permissions: Like your access to competence."
108
-kill -9 → "Kill -9: Killing everything, including hopes."
109
-```
110
-
111
-**Implementation:** ~70 lines, number pattern matching
112
-
113
----
114
-
115
-## ⭐ TIER 2: Medium Complexity (Implement if time)
116
-
117
-### 8. **Git Branch Awareness**
118
-If in git repo, detect branch:
119
-
120
-```bash
121
-main/master → "Breaking main? Breaking everyone."
122
-develop → "Develop your skills first."
123
-feature/* → "Feature branch: Featured failure."
124
-hotfix/* → "Hotfix? You ARE the bug."
125
-```
126
-
127
-**Implementation:** ~80 lines, call `git branch --show-current`
128
-
129
----
130
-
131
-### 9. **Project Type Detection**
132
-Read project files to understand context:
133
-
134
-```bash
135
-package.json exists → "Node project detected. Dependencies: Many. Skills: None."
136
-Cargo.toml exists → "Rust project: Can't cargo your incompetence."
137
-go.mod exists → "Go project: Should go away."
138
-pom.xml exists → "Maven project: Mav-un successful."
139
-requirements.txt → "Python requirements: Skill requirement unmet."
140
-```
141
-
142
-**Implementation:** ~100 lines, file existence checks
143
-
144
----
145
-
146
-### 10. **Common Error Pattern Recognition**
147
-Parse for common error keywords:
148
-
149
-```bash
150
-"permission denied" → "Denied by reality itself."
151
-"connection refused" → "Server ghosting you."
152
-"timeout" → "Timed out like your patience."
153
-"not found" → "404: Your competence not found."
154
-"already exists" → "Already exists: Your failure record."
155
-"syntax error" → "Syntax error in brain.rs"
156
-```
157
-
158
-**Implementation:** ~120 lines, keyword matching
159
-
160
----
161
-
162
-### 11. **Shell Type Awareness**
163
-Different insults per shell:
164
-
165
-```bash
166
-bash → "Bash your head against keyboard. Same result."
167
-zsh → "Z shell: Z for zero competence."
168
-fish → "Fish shell? You're swimming in failure."
169
-sh → "Bourne shell: Born to fail."
170
-```
171
-
172
-**Implementation:** ~30 lines, check $SHELL
173
-
174
----
175
-
176
-## 🚀 TIER 3: Advanced (Future Phases)
177
-
178
-### 12. **Command History Analysis**
179
-Read recent history for patterns:
180
-
181
-- Same command failed 5 times → "Still trying the same thing? Insanity."
182
-- Alternating between npm/yarn → "Can't decide? Neither can your code."
183
-- Many sudo attempts → "Sudo won't sudo-make you competent."
184
-
185
-**Implementation:** ~150 lines, shell history parsing
186
-
187
----
188
-
189
-### 13. **Dependency Version Detection**
190
-Parse package files for old versions:
191
-
192
-```bash
193
-npm: express@3.x → "Express version ancient. So is your knowledge."
194
-python: django==1.x → "Django 1? Living in the past?"
195
-node: <12 → "Node version EOL. So is your relevance."
196
-```
197
-
198
-**Implementation:** ~200 lines, JSON/TOML parsing
199
-
200
----
201
-
202
-### 14. **CI/CD Pipeline Detection**
203
-Detect CI environment variables:
204
-
205
-```bash
206
-GITHUB_ACTIONS → "Breaking GitHub Actions? Actions speak louder."
207
-GITLAB_CI → "GitLab CI failed: Commit to learning."
208
-JENKINS_HOME → "Jenkins job failed: Job security failed."
209
-CIRCLE_CI → "Circle CI: Circular logic detected."
210
-```
211
-
212
-**Implementation:** ~50 lines, env var checks
213
-
214
----
215
-
216
-### 15. **Resource Usage Detection**
217
-Check system resources:
218
-
219
-```bash
220
-Low disk space → "Out of space? Out of competence."
221
-High CPU → "CPU at 100%? Your brain at 0%."
222
-Low memory → "Low RAM? Lower skill."
223
-```
224
-
225
-**Implementation:** ~100 lines, system calls
226
-
227
----
228
-
229
-## 🎯 RECOMMENDED IMPLEMENTATION ORDER
230
-
231
-### Phase 2.2 (NOW):
232
-1. ✅ Environment Variable Detection (30 lines)
233
-2. ✅ Working Directory Awareness (40 lines)
234
-3. ✅ Time-of-Day Intelligence (50 lines)
235
-4. ✅ File Extension Detection (50 lines)
236
-5. ✅ Command Length Intelligence (30 lines)
237
-6. ✅ Numeric Argument Detection (70 lines)
238
-7. ✅ Shell Type Awareness (30 lines)
239
-
240
-**Total: ~300 lines of smart detection**
241
-
242
-### Phase 2.3 (Next):
243
-8. Git Branch Awareness
244
-9. Project Type Detection
245
-10. Common Error Pattern Recognition
246
-11. Repeated Failure Detection
247
-
248
-### Phase 3.0 (Future):
249
-- Command History Analysis
250
-- Dependency Version Detection
251
-- CI/CD Pipeline Detection
252
-- Resource Usage Detection
253
-
254
----
255
-
256
-## 📊 IMPLEMENTATION STRATEGY
257
-
258
-### New Architecture:
259
-
260
-```
261
-SmartFallbackContext {
262
-    // Existing
263
-    Command, Subcommand, Arguments, ExitCode
264
-
265
-    // NEW Tier 1 additions
266
-    Environment map[string]string  // CI, DEBUG, etc.
267
-    WorkingDir string               // Current directory
268
-    TimeOfDay int                   // Hour 0-23
269
-    FileExtensions []string         // Files mentioned in command
270
-    CommandLength int               // Command complexity
271
-    NumericArgs []int               // Port numbers, chmod values
272
-    Shell string                    // bash, zsh, fish
273
-}
274
-```
275
-
276
-### Enhanced GenerateSmartFallback():
277
-
278
-```go
279
-func GenerateSmartFallback(ctx SmartFallbackContext) string {
280
-    // Priority order:
281
-    1. Environment-specific insult
282
-    2. Time-sensitive insult
283
-    3. Working directory insult
284
-    4. File extension insult
285
-    5. Numeric argument insult
286
-    6. Shell-specific insult
287
-    7. Command length insult
288
-    8. [Existing] Exit code insult
289
-    9. [Existing] Command pattern insult
290
-    10. [Existing] Argument-aware insult
291
-    11. [Fallback] Expanded database
292
-
293
-    return mostRelevantInsult()
294
-}
295
-```
296
-
297
----
298
-
299
-## 🎨 EXAMPLE OUTPUTS
300
-
301
-### Environment Detection:
302
-```bash
303
-$ CI=true npm test
304
-🦜 Breaking CI? Breaking everyone's day.
305
-
306
-$ NODE_ENV=production node app.js
307
-🦜 Production error: Producing only failures.
308
-```
309
-
310
-### Time-of-Day:
311
-```bash
312
-$ [03:47] git push
313
-🦜 3 AM push to prod? Tomorrow's you will hate today's you.
314
-
315
-$ [23:59] docker build .
316
-🦜 Building at midnight? Building toward burnout.
317
-```
318
-
319
-### Working Directory:
320
-```bash
321
-$ cd /tmp && python script.py
322
-🦜 Coding in /tmp? That's where your code belongs: temporary.
323
-
324
-$ cd ~ && rm -rf /
325
-🦜 Running destructive commands from home? Homeless soon.
326
-```
327
-
328
-### File Extensions:
329
-```bash
330
-$ rustc main.rs
331
-🦜 .rs file failed: Rust in peace, code.
332
-
333
-$ javac Main.java
334
-🦜 .java compile failed: Java needs more than coffee beans.
335
-
336
-$ gcc -o app main.cpp
337
-🦜 C++ compilation failed: C++ you later, career.
338
-```
339
-
340
-### Numeric Arguments:
341
-```bash
342
-$ chmod 777 script.sh
343
-🦜 chmod 777: Maximum permissions, minimum security, zero brains.
344
-
345
-$ kill -9 12345
346
-🦜 kill -9: Killing process 12345. Can't kill your incompetence.
347
-
348
-$ nc localhost 8080
349
-🦜 Port 8080: Eight-zero-eight-zero problems detected.
350
-```
351
-
352
-### Shell Type:
353
-```bash
354
-$ zsh: command not found
355
-🦜 Z shell for Z-ero competence level.
356
-
357
-$ fish: Unknown command
358
-🦜 Fish shell? You're drowning in incompetence.
359
-```
360
-
361
----
362
-
363
-## 📈 METRICS
364
-
365
-After Phase 2.2 implementation:
366
-
367
-- **Intelligence Layers:** 10+ (from 3)
368
-- **Context Factors:** 15+ variables considered
369
-- **Decision Points:** 20+ checks per failure
370
-- **Insult Database:** 1,150+ (adding 300 more)
371
-- **Relevance Score:** 95%+ (vs 70% before)
372
-
373
----
374
-
375
-## 🔧 TECHNICAL NOTES
376
-
377
-### Performance:
378
-- All checks are O(1) or O(n) where n is small
379
-- No external API calls (all local)
380
-- Total latency: < 5ms for all checks
381
-- Memory: < 1KB per context
382
-
383
-### Backwards Compatibility:
384
-- All new features gracefully degrade
385
-- If detection fails, falls back to existing system
386
-- No breaking changes to API
387
-
388
-### Testing:
389
-- Unit tests for each detection type
390
-- Integration tests for priority order
391
-- Edge case coverage
392
-
393
----
394
-
395
-## 🎉 EXPECTED OUTCOME
396
-
397
-After Phase 2.2:
398
-
399
-**Parrot will understand:**
400
-- What environment you're in
401
-- What time it is
402
-- Where you're working
403
-- What files you're touching
404
-- How complex your command is
405
-- What numbers mean in context
406
-- What shell you're using
407
-
408
-**Result:** Brutally specific, context-perfect mockery! 🔥
409
-
410
-Let's implement Tier 1 NOW! 🚀
docs/TIER_4_ROADMAP.mddeleted
@@ -1,315 +0,0 @@
1
-# Tier 4 Intelligence: Machine Learning & Dynamic Generation
2
-
3
-## 🎯 OBJECTIVE
4
-Make fallback insults indistinguishable from local LLM responses through:
5
-- Rudimentary ML/pattern learning (no external dependencies)
6
-- Dynamic insult generation
7
-- Persistent learning across sessions
8
-- 300+ savage, brutal insults
9
-
10
----
11
-
12
-## 🧠 TIER 4 FEATURE OPTIONS
13
-
14
-### Option A: Template-Based Dynamic Generation ⭐ RECOMMENDED
15
-**Complexity:** Medium | **Impact:** High | **LOC:** ~400
16
-
17
-Build insults dynamically from components:
18
-
19
-```go
20
-type InsultTemplate struct {
21
-    Prefix   []string  // "Congratulations:", "Well done:", "Achievement unlocked:"
22
-    Core     []string  // "breaking production", "catastrophic failure", "disaster deployed"
23
-    Suffix   []string  // "on a Friday", "right before demo", "in front of everyone"
24
-    Modifier []string  // "spectacularly", "epically", "magnificently"
25
-}
26
-
27
-// Example generated insults:
28
-"Achievement unlocked: Spectacularly breaking production right before demo."
29
-"Well done: Epically deploying disaster on a Friday."
30
-"Congratulations: Magnificently failing in front of everyone."
31
-```
32
-
33
-**Variables:**
34
-- `{command}` - The actual command
35
-- `{error_code}` - Exit code
36
-- `{time}` - Current time/day
37
-- `{branch}` - Git branch
38
-- `{project}` - Project type
39
-- `{count}` - Failure count
40
-
41
-```go
42
-"Failed {command} {count} times. Einstein called: That's insanity."
43
-"Exit code {error_code} on {branch}. Breaking {project} projects: Your specialty."
44
-"At {time} on a Friday? Weekend warrior of failure."
45
-```
46
-
47
----
48
-
49
-### Option B: Markov Chain Insult Generator
50
-**Complexity:** High | **Impact:** Medium | **LOC:** ~600
51
-
52
-Learn patterns from existing insults to generate new ones:
53
-
54
-```go
55
-type MarkovChain struct {
56
-    transitions map[string]map[string]int  // word -> next word -> frequency
57
-    order       int                         // 2-gram or 3-gram
58
-}
59
-
60
-// Train on existing 2,250+ insults
61
-// Generate novel combinations:
62
-"Git push failed: Can't push past incompetence into employment."
63
-"Docker build crashed: Containerize your career away."
64
-```
65
-
66
-**Pros:** Novel insults, seemingly intelligent
67
-**Cons:** Can generate nonsensical combinations
68
-
69
----
70
-
71
-### Option C: Rule-Based Intelligence Engine
72
-**Complexity:** Medium | **Impact:** Very High | **LOC:** ~800
73
-
74
-Advanced pattern matching with persistent learning:
75
-
76
-```go
77
-type FailurePattern struct {
78
-    CommandSequence []string      // ["git add", "git commit", "git push"]
79
-    TimePattern     string         // "late_night", "friday", "monday"
80
-    FailureChain    bool          // Multiple related failures
81
-    UserProfile     UserBehavior  // Historical patterns
82
-}
83
-
84
-type UserBehavior struct {
85
-    CommonMistakes   map[string]int  // Tracks repeated errors
86
-    FailureStreak    int             // Current failure count
87
-    WorstCommands    []string        // Top failed commands
88
-    TimeOfMistakes   map[int]int     // Hourly failure distribution
89
-}
90
-```
91
-
92
-**Persistent Storage:** JSON file in `~/.parrot/failure_history.json`
93
-
94
-```json
95
-{
96
-  "total_failures": 847,
97
-  "failure_streak": 5,
98
-  "common_commands": {
99
-    "git push": 143,
100
-    "docker build": 89,
101
-    "npm install": 67
102
-  },
103
-  "worst_hour": 23,
104
-  "branch_disasters": {
105
-    "main": 45,
106
-    "feature/*": 12
107
-  }
108
-}
109
-```
110
-
111
-**Advanced Insults:**
112
-```
113
-"5 failures in a row. New personal best in incompetence."
114
-"Failed 'git push' 143 times. Have you considered 'git out'?"
115
-"23:00 again? 67% of your failures happen at this hour."
116
-"Breaking main for the 45th time. Team morale: -100."
117
-```
118
-
119
----
120
-
121
-### Option D: Error Message Parsing & Analysis
122
-**Complexity:** Very High | **Impact:** Very High | **LOC:** ~1000
123
-
124
-Parse actual error output for context-aware responses:
125
-
126
-```go
127
-type ErrorAnalysis struct {
128
-    ActualError     string        // Captured stderr/stdout
129
-    ParsedErrors    []ErrorToken  // Extracted key phrases
130
-    SuggestedFix    string        // Mock "helpful" suggestion
131
-}
132
-
133
-// Parse common error patterns:
134
-"error: failed to push some refs" → "Failed to push: Your code is the ref-use."
135
-"ENOENT: no such file or directory" → "No such file: Like your competence."
136
-"TypeError: undefined is not a function" → "Undefined function. Defined incompetence."
137
-"permission denied (publickey)" → "Permission denied: Even SSH rejects you."
138
-```
139
-
140
-**Integration Point:** Hook into command output capture in shell script
141
-
142
----
143
-
144
-## 🔥 RECOMMENDED TIER 4 IMPLEMENTATION
145
-
146
-### **Hybrid Approach:** Combine A + C + Savage Insults
147
-
148
-**Phase 4.1: Template-Based Generation**
149
-- 50+ prefixes, 100+ cores, 50+ suffixes, 30+ modifiers
150
-- Variable substitution system
151
-- Component mixing algorithm
152
-- **Result:** Millions of possible combinations
153
-
154
-**Phase 4.2: Persistent Learning**
155
-- Track failures to `~/.parrot/failures.json`
156
-- Failure streak detection (escalating severity)
157
-- Command frequency analysis
158
-- Time-based pattern detection
159
-- **Result:** Personalized, adaptive insults
160
-
161
-**Phase 4.3: Savage Insult Database**
162
-- 300+ new brutal insults
163
-- Categories:
164
-  - **ego_destruction** (40): Personal attacks on competence
165
-  - **career_advice** (40): Suggestions to quit
166
-  - **team_impact** (40): How you're affecting others
167
-  - **existential** (40): Deep cuts about purpose
168
-  - **comparison** (40): Unfavorable comparisons
169
-  - **timeline** (40): Past/present/future failures
170
-  - **meta** (40): Self-aware commentary on failures
171
-  - **technical_savage** (20): Brutal tech-specific burns
172
-
173
----
174
-
175
-## 📊 TIER 4 ARCHITECTURE
176
-
177
-```
178
-ParseCommandContext()
179
-    ↓
180
-LoadUserHistory() ← ~/.parrot/failures.json
181
-    ↓
182
-AnalyzeFailurePattern()
183
-    ↓
184
-GenerateSmartFallback()
185
-    ↓
186
-    ├─ Tier 4 Intelligence (NEW)
187
-    │   ├─ Failure Streak Escalation
188
-    │   ├─ Historical Pattern Matching
189
-    │   ├─ Dynamic Template Generation
190
-    │   └─ Personalized Savage Mode
191
-    │
192
-    ├─ Tier 3 Intelligence
193
-    │   ├─ Repeated failure tracking
194
-    │   ├─ CI/CD detection
195
-    │   └─ Error pattern recognition
196
-    │
197
-    └─ ... (Tier 2, 1, Original, Database)
198
-        ↓
199
-UpdateUserHistory() → ~/.parrot/failures.json
200
-```
201
-
202
----
203
-
204
-## 🎨 EXAMPLE TIER 4 OUTPUTS
205
-
206
-### Dynamic Generation:
207
-```
208
-Command: git push origin main
209
-Failure #1:  "Git push failed: Push yourself towards unemployment."
210
-Failure #3:  "3rd git push failure. Persistence: Admirable. Competence: Absent."
211
-Failure #7:  "7 CONSECUTIVE FAILURES. Breaking main repeatedly: Your signature move."
212
-Failure #12: "12 FAILURES IN A ROW. Your team has a betting pool on when you'll quit."
213
-```
214
-
215
-### Historical Context:
216
-```
217
-"Failed 'docker build' again. 89 times this month. New record?"
218
-"11 PM failure #23. Your most productive hour: For disasters."
219
-"Breaking feature branches: 47% success rate. Breaking main: 100% failure rate."
220
-"5-day failure streak. Consistency: The only skill demonstrated."
221
-```
222
-
223
-### Template Combinations:
224
-```
225
-"Achievement unlocked: Catastrophically breaking production on a Friday afternoon."
226
-"Congratulations: Spectacularly deploying garbage right before the demo."
227
-"Outstanding: Magnificently crashing the server during peak hours."
228
-"Impressive: Expertly corrupting the database in front of stakeholders."
229
-```
230
-
231
----
232
-
233
-## 🔢 IMPLEMENTATION ESTIMATES
234
-
235
-| Feature | Lines of Code | Difficulty | Impact |
236
-|---------|--------------|------------|--------|
237
-| Template Generation | ~200 | Medium | High |
238
-| Variable Substitution | ~100 | Low | High |
239
-| Persistent Storage | ~150 | Medium | Very High |
240
-| Failure History Analysis | ~200 | Medium | Very High |
241
-| Streak Detection | ~100 | Low | High |
242
-| Pattern Matching | ~150 | Medium | High |
243
-| Savage Insult DB (300+) | ~600 | Low | Very High |
244
-| **TOTAL** | **~1,500** | **Medium** | **Very High** |
245
-
246
----
247
-
248
-## 🎯 SUCCESS METRICS
249
-
250
-**Tier 4 Complete When:**
251
-1. ✅ Dynamic insult generation produces unique outputs
252
-2. ✅ User failure history persists across sessions
253
-3. ✅ Failure streaks trigger escalating brutality
254
-4. ✅ Historical patterns influence insult selection
255
-5. ✅ 300+ savage insults added to database
256
-6. ✅ Total database exceeds 2,500 insults
257
-7. ✅ Insults feel "LLM-like" in context awareness
258
-
259
----
260
-
261
-## 💀 SAVAGE INSULT PREVIEW
262
-
263
-### ego_destruction:
264
-- "Your code is the coding equivalent of a participation trophy. Except nobody participated."
265
-- "If incompetence was an Olympic sport, you'd finish fourth."
266
-- "Your commit history reads like a tragedy written by someone who doesn't understand tragedy."
267
-- "You're not a 10x engineer. You're a 0.1x engineer. Generous estimate."
268
-
269
-### career_advice:
270
-- "Have you considered a career where failure is the goal? Like professional crash test dummy?"
271
-- "LinkedIn is free. Monster.com is waiting. Your IDE should be closed."
272
-- "Your resume says 'Full Stack Developer'. Full stack of failures, maybe."
273
-- "They say everyone starts somewhere. You should've stayed there."
274
-
275
-### team_impact:
276
-- "Your pull request has 47 comments. 46 are 'please no'."
277
-- "The team retrospective has a dedicated section titled 'Never again'."
278
-- "Your standups require a trigger warning."
279
-- "HR added 'Survived working with [you]' to employee benefits."
280
-
281
-### existential:
282
-- "In the grand scheme of the universe, you are insignificant. In the grand scheme of this codebase, you are catastrophic."
283
-- "Sisyphus pushed a boulder uphill for eternity. You push bugs to production."
284
-- "The void stares back. The void is more competent."
285
-- "If a tree falls in the forest and no one hears it, it still has more impact than your code."
286
-
287
----
288
-
289
-## 🚀 NEXT STEPS
290
-
291
-**Decision Point:**
292
-1. **Full Tier 4** (Template + Learning + Savage) - ~1,500 LOC
293
-2. **Savage Only** (Just add 300+ brutal insults) - ~600 LOC
294
-3. **Learning Focus** (Persistent history + patterns) - ~500 LOC
295
-4. **Template Focus** (Dynamic generation) - ~400 LOC
296
-
297
-**Recommendation:** Full Tier 4 for maximum impact. The combination of dynamic generation + learning + savage insults will truly rival LLM-quality responses.
298
-
299
----
300
-
301
-## 📝 NOTES
302
-
303
-- No external dependencies required (pure Go standard library)
304
-- Persistent storage uses JSON (human-readable, debuggable)
305
-- Template system allows infinite combinations
306
-- Learning system gets smarter over time
307
-- Savage insults ensure maximum entertainment value
308
-
309
-**Estimated Development Time:** 2-3 hours for full implementation
310
-**Estimated Fun Factor:** 11/10
311
-
312
----
313
-
314
-*"The best way to predict the future is to insult it mercilessly."*
315
-*- Parrot AI, probably*
parrot-hook.fishadded
@@ -0,0 +1,43 @@
1
+# Parrot shell hook for fish - source this in your fish config
2
+# Typically installed to ~/.config/fish/conf.d/parrot.fish
3
+
4
+# Path to parrot binary - update this if needed
5
+set -g PARROT_BIN "parrot"
6
+
7
+# Function to check if parrot binary exists
8
+function parrot_check
9
+    if not command -v $PARROT_BIN >/dev/null 2>&1
10
+        echo "⚠️  Parrot binary not found. Make sure 'parrot' is in your PATH."
11
+        return 1
12
+    end
13
+    return 0
14
+end
15
+
16
+# Function called after each command completes
17
+function parrot_postexec --on-event fish_postexec
18
+    set -l exit_code $status
19
+    set -l last_cmd (history max 1)
20
+
21
+    # Only mock if command failed and we have a command
22
+    if test $exit_code -ne 0; and test -n "$last_cmd"; and parrot_check
23
+        # Run parrot in background to avoid blocking shell if PARROT_ASYNC is set
24
+        if test "$PARROT_ASYNC" = "true"
25
+            $PARROT_BIN mock "$last_cmd" "$exit_code" &
26
+        else
27
+            $PARROT_BIN mock "$last_cmd" "$exit_code"
28
+        end
29
+    end
30
+end
31
+
32
+# Setup hook (only show messages if not already initialized)
33
+if not set -q PARROT_INITIALIZED
34
+    echo "🦜 Parrot is now watching your fish commands..."
35
+
36
+    # Show performance tip
37
+    if test "$PARROT_ASYNC" != "true"
38
+        echo "💡 Tip: Set PARROT_ASYNC=true to prevent terminal hangs on slow networks"
39
+    end
40
+
41
+    # Mark as initialized for this shell session
42
+    set -gx PARROT_INITIALIZED 1
43
+end
parrot-hook.shmodified
@@ -63,7 +63,8 @@ if [ -z "$PARROT_INITIALIZED" ]; then
6363
         add-zsh-hook precmd parrot_precmd
6464
         echo "🦜 Parrot is now watching your zsh commands..."
6565
     else
66
-        echo "⚠️  Parrot: Unsupported shell. Only bash and zsh are supported."
66
+        echo "⚠️  Parrot: Unsupported shell. Only bash, zsh, and fish are supported."
67
+        echo "💡 For fish shell, use parrot-hook.fish instead."
6768
     fi
6869
 
6970
     # Show performance tip