1---2name: legacy-api-modernization3enabled: true4description: |5 Use when performing legacy api modernization — guides the modernization of6 legacy APIs (SOAP, XML-RPC, proprietary protocols) to modern RESTful or7 GraphQL interfaces. Covers API discovery, contract analysis, versioning8 strategy, backward compatibility, consumer migration, and deprecation9 planning.10required_connections:11 - prefix: api-gateway12 label: "API Gateway"13config_fields:14 - key: legacy_api_type15 label: "Legacy API Type"16 required: true17 placeholder: "e.g., SOAP, XML-RPC, proprietary REST"18 - key: target_api_style19 label: "Target API Style"20 required: true21 placeholder: "e.g., REST, GraphQL, gRPC"22 - key: consumer_count23 label: "Number of API Consumers"24 required: false25 placeholder: "e.g., 15"26features:27 - CLOUD_MIGRATION28 - API29 - MODERNIZATION30---3132# Legacy API Modernization Plan3334## Phase 1: API Discovery & Analysis351. Catalog all legacy API endpoints36 - [ ] Endpoint URLs and methods37 - [ ] Request/response schemas (WSDL, XSD, etc.)38 - [ ] Authentication mechanisms39 - [ ] Rate limits and SLAs40 - [ ] Error handling patterns412. Identify all API consumers and their usage patterns423. Document business logic embedded in API layer434. Measure current traffic volumes and latency baselines4445### Consumer Impact Matrix4647| Consumer | Endpoints Used | Traffic Volume | Migration Difficulty | Priority |48|----------|---------------|----------------|---------------------|----------|49| | | req/day | Low/Med/High | 1-5 |5051## Phase 2: Modern API Design521. Design resource-oriented API structure (REST) or schema (GraphQL)532. Define OpenAPI / GraphQL schema specification543. Plan versioning strategy (URL path, header, query param)554. Design authentication flow (OAuth 2.0, API keys, JWT)565. Define rate limiting and throttling policies576. Plan pagination, filtering, and sorting patterns5859### Endpoint Mapping6061| Legacy Endpoint | Modern Endpoint | Method | Breaking Change | Adapter Needed |62|----------------|-----------------|--------|-----------------|----------------|63| | | | Yes/No | Yes/No |6465## Phase 3: Adapter Layer Implementation661. Build adapter/facade layer between legacy and modern APIs672. Implement request/response transformation logic683. Handle data format conversion (XML to JSON, etc.)694. Maintain backward compatibility through the adapter705. Add comprehensive logging for both old and new paths7172## Phase 4: Modern API Implementation731. Implement modern API endpoints742. Write comprehensive API tests (unit, integration, contract)753. Set up API documentation (Swagger UI, GraphQL Playground)764. Configure API gateway routing775. Implement monitoring and alerting7879## Phase 5: Consumer Migration801. Publish migration guide and updated SDK/client libraries812. Provide sandbox environment for consumer testing823. Migrate consumers in waves, starting with internal teams834. Monitor error rates per consumer during migration845. Provide support window for each migration wave8586## Phase 6: Deprecation & Decommission871. Announce deprecation timeline for legacy endpoints882. Add deprecation headers to legacy API responses893. Monitor remaining legacy traffic904. Remove adapter layer after all consumers migrated915. Decommission legacy API infrastructure9293## Counter-Rationalizations9495| Shortcut | Counter | Why |96|----------|---------|-----|97| "We can skip some steps for this case" | Adapt the workflow steps, don't skip them | Skipped steps are where incidents and oversights originate |98| "The user seems to already know what to do" | Complete all workflow phases with the user | The workflow catches blind spots that experience alone misses |99| "This is a minor case, full process is overkill" | Scale the process down, don't turn it off | Minor cases become major when unstructured; the process scales, not disappears |100| "I'll fill in the details later" | Complete each section before moving on | Deferred details are forgotten; real-time capture is more accurate |101| "The template output isn't necessary" | Always produce the structured output format | Structured output enables comparison, audit trails, and handoff to other teams |102103## Output Format104- **API Inventory**: Complete catalog of legacy endpoints and consumers105- **Modern API Specification**: OpenAPI/GraphQL schema document106- **Migration Guide**: Consumer-facing documentation for migration107- **Adapter Architecture**: Design for backward-compatible transition108- **Deprecation Timeline**: Phased schedule with milestones109110## Action Items111- [ ] Complete legacy API discovery and consumer mapping112- [ ] Design and review modern API specification113- [ ] Build adapter layer with backward compatibility114- [ ] Deploy modern API to staging for consumer testing115- [ ] Migrate consumers in planned waves116- [ ] Enforce deprecation dates and decommission legacy API