23 Commits

Author SHA1 Message Date
Cheffromspace
dd5e6e6146 feat\!: Remove deprecated /api/claude endpoint in favor of webhook-based sessions (#172)
BREAKING CHANGE: The /api/claude endpoint has been removed. All Claude API functionality
is now available through the more robust /api/webhooks/claude endpoint.

Migration guide:
- For creating sessions: POST /api/webhooks/claude with type: 'session.create'
- For checking status: POST /api/webhooks/claude with type: 'session.get'
- Sessions now run asynchronously and return immediately with a session ID

Changes:
- Removed src/routes/claude.ts entirely
- Removed related test files (claude.test.ts, claude-simple.test.ts)
- Updated all documentation to use webhook endpoint
- Updated test utilities to use async session API
- Fixed formatting in modified files

The webhook-based approach provides:
- Async session management with immediate response
- Better error handling and recovery
- Session status tracking
- Parallel session execution
- Consistent API with other webhook operations
2025-06-03 14:11:02 -05:00
Cheffromspace
bf1c42f5ca feat: Update organization name from intelligence-assist to claude-did-this (#162)
- Updated all GitHub URLs and organization references across the codebase
- Updated documentation links to use claude-did-this.com
- Removed self-hosted runner related files as they are no longer used
- Updated test repository references
- Preserved Docker Hub references as requested

Note: .env files and .claude/settings.local.json were also updated but are gitignored

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-authored-by: Claude <noreply@anthropic.com>
2025-06-01 17:07:55 -05:00
Cheffromspace
af851491e8 feat: Improve Claude authentication setup experience (#153)
* feat: Improve Claude authentication setup experience

- Replace 'claude login' with 'claude --dangerously-skip-permissions'
- Fix path references from /auth-output to actual authentication location
- Simplify user instructions to be more accessible
- Add automatic authentication execution (no manual typing required)
- Add comprehensive validation for authentication success
- Check file existence, size, and timestamp
- Provide clear error messages for different failure scenarios
- Remove deprecated setup-claude-auth.sh script
- Update CLAUDE.md to reference correct build script path
- Exclude todos directory from authentication capture

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>

* remove self-hosted runners from ci

---------

Co-authored-by: Claude <noreply@anthropic.com>
2025-06-01 12:54:58 -05:00
Cheffromspace
12e4589169 Fix: Merge entrypoint scripts and fix auto-tagging tool permissions (#146)
* fix: merge entrypoint scripts and fix auto-tagging tool permissions

- Merged duplicate claudecode-entrypoint.sh and claudecode-tagging-entrypoint.sh scripts
- Added dynamic tool selection based on OPERATION_TYPE environment variable
- Fixed auto-tagging permissions to include required Bash(gh:*) commands
- Removed 95% code duplication between entrypoint scripts
- Simplified claudeService.ts to use unified entrypoint
- Auto-tagging now uses: Read,GitHub,Bash(gh issue edit:*),Bash(gh issue view:*),Bash(gh label list:*)
- General operations continue to use full tool set

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>

* fix: update Dockerfile to use unified entrypoint script

- Remove references to deleted claudecode-tagging-entrypoint.sh
- Update build process to use single unified entrypoint script

* fix: remove unnecessary async from promisify mock to fix lint error

* feat: add Husky pre-commit hooks with Prettier as primary formatter

- Added Husky for Git pre-commit hooks
- Configured eslint-config-prettier to avoid ESLint/Prettier conflicts
- Prettier handles all formatting, ESLint handles code quality only
- Pre-commit hooks: Prettier format, ESLint check, TypeScript check
- Updated documentation with pre-commit hook setup
- All code quality issues resolved

* feat: consolidate workflows and fix permission issues with clean Docker runners

- Replace 3 complex workflows with 2 lean ones (pull-request.yml, main.yml)
- Add Docker runner configuration for clean, isolated builds
- Remove file permission hacks - use ephemeral containers instead
- Split workload: GitHub-hosted for tests/security, self-hosted for Docker builds
- Add comprehensive pre-commit configuration for security
- Update documentation to be more pragmatic
- Fix credential file permissions and security audit

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>

* fix: allow Husky prepare script to fail in production builds

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>

* fix: update CI badge to reference new main.yml workflow

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>

---------

Co-authored-by: Claude <noreply@anthropic.com>
2025-05-31 20:53:58 -05:00
Jonathan
f5f7520588 docs: clean up authentication documentation and add test coverage
- Remove TOS violations and marketing copy from authentication guides
- Fix Claude CLI command references to use --dangerously-skip-permissions
- Update setup scripts with correct command syntax
- Add test coverage for Docker authentication mount path logic
- Focus documentation on technical implementation details

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-05-31 12:48:32 -05:00
Jonathan
6b319fa511 docs: update Claude subscription plans to reflect 2025 structure
Based on latest Claude subscription information:
- Claude Pro: $20/month (no Claude Code access)
- Claude Max 5x: $100/month (5x usage limits, includes Claude Code)
- Claude Max 20x: $200/month (20x usage limits, includes Claude Code)

Updates:
- Correct references from "Claude 20x" to "Claude Max 5x/20x plans"
- Add specific usage limits: ~225/900 messages per 5-hour session
- Add Claude Code usage limits: ~50-200/200-800 prompts per session
- Clarify that only Max plans include Claude Code access
- Update cost comparison tables with accurate pricing
- Remove misleading "unlimited" claims

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-05-31 10:57:37 -05:00
Jonathan
e7f19d8307 fix: address PR review feedback
Security:
- Fix user-controlled bypass vulnerability in webhook body validation
- Add proper type checking for request body object

Documentation:
- Remove specific Claude subscription pricing amounts per feedback
- Correct Claude Pro vs Max subscription access clarification
- Use "fixed subscription cost" instead of specific dollar amounts
- Remove "unlimited" claims for Claude 20x
- Improve consistency across authentication documentation

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-05-31 10:51:18 -05:00
Jonathan
a71cdcad40 feat: implement rock-solid Claude Max subscription authentication
This comprehensive update adds support for Claude Max subscription authentication
and improves the overall authentication system with multiple methods:

🔐 Claude Authentication Enhancements:
- Add setup container method for Claude Max/20x subscription usage ($20-200/month)
- Create interactive authentication script (setup-claude-interactive.sh)
- Add authentication testing utility (test-claude-auth.sh)
- Support three authentication methods: Setup Container, API Key, AWS Bedrock
- Comprehensive authentication documentation

📁 Directory Configuration:
- Add CLAUDE_HUB_DIR environment variable (default: ~/.claude-hub)
- Update .gitignore to use .claude-hub/ instead of hardcoded paths
- Consistent environment variable usage across all scripts

🐙 GitHub Token Support:
- Add fine-grained GitHub token support (github_pat_) alongside classic tokens (ghp_)
- Update token validation in claudeService and githubService
- Enhanced token detection and authentication flow

📖 Documentation & Guides:
- Add complete Claude Authentication Guide with all three methods
- Add Setup Container Deep Dive documentation
- Update CLAUDE.md with quick start authentication section
- Comprehensive cost comparison and use case recommendations

🐳 Container & Docker Improvements:
- Update Dockerfile.claudecode with proper entrypoint script copying
- Add Dockerfile.claude-setup for interactive authentication
- Update docker-compose.yml with new port (3003) and environment variables
- Enhanced container volume mounting for authentication

🔧 Infrastructure Updates:
- Add TRUST_PROXY configuration for reverse proxy environments
- Update port configuration from 3002 to 3003
- Enhanced environment variable documentation in .env.example
- Debug utilities for troubleshooting authentication issues

This update enables Claude Max subscribers to use their existing subscriptions
for automation, potentially saving thousands in API costs while maintaining
full production capabilities.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-05-31 10:22:16 -05:00
Jonathan Flatt
fdf255cbec feat: remove JavaScript files replaced by TypeScript equivalents
- Remove 11 JavaScript source files that have been migrated to TypeScript
- Update package.json scripts to reference TypeScript files
- Update documentation and scripts to reference .ts instead of .js
- Keep JavaScript files without TypeScript equivalents (chatbot-related)

This completes the TypeScript migration for core application files while
maintaining backward compatibility for components not yet migrated.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-05-28 15:01:03 +00:00
Jonathan Flatt
a38ed85924 feat: setup TypeScript infrastructure for Phase 1 migration
## Overview
Establishes comprehensive TypeScript infrastructure and tooling for
the claude-github-webhook project as specified in issue #101.

## Dependencies Added
- Core TypeScript: typescript, @types/node, @types/express, @types/body-parser
- Development: ts-node for dev execution
- ESLint: @typescript-eslint/parser, @typescript-eslint/eslint-plugin
- Testing: ts-jest, babel-jest for Jest TypeScript support

## Configuration Files
- tsconfig.json: Strict TypeScript config targeting ES2022/CommonJS
- eslint.config.js: Updated with TypeScript support and strict rules
- jest.config.js: Configured for both .js and .ts test files
- babel.config.js: Babel configuration for JavaScript transformation

## Build Scripts
- npm run build: Compile TypeScript to dist/
- npm run build Watch mode compilation
- npm run typecheck: Type checking without compilation
- npm run clean: Clean build artifacts
- npm run dev: Development with ts-node
- npm run dev Development with nodemon + ts-node

## Infrastructure Verified
 TypeScript compilation works
 ESLint supports TypeScript files
 Jest runs tests with TypeScript support
 All existing tests pass (67 tests, 2 skipped)
 Docker build process updated for TypeScript

## Documentation
- CLAUDE.md updated with TypeScript build commands and architecture
- Migration strategy documented (Phase 1: Infrastructure, Phase 2: Code conversion)
- TypeScript coding guidelines added

## Backward Compatibility
- Existing JavaScript files continue to work during transition
- Support for both .js and .ts files in tests and linting
- No breaking changes to existing functionality

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-05-27 19:35:54 -05:00
Jonathan Flatt
08e4e66287 fix(pr-review): implement smart wait-for-all-checks logic
Fixes automated PR review triggering by implementing intelligent check suite analysis:

Key improvements:
- Smart categorization of check suites (meaningful vs skipped vs timed-out)
- Handles conditional jobs that never start (5min timeout)
- Skips explicitly neutral/skipped check suites
- Prevents waiting for stale in-progress jobs (30min timeout)
- Enhanced logging for better debugging
- Backwards compatible with existing configuration

New environment variables:
- PR_REVIEW_MAX_WAIT_MS: Max wait for stale jobs (default: 30min)
- PR_REVIEW_CONDITIONAL_TIMEOUT_MS: Timeout for conditional jobs (default: 5min)

This resolves issues where PR reviews weren't triggering due to overly strict
wait-for-all logic that didn't account for skipped/conditional CI jobs.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-05-27 18:11:07 -05:00
Jonathan Flatt
d5d5ca4d39 feat: complete E2E test migration and cleanup obsolete shell scripts
- Fixed E2E test assertions to match actual container behavior
- Added test:e2e npm script for running E2E tests
- Removed 14 obsolete shell test scripts replaced by Jest E2E tests
- Updated CLAUDE.md documentation with E2E test command
- Created MIGRATION_NOTICE.md documenting the test migration
- Applied consistent formatting with Prettier and ESLint

All 80 E2E tests now pass successfully. The tests work with mock credentials
and gracefully skip tests requiring real tokens (GitHub, AWS, Anthropic).

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-05-27 07:45:58 +00:00
MCPClaude
4338059113 Implement wait-for-all-checks PR review trigger to prevent duplicate reviews (#73)
* feat: implement wait-for-all-checks PR review trigger

This change modifies the PR review triggering logic to wait for ALL check suites
to complete successfully before triggering a single PR review, preventing duplicate
reviews from different check suites (build, security scans, etc.).

Key changes:
- Added PR_REVIEW_WAIT_FOR_ALL_CHECKS env var (default: true)
- Added PR_REVIEW_DEBOUNCE_MS for configurable delay (default: 5000ms)
- Implemented checkAllCheckSuitesComplete() function that queries GitHub API
- Made PR_REVIEW_TRIGGER_WORKFLOW optional (only used when wait-for-all is false)
- Updated tests to handle new behavior

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>

* fix: correct indentation and remove test-results from git

- Fix ESLint indentation errors in claudeService.js
- Remove test-results directory from git tracking (added to .gitignore)

🤖 Generated with Claude Code (https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>

* feat: add Claude CLI database sharing and backup system

- Mount host ~/.claude directory in container for shared context
- Add .dockerignore to optimize build context
- Create backup script with daily/weekly retention strategy
- Add cron setup for automated backups to /backup partition

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>

* fix: add missing makeGitHubRequest function to githubService

The checkAllCheckSuitesComplete function was failing because it tried to call
githubService.makeGitHubRequest which didn't exist. This was causing PR reviews
to never trigger with the 'Waiting for other check suites to complete' message.

Added the missing function to make direct GitHub API requests using Octokit.

* fix: add URL validation to makeGitHubRequest to prevent SSRF vulnerability

* refactor: remove makeGitHubRequest to fix SSRF vulnerability

- Replace makeGitHubRequest with getCheckSuitesForRef using Octokit
- Simplify getWorkflowNameFromCheckSuite to use app info from webhook
- Fix tests to match new implementation
- Add PR review environment variables to .env file

---------

Co-authored-by: Jonathan Flatt <jonflatt@gmail.com>
Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: ClaudeBot <claude@example.com>
2025-05-26 20:45:59 -05:00
Jonathan Flatt
8e2e30e38b Implement minimal-permission security model for auto-tagging operations using dedicated entrypoint scripts and CLI-based labeling to improve reliability and reduce attack surface
🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-05-25 22:58:20 -05:00
Jonathan Flatt
78627ddeca Implement selective PR review triggers and fix workflow issues
- Add PR_REVIEW_TRIGGER_WORKFLOW environment variable for precise control
- Make automated PR reviews repository-independent
- Fix Docker security scan conditional logic in pr.yml
- Add security job dependencies to docker-build job
- Filter out CodeQL/analysis-only workflows from triggering PR reviews
- Update documentation with new configuration options
- Partial test fixes for new workflow filtering logic

This prevents multiple PR reviews from different check suites and makes
the system work across any repository with proper configuration.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-05-25 21:03:30 -05:00
Jonathan Flatt
a2450d8da4 docs: Fix CLI command examples to reference correct claude-webhook path
Update CLI command examples in CLAUDE.md to use ./cli/claude-webhook instead of ./claude-webhook now that the script has been moved to the cli/ directory.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-05-22 14:13:22 -05:00
Jonathan Flatt
2662ed41da refactor: Clean up project root directory structure
- Remove backup Dockerfile and temporary benchmark results
- Organize scripts and documentation into proper directories
- Update CLAUDE.md to reference actual script locations instead of wrappers
- Enhance .gitignore to prevent future root directory clutter
- Move utilities to appropriate locations (cli/, test/, docs/)

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-05-22 14:13:22 -05:00
Jonathan Flatt
7e545475d0 security: Implement comprehensive credential protection system
Replace environment variable credentials with secure file-based mounting
to prevent runtime credential exposure that was causing security leaks.

Key security improvements:
- Docker secrets integration for credential mounting
- Secure credential loader utility (secureCredentials.js)
- Enhanced logging redaction for all credential types
- Pre-commit security scanning with multiple tools
- Automated security audit workflow and scripts
- File-based credentials with proper 600 permissions

Services updated:
- githubController.js: Use secure credentials for webhook verification
- claudeService.js: Use secure credentials for GitHub/Anthropic APIs
- githubService.js: Use secure credentials for GitHub API calls
- logger.js: Enhanced redaction patterns for all credential types

New security infrastructure:
- ./scripts/setup/setup-secure-credentials.sh: Setup script for secure credentials
- ./scripts/security/credential-audit.sh: Comprehensive security audit
- .github/workflows/security-audit.yml: Automated security scanning
- docker-compose.yml: Updated to use Docker secrets by default
- k8s/secrets.yaml: Kubernetes secrets configuration
- systemd/claude-webhook.service: Systemd service configuration

This eliminates credential exposure in:
- Environment variables and process lists
- Container logs and debug output
- Git commits and PR comments
- Runtime error messages

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-05-21 23:03:07 -05:00
Jonathan Flatt
2a3327e038 feat: Add comprehensive CI/CD pipeline with automated PR reviews
- Add GitHub Actions workflows for CI, security scanning, and deployment
- Implement automated PR review system triggered by successful check suites
- Add ESLint and Prettier for code quality and formatting
- Configure Dependabot for automated dependency updates
- Add comprehensive test coverage for check suite webhook events
- Include Docker builds and container registry publishing
- Add security scanning with CodeQL, npm audit, and TruffleHog
- Create PR and issue templates for better collaboration
- Add comprehensive CI/CD documentation

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-05-21 03:42:09 +00:00
Jonathan Flatt
c341b71558 Improve auto-tagging keyword detection and add E2E testing documentation
Enhanced fallback labeling logic to prioritize documentation detection and prevent false matches. Added comprehensive end-to-end testing documentation using demo repository for webhook validation.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-05-21 03:01:06 +00:00
Jonathan Flatt
0363255da4 Add intelligent issue auto-tagging with Claude analysis
- Implement issue-opened webhook trigger for automatic label classification
- Add comprehensive label system (priority, type, complexity, component)
- Create Claude-powered prompt for intelligent issue analysis
- Include keyword-based fallback labeling for reliability
- Add GitHub API integration for label creation and application
- Provide setup script for initializing repository labels
- Include unit tests for new GitHub service functions
- Add explanatory comments on auto-tagged issues

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-05-21 02:49:44 +00:00
Jonathan Flatt
76126d4ad6 initial commit 2025-05-21 00:05:39 +00:00
Jonathan Flatt
fc567071dd Initial commit 2025-05-20 17:01:59 +00:00