구성

사용자 지정 모드

특정 작업이나 워크플로에 맞게 Bob의 동작을 조정하는 사용자 지정 모드를 만들 수 있습니다. Bob Shell의 사용자 지정 모드는 Bob IDE 모드와 유사하게 작동합니다.

Bob Shell에서 사용자 지정 모드를 사용하는 이유

  • 셸 최적화 워크플로: 터미널 기반 개발 작업을 위해 특별히 설계된 모드 만들기
  • 명령줄 안전성: 운영 환경에서 작업할 때 안전한 작업만 수행하도록 모드 제한
  • 환경별 동작: 다양한 셸 환경에 맞게 적응하는 모드 구성
  • 자동화 친화적: 대화형 및 비대화형 세션 모두에서 원활하게 작동하는 모드 설계
  • 팀 표준화: 일관된 워크플로를 위해 팀 전체에 셸별 모드 공유

사용자 지정 모드에 포함된 내용

Bob Shell의 사용자 지정 모드는 Bob IDE 모드와 동일한 핵심 구조를 사용합니다:

속성설명셸별 고려 사항
slug고유한 내부 식별자명령줄 인수에 사용됨:
bob --chat-mode=my-mode
nameUI의 표시 이름대화형 모드의 모드 선택기에 표시됨
description모드 선택기에 표시되는 짧은 설명모드의 목적을 간략히 설명하세요
roleDefinition핵심 정체성 및 전문성셸 컨텍스트와 명령줄 워크플로를 고려해야 합니다
groups허용된 도구셋 및 파일 접근셸 환경에서는 명령 실행 권한이 중요합니다
whenToUse모드 선택 가이드Bob Shell이 작업에 적합한 모드를 선택하는 데 도움이 됩니다
customInstructions모드에 대한 특정 동작 가이드라인 또는 규칙Bob Shell 개발 패턴을 참조할 수 있습니다

사용 가능한 도구

사용 가능한 도구 그룹

  • read: 파일 및 디렉토리 읽기
  • edit: 파일 수정 (fileRegex로 제한 가능)
  • browser: 브라우저 자동화 사용
  • command: 터미널 명령 실행
  • mcp: MCP 서버 접근

사용자 지정 모드 만들기

구성 파일

Bob Shell은 Bob IDE와 동일한 구성 형식을 사용하며, YAML (권장)과 JSON 형식을 모두 지원합니다.

전역 모드

모든 프로젝트에서 사용 가능한 모드는 ~/.bob/custom_modes.yaml을 만들거나 편집하세요:

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
      - command
      - browser

프로젝트별 모드

프로젝트 루트에서 .bob/custom_modes.yaml을 만들거나 편집하세요:

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
      - command

명령줄에서 모드 선택

Bob Shell을 시작할 때 모드를 지정하세요:

# 특정 모드로 Bob Shell 시작
bob --chat-mode=shell-debug

# 다른 옵션과 함께 사용
bob --chat-mode=deploy-helper --sandbox

대화형 모드 전환

대화형 모드에서 슬래시 명령어로 모드를 전환하세요:

# 사용자 지정 모드로 전환
/mode shell-debug

# 또는 모드의 슬러그를 직접 사용
/shell-debug

셸별 구성

운영 환경 안전 모드

운영 환경에 특화된 안전 중심 모드 만들기:

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 command groups for maximum safety

스크립트 개발 모드

셸 스크립트 개발을 위한 모드 만들기:

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
      - command

명령 실행 권한

명령 접근 제한

command 그룹을 생략하여 모드가 실행할 수 있는 명령을 제어하세요:

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 command or edit groups - read-only mode

특정 명령 허용

설정 파일에서 사용자 지정 모드와 함께 Bob Shell의 allowed 도구 구성을 사용하세요:

{
  "tools": {
    "allowed": [
      "run_shell_command(git status)",
      "run_shell_command(git log)",
      "run_shell_command(git diff)"
    ]
  }
}

대화형 vs 비대화형 동작

두 모드 모두를 위한 설계

대화형 및 비대화형 세션 모두에서 잘 작동하는 모드 만들기:

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
      - command

비대화형 사용

비대화형 모드에서 모드 사용하기:

# 자동화를 위해 설계된 모드 사용
bob --chat-mode=test-runner -p "Run the test suite and report failures"

# 출력 처리와 함께 사용
bob --chat-mode=test-runner -p "Run tests" --hide-intermediary-output > results.txt

파일을 통한 모드별 지시사항

디렉토리 기반 지시사항

.bob/rules-{mode-slug}/에 모드별 지시사항 파일을 만드세요:

01-environment-checks.md
02-common-issues.md
03-debugging-steps.md
custom_modes.yaml

지시사항 파일 예시 (.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 exist

단일 파일 지시사항 (대안)

워크스페이스 루트에 단일 파일 .bobrules-{mode-slug}를 사용할 수도 있습니다.

구성 우선순위

모드 구성은 다음 순서로 적용됩니다:

  1. 명령줄 인수 (--chat-mode=mode-slug)
  2. 프로젝트 수준 모드 (.bob/custom_modes.yaml)
  3. 사용자 수준 모드 (~/.bob/custom_modes.yaml)
  4. 시스템 수준 모드 (플랫폼별 위치)
  5. 기본 모드

사용자 지정 모드로 샌드박싱

안전한 실험을 위해 사용자 지정 모드와 Bob Shell의 sandbox 기능을 함께 사용하세요:

# sandbox에서 사용자 지정 모드 시작
bob --chat-mode=script-dev --sandbox

# Docker sandbox와 함께 사용
bob --chat-mode=deploy-helper --sandbox

Bob IDE에서 모드 마이그레이션

주요 차이점

Bob IDE에서 Bob Shell로 사용자 지정 모드를 마이그레이션할 때:

측면Bob IDEBob Shell
UI 상호작용패널이 있는 시각적 인터페이스터미널 기반 인터페이스
파일 편집편집기 내 diff 및 미리보기CLI diff 보기 또는 외부 편집기
명령 실행통합 터미널직접 셸 실행
모드 전환UI 드롭다운 또는 슬래시 명령어슬래시 명령어 또는 CLI 인수
구성설정 UI + 파일구성 파일만

적응 체크리스트

Bob IDE 모드를 Bob Shell용으로 적응시킬 때:

  • 셸별 컨텍스트를 위해 roleDefinition 검토
  • 명령줄 워크플로를 참조하도록 customInstructions 업데이트
  • groups 구성에서 명령 실행 안전성 고려
  • 대화형 및 비대화형 세션 모두에서 모드 테스트
  • 셸 컨텍스트에서 파일 경로 처리가 올바르게 작동하는지 확인
  • 해당하는 경우 sandbox 모드로 테스트

마이그레이션 예시

원래 Bob IDE 모드:

customModes:
  - slug: code-reviewer
    name: 👀 Code Reviewer
    roleDefinition: You are a code reviewer who provides detailed feedback.
    groups:
      - read
      - browser

Bob Shell용으로 적응:

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
      - command  # Added for git operations
      - browser
이 주제는 어떤가요?