Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 18 additions & 18 deletions .ai/docs/automation.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# Automation Guide [Claude Code only]
# Automation Guide [Gemini Cli only]

This guide explains how automation works for Claude Code and how to extend it for your needs.
This guide explains how automation works for Gemini Cli and how to extend it for your needs.

## 🔄 How Automation Works

### The Hook System

Claude Code supports hooks that trigger actions based on events:
Gemini Cli supports hooks that trigger actions based on events:

```json
{
Expand All @@ -31,7 +31,7 @@ Claude Code supports hooks that trigger actions based on events:
#### 1. **Automatic Quality Checks**

- **Trigger**: After any file edit/write
- **Script**: `.claude/tools/make-check.sh`
- **Script**: `.gemini/tools/make-check.sh`
- **What it does**:
- Finds the nearest Makefile
- Runs `make check`
Expand All @@ -40,8 +40,8 @@ Claude Code supports hooks that trigger actions based on events:

#### 2. **Desktop Notifications**

- **Trigger**: Any Claude Code notification event
- **Script**: `.claude/tools/notify.sh`
- **Trigger**: Any Gemini Cli notification event
- **Script**: `.gemini/tools/notify.sh`
- **Features**:
- Native notifications on all platforms
- Shows project context
Expand Down Expand Up @@ -168,15 +168,15 @@ test:

### How Notifications Work

1. **Event Occurs**: Claude Code needs attention
1. **Event Occurs**: Gemini Cli needs attention
2. **Hook Triggered**: Notification hook activates
3. **Context Gathered**: Project name, session ID extracted
4. **Platform Detection**: Appropriate notification method chosen
5. **Notification Sent**: Native notification appears

### Customizing Notifications

Edit `.claude/tools/notify.sh`:
Edit `.gemini/tools/notify.sh`:

```bash
# Add custom notification categories
Expand Down Expand Up @@ -232,7 +232,7 @@ paplay /usr/share/sounds/freedesktop/stereo/complete.oga
"hooks": [
{
"type": "command",
"command": ".claude/tools/auto-format.sh"
"command": ".gemini/tools/auto-format.sh"
}
]
}
Expand All @@ -241,7 +241,7 @@ paplay /usr/share/sounds/freedesktop/stereo/complete.oga
}
```

Create `.claude/tools/auto-format.sh`:
Create `.gemini/tools/auto-format.sh`:

```bash
#!/usr/bin/env bash
Expand Down Expand Up @@ -278,7 +278,7 @@ esac
"hooks": [
{
"type": "command",
"command": ".claude/tools/auto-commit.sh"
"command": ".gemini/tools/auto-commit.sh"
}
]
}
Expand All @@ -287,7 +287,7 @@ esac
}
```

Create `.claude/tools/auto-commit.sh`:
Create `.gemini/tools/auto-commit.sh`:

```bash
#!/usr/bin/env bash
Expand All @@ -314,7 +314,7 @@ git commit -m "$COMMIT_MSG" --no-verify || true
"hooks": [
{
"type": "command",
"command": ".claude/tools/run-tests.sh"
"command": ".gemini/tools/run-tests.sh"
}
]
}
Expand Down Expand Up @@ -402,7 +402,7 @@ fi

```bash
# Add to any automation script
DEBUG_LOG="/tmp/claude-automation-debug.log"
DEBUG_LOG="/tmp/gemini-automation-debug.log"
echo "[$(date)] Script started" >> "$DEBUG_LOG"
echo "Input: $JSON_INPUT" >> "$DEBUG_LOG"
```
Expand All @@ -411,14 +411,14 @@ echo "Input: $JSON_INPUT" >> "$DEBUG_LOG"

```bash
# Test with sample input
echo '{"file_path": "/path/to/test.py", "success": true}' | .claude/tools/make-check.sh
echo '{"file_path": "/path/to/test.py", "success": true}' | .gemini/tools/make-check.sh
```

### Common Issues

1. **Script Not Executing**

- Check file permissions: `chmod +x .claude/tools/*.sh`
- Check file permissions: `chmod +x .gemini/tools/*.sh`
- Verify path in settings.json

2. **No Output**
Expand All @@ -433,7 +433,7 @@ echo '{"file_path": "/path/to/test.py", "success": true}' | .claude/tools/make-c
## 🚀 Best Practices

1. **Fast Execution**: Keep automations under 5 seconds
2. **Fail Gracefully**: Don't break Claude Code workflow
2. **Fail Gracefully**: Don't break Gemini Cli workflow
3. **User Feedback**: Provide clear success/failure messages
4. **Cross-Platform**: Test on Mac, Linux, Windows, WSL
5. **Configurable**: Allow users to customize behavior
Expand All @@ -444,7 +444,7 @@ echo '{"file_path": "/path/to/test.py", "success": true}' | .claude/tools/make-c

