This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
This is a Temporal-based automation system that integrates Helicone observability into open-source LLM projects. It uses:
- Temporal workflows for orchestration
- Claude Code SDK for generating integration code
- GitHub API for repository management
npm run build # Compile TypeScript
npm run build.watch # Watch mode# Start Temporal (required first)
docker-compose up
# Start worker
npm start
# or watch mode:
npm start.watch
# Execute workflow
npm run workflow# Approve changes
npm run review <workflow-id> approve
# Reject with feedback
npm run review <workflow-id> reject "feedback here"npm run lint # ESLint with TypeScript
npm run format # Prettier formatting
npm run format:check # Check formatting/src- TypeScript source filesworker.ts- Temporal worker that executes workflows and activitiesclient.ts- CLI client to start workflowsworkflows.ts- Temporal workflow definitions (simplified with helper functions)activities.ts- Temporal activities (GitHub, Claude Code, Git operations)review.ts- CLI tool for sending review signals to workflowsconstants.ts- Shared constants including Claude Code prompt/utils- Utility functionserrors.ts- Standardized error handling classes
The system follows Temporal's workflow/activity separation:
- Workflows (
src/workflows.ts): Orchestration logic, must be deterministic - Activities (
src/activities.ts): Side effects like API calls, file I/O - Worker (
src/worker.ts): Executes workflows and activities - Client (
src/client.ts): Starts workflows
repositoryIntegrationWorkfloworchestrates the entire process- Fork repository and clone it locally
- Run Claude Code to add Helicone integration (with retry/feedback loop)
- Create review PR in fork for human approval
- Upon approval, create final PR to original repository
- Activities handle GitHub operations, file system operations, and Claude Code execution
- Claude Code SDK is used with specific permissions to modify codebases
- Custom error types in
utils/errors.tsfor different failure scenarios - Consistent error messages across activities
- Proper cleanup and status updates on failure
- Workflow code cannot import Node.js built-ins (except 'assert')
- Activities have timeout and retry configurations
- Claude Code execution has extended timeout (20 minutes)
Required in .env:
GITHUB_TOKEN: GitHub PAT with repo permissionsANTHROPIC_API_KEY: For Claude Code SDKTEMPORAL_ADDRESS: Default localhost:7233HELICONE_API_URL: For status updatesHELICONE_API_KEY: For API authentication