Engineering
crowi-migration avatar

crowi-migration

Automated migration workflow from legacy Crowi (Express/Swig) to modern architecture (Next.js 16/Fastify/ts-rest).

Introduction

The Crowi Migration skill provides a structured, agent-driven workflow designed to refactor the legacy Crowi application into a modern technology stack. It is specifically built for developers and maintainers managing the transition from the legacy Express and Swig template-based architecture to a high-performance, type-safe stack comprising Next.js 16, Fastify v5, and ts-rest. The skill uses a modular sub-agent system including a planner, implementer, reviewer, and committer to ensure that each component of the wiki system is systematically transformed without breaking core functionality.

  • Automated transition of legacy Express routes to Fastify controllers with strict ts-rest API contracts.

  • Systematic conversion of Swig HTML templates into modular React 19 components with Next.js 16 app directory structure.

  • Integrated task management via .migration-state files, tracking progress through distinct phases: PLANNED, IN_PROGRESS, REVIEW, APPROVED, and COMMITTED.

  • Built-in validation hooks to block dangerous operations during the refactoring process.

  • Support for Turborepo monorepo structures, ensuring type safety with TypeScript 5.x and shared packages.

  • Intended for core contributors and migration engineers handling legacy-to-modern codebase refactoring.

  • Input requirements include access to the legacy lib/routes, lib/views, and lib/models directories.

  • Outputs consist of refactored TypeScript code files, updated api-contract definitions, and pull requests following the defined migration patterns.

  • Constraints: The migration assumes a Node.js 22.x environment and strict adherence to the defined architecture including ts-rest interfaces.

  • Operational tips: Use the /migrate task-name command to initiate workflows; ensure the .migration-state/queue.json is properly configured before execution.

  • Ideal for converting legacy MongoDB/Mongoose models to integrate with the new Fastify/ts-rest backend while maintaining backward compatibility with the existing data layer.

Repository Stats

Stars
1,098
Forks
166
Open Issues
27
Language
JavaScript
Default Branch
main
Sync Status
Idle
Last Synced
May 1, 2026, 09:52 AM
View on GitHub