```bash
# Cache expensive operations
CACHE_FILE="/tmp/claude-check-cache"
CACHE_FILE="/tmp/gemini-check-cache"
CACHE_AGE=$(($(date +%s) - $(stat -f %m "$CACHE_FILE" 2>/dev/null || echo 0)))

if [ $CACHE_AGE -lt 300 ]; then # 5 minutes
Expand Down
40 changes: 2 additions & 38 deletions .ai/docs/commands.md
Original file line number Diff line number Diff line change
Expand Up @@ -201,11 +201,11 @@ Check our patterns in IMPLEMENTATION_PHILOSOPHY.md

## 🛠️ Creating Custom Commands

### Claude Code
### Gemini Cli

#### Command Structure

Create a new file in `.claude/commands/your-command.md`:
Create a new file in `.gemini/commands/your-command.md`:

```markdown
## Usage
Expand Down Expand Up @@ -236,42 +236,6 @@ Describe what the user will see:
- Any generated artifacts
```

### Gemini CLI

#### Command Structure

Create a new file in `.gemini/commands/your-command.toml`:

```toml
description = "Brief description of the command"
prompt = """## Usage

`/your-command <required-arg> [optional-arg]`

## Context

- Brief description of what the command does
- When and why to use it
- Any important notes or warnings

## Process

1. First step with clear description
2. Second step with details
3. Continue for all steps
4. Include decision points
5. Handle edge cases

## Output Format

Describe what the user will see:
- Success messages
- Error handling
- Next steps
- Any generated artifacts
"""
```

### Best Practices

1. **Clear Usage**: Show exact syntax with examples
Expand Down
28 changes: 14 additions & 14 deletions .ai/docs/notifications.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# Desktop Notifications Guide [Claude Code only]
# Desktop Notifications Guide [Gemini Cli only]

Never miss important Claude Code events with native desktop notifications on all platforms.
Never miss important Gemini Cli events with native desktop notifications on all platforms.

## 🔔 Overview

The notification system keeps you in flow by alerting you when:

- Claude Code needs permission to proceed
- Gemini Cli needs permission to proceed
- Tasks complete successfully
- Errors require your attention
- Long-running operations finish
Expand Down Expand Up @@ -69,7 +69,7 @@ The system automatically:
### Notification Flow

```
Claude Code Event
Gemini Cli Event
Notification Hook Triggered
Expand Down Expand Up @@ -110,7 +110,7 @@ Example: `MyProject (abc123): Build completed successfully`

### Custom Messages

Edit `.claude/settings.json` to customize when notifications appear:
Edit `.gemini/settings.json` to customize when notifications appear:

```json
{
Expand All @@ -121,7 +121,7 @@ Edit `.claude/settings.json` to customize when notifications appear:
"hooks": [
{
"type": "command",
"command": ".claude/tools/notify-error.sh"
"command": ".gemini/tools/notify-error.sh"
}
]
}
Expand Down Expand Up @@ -164,7 +164,7 @@ notify-send -i "/path/to/icon.png" "Title" "Message"
**macOS** (using terminal-notifier):

```bash
terminal-notifier -title "Claude Code" -message "Done!" -appIcon "/path/to/icon.png"
terminal-notifier -title "Gemini Cli" -message "Done!" -appIcon "/path/to/icon.png"
```

### Notification Categories
Expand Down Expand Up @@ -200,26 +200,26 @@ notify-send -u "$URGENCY" -t "$TIMEOUT" "$TITLE" "$MESSAGE"

```bash
# Make script executable
chmod +x .claude/tools/notify.sh
chmod +x .gemini/tools/notify.sh
```

2. **Test manually**:

```bash
echo '{"message": "Test notification", "cwd": "'$(pwd)'"}' | .claude/tools/notify.sh
echo '{"message": "Test notification", "cwd": "'$(pwd)'"}' | .gemini/tools/notify.sh
```

3. **Enable debug mode**:
```bash
echo '{"message": "Test"}' | .claude/tools/notify.sh --debug
# Check /tmp/claude-code-notify-*.log
echo '{"message": "Test"}' | .gemini/tools/notify.sh --debug
# Check /tmp/gemini-cli-notify-*.log
```

### Platform-Specific Issues

**macOS**:

- Check System Preferences → Notifications → Terminal/Claude Code
- Check System Preferences → Notifications → Terminal/Gemini Cli
- Ensure notifications are allowed
- Try: `osascript -e 'display notification "Test"'`

Expand Down Expand Up @@ -253,7 +253,7 @@ Track all notifications:

```bash
# Add to notify.sh
echo "$(date): $MESSAGE" >> ~/.claude-notifications.log
echo "$(date): $MESSAGE" >> ~/.gemini-notifications.log
```

### Conditional Notifications
Expand Down Expand Up @@ -311,7 +311,7 @@ osascript -e "display notification \"$MESSAGE\" with title \"Amplifier\" subtitl
"hooks": [
{
"type": "command",
"command": ".claude/tools/notify-build.sh"
"command": ".gemini/tools/notify-build.sh"
}
]
}
Expand Down
Loading