Faithful companion for large-scale code migrations
Hachiko is a GitHub App that orchestrates technical migrations in large legacy codebases using configurable LLM coding agents. It provides strong guardrails, fast feedback loops, and excellent developer ergonomics for managing complex, multi-step migrations.
- π Plan-Driven Migrations: Define migrations as markdown files with structured frontmatter
- π€ Agent Orchestration: Support for multiple AI coding agents (Claude, Cursor, custom CLIs)
- π‘οΈ Safety First: Comprehensive policy engine with filesystem allowlists and risky change detection
- β‘ Fast Feedback: Immediate CI checks, linting, testing, and coverage reporting
- π Smart State Management: Automatic progress tracking, rollback support, and conflict resolution
- π¬ Interactive Commands: Control migrations via GitHub issue comments (
/hachi pause,/hachi resume, etc.) - π§ Self-Sufficient: One command to develop, test, and simulate migrations locally
# Install Hachiko on your repository
# TODO (Installation instructions will be added once the app is deployed)Create .hachiko.yml in your repository root:
plans:
directory: migrations/
filenamePattern: "*.md"
defaults:
agent: claude-cli
prParallelism: 1
requirePlanReview: true
agents:
claude-cli:
kind: cli
command: claude
args: ["code", "--apply"]Create migrations/my-migration.md:
---
id: upgrade-dependencies
title: "Upgrade Node.js dependencies to latest versions"
owner: "@your-team"
status: draft
strategy:
chunkBy: package
maxOpenPRs: 2
steps:
- id: audit
description: "Analyze current dependencies and identify outdated packages"
expectedPR: false
- id: upgrade
description: "Apply dependency upgrades with automated testing"
expectedPR: true
---
# Dependency Upgrade Migration
This migration will upgrade all Node.js dependencies to their latest stable versions...- Push your migration plan to the default branch
- Hachiko will create a Migration Issue and Plan Review PR
- Review and merge the Plan Review PR to activate the migration
- Watch as Hachiko orchestrates the migration step by step!
- Architecture Overview
- Configuration Reference
- Migration Plan Format
- Developer Setup
- Security Model
- Dogfooding Guide
Control your migrations using GitHub issue comments:
/hachi status- Show current migration status/hachi pause- Pause the active migration/hachi resume [stepId]- Resume migration from a specific step/hachi rebase- Rebase open migration PRs/hachi skip <stepId>- Skip a specific step/hachi retry <stepId>- Retry a failed step/hachi adopt <agent>- Switch to a different agent
- Node.js 22+
- pnpm 9+
- Docker (for agent sandboxing)
# Clone and install dependencies
git clone https://github.com/launchdarkly/hachiko.git
cd hachiko
pnpm install
# Build the app
pnpm build
# Run locally with webhook proxy
pnpm dev# Run all tests
pnpm test
# Run with coverage
pnpm coverage
# Lint and format
pnpm lint
pnpm format
# Type check
pnpm typecheck# Run end-to-end migration simulation
pnpm scripts:simulate-migration
# Fire test webhooks
pnpm scripts:fire-webhook push examples/migrations/react-class-to-hooks.mdHachiko takes security seriously:
- π Least Privilege: Minimal GitHub App permissions
- π¦ Container Sandboxing: Agents run in isolated Docker containers
- π« Filesystem Allowlists: Strict control over what files can be modified
- π Policy Engine: Configurable rules for risky change detection
- π Audit Trail: Complete history of all migration actions
- π No Network Access: Agents run without network by default
See Security Model for details.
We welcome contributions! Please see CONTRIBUTING.md for guidelines.
- Fork the repository
- Create a feature branch
- Make your changes with tests
- Ensure all CI checks pass
- Open a pull request
- Named after HachikΕ, the legendary loyal dog
- Inspired by large-scale migration challenges at LaunchDarkly
- Built with Probot and TypeScript
"Just as HachikΕ waited faithfully for his owner, Hachiko faithfully manages your code migrations from start to finish." π