{"id":44561574,"url":"https://github.com/royosherove/repo-swarm","last_synced_at":"2026-02-13T23:39:04.509Z","repository":{"id":315353140,"uuid":"1051662726","full_name":"royosherove/repo-swarm","owner":"royosherove","description":"RepoSwarm is an AI powered multi-repo architecture discovery platform that generates its output in a specialized output repository that you can use for agent context.","archived":false,"fork":false,"pushed_at":"2026-01-10T13:51:14.000Z","size":880,"stargazers_count":198,"open_issues_count":8,"forks_count":44,"subscribers_count":6,"default_branch":"main","last_synced_at":"2026-02-12T11:25:18.102Z","etag":null,"topics":["agentic","ai","architecture"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/royosherove.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-09-06T13:19:54.000Z","updated_at":"2026-02-12T08:55:44.000Z","dependencies_parsed_at":"2025-09-18T06:22:18.833Z","dependency_job_id":null,"html_url":"https://github.com/royosherove/repo-swarm","commit_stats":null,"previous_names":["royosherove/repo-swarm"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/royosherove/repo-swarm","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/royosherove%2Frepo-swarm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/royosherove%2Frepo-swarm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/royosherove%2Frepo-swarm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/royosherove%2Frepo-swarm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/royosherove","download_url":"https://codeload.github.com/royosherove/repo-swarm/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/royosherove%2Frepo-swarm/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29423536,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-13T22:20:51.549Z","status":"ssl_error","status_checked_at":"2026-02-13T22:20:49.838Z","response_time":78,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["agentic","ai","architecture"],"created_at":"2026-02-13T23:39:00.928Z","updated_at":"2026-02-13T23:39:04.499Z","avatar_url":"https://github.com/royosherove.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# RepoSwarm🤖\n![RepoSwarm](RepoSwarm1.jpg)\n\n🎬 **Architecture Overview (click to play)**  \n[![▶ Watch](https://img.youtube.com/vi/rOMf9xvpgtc/hqdefault.jpg)](https://www.youtube.com/watch?v=rOMf9xvpgtc)\n\nRepoSwarm is an AI powered multi-repo architecture discovery platform that generates its output in a specialized output repository that you can use for agent context.\n\nsee example results repo at  [repo-swarm-sample-results-hub](https://github.com/royosherove/repo-swarm-sample-results-hub). \n\n## Credits\nRepoSwarm was born out of a hackathon we ran at Verbit, in which our team, comprised of [Moshe](https://github.com/mosher), [Idan](https://github.com/Idandos) and [Roy](https://github.com/royosherove) created this project together. \n\n## What's This For?\n\nRepoSwarm is an intelligent agentic-like engine that:\n\n- 🔍 Analyzes GitHub repositories using Claude Code SDK\n- 📝 Generates standardized `.arch.md` architecture files  \n- 🔄 Runs daily via Temporal workflows on repos with new commits\n- 💾 Caches results to avoid redundant analysis\n- Writes the results into a results repository that you configure\n\n📋 **See it in action**: Check out [RepoSwarm's self-analysis report](https://github.com/royosherove/repo-swarm-sample-results-hub/blob/main/repo-swarm.arch.md) - an example of RepoSwarm investigating its own codebase!\n\n## How It Works\n\nRepoSwarm runs as a Temporal workflow that automatically processes repositories and feeds  a configured targer repository.\n\n```mermaid\ngraph TB\n    A[Your Repositories] --\u003e|New commits detected| B[repo-swarm]\n    B --\u003e|Temporal Workflow\u003cbr/\u003eDaily execution| C[Clone \u0026 Analyze]\n    C --\u003e|AI Analysis\u003cbr/\u003eusing Claude| D[Generate .arch.md]\n    D --\u003e|Cache in DynamoDB or file system| E[Store Results]\n    E --\u003e|Auto-commit| F[Results Repository]\n    F --\u003e|Query with AI| G[Reports \u0026 Insights]\n    \n    style A fill:#e1f5fe,color:#000\n    style B fill:#fff3e0,color:#000\n    style F fill:#f3e5f5,color:#000\n    style G fill:#e8f5e8,color:#000\n```\n\n🔗 **Analysis prompts**: [prompts/shared](prompts/shared) - The AI prompts used to understand your codebases\n🏗️ **Generated docs**: [repo-swarm-sample-results-hub](https://github.com/royosherove/repo-swarm-sample-results-hub) - Where the `.arch.md` files end up\n\n## Quick Start\n\n### Prerequisites\n\n- Python 3.12+\n- Claude API key\n\n### Installation\n\n**Install mise** (tool version manager):\n\n```bash\n# macOS\nbrew install mise\n\n# Linux/WSL\ncurl https://mise.run | sh\n```\n\n**🚀 Run the setup wizard** (recommended):\n\n```bash\n# Interactive setup wizard - sets up everything automatically\nmise get-started\n```\n\nThis wizard will:\n- ✅ Create your `.env.local` file\n- ✅ Configure your Claude API key\n- ✅ Set up GitHub integration (optional)\n- ✅ Configure Architecture Hub repository\n- ✅ Set up git user details\n\n**Manual setup** (alternative):\n\n```bash\n# Copy local environment template\ncp env.local.example .env.local\n\n# Edit .env.local with your Claude API key\n# ANTHROPIC_API_KEY=your_key_here\n```\n\n**Install dependencies**:\n\n```bash\nmise install\nmise run dev-dependencies\n```\n\n### Running RepoSwarm\n\n#### Recommended: Full Local Testing\n\n```bash\n# Analyze repositories and generate .arch.md files\n# Uses file-based storage (no AWS required)\nmise investigate-all\n```\n\nThis command:\n\n- ✅ Loads configuration from `.env.local`\n- ✅ Uses file-based storage (no DynamoDB required)\n- ✅ Automatically starts Temporal server and worker\n- ✅ Analyzes repositories from `src/prompts/repos.json`\n- ✅ Stores `.arch.md` files in `temp/` directory\n\n#### Test Single Repository\n\n```bash\n# Test a specific repository\nmise investigate-one https://github.com/user/repo\n\n# Or use predefined repos\nmise investigate-one hello-world\n```\n\n## Configuration\n\n### Adding Repositories\n\nEdit `prompts/repos.json` to add repositories for analysis:\n\n```json\n{\n  \"repositories\": {\n    \"my-backend\": {\n      \"url\": \"https://github.com/org/my-backend\",\n      \"type\": \"backend\",\n      \"description\": \"Main API service\"\n    },\n    \"my-frontend\": {\n      \"url\": \"https://github.com/org/my-frontend\", \n      \"type\": \"frontend\",\n      \"description\": \"React web app\"\n    }\n  }\n}\n```\n\n### Customizing Analysis Prompts\n\nRepoSwarm uses specialized prompts for different repository types:\n\n- 🔧 **Backend**: APIs, databases, services → [prompts/backend/](prompts/backend/)\n- 🎨 **Frontend**: Components, routing, state → [prompts/frontend/](prompts/frontend/)\n- 📱 **Mobile**: UI, device features, offline → [prompts/mobile/](prompts/mobile/)\n- 📚 **Libraries**: API surface, internals → [prompts/libraries/](prompts/libraries/)\n- ☁️ **Infrastructure**: Resources, deployments → [prompts/infra-as-code/](prompts/infra-as-code/)\n- 🔗 **Shared**: Security, auth, monitoring → [prompts/shared/](prompts/shared/)\n\nEach type has a `prompts.json` that defines which analysis steps to run.\n\n## Mise Task Organization\n\nRepoSwarm uses a logical naming convention for all mise tasks:\n\n### Development Tasks (`dev-*`)\n```bash\nmise dev-server          # Start Temporal server\nmise dev-dependencies      # Install Python dependencies\nmise dev-worker           # Start Temporal worker\nmise dev-client           # Run workflow client\nmise dev-hello            # Test basic workflow\nmise kill                 # Stop all Temporal processes\nmise dev-repos-list       # List available repositories\nmise dev-repos-update     # Update repository list from GitHub\n```\n\n### Investigation Tasks (`investigate-*`)\n```bash\nmise investigate-all      # Analyze all repositories locally\nmise investigate-one      # Analyze single repository locally\nmise investigate-public   # Analyze public repository\nmise investigate-debug    # Analyze with detailed logging\n```\n\n### Testing Tasks (`test-*`)\n```bash\nmise verify-config        # Validate configuration and test repository access\nmise test-all             # Run complete test suite\nmise test-units           # Run unit tests only\nmise test-integration     # Run integration tests\nmise test-dynamodb        # Test DynamoDB functionality\n```\n\n### Docker Tasks (`docker-*`)\n```bash\nmise docker-dev           # Build and run for development\nmise docker-debug         # Debug with verbose logging\nmise docker-test-build    # Test Docker build process\n```\n\n### Maintenance Tasks\n```bash\nmise cleanup-temp         # Clean temporary files\nmise monitor-workflow     # Check workflow status\n```\n\n## Testing\n\n```bash\n# Run all tests\nmise test-all\n\n# Run unit tests only\nmise test-units\n\n# Run integration tests\nmise test-integration\n```\n\n## Related Projects\n\n- 🏗️ [**repo-swarm-sample-results-hub**](https://github.com/royosherove/repo-swarm-sample-results-hub) - The centralized repository where generated `.arch.md` files are stored and queried\n- 📝 [Analysis prompts](prompts/shared/) - The AI prompts used to understand different types of codebases\n\n## Understanding the Codebase\n\n### Key Directories\n\n```text\nrepo-swarm/\n├── prompts/                 # AI analysis prompts by repo type\n│   ├── backend/            # API, database, service prompts\n│   ├── frontend/           # UI, component, routing prompts\n│   ├── mobile/             # Mobile app specific prompts\n│   ├── libraries/          # Library/API prompts\n│   ├── infra-as-code/      # Infrastructure prompts\n│   ├── shared/             # Cross-cutting concerns (auth, security, etc)\n│   └── repos.json          # Repository configuration\n│\n├── src/\n│   ├── investigator/       # Core analysis engine\n│   │   ├── core/          # Main analysis logic\n│   │   └── investigator.py # Main investigator class\n│   │\n│   ├── workflows/          # Temporal workflow definitions\n│   ├── activities/         # Temporal activity implementations\n│   ├── models/             # Data models and schemas\n│   └── utils/              # Storage adapters and utilities\n│\n├── tests/                  # Unit and integration tests\n├── temp/                   # Generated .arch.md files (local development)\n└── scripts/                # Development and deployment scripts\n```\n\n### Getting Started with Development\n\n1. **Explore the codebase**: Start with `src/investigator/core/` to understand the analysis engine\n2. **Check existing prompts**: Look at `prompts/shared/` for examples of analysis prompts\n3. **Run tests**: Use `mise test-all` to ensure everything works\n4. **Try investigations**: Use `mise investigate-one hello-world` to see the system in action\n\n### Need Help?\n\n- Check existing issues and pull requests\n- Look at the test files for usage examples\n- Review the prompts in `prompts/` for analysis patterns\n\n## Production Deployment\n\nFor production deployments, you need to deploy Temporal workers that can run on company servers or your local machine. The worker connects to a Temporal server (either locally or remotely) and processes workflow tasks.\n\n### Temporal Worker Deployment\n\n**Key Concepts:**\n- **Worker**: A process that hosts workflow and activity implementations\n- **Task Queue**: Named queue where workers poll for tasks\n- **Temporal Server**: Orchestrates workflow execution and task distribution\n\n**Deployment Options:**\n1. **Local Development**: Run workers on your development machine\n2. **Company Servers**: Deploy workers to internal infrastructure\n3. **Cloud Infrastructure**: Deploy to any cloud provider (AWS, GCP, Azure, etc.)\n4. **Containerized**: Run workers in Docker containers or Kubernetes\n\n### Getting Started with Worker Deployment\n\n```bash\n# Start Temporal server (local development)\nmise dev-server\n\n# Run worker in background\nmise dev-worker \u0026\n\n# Trigger workflow via client\nmise dev-client\n\n# Monitor workflow status\nmise monitor-workflow investigate-repos-workflow\n```\n\n### Production Worker Setup\n\nFor production environments:\n\n1. **Deploy Worker Image**: Containerize your worker application\n2. **Connect to Temporal Server**: Configure connection to your Temporal server\n3. **Set Task Queue**: Workers listen on specific task queues\n4. **Trigger via API**: Use Temporal client to start workflows\n\n**Example Worker Deployment:**\n```bash\n# Run worker connecting to remote Temporal server\nTEMPORAL_SERVER_URL=your-temporal-server:7233 mise dev-worker\n```\n\n### Client Integration\n\nClients trigger workflows by connecting to the Temporal server and specifying the task queue:\n\n```python\n# Example client integration\nfrom temporalio.client import Client\n\nasync def trigger_investigation():\n    client = await Client.connect(\"your-temporal-server:7233\")\n    await client.execute_workflow(\n        \"investigate_repos_workflow\",\n        args=[\"repo-url\"],\n        id=\"workflow-id\",\n        task_queue=\"investigation-queue\"\n    )\n```\n\nFor detailed worker deployment strategies, see the [Temporal Worker Deployments documentation](https://docs.temporal.io/production-deployment/worker-deployments).\n\n### Monitoring\n\n```bash\n# Check workflow status\nmise monitor-workflow investigate-repos-workflow\n\n# Check Temporal server status\nmise monitor-temporal\n\n# View logs (local)\ntail -f temp/investigation.log\n```\n\n## Advanced: System Architecture\n\n### Workflow Orchestration\n\nThe system uses Temporal for reliable workflow orchestration:\n\n1. **Cache Check**: Query DynamoDB to see if repo was already analyzed\n2. **Clone**: Clone the repository to temporary storage\n3. **Type Detection**: Determine if it's backend, frontend, mobile, etc.\n4. **Structure Analysis**: Build a tree of files and directories\n5. **Prompt Selection**: Choose appropriate analysis prompts based on repo type\n6. **AI Analysis**: Send prompts + code context to Claude for analysis\n7. **Result Storage**: Save results to DynamoDB and generate markdown files\n8. **Cleanup**: Remove temporary files\n\n### DynamoDB Caching\n\nCache invalidation happens when:\n\n- Repository has new commits\n- Branch has changed\n- TTL expires (30 days)\n- Manual cache clear requested\n\n### Troubleshooting\n\n#### Common Development Issues\n\n**Temporal Server Connection**\n```bash\n# Check if Temporal server is running\nmise monitor-temporal\n\n# Start Temporal server if needed\nmise dev-server\n```\n\n**Claude API Errors**\n- Verify API key: `echo $ANTHROPIC_API_KEY | head -c 10` (should show first 10 chars)\n- Check rate limits in your Anthropic dashboard\n- Ensure you're using a valid Claude model name\n\n**Test Failures**\n```bash\n# Run specific test suites\nmise test-units              # Unit tests only\nmise test-integration        # Integration tests only\nmise test-dynamodb           # DynamoDB tests\n```\n\n**Clean Development Environment**\n```bash\n# Stop all processes\nmise kill\n\n# Clean temporary files\nmise cleanup-temp\n\n# Reset everything\nmise cleanup-temp \u0026\u0026 mise dev-dependencies\n```\n\n## Contributing\n\n1. Fork the repository\n2. Create a feature branch\n3. Make changes and add tests\n4. Ensure tests pass: `mise test-all`\n5. Submit a pull request\n\n### Development Workflow\n\n```bash\n# Set up development environment\nmise dev-dependencies\nmise dev-server\n\n# Run tests before committing\nmise test-all\n\n# Clean up when done\nmise kill\nmise cleanup-temp\n```\n\n---\n\n*Twin project: [repo-swarm-sample-results-hub](https://github.com/royosherove/repo-swarm-sample-results-hub) - Query and analyze the generated architecture documentation*\n\n\n# License\nThis project is licensed under the Polyform Noncommercial License 1.0.0.\nYou may use, copy, and modify the code for non-commercial purposes only.\nFor commercial licensing, please contact roy at osherove dot_com.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Froyosherove%2Frepo-swarm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Froyosherove%2Frepo-swarm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Froyosherove%2Frepo-swarm/lists"}