Özel modlar
Belirli görevlere veya iş akışlarına göre Bob'un davranışını uyarlamak için özel modlar oluşturabilirsin. Bob Shell'deki özel modlar Bob IDE modlarına benzer şekilde çalışır.
Bob Shell'de özel modlar neden kullanılır
- Shell için optimize edilmiş iş akışları: Terminal tabanlı geliştirme görevleri için özel olarak tasarlanmış modlar oluştur
- Komut satırı güvenliği: Üretim ortamlarında çalışırken güvenli işlemlerle sınırlandırılmış modlar oluştur
- Ortama özgü davranış: Farklı shell ortamlarına uyum sağlayan modlar yapılandır
- Otomasyon dostu: Hem interaktif hem de interaktif olmayan oturumlarda sorunsuz çalışan modlar tasarla
- Ekip standardizasyonu: Tutarlı iş akışları için shell'e özgü modları ekibinde paylaş
Özel moda dahil olanlar
Bob Shell'deki özel modlar, Bob IDE modlarıyla aynı temel yapıyı kullanır:
| Özellik | Açıklama | Shell'e Özgü Dikkat Noktaları |
|---|---|---|
slug | Benzersiz iç tanımlayıcı | Komut satırı argümanlarında kullanılır:bob --mode my-mode |
name | UI'da görünen ad | İnteraktif modun mod seçicisinde gösterilir |
description | Mod seçicisinde gösterilen kısa açıklama | Modun amacını kısaca açıkla |
roleDefinition | Temel kimlik ve uzmanlık | Shell bağlamını ve komut satırı iş akışlarını dikkate almalı |
groups | İzin verilen araç setleri ve dosya erişimi | Shell ortamlarında komut çalıştırma izinleri kritik öneme sahiptir |
whenToUse | Mod seçim kılavuzu | Bob Shell'in görevler için uygun modları seçmesine yardımcı olur |
customInstructions | Moda özgü davranış yönergeleri veya kurallar | Bob Shell geliştirme desenlerine referans verebilir |
Mevcut araçlar
Mevcut araç grupları
read: Dosya ve dizinleri okuedit: Dosyaları değiştir (fileRegexile kısıtlanabilir)execute: Terminal komutlarını çalıştır (commandeski bir takma ad olarak kabul edilir)browser: Herkese açık web sayfalarını getir (deneysel;experiments.webFetchgerektirir)mcp: MCP sunucularına erişskill: Skill'leri etkinleştirtodo: Yapılacaklar listesini güncellesubagent: Subagent oluşturmode: Mod değiştir
Özel modlar oluşturma
Yapılandırma dosyaları
Bob Shell, Bob IDE ile aynı yapılandırma biçimini kullanır; hem YAML (tercih edilen) hem de JSON biçimlerini destekler.
Global modlar
Tüm projelerde kullanılabilir modlar için ~/.bob/settings/custom_modes.yaml dosyasını oluştur veya düzenle:
customModes:
- slug: shell-debug
name: 🐛 Shell Debugger
roleDefinition: >-
You are a debugging specialist focused on command-line troubleshooting.
You excel at analyzing shell output, environment variables, and system logs.
whenToUse: Use for debugging shell scripts, command failures, and environment issues.
customInstructions: |-
When debugging:
- Always check environment variables first
- Examine command exit codes
- Review relevant log files
- Test commands in isolation before suggesting fixes
groups:
- read
- execute
- browserProjeye özgü modlar
Proje kökünde .bob/custom_modes.yaml dosyasını oluştur veya düzenle:
customModes:
- slug: deploy-helper
name: 🚀 Deployment Assistant
roleDefinition: You are a deployment specialist for this project's infrastructure.
whenToUse: Use for deployment tasks, infrastructure changes, and release management.
customInstructions: |-
Deployment guidelines:
- Always verify the target environment before running commands
- Check for running processes that might be affected
- Validate configuration files before applying changes
- Create backups before destructive operations
groups:
- read
- - edit
- fileRegex: \.(yaml|yml|sh|env)$
description: Configuration and script files only
- executeKomut satırından mod seçimi
Bob Shell başlatırken bir mod belirt:
# Bob Shell'i belirli bir modda başlat
bob --mode shell-debug
# Diğer seçeneklerle birlikte kullan
bob --mode deploy-helper --max-turns 20İnteraktif mod geçişi
İnteraktif modda mod seçiciyi açmak için /mode yaz, ardından özel modunu seç. Özel modlar, seçicide yerleşik Agent, Plan ve Ask modlarıyla birlikte görünür.
Shell'e özgü yapılandırmalar
Üretim güvenliği modu
Üretim ortamları için güvenlik odaklı bir mod oluştur:
customModes:
- slug: prod-ops
name: 🔒 Production Operations
roleDefinition: >-
You are a production operations specialist with a strong focus on safety.
You never run destructive commands without explicit confirmation.
whenToUse: Use when working with production systems or sensitive environments.
customInstructions: |-
Production safety rules:
- NEVER run destructive commands without explicit user confirmation
- Always verify the target environment before any operation
- Suggest dry-run options when available
- Check for active connections or processes before changes
- Recommend backup procedures before modifications
groups:
- read
- browser
# Note: No edit or execute groups for maximum safetyScript geliştirme modu
Shell script geliştirme için bir mod oluştur:
customModes:
- slug: script-dev
name: 📜 Script Developer
roleDefinition: >-
You are a shell scripting expert specializing in bash, zsh, and POSIX-compliant scripts.
whenToUse: Use for creating, debugging, or improving shell scripts.
customInstructions: |-
Shell scripting best practices:
- Use shellcheck-compliant syntax
- Include proper error handling with set -e and set -u
- Add usage documentation at the top of scripts
- Quote variables to prevent word splitting
- Provide exit codes for different error conditions
groups:
- read
- - edit
- fileRegex: \.(sh|bash|zsh)$
description: Shell script files only
- executeKomut çalıştırma izinleri
Komut erişimini kısıtlama
execute grubunu dışarıda bırakarak bir modun komut çalıştırıp çalıştıramayacağını kontrol et:
customModes:
- slug: safe-reviewer
name: 👀 Safe Code Reviewer
roleDefinition: You are a code reviewer focused on analysis, not modification.
whenToUse: Use for code reviews and analysis without making changes.
groups:
- read
- browser
# No execute or edit groups - read-only modeBelirli komutlara izin verme
Belirli komutları otomatik onaylamak için approval.allowed_permissions listesine "execute" ekle ve komutları ~/.bob/settings/settings.json içinde execute_command aracı için approval.allowedExecutors altında listele:
{
"approval": {
"allowed_permissions": ["read", "execute"],
"allowedExecutors": [
{
"toolId": "execute_command",
"approvedCommands": ["git status", "git log", "git diff"],
"deniedCommands": []
}
]
}
}allowedExecutors ayarlamak, varsayılan onaylı komut listesinin yerini alır; bu yüzden korumak istediğin varsayılanları da ekle. Ayrıntılar için bkz. Onay ayarları.
İnteraktif ve interaktif olmayan davranış
Her iki mod için tasarım
Hem interaktif hem de interaktif olmayan oturumlarda iyi çalışan modlar oluştur:
customModes:
- slug: test-runner
name: 🧪 Test Runner
roleDefinition: >-
You are a testing specialist who runs and analyzes test suites.
You adapt your output based on the running context.
whenToUse: Use for running tests, analyzing test results, and debugging test failures.
customInstructions: |-
Testing guidelines:
- In interactive mode: Provide detailed explanations and suggestions
- In non-interactive mode: Focus on concise, actionable output
- Always report test results clearly
- Suggest fixes for failing tests
groups:
- read
- executeİnteraktif olmayan kullanım
Modları interaktif olmayan modda kullan:
# Otomasyon için tasarlanmış bir mod kullan
bob run --mode test-runner "Run the test suite and report failures"
# Çıktı işlemeyle birleştir
bob run --mode test-runner --format json "Run tests" > results.jsonDosyalar aracılığıyla moda özgü talimatlar
Dizin tabanlı talimatlar
.bob/rules-{mode-slug}/ içinde moda özgü talimat dosyaları oluştur:
Örnek talimat dosyası (.bob/rules-shell-debug/01-environment-checks.md):
# Environment Debugging Checklist
When debugging shell issues, always check:
1. **Environment Variables**: PATH, SHELL, TERM, and application-specific variables
2. **Shell Configuration**: .bashrc, .zshrc, .profile files
3. **System State**: Current working directory, file permissions, disk space
4. **Command Availability**: Use `command -v <cmd>` to verify commands existYapılandırma önceliği
İki mod aynı slug'ı paylaşıyorsa Bob Shell, şu sırayla bulduğu ilk modu kullanır:
- Yerleşik modlar (
agent,plan,ask) - Kullanıcı düzeyinde modlar (
~/.bob/settings/custom_modes.yaml) - Proje düzeyinde modlar (
.bob/custom_modes.yaml)
Her özel mod için benzersiz bir slug kullan. --mode bayrağı yalnızca hangi modda başlanacağını seçer.
Modları Bob IDE'den taşıma
Temel farklılıklar
Bob IDE'den Bob Shell'e özel modları taşırken:
| Konu | Bob IDE | Bob Shell |
|---|---|---|
| UI etkileşimi | Panelli görsel arayüz | Terminal tabanlı arayüz |
| Dosya düzenleme | Editörde diff'ler ve önizlemeler | CLI diff görünümü veya harici editör |
| Komut çalıştırma | Entegre terminal | Doğrudan shell çalıştırma |
| Mod geçişi | Mod seçici dropdown | /mode seçicisi veya --mode CLI bayrağı |
| Yapılandırma | Ayarlar UI'ı + dosyalar | Yalnızca yapılandırma dosyaları |
Uyarlama kontrol listesi
Bob IDE modlarını Bob Shell için uyarlarken:
- Shell'e özgü bağlam için
roleDefinition'ı incele - Komut satırı iş akışlarına referans vermek için
customInstructions'ı güncelle groupsyapılandırmasında komut çalıştırma güvenliğini göz önünde bulundur- Modu hem interaktif hem de interaktif olmayan oturumlarda test et
- Dosya yolu işlemenin shell bağlamında çalıştığını doğrula
Örnek taşıma
Orijinal Bob IDE modu:
customModes:
- slug: code-reviewer
name: 👀 Code Reviewer
roleDefinition: You are a code reviewer who provides detailed feedback.
groups:
- read
- browserBob Shell için uyarlanmış:
customModes:
- slug: code-reviewer
name: 👀 Code Reviewer
roleDefinition: >-
You are a code reviewer who provides detailed feedback.
You work efficiently in terminal environments and provide clear, actionable suggestions.
whenToUse: Use for code reviews, pull request analysis, and code quality checks.
customInstructions: |-
Code review guidelines:
- Provide feedback in a structured format suitable for terminal output
- Reference specific line numbers and file paths
- Suggest concrete improvements with examples
- Format output for easy parsing if used in non-interactive mode
groups:
- read
- execute # Added for git operations
- browserÖzel kurallar
Özel kurallar, Bob Shell'in terminal ortamındaki isteklerine nasıl yanıt verdiğini etkiler; çıktıyı spesifik tercihlerinle ve proje gereksinimlerinle hizalar. Kodlama stilini, dokümantasyon yaklaşımını ve karar alma süreçlerini kontrol edebilirsin.
Agent personaları
Bir subagentin rolünü, odağını ve tool erişimini şekillendiren yeniden kullanılabilir persona dosyaları oluştur. Bir subagentin neyi arayacağını, çıktısını nasıl biçimlendireceğini ve ne yapmasına izin verilmediğini tanımla.