migrate-application-operation

Migrate protected Sim resource operations into shared application use cases across API and tool surfaces.

29.5k|3.8k|Updated Jan 5, 2025
One-click install
npx skills add https://github.com/simstudioai/sim --skill migrate-application-operation
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: migrate-application-operation
Source: https://github.com/simstudioai/sim/tree/main/.agents/skills/migrate-application-operation
Command: npx skills add https://github.com/simstudioai/sim --skill migrate-application-operation

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

It prevents duplicated authorization and business logic when the same protected resource operation must be exposed through internal APIs, public or versioned APIs, Copilot tools, and other trusted adapters in the Sim codebase.

Core Features & Use Cases

  • Shared semantic operations: Define one operation registry entry with role, workspace-key policy, and principal kinds, then reuse it across every surface.
  • Layered migration guidance: Enforces a strict boundary between authentication adapters, route or tool adapters, application use cases, repositories, and presenters.
  • Behavior preservation: Requires freezing legacy observable behavior with characterization tests before moving code, including errors, audit, rate limits, and side effects.
  • Use Case: When adding a new protected endpoint like renaming a workspace file, use this Skill to route internal API, v2 public API, and Copilot tool calls through one authorized application use case without changing wire contracts.

Quick Start

Use $migrate-application-operation to migrate the rename endpoint for workspace files into a shared authorized application use case across the internal API and Copilot.

Frequently Asked Questions about migrate-application-operation

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

FAQPage Schema
How do I migrate a protected API route to a shared application use case?

Inventory every entry point, freeze legacy observable behavior with characterization tests, define one semantic operation in the domain registry, then implement an authorized workspace use case that each surface adapter calls. Preserve each surface's own contract and presenter.

How do I expose an existing operation through Copilot tools?

Create one domain-level Copilot application adapter with createCopilotApplicationAdapter that builds the delegated Principal from trusted server-authored context and calls the exact application use case. Never construct delegation from model-provided workspace IDs, operation IDs, or permission tags.

Can internal and public APIs share the same authorization logic?

Yes, both surfaces must call the same application use case so authorization and business behavior stay identical, while authentication, rate limiting, contracts, and response presenters remain surface-specific. Never create internal- or public-specific versions of the same semantic operation.

What operations should not go through an ordinary JSON migration?

Upload or multipart lifecycles, large bodies, binary or streaming responses, bulk or recursive operations, polymorphic tools, and multi-resource transactions require explicit special-case handling. Stop and report a missing design rather than weakening identity, authorization, limits, or error behavior.

Why must behavior be frozen before migrating a route?

Moving legacy steps under a shared wrapper can change authorization order, audit timing, error mapping, or partial-failure state even when individual calls are reused. Characterization tests pin down exact inputs, statuses, side effects, and response shapes before editing.