구성

사용자 지정 모드

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

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

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

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

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

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

사용 가능한 도구

사용 가능한 도구 그룹

  • read: 파일 및 디렉토리 읽기
  • edit: 파일 수정 (fileRegex로 제한 가능)
  • execute: 터미널 명령 실행 (command는 레거시 별칭으로 허용됨)
  • browser: 공개 웹 페이지 가져오기 (실험적 기능, experiments.webFetch 필요)
  • mcp: MCP 서버 접근
  • skill: 스킬 활성화
  • todo: 할 일 목록 업데이트
  • subagent: Subagent 생성
  • mode: 모드 전환

사용자 지정 모드 만들기

구성 파일

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

전역 모드

모든 프로젝트에서 사용 가능한 모드는 ~/.bob/settings/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
      - execute
      - 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
      - execute

명령줄에서 모드 선택

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

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

# 다른 옵션과 함께 사용
bob --mode deploy-helper --max-turns 20

대화형 모드 전환

대화형 모드에서 /mode를 입력해 모드 선택기를 연 다음 사용자 지정 모드를 선택하세요. 사용자 지정 모드는 기본 제공 Agent, Plan, Ask 모드와 함께 선택기에 표시됩니다.

셸별 구성

운영 환경 안전 모드

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

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

명령 실행 권한

명령 접근 제한

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

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 mode

특정 명령 허용

특정 명령을 자동 승인하려면 ~/.bob/settings/settings.json에서 approval.allowed_permissions에 "execute"를 추가하고, execute_command 도구에 대한 approval.allowedExecutors에 명령을 나열하세요:

{
  "approval": {
    "allowed_permissions": ["read", "execute"],
    "allowedExecutors": [
      {
        "toolId": "execute_command",
        "approvedCommands": ["git status", "git log", "git diff"],
        "deniedCommands": []
      }
    ]
  }
}

allowedExecutors를 설정하면 기본 승인 명령 목록이 대체되므로, 유지하려는 기본값도 함께 포함하세요. 자세한 내용은 승인 설정을 참조하세요.

대화형 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
      - execute

비대화형 사용

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

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

# 출력 처리와 함께 사용
bob run --mode test-runner --format json "Run tests" > results.json

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

디렉토리 기반 지시사항

.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

구성 우선순위

두 모드가 같은 slug를 공유하면 Bob Shell은 다음 순서로 가장 먼저 찾은 모드를 사용합니다:

  1. 기본 제공 모드 (agent, plan, ask)
  2. 사용자 수준 모드 (~/.bob/settings/custom_modes.yaml)
  3. 프로젝트 수준 모드 (.bob/custom_modes.yaml)

각 사용자 지정 모드에는 고유한 slug를 사용하세요. --mode 플래그는 시작할 모드만 선택합니다.

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

주요 차이점

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

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

적응 체크리스트

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

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

마이그레이션 예시

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