-
Notifications
You must be signed in to change notification settings - Fork 3
feat: add Claude Code configuration #20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,61 @@ | ||
| # Claude Code Configuration | ||
|
|
||
| This directory contains Claude Code configuration for the SuperDeck project. | ||
|
|
||
| ## Files | ||
|
|
||
| ### settings.json | ||
|
|
||
| Team-wide Claude Code settings: | ||
| - **sessionStart hook**: Runs `scripts/setup.sh` automatically when Claude Code session starts | ||
| - **Default model**: Uses Sonnet (can be overridden with opus or haiku) | ||
| - **Default shell**: Uses bash | ||
|
|
||
| ### settings.local.json (git-ignored) | ||
|
|
||
| Personal overrides for team settings. Create this file if you want to customize: | ||
| - Model preferences | ||
| - Custom hooks | ||
| - Personal environment variables | ||
|
|
||
| Example: | ||
| ```json | ||
| { | ||
| "model": { | ||
| "default": "opus" | ||
| } | ||
| } | ||
| ``` | ||
|
|
||
| ## Settings Precedence | ||
|
|
||
| 1. User settings (`~/.claude/settings.json`) - Lowest | ||
| 2. Project settings (`settings.json`) - This file | ||
| 3. Project local (`settings.local.json`) - Personal overrides | ||
| 4. Command-line arguments | ||
| 5. Enterprise policies - Highest (cannot override) | ||
|
|
||
| ## Context Files | ||
|
|
||
| - **CLAUDE.md** (project root): Imports AGENTS.md to provide full project context | ||
| - **CLAUDE.local.md** (git-ignored): Personal instructions that override CLAUDE.md | ||
| - **AGENTS.md** (project root): Architecture documentation and development guidelines | ||
|
|
||
| ## Setup Script | ||
|
|
||
| The `scripts/setup.sh` script automatically: | ||
| 1. Verifies AGENTS.md and CLAUDE.md exist | ||
| 2. Configures PATH for pub-cache and FVM | ||
| 3. Installs/verifies FVM (Flutter Version Management) | ||
| 4. Installs Flutter via FVM (reads `.fvmrc`) | ||
| 5. Installs/verifies Melos (monorepo workspace manager) | ||
| 6. Installs/verifies DCM (Dart Code Metrics) | ||
| 7. Bootstraps workspace (`melos bootstrap`) | ||
| 8. Generates code (`melos run build_runner:build`) | ||
| 9. Verifies setup with Flutter doctor | ||
|
|
||
| ## Resources | ||
|
|
||
| - Claude Code Docs: https://docs.claude.com/en/docs/claude-code | ||
| - Memory & Imports: https://docs.claude.com/en/docs/claude-code/memory.md | ||
| - Settings Reference: https://docs.claude.com/en/docs/claude-code/settings.md |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| { | ||
| "hooks": { | ||
| "sessionStart": "scripts/setup.sh" | ||
| }, | ||
| "model": { | ||
| "default": "sonnet" | ||
| }, | ||
| "shell": { | ||
| "defaultShell": "/bin/bash" | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -51,7 +51,6 @@ node_modules | |
| discovery | ||
|
|
||
| **/.claude/settings.local.json | ||
| CLAUDE.md | ||
|
|
||
| # Local documentation artifacts | ||
| *.local.md | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| # SuperDeck - Claude Code Context | ||
|
|
||
| > Project Context: @AGENTS.md | ||
|
|
||
| This file imports AGENTS.md to provide full project context to Claude Code. |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,190 @@ | ||||||
| #!/bin/bash | ||||||
| # SuperDeck Development Environment Setup Script | ||||||
| # Automatically configures tools and dependencies for Claude Code sessions | ||||||
|
|
||||||
| set -e # Exit on error | ||||||
|
|
||||||
| # Color output for better readability | ||||||
| RED='\033[0;31m' | ||||||
| GREEN='\033[0;32m' | ||||||
| YELLOW='\033[1;33m' | ||||||
| BLUE='\033[0;34m' | ||||||
| NC='\033[0m' # No Color | ||||||
|
|
||||||
| # Helper functions | ||||||
| log_info() { | ||||||
| echo -e "${BLUE}ℹ${NC} $1" | ||||||
| } | ||||||
|
|
||||||
| log_success() { | ||||||
| echo -e "${GREEN}✓${NC} $1" | ||||||
| } | ||||||
|
|
||||||
| log_warning() { | ||||||
| echo -e "${YELLOW}⚠${NC} $1" | ||||||
| } | ||||||
|
|
||||||
| log_error() { | ||||||
| echo -e "${RED}✗${NC} $1" | ||||||
| } | ||||||
|
|
||||||
| step() { | ||||||
| echo "" | ||||||
| echo -e "${BLUE}▶${NC} $1" | ||||||
| } | ||||||
|
|
||||||
| # Detect environment | ||||||
| CLAUDE_CODE_REMOTE="${CLAUDE_CODE_REMOTE:-false}" | ||||||
| if [ "$CLAUDE_CODE_REMOTE" = "true" ]; then | ||||||
| log_info "Running in Claude Code remote environment" | ||||||
| else | ||||||
| log_info "Running in local environment" | ||||||
| fi | ||||||
|
|
||||||
| # Verify project structure | ||||||
| step "Step 1/9: Verifying project structure" | ||||||
|
|
||||||
| if [ ! -f "AGENTS.md" ]; then | ||||||
| log_error "AGENTS.md not found in project root" | ||||||
| exit 1 | ||||||
| fi | ||||||
| log_success "AGENTS.md found" | ||||||
|
|
||||||
| if [ ! -f "CLAUDE.md" ]; then | ||||||
| log_error "CLAUDE.md not found in project root" | ||||||
| exit 1 | ||||||
| fi | ||||||
| log_success "CLAUDE.md found" | ||||||
|
|
||||||
| if [ ! -f ".fvmrc" ]; then | ||||||
| log_error ".fvmrc not found - cannot determine Flutter version" | ||||||
| exit 1 | ||||||
| fi | ||||||
| log_success ".fvmrc found" | ||||||
|
|
||||||
| if [ ! -f "melos.yaml" ]; then | ||||||
| log_error "melos.yaml not found - cannot bootstrap workspace" | ||||||
| exit 1 | ||||||
| fi | ||||||
| log_success "melos.yaml found" | ||||||
|
|
||||||
| # Configure PATH | ||||||
| step "Step 2/9: Configuring PATH and checking prerequisites" | ||||||
|
|
||||||
| # Add pub-cache to PATH for global Dart packages | ||||||
| export PATH="$HOME/.pub-cache/bin:$PATH" | ||||||
| log_success "Configured PATH for Dart tools" | ||||||
|
|
||||||
| # Check if Dart is available | ||||||
| if ! command -v dart &> /dev/null; then | ||||||
| log_warning "Dart SDK not found - attempting to install" | ||||||
|
|
||||||
| # Install Dart SDK using apt-get (for Debian/Ubuntu) | ||||||
| if command -v apt-get &> /dev/null && [ -w /var/lib/dpkg ]; then | ||||||
| log_info "Installing Dart SDK via apt-get..." | ||||||
| sudo apt-get update -qq | ||||||
| sudo apt-get install -y dart | ||||||
| export PATH="/usr/lib/dart/bin:$PATH" | ||||||
| else | ||||||
| log_error "Cannot install Dart SDK automatically in this environment" | ||||||
| log_info "Claude Code remote environments may not support full Flutter development" | ||||||
| log_info "Skipping setup - manual installation required" | ||||||
| exit 0 # Exit gracefully | ||||||
| fi | ||||||
| fi | ||||||
|
|
||||||
| DART_VERSION=$(dart --version 2>&1 | head -n1 || echo "unknown") | ||||||
| log_success "Dart SDK available: $DART_VERSION" | ||||||
|
|
||||||
| # Install/verify FVM | ||||||
| step "Step 3/9: Installing FVM (Flutter Version Management)" | ||||||
|
|
||||||
| if command -v fvm &> /dev/null; then | ||||||
| FVM_VERSION=$(fvm --version 2>&1 | head -n1 || echo "unknown") | ||||||
| log_success "FVM already installed: $FVM_VERSION" | ||||||
| else | ||||||
| log_info "Installing FVM..." | ||||||
| dart pub global activate fvm | ||||||
| export PATH="$HOME/.pub-cache/bin:$PATH" | ||||||
| log_success "FVM installed successfully" | ||||||
| fi | ||||||
|
|
||||||
| # Install Flutter via FVM | ||||||
| step "Step 4/9: Installing Flutter via FVM" | ||||||
|
|
||||||
| FLUTTER_CHANNEL=$(cat .fvmrc | grep '"flutter"' | cut -d'"' -f4) | ||||||
|
||||||
| log_info "Flutter channel from .fvmrc: $FLUTTER_CHANNEL" | ||||||
|
|
||||||
| if [ -d ".fvm/flutter_sdk" ]; then | ||||||
| FLUTTER_VERSION=$(cd .fvm/flutter_sdk && bin/flutter --version | head -n1 || echo "unknown") | ||||||
|
||||||
| FLUTTER_VERSION=$(cd .fvm/flutter_sdk && bin/flutter --version | head -n1 || echo "unknown") | |
| FLUTTER_VERSION=$("$(pwd)/.fvm/flutter_sdk/bin/flutter" --version | head -n1 || echo "unknown") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PATH export is redundant as the same path was already added at line 75. Consider removing this duplicate line.