migrate-service-to-container

Migrate backend services into container modules with shared libraries and tenant-aware queries.

Updated Aug 27, 2026
One-click install
npx skills add https://github.com/Edgame2/castiel2 --skill migrate-service-to-container
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: migrate-service-to-container
Source: https://github.com/Edgame2/castiel2/tree/main/.cursor/skills/migrate-service-to-container
Command: npx skills add https://github.com/Edgame2/castiel2 --skill migrate-service-to-container

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Guides migrating existing services to containers using ModuleImplementationGuide.md standards; ensures code transforms to use shared libraries, tenantId-aware queries, config-driven URLs, and event-driven communication.

Core Features & Use Cases

  • Create module structure under containers/<service-name> with config, src, tests
  • Transform imports to use @coder/shared and loadConfig
  • Add tenantId to database queries to enforce multi-tenant isolation
  • Replace hardcoded URLs with config-driven ServiceClient usage
  • Enforce authentication and tenant enforcement on routes
  • Update error handling to use AppError
  • Set up event publishing/consuming via EventPublisher
  • Update service initialization to use shared DB/cache clients

Quick Start

Begin by creating the containers/<service-name> module and apply the migration steps to update imports, queries, routes, error handling, and event publishing.

Frequently Asked Questions about migrate-service-to-container

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I migrate an existing backend service to a container module?

Migrating an existing backend service to a container module involves creating a directory under containers/<service-name> with config, src, and tests. You then transform imports to use shared libraries and loadConfig for standardized architecture.

How do I enforce multi-tenant isolation when refactoring services to containers?

You enforce multi-tenant isolation when refactoring services to containers by adding tenantId to all database queries. This tenant-aware query pattern ensures data segregation across tenants within the new container module.

What is the best way to replace hardcoded URLs when refactoring backend services?

The best way to replace hardcoded URLs when refactoring backend services is implementing config-driven ServiceClient usage. This approach centralizes endpoint management and standardizes service communication across container-based modules.

Does container migration require event-driven communication wiring?

Yes, container migration requires event-driven communication wiring via EventPublisher for publishing and consuming events. This setup ensures decoupled, standardized event flow across the refactored backend architecture.

How do I update error handling when moving services to containers?

Update error handling when moving services to containers by replacing existing throw patterns with AppError. This enforces consistent error handling standards across all refactored backend services within the new module structure.

What dependencies do I need to set up shared clients for containerized services?

Setting up shared clients for containerized services requires dependencies on a shared client library and ModuleImplementationGuide. This provides shared DB and cache clients, enforcing standardized service initialization and configuration.