ai-assistant-discord-bot/config.example.yaml
Claude Discord Bot b2ff6f19f2 Implement CRIT-006: Config system with YAML validation
- ProjectConfig dataclass for type-safe project settings
  - Channel-to-project mapping with required fields
  - Environment variable expansion ($HOME, custom vars)
  - System prompt loading from file or inline
  - Tool restriction per project
  - Model selection per project

- Config class with comprehensive YAML loading
  - Default config: ~/.claude-coordinator/config.yaml
  - Full validation with detailed error messages
  - Duplicate channel ID detection
  - Project directory existence checks
  - Tool name validation (Bash, Read, Write, Edit, Glob, Grep, WebSearch, WebFetch)
  - Model validation (sonnet, opus, haiku)
  - System prompt file validation

- Example config with all options documented
  - Full example with all fields
  - Minimal example with defaults
  - Environment variable usage
  - Read-only project example
  - Inline comments explaining all options

- Comprehensive test suite: 25/25 tests passing
  - ProjectConfig creation and defaults
  - Environment variable expansion
  - System prompt loading (inline and file)
  - YAML loading and parsing
  - Required field validation
  - Duplicate channel ID detection
  - Invalid tool name detection
  - Missing directory warnings
  - Invalid model detection
  - Channel ID lookup
  - Numeric channel ID conversion

Progress: 6/6 Week 1 tasks complete

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 18:01:49 +00:00

99 lines
3.0 KiB
YAML

# Claude Discord Coordinator - Example Configuration
#
# This file maps Discord channels to project configurations, allowing
# different channels to work with different projects, tools, and prompts.
#
# Default location: ~/.claude-coordinator/config.yaml
#
# Environment variables are expanded in paths:
# $HOME or ${HOME} - User's home directory
# $USER or ${USER} - Username
# Any other environment variable
projects:
# Full example with all options
major-domo:
# REQUIRED: Discord channel ID (as string or number)
channel_id: "1234567890"
# REQUIRED: Absolute path to project directory
# Environment variables like $HOME are expanded
project_dir: "/opt/projects/major-domo-bot"
# OPTIONAL: List of allowed tools (defaults to all tools if omitted)
# Valid tools: Bash, Read, Write, Edit, Glob, Grep, WebSearch, WebFetch
allowed_tools:
- Bash
- Read
- Write
- Edit
- Glob
- Grep
# OPTIONAL: System prompt loaded from file
# Use this for complex prompts stored in your project
system_prompt_file: "/opt/projects/major-domo-bot/CLAUDE.md"
# OPTIONAL: Model to use (defaults to "sonnet")
# Valid values: sonnet, opus, haiku
model: "sonnet"
# Example with inline system prompt
paper-dynasty:
channel_id: "0987654321"
project_dir: "/opt/projects/paper-dynasty"
# OPTIONAL: Inline system prompt (alternative to system_prompt_file)
# Use for short prompts; prefer system_prompt_file for longer ones
system_prompt: |
You are helping with the Paper Dynasty baseball card game.
Focus on gameplay mechanics, card generation, and player stats.
allowed_tools:
- Bash
- Read
- Grep
- WebSearch
model: "sonnet"
# Minimal example with only required fields
new-projects:
channel_id: "1111111111"
project_dir: "/opt/projects"
# allowed_tools defaults to all tools
# model defaults to "sonnet"
# no system_prompt or system_prompt_file
# Example using environment variables
personal-workspace:
channel_id: "2222222222"
project_dir: "$HOME/workspace/my-project"
system_prompt_file: "${HOME}/.config/claude/my-prompt.md"
allowed_tools:
- Bash
- Read
- Write
- Edit
model: "opus" # Use more powerful model for complex work
# Example with read-only access (no Write/Edit tools)
documentation:
channel_id: "3333333333"
project_dir: "/opt/projects/docs"
allowed_tools:
- Read
- Glob
- Grep
- WebSearch
system_prompt: "You help users navigate and understand documentation."
model: "haiku" # Faster model for simpler tasks
# Notes:
# - Each channel_id must be unique across all projects
# - Project directories should exist before running the bot
# - System prompt files are loaded at runtime
# - If both system_prompt and system_prompt_file are set, system_prompt takes precedence
# - Invalid tool names will cause validation errors
# - Model choices: sonnet (balanced), opus (powerful), haiku (fast)