diff --git a/.claude/claude.json b/.claude/claude.json new file mode 100644 index 0000000..1bb0d43 --- /dev/null +++ b/.claude/claude.json @@ -0,0 +1,8 @@ +{ + "name": "GradesCentral API", + "description": "Rails API for UW Madison course data and grade distributions", + "version": "1.0.0", + "config": { + "sessionStartHook": ".claude/hooks/session_start.sh" + } +} diff --git a/.claude/commands/migrate.md b/.claude/commands/migrate.md new file mode 100644 index 0000000..4722cf1 --- /dev/null +++ b/.claude/commands/migrate.md @@ -0,0 +1,5 @@ +--- +description: Run database migrations +--- + +Run pending database migrations using `rake db:migrate`. diff --git a/.claude/commands/reindex.md b/.claude/commands/reindex.md new file mode 100644 index 0000000..0920797 --- /dev/null +++ b/.claude/commands/reindex.md @@ -0,0 +1,5 @@ +--- +description: Reindex Elasticsearch data +--- + +Reindex all searchable models in Elasticsearch using `rake reindex`. diff --git a/.claude/commands/routes.md b/.claude/commands/routes.md new file mode 100644 index 0000000..819fb10 --- /dev/null +++ b/.claude/commands/routes.md @@ -0,0 +1,5 @@ +--- +description: Display all API routes +--- + +Display all available API routes using `rake routes`. diff --git a/.claude/commands/server.md b/.claude/commands/server.md new file mode 100644 index 0000000..e745f6c --- /dev/null +++ b/.claude/commands/server.md @@ -0,0 +1,5 @@ +--- +description: Start the Rails development server +--- + +Start the Rails development server using `rails s` on port 3000. diff --git a/.claude/commands/test.md b/.claude/commands/test.md new file mode 100644 index 0000000..62b48de --- /dev/null +++ b/.claude/commands/test.md @@ -0,0 +1,5 @@ +--- +description: Run the test suite +--- + +Run the Rails test suite using `bundle exec rails test` or appropriate test command. diff --git a/.claude/hooks/session_start.sh b/.claude/hooks/session_start.sh new file mode 100755 index 0000000..dc3436b --- /dev/null +++ b/.claude/hooks/session_start.sh @@ -0,0 +1,62 @@ +#!/bin/bash +# Session start hook for GradesCentral API +# This script runs when a new Claude Code session starts + +echo "🚀 Starting GradesCentral API session..." + +# Check Ruby version +if command -v ruby &> /dev/null; then + RUBY_VERSION=$(ruby -v) + echo "✓ Ruby: $RUBY_VERSION" +else + echo "⚠ Ruby not found" +fi + +# Check if bundler is installed +if command -v bundle &> /dev/null; then + echo "✓ Bundler installed" +else + echo "⚠ Bundler not found - run: gem install bundler" +fi + +# Check if dependencies are installed +if [ -f "Gemfile.lock" ]; then + if bundle check &> /dev/null; then + echo "✓ Bundle dependencies installed" + else + echo "⚠ Bundle dependencies missing - run: bundle install" + fi +fi + +# Check for database configuration +if [ -f "config/database.yml" ]; then + echo "✓ Database configuration found" +else + echo "⚠ Database configuration missing - create config/database.yml" +fi + +# Check for environment file +if [ -f ".env" ]; then + echo "✓ Environment configuration found" +else + echo "⚠ Environment file missing - copy .env.example to .env" +fi + +# Check Elasticsearch connection +if command -v curl &> /dev/null; then + if curl -s http://localhost:9200 &> /dev/null; then + echo "✓ Elasticsearch running at localhost:9200" + else + echo "⚠ Elasticsearch not accessible at localhost:9200" + fi +fi + +echo "" +echo "📝 Available commands:" +echo " /test - Run the test suite" +echo " /server - Start Rails development server" +echo " /migrate - Run database migrations" +echo " /routes - Display all API routes" +echo " /reindex - Reindex Elasticsearch data" +echo "" +echo "Ready to code! 🎉"