[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M69B2KJY703H8X3B5RQV2CS4":3,"skill-same:01M69B2KJY703H8X3B5RQV2CS4":61},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":8,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":18,"categories":19,"keywords":30,"publishedAt":33,"linkOnly":34,"markdownContent":35,"markdownBody":36,"frontMatter":37,"refName":38,"commitSha":39,"skillDirectory":40,"forksCount":41,"repositoryHtmlUrl":42,"repositoryHomepageUrl":17,"ownerHtmlUrl":43,"ownerBlogUrl":44,"ownerDescription":45,"updatedAt":46,"install":47,"resources":60},"01M69B2KJY703H8X3B5RQV2CS4","api-service-contracts","API 服务通信契约生成","Generate API and service communication contracts with sequence diagram","生成 API 及服务之间的通信契约，并附带时序图。","microsoft\u002Fgithub-copilot-modernization","microsoft","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F6154722?v=4","01M698VYDXZ6JW5WH3CRV650R8","Microsoft","01M69B2DAY0HTBHWQN4WF3JDBQ",55,"MIT",null,"https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fgithub-copilot-modernization\u002Fblob\u002Fmain\u002Fplugins\u002Fgithub-copilot-modernization\u002Fskills\u002Fapi-service-contracts\u002FSKILL.md",[20,25],{"categoryNo":21,"categoryName":22,"taxonomyType":23,"taxonomyTypeDesc":24},"01M8BQ6TQZN6R52WBJ9H8NRMQM","软件开发工程师","PROFESSION","适用职业",{"categoryNo":26,"categoryName":27,"taxonomyType":28,"taxonomyTypeDesc":29},"01M8BT7QTSZKB08EAW9P9ZCDNQ","设计评审与架构优化","SCENARIO","使用场景",[31,32],"api service contracts","diagram","2026-11-10 10:12:30",false,"---\nname: api-service-contracts\ndescription: Generate API and service communication contracts with sequence diagram\n---\n\n# API & Service Communication Contracts\n\nAnalyze the project to document all services, API endpoints, communication patterns (sync\u002Fasync), DTOs, and retry\u002Fcircuit-breaker policies. Generate a Mermaid sequence diagram showing the primary request flow across services. Save to `.github\u002Fmodernize\u002Fassessment\u002Fengines\u002Ffacts\u002Fapi-service-contracts.md`.\n\n## Input Parameters\n\n- `workspace-path` (optional): Path to the project to analyze (defaults to current directory)\n\n## ⚠ Mermaid Safety Constraints — read BEFORE you write the ```mermaid block\n\nMermaid sequenceDiagram is unforgiving in a few specific ways: one bad alias or one missing `end` crashes the **whole** diagram with `Syntax error in text`, not just the offending line. Stay strictly inside this subset for the sequence diagram in Step 7:\n\n1. **Chart kind.** `sequenceDiagram` only. Never `sequence-diagram`, never `sequence`.\n2. **Participants.** Always declare with the alias form `participant \u003CAlphaNumId> as \"Display Label\"`. The id must match `[A-Za-z][A-Za-z0-9_]*`. Never omit the id — even a one-word participant should be `participant Client as \"Client\"`. This is the single biggest cause of past failures.\n3. **Arrows.**\n   - `->>` synchronous request\n   - `-->>` synchronous response (or async return)\n   - `-)` async fire-and-forget\n   - Message text goes after `:` and is plain text — keep it short and on one line.\n4. **Blocks.** `alt` \u002F `else` \u002F `opt` \u002F `loop` \u002F `par` \u002F `critical` MUST be closed by `end` on its own line. Every open block must have a matching `end`. Missing `end` is the #2 cause of past failures.\n5. **No line breaks anywhere.** The escape `\\n` was removed in modern Mermaid. Aliases, message text, and `Note over` content must all be single-line. Split a long note into multiple consecutive `Note over` lines; split a long message into multiple arrows. This is the #1 cause of past failures.\n6. **Banned characters inside participant aliases specifically** (message text is more permissive — only `\\n` is banned there):\n\n   | Banned in alias | Why it breaks | Replacement |\n   |---|---|---|\n   | `\\n` (literal two chars) | escape removed | drop |\n   | `\"` (a second double-quote) | closes the alias early | `'` (single quote) |\n   | `` ` `` (backtick) | breaks alias quoting | drop |\n   | smart quotes `\"` `\"` `'` `'` | not ASCII | regular `\"` and `'` |\n   | `:` | confuses with message delimiter | rephrase, e.g. `\"REST API (port 8080)\"` not `\"REST API: port 8080\"` |\n   | `\u003Cbr\u002F>` | not interpreted inside aliases | rephrase as shorter alias |\n\n7. **Quote the alias.** `participant Svc as \"Order Service\"` — never `participant Svc as Order Service` (unquoted multi-word aliases break).\n\n### Mandatory self-attestation\n\nImmediately before writing the ` ```mermaid ` opening fence in Step 7, emit this exact one-line HTML comment in the markdown (it does not render — it is for your own visible attestation):\n\n```\n\u003C!-- mermaid-checked: every participant uses `participant Id as \"Label\"`, no \\n in aliases\u002Fmessages\u002Fnotes, every alt\u002Fopt\u002Floop closed by end, no `:` inside any alias -->\n```\n\nIf you cannot truthfully emit that comment, fix the diagram first.\n\n---\n\n## Scope Boundaries — Avoid Redundancy with Other Skills\n\nThis skill is part of a set of four complementary assessment skills. To avoid content duplication across their output documents, observe these scope rules:\n\n- **Introduction**: Write a 1-2 sentence intro focused on the API surface (number of endpoints, communication style). Do NOT restate the application's technology stack, database options, or architecture type — those are covered by other skills.\n- **Entity fields and persistence details** are owned by the `data-architecture` skill. In the DTOs & Contracts section, list entity\u002FDTO **class names** and their role in the API contract (request type, response type, immutability). Do NOT reproduce full field lists, ORM annotations (cascade, fetch strategy), or table names — reference `data-architecture.md` instead.\n- **Validation rules** (e.g., `@NotBlank`, custom validators) are owned by the `business-workflows` skill. Mention validation only when it affects the API contract (e.g., \"returns 400 if validation fails\"). Do NOT enumerate individual field constraints.\n- **Caching implementation details** (provider, TTL, configuration class) are owned by the `data-architecture` skill. In the sequence diagram, you may show cache hit\u002Fmiss behavior, but do NOT repeat the cache provider name, configuration details, or rationale.\n- **Configuration properties and profiles** (e.g., `spring.jpa.*`, database profiles) are owned by the `configuration-inventory` skill. Do NOT list property keys\u002Fvalues.\n- **Startup dependency chain details** (readiness probes, K8s manifests, dockerize) are owned by the `configuration-inventory` skill. Mention startup order only if it directly affects API availability. Do NOT repeat probe paths or wait mechanisms.\n\n## Execution Steps\n\n### Step 1: Generate Service Catalog Section\n\nIdentify all independently deployable services\u002Fmodules and produce the complete `## Service Catalog` section:\n\n- Multi-module builds: Maven modules (`pom.xml` `\u003Cmodules>`), Gradle subprojects (`settings.gradle`), .NET solutions (`.sln` → `.csproj` projects), monorepo workspaces (`package.json` workspaces)\n- Docker Compose services (`docker-compose.yml` service definitions) — note third-party containers vs source-built services\n- Kubernetes deployments, Helm charts, or IaC definitions\n\nFor each service extract:\n- Service name and Maven module \u002F project name\n- Port number (from config files, `docker-compose.yml`, or `application.properties`\u002F`appsettings.json`)\n- Category: **API Layer** (gateways, BFFs), **Business** (domain services), **Infrastructure** (config, discovery, admin), **Observability** (tracing, metrics, dashboards)\n- Purpose (one-line description)\n- Key framework dependencies (from `pom.xml`, `.csproj`, `package.json`)\n\n### Step 2: Generate API Endpoints Inventory Section\n\nScan source code for API endpoint definitions and produce the complete `## API Endpoints Inventory` section:\n\n- Java (Spring): `@RestController`, `@Controller`, `@GetMapping`, `@PostMapping`, `@PutMapping`, `@DeleteMapping`, `@RequestMapping`\n- Java (Jakarta EE): `@Path`, `@GET`, `@POST`, `@PUT`, `@DELETE` (JAX-RS)\n- .NET (ASP.NET Core): `[ApiController]`, `[HttpGet]`, `[HttpPost]`, `[HttpPut]`, `[HttpDelete]`, `[Route]`\n- JavaScript\u002FTypeScript: Express routes (`app.get`, `app.post`, `router.get`), Fastify routes, NestJS decorators (`@Get`, `@Post`)\n\nFor each endpoint extract:\n- HTTP method (GET, POST, PUT, DELETE, PATCH)\n- URL path (including path parameters)\n- Request type (body\u002Fquery\u002Fpath parameters, DTO class name)\n- Response type (DTO class name, status codes)\n- API versioning scheme if present (URL path, header, query parameter)\n- Which service\u002Fcontroller it belongs to\n\n### Step 3: Generate Management & Observability Endpoints Section\n\nIdentify management and observability endpoints and produce the complete `## Management & Observability Endpoints` section:\n\n- Spring Boot Actuator endpoints (`\u002Factuator\u002Fhealth`, `\u002Factuator\u002Finfo`, `\u002Factuator\u002Fmetrics`, `\u002Factuator\u002Fprometheus`)\n- .NET health checks (`\u002Fhealth`, `\u002Fhealthz`), Swagger UI (`\u002Fswagger`)\n- Custom metrics annotations: `@Timed` (Micrometer), `[Meter]`, custom metric registrations — note the metric name and which service exposes it\n\n### Step 4: Generate DTOs & Contracts Section\n\nAnalyze DTO and contract definitions and produce the complete `## DTOs & Contracts` section:\n\n- Find DTO \u002F request \u002F response model classes (records, POJOs, C# records\u002Fclasses). List class names and their API role (request body, response, path\u002Fquery param). Do NOT reproduce full field lists or ORM annotations — those belong in `data-architecture.md`.\n- **Distinguish gateway-level DTOs** (aggregation\u002Fcomposition models that combine data from multiple services) from **service-level domain entities** (owned by a single service)\n- Note which DTOs are immutable (Lombok `@Value`, Java records, C# records, frozen data classes)\n- Identify OpenAPI\u002FSwagger specifications (`openapi.yaml`, `swagger.json`, Springdoc\u002FSwashbuckle annotations)\n- Check for protobuf schemas (`.proto` files) or GraphQL schemas\n- Note serialization configuration (Jackson, System.Text.Json, custom serializers)\n\n### Step 5: Generate Communication Patterns Section\n\nIdentify inter-service and intra-service communication and produce the complete `## Communication Patterns` section:\n\n- **Synchronous**: REST (HttpClient, RestTemplate, WebClient, Feign), gRPC, direct method calls\n- **Asynchronous**: Message queues (Kafka, RabbitMQ, Azure Service Bus, SQS), event-driven patterns, pub\u002Fsub\n- **Resilience patterns**: Circuit breaker (Resilience4j, Polly, Spring Retry), retry policies, timeout configuration, bulkhead patterns — note specific timeout values and fallback behavior\n- **Service discovery**: Eureka, Consul, Kubernetes DNS, Azure Service Discovery — note whether services register by logical name or hardcoded URL\n- **API gateway**: Spring Cloud Gateway, Ocelot, Kong, custom gateway patterns\n- **Gateway aggregation\u002Fcomposition**: Document how the gateway combines responses from multiple backend services (e.g., fetching owner details from one service and visit history from another, then merging them into a single response). Note the composition logic and fallback behavior when a downstream service is unavailable.\n- **Client-side load balancing**: Spring Cloud LoadBalancer, Ribbon, or framework-provided balancing\n- **Startup dependency chain**: Briefly note the service startup order if it affects API availability. For full details (probes, wait mechanisms, timeouts), refer to `configuration-inventory.md`.\n- **Security posture**: Note whether transport security (HTTPS\u002FTLS), authentication (JWT, OAuth2, Basic Auth, Spring Security), or authorization (RBAC, `@PreAuthorize`, role checks) are implemented at the API level. If absent, state it explicitly — e.g., \"No authentication or TLS configured; all endpoints are publicly accessible with no authorization checks.\" Do NOT duplicate CWE security scan findings; focus only on presence or absence at the API contract level.\n\n### Step 6: Generate Service Technology Matrix Section\n\nFor each service, identify which cross-cutting capabilities it uses and produce the complete `## Service Technology Matrix` section:\n\n- Web framework (MVC, Reactive\u002FWebFlux, Minimal API)\n- Data access (JPA, EF Core, Mongoose, etc.)\n- Service discovery (client, server, or none)\n- Gateway functionality\n- Actuator\u002Fhealth checks\n- Caching layer\n- Metrics export (Prometheus, Application Insights, etc.)\n\n### Step 7: Generate Service Communication Sequence Section\n\nCreate a **Mermaid `sequenceDiagram`** and produce the complete `## Service Communication Sequence` section (re-read the Safety Constraints above before writing):\n- Show key actors: Client, API Gateway (if present), Controllers, Services, External Services, Message Brokers\n- Annotate synchronous calls with solid arrows and asynchronous calls with dashed arrows\n- Include request\u002Fresponse types where relevant\n- Show error handling paths for critical flows (circuit breaker, retry)\n- For gateway aggregation flows, show how multiple downstream calls are composed\n\nReference example (this block satisfies every Safety Constraint — match its shape):\n\n\u003C!-- mermaid-checked: every participant uses `participant Id as \"Label\"`, no \\n in aliases\u002Fmessages\u002Fnotes, every alt\u002Fopt\u002Floop closed by end, no `:` inside any alias -->\n~~~mermaid\nsequenceDiagram\n    participant Client as \"Client\"\n    participant Gateway as \"API Gateway\"\n    participant CustSvc as \"Customers Service\"\n    participant VisitSvc as \"Visits Service\"\n    participant DB as \"Database\"\n\n    Client->>Gateway: GET \u002Fapi\u002Fgateway\u002Fowners\u002F1\n    Gateway->>CustSvc: GET \u002Fowners\u002F1\n    CustSvc->>DB: findById(1)\n    DB-->>CustSvc: Owner + Pets\n    CustSvc-->>Gateway: OwnerDetails(pets=[Pet1,Pet2])\n    Gateway->>VisitSvc: GET \u002Fpets\u002Fvisits?petId=1,2\n    alt Visits Service Available\n        VisitSvc->>DB: findByPetIdIn([1,2])\n        DB-->>VisitSvc: Visits list\n        VisitSvc-->>Gateway: Visits(items=[...])\n    else Circuit Breaker Open\n        Gateway-->>Gateway: Fallback - empty visits\n    end\n    Gateway->>Gateway: Merge visits into pets\n    Gateway-->>Client: 200 OwnerDetails + Visits\n~~~\n\n### Step 8: Save Output\n\nSave to `.github\u002Fmodernize\u002Fassessment\u002Fengines\u002Ffacts\u002Fapi-service-contracts.md` with this exact structure:\n\n```\n# API & Service Communication Contracts\n\nA brief introduction (1-2 sentences) summarizing the API surface and communication patterns found.\n\n## Service Catalog\n\n[Table: Service | Port | Category | Purpose]\n\n## API Endpoints Inventory\n\n[Table: Service | Method | Path | Request Type | Response Type]\n\n## Management & Observability Endpoints\n\n[Table: Service | Endpoint | Custom Metrics (if any)]\n\n## DTOs & Contracts\n\n[Description of gateway-level DTOs vs service-level entities, immutability, serialization]\n\n## Communication Patterns\n\n[Description of sync\u002Fasync patterns, gateway aggregation\u002Fcomposition logic, circuit breaker\u002Fretry policies with timeout values, service discovery, startup dependency chain, and security posture (authentication\u002Fauthorization\u002FTLS — or explicit statement that none is configured)]\n\n## Service Technology Matrix\n\n[Table: Service | Web | Data Access | Discovery | Gateway | Actuator | Cache | Metrics]\n\n## Service Communication Sequence\n\n\u003C Mermaid sequenceDiagram here >\n```\n\n## Scaling Rules\n\n- If the project has **more than 30 endpoints**, group by service\u002Fcontroller and show representative endpoints per group\n- Keep the sequence diagram under **40 participants and messages** to ensure readability and GitHub rendering compatibility\n- For multi-module projects, focus on inter-module communication in the sequence diagram and list all endpoints in the table\n- Aggregate similar endpoints (e.g., CRUD operations on the same resource) into one table row if needed for brevity\n- For the service technology matrix, use checkmarks or short labels; omit columns where no service uses the capability\n\n## Common failure patterns observed in past runs\n\nEach row below is something the model actually produced that crashed the diagram. Use the ✅ form.\n\n| ❌ Past mistake | ✅ Safe form | Why the ❌ crashed |\n|---|---|---|\n| `participant API` (no alias) | `participant API as \"API\"` | Bare participants with later spaces in usage break |\n| `participant API as \"REST API\\n(SubsonicController)\"` | `participant API as \"REST API (SubsonicController)\"` | Literal `\\n` in alias |\n| `participant API as \"REST API: port 8080\"` | `participant API as \"REST API (port 8080)\"` | `:` in alias collides with message delimiter |\n| `Note over Client,API: First fact\\nSecond fact` | Two consecutive `Note over Client,API: ...` lines | `\\n` in note text |\n| `alt happy path` ... missing `end` | `alt happy path` ... `end` | Unclosed block |\n| `participant Svc as Order Service` (no quotes) | `participant Svc as \"Order Service\"` | Multi-word alias must be quoted |\n\n## Error Handling\n\n- **Unsupported project type**: Output a single line: `> ERROR: Unsupported project type. This skill supports Java, .NET, JavaScript, and TypeScript projects only.`\n- **No API endpoints found**: Output: `> ERROR: No recognized API endpoints found at workspace-path. Verify the path is correct.`\n- **Insufficient info**: Generate a best-effort document from available data. Add a note: `> Note: Some endpoints or communication patterns could not be fully identified.`\n\n## Success Criteria\n\n- Service catalog table lists all discovered services with ports, categories, and purposes\n- API endpoints table lists all discovered endpoints with HTTP method, path, and types\n- Management\u002Fobservability endpoints are cataloged with custom metric names\n- Gateway aggregation\u002Fcomposition patterns are documented with fallback behavior\n- Service technology matrix shows per-service capabilities\n- Communication patterns section describes sync\u002Fasync patterns, resilience policies, and security posture (authentication, authorization, TLS — explicitly stating if none is configured)\n- Mermaid sequence diagram renders correctly showing primary request flow with aggregation and fallback\n- The ```mermaid block is preceded by the `\u003C!-- mermaid-checked: ... -->` attestation comment\n- File saved to `.github\u002Fmodernize\u002Fassessment\u002Fengines\u002Ffacts\u002Fapi-service-contracts.md`\n","# API & Service Communication Contracts\n\nAnalyze the project to document all services, API endpoints, communication patterns (sync\u002Fasync), DTOs, and retry\u002Fcircuit-breaker policies. Generate a Mermaid sequence diagram showing the primary request flow across services. Save to `.github\u002Fmodernize\u002Fassessment\u002Fengines\u002Ffacts\u002Fapi-service-contracts.md`.\n\n## Input Parameters\n\n- `workspace-path` (optional): Path to the project to analyze (defaults to current directory)\n\n## ⚠ Mermaid Safety Constraints — read BEFORE you write the ```mermaid block\n\nMermaid sequenceDiagram is unforgiving in a few specific ways: one bad alias or one missing `end` crashes the **whole** diagram with `Syntax error in text`, not just the offending line. Stay strictly inside this subset for the sequence diagram in Step 7:\n\n1. **Chart kind.** `sequenceDiagram` only. Never `sequence-diagram`, never `sequence`.\n2. **Participants.** Always declare with the alias form `participant \u003CAlphaNumId> as \"Display Label\"`. The id must match `[A-Za-z][A-Za-z0-9_]*`. Never omit the id — even a one-word participant should be `participant Client as \"Client\"`. This is the single biggest cause of past failures.\n3. **Arrows.**\n   - `->>` synchronous request\n   - `-->>` synchronous response (or async return)\n   - `-)` async fire-and-forget\n   - Message text goes after `:` and is plain text — keep it short and on one line.\n4. **Blocks.** `alt` \u002F `else` \u002F `opt` \u002F `loop` \u002F `par` \u002F `critical` MUST be closed by `end` on its own line. Every open block must have a matching `end`. Missing `end` is the #2 cause of past failures.\n5. **No line breaks anywhere.** The escape `\\n` was removed in modern Mermaid. Aliases, message text, and `Note over` content must all be single-line. Split a long note into multiple consecutive `Note over` lines; split a long message into multiple arrows. This is the #1 cause of past failures.\n6. **Banned characters inside participant aliases specifically** (message text is more permissive — only `\\n` is banned there):\n\n   | Banned in alias | Why it breaks | Replacement |\n   |---|---|---|\n   | `\\n` (literal two chars) | escape removed | drop |\n   | `\"` (a second double-quote) | closes the alias early | `'` (single quote) |\n   | `` ` `` (backtick) | breaks alias quoting | drop |\n   | smart quotes `\"` `\"` `'` `'` | not ASCII | regular `\"` and `'` |\n   | `:` | confuses with message delimiter | rephrase, e.g. `\"REST API (port 8080)\"` not `\"REST API: port 8080\"` |\n   | `\u003Cbr\u002F>` | not interpreted inside aliases | rephrase as shorter alias |\n\n7. **Quote the alias.** `participant Svc as \"Order Service\"` — never `participant Svc as Order Service` (unquoted multi-word aliases break).\n\n### Mandatory self-attestation\n\nImmediately before writing the ` ```mermaid ` opening fence in Step 7, emit this exact one-line HTML comment in the markdown (it does not render — it is for your own visible attestation):\n\n```\n\u003C!-- mermaid-checked: every participant uses `participant Id as \"Label\"`, no \\n in aliases\u002Fmessages\u002Fnotes, every alt\u002Fopt\u002Floop closed by end, no `:` inside any alias -->\n```\n\nIf you cannot truthfully emit that comment, fix the diagram first.\n\n---\n\n## Scope Boundaries — Avoid Redundancy with Other Skills\n\nThis skill is part of a set of four complementary assessment skills. To avoid content duplication across their output documents, observe these scope rules:\n\n- **Introduction**: Write a 1-2 sentence intro focused on the API surface (number of endpoints, communication style). Do NOT restate the application's technology stack, database options, or architecture type — those are covered by other skills.\n- **Entity fields and persistence details** are owned by the `data-architecture` skill. In the DTOs & Contracts section, list entity\u002FDTO **class names** and their role in the API contract (request type, response type, immutability). Do NOT reproduce full field lists, ORM annotations (cascade, fetch strategy), or table names — reference `data-architecture.md` instead.\n- **Validation rules** (e.g., `@NotBlank`, custom validators) are owned by the `business-workflows` skill. Mention validation only when it affects the API contract (e.g., \"returns 400 if validation fails\"). Do NOT enumerate individual field constraints.\n- **Caching implementation details** (provider, TTL, configuration class) are owned by the `data-architecture` skill. In the sequence diagram, you may show cache hit\u002Fmiss behavior, but do NOT repeat the cache provider name, configuration details, or rationale.\n- **Configuration properties and profiles** (e.g., `spring.jpa.*`, database profiles) are owned by the `configuration-inventory` skill. Do NOT list property keys\u002Fvalues.\n- **Startup dependency chain details** (readiness probes, K8s manifests, dockerize) are owned by the `configuration-inventory` skill. Mention startup order only if it directly affects API availability. Do NOT repeat probe paths or wait mechanisms.\n\n## Execution Steps\n\n### Step 1: Generate Service Catalog Section\n\nIdentify all independently deployable services\u002Fmodules and produce the complete `## Service Catalog` section:\n\n- Multi-module builds: Maven modules (`pom.xml` `\u003Cmodules>`), Gradle subprojects (`settings.gradle`), .NET solutions (`.sln` → `.csproj` projects), monorepo workspaces (`package.json` workspaces)\n- Docker Compose services (`docker-compose.yml` service definitions) — note third-party containers vs source-built services\n- Kubernetes deployments, Helm charts, or IaC definitions\n\nFor each service extract:\n- Service name and Maven module \u002F project name\n- Port number (from config files, `docker-compose.yml`, or `application.properties`\u002F`appsettings.json`)\n- Category: **API Layer** (gateways, BFFs), **Business** (domain services), **Infrastructure** (config, discovery, admin), **Observability** (tracing, metrics, dashboards)\n- Purpose (one-line description)\n- Key framework dependencies (from `pom.xml`, `.csproj`, `package.json`)\n\n### Step 2: Generate API Endpoints Inventory Section\n\nScan source code for API endpoint definitions and produce the complete `## API Endpoints Inventory` section:\n\n- Java (Spring): `@RestController`, `@Controller`, `@GetMapping`, `@PostMapping`, `@PutMapping`, `@DeleteMapping`, `@RequestMapping`\n- Java (Jakarta EE): `@Path`, `@GET`, `@POST`, `@PUT`, `@DELETE` (JAX-RS)\n- .NET (ASP.NET Core): `[ApiController]`, `[HttpGet]`, `[HttpPost]`, `[HttpPut]`, `[HttpDelete]`, `[Route]`\n- JavaScript\u002FTypeScript: Express routes (`app.get`, `app.post`, `router.get`), Fastify routes, NestJS decorators (`@Get`, `@Post`)\n\nFor each endpoint extract:\n- HTTP method (GET, POST, PUT, DELETE, PATCH)\n- URL path (including path parameters)\n- Request type (body\u002Fquery\u002Fpath parameters, DTO class name)\n- Response type (DTO class name, status codes)\n- API versioning scheme if present (URL path, header, query parameter)\n- Which service\u002Fcontroller it belongs to\n\n### Step 3: Generate Management & Observability Endpoints Section\n\nIdentify management and observability endpoints and produce the complete `## Management & Observability Endpoints` section:\n\n- Spring Boot Actuator endpoints (`\u002Factuator\u002Fhealth`, `\u002Factuator\u002Finfo`, `\u002Factuator\u002Fmetrics`, `\u002Factuator\u002Fprometheus`)\n- .NET health checks (`\u002Fhealth`, `\u002Fhealthz`), Swagger UI (`\u002Fswagger`)\n- Custom metrics annotations: `@Timed` (Micrometer), `[Meter]`, custom metric registrations — note the metric name and which service exposes it\n\n### Step 4: Generate DTOs & Contracts Section\n\nAnalyze DTO and contract definitions and produce the complete `## DTOs & Contracts` section:\n\n- Find DTO \u002F request \u002F response model classes (records, POJOs, C# records\u002Fclasses). List class names and their API role (request body, response, path\u002Fquery param). Do NOT reproduce full field lists or ORM annotations — those belong in `data-architecture.md`.\n- **Distinguish gateway-level DTOs** (aggregation\u002Fcomposition models that combine data from multiple services) from **service-level domain entities** (owned by a single service)\n- Note which DTOs are immutable (Lombok `@Value`, Java records, C# records, frozen data classes)\n- Identify OpenAPI\u002FSwagger specifications (`openapi.yaml`, `swagger.json`, Springdoc\u002FSwashbuckle annotations)\n- Check for protobuf schemas (`.proto` files) or GraphQL schemas\n- Note serialization configuration (Jackson, System.Text.Json, custom serializers)\n\n### Step 5: Generate Communication Patterns Section\n\nIdentify inter-service and intra-service communication and produce the complete `## Communication Patterns` section:\n\n- **Synchronous**: REST (HttpClient, RestTemplate, WebClient, Feign), gRPC, direct method calls\n- **Asynchronous**: Message queues (Kafka, RabbitMQ, Azure Service Bus, SQS), event-driven patterns, pub\u002Fsub\n- **Resilience patterns**: Circuit breaker (Resilience4j, Polly, Spring Retry), retry policies, timeout configuration, bulkhead patterns — note specific timeout values and fallback behavior\n- **Service discovery**: Eureka, Consul, Kubernetes DNS, Azure Service Discovery — note whether services register by logical name or hardcoded URL\n- **API gateway**: Spring Cloud Gateway, Ocelot, Kong, custom gateway patterns\n- **Gateway aggregation\u002Fcomposition**: Document how the gateway combines responses from multiple backend services (e.g., fetching owner details from one service and visit history from another, then merging them into a single response). Note the composition logic and fallback behavior when a downstream service is unavailable.\n- **Client-side load balancing**: Spring Cloud LoadBalancer, Ribbon, or framework-provided balancing\n- **Startup dependency chain**: Briefly note the service startup order if it affects API availability. For full details (probes, wait mechanisms, timeouts), refer to `configuration-inventory.md`.\n- **Security posture**: Note whether transport security (HTTPS\u002FTLS), authentication (JWT, OAuth2, Basic Auth, Spring Security), or authorization (RBAC, `@PreAuthorize`, role checks) are implemented at the API level. If absent, state it explicitly — e.g., \"No authentication or TLS configured; all endpoints are publicly accessible with no authorization checks.\" Do NOT duplicate CWE security scan findings; focus only on presence or absence at the API contract level.\n\n### Step 6: Generate Service Technology Matrix Section\n\nFor each service, identify which cross-cutting capabilities it uses and produce the complete `## Service Technology Matrix` section:\n\n- Web framework (MVC, Reactive\u002FWebFlux, Minimal API)\n- Data access (JPA, EF Core, Mongoose, etc.)\n- Service discovery (client, server, or none)\n- Gateway functionality\n- Actuator\u002Fhealth checks\n- Caching layer\n- Metrics export (Prometheus, Application Insights, etc.)\n\n### Step 7: Generate Service Communication Sequence Section\n\nCreate a **Mermaid `sequenceDiagram`** and produce the complete `## Service Communication Sequence` section (re-read the Safety Constraints above before writing):\n- Show key actors: Client, API Gateway (if present), Controllers, Services, External Services, Message Brokers\n- Annotate synchronous calls with solid arrows and asynchronous calls with dashed arrows\n- Include request\u002Fresponse types where relevant\n- Show error handling paths for critical flows (circuit breaker, retry)\n- For gateway aggregation flows, show how multiple downstream calls are composed\n\nReference example (this block satisfies every Safety Constraint — match its shape):\n\n\u003C!-- mermaid-checked: every participant uses `participant Id as \"Label\"`, no \\n in aliases\u002Fmessages\u002Fnotes, every alt\u002Fopt\u002Floop closed by end, no `:` inside any alias -->\n~~~mermaid\nsequenceDiagram\n    participant Client as \"Client\"\n    participant Gateway as \"API Gateway\"\n    participant CustSvc as \"Customers Service\"\n    participant VisitSvc as \"Visits Service\"\n    participant DB as \"Database\"\n\n    Client->>Gateway: GET \u002Fapi\u002Fgateway\u002Fowners\u002F1\n    Gateway->>CustSvc: GET \u002Fowners\u002F1\n    CustSvc->>DB: findById(1)\n    DB-->>CustSvc: Owner + Pets\n    CustSvc-->>Gateway: OwnerDetails(pets=[Pet1,Pet2])\n    Gateway->>VisitSvc: GET \u002Fpets\u002Fvisits?petId=1,2\n    alt Visits Service Available\n        VisitSvc->>DB: findByPetIdIn([1,2])\n        DB-->>VisitSvc: Visits list\n        VisitSvc-->>Gateway: Visits(items=[...])\n    else Circuit Breaker Open\n        Gateway-->>Gateway: Fallback - empty visits\n    end\n    Gateway->>Gateway: Merge visits into pets\n    Gateway-->>Client: 200 OwnerDetails + Visits\n~~~\n\n### Step 8: Save Output\n\nSave to `.github\u002Fmodernize\u002Fassessment\u002Fengines\u002Ffacts\u002Fapi-service-contracts.md` with this exact structure:\n\n```\n# API & Service Communication Contracts\n\nA brief introduction (1-2 sentences) summarizing the API surface and communication patterns found.\n\n## Service Catalog\n\n[Table: Service | Port | Category | Purpose]\n\n## API Endpoints Inventory\n\n[Table: Service | Method | Path | Request Type | Response Type]\n\n## Management & Observability Endpoints\n\n[Table: Service | Endpoint | Custom Metrics (if any)]\n\n## DTOs & Contracts\n\n[Description of gateway-level DTOs vs service-level entities, immutability, serialization]\n\n## Communication Patterns\n\n[Description of sync\u002Fasync patterns, gateway aggregation\u002Fcomposition logic, circuit breaker\u002Fretry policies with timeout values, service discovery, startup dependency chain, and security posture (authentication\u002Fauthorization\u002FTLS — or explicit statement that none is configured)]\n\n## Service Technology Matrix\n\n[Table: Service | Web | Data Access | Discovery | Gateway | Actuator | Cache | Metrics]\n\n## Service Communication Sequence\n\n\u003C Mermaid sequenceDiagram here >\n```\n\n## Scaling Rules\n\n- If the project has **more than 30 endpoints**, group by service\u002Fcontroller and show representative endpoints per group\n- Keep the sequence diagram under **40 participants and messages** to ensure readability and GitHub rendering compatibility\n- For multi-module projects, focus on inter-module communication in the sequence diagram and list all endpoints in the table\n- Aggregate similar endpoints (e.g., CRUD operations on the same resource) into one table row if needed for brevity\n- For the service technology matrix, use checkmarks or short labels; omit columns where no service uses the capability\n\n## Common failure patterns observed in past runs\n\nEach row below is something the model actually produced that crashed the diagram. Use the ✅ form.\n\n| ❌ Past mistake | ✅ Safe form | Why the ❌ crashed |\n|---|---|---|\n| `participant API` (no alias) | `participant API as \"API\"` | Bare participants with later spaces in usage break |\n| `participant API as \"REST API\\n(SubsonicController)\"` | `participant API as \"REST API (SubsonicController)\"` | Literal `\\n` in alias |\n| `participant API as \"REST API: port 8080\"` | `participant API as \"REST API (port 8080)\"` | `:` in alias collides with message delimiter |\n| `Note over Client,API: First fact\\nSecond fact` | Two consecutive `Note over Client,API: ...` lines | `\\n` in note text |\n| `alt happy path` ... missing `end` | `alt happy path` ... `end` | Unclosed block |\n| `participant Svc as Order Service` (no quotes) | `participant Svc as \"Order Service\"` | Multi-word alias must be quoted |\n\n## Error Handling\n\n- **Unsupported project type**: Output a single line: `> ERROR: Unsupported project type. This skill supports Java, .NET, JavaScript, and TypeScript projects only.`\n- **No API endpoints found**: Output: `> ERROR: No recognized API endpoints found at workspace-path. Verify the path is correct.`\n- **Insufficient info**: Generate a best-effort document from available data. Add a note: `> Note: Some endpoints or communication patterns could not be fully identified.`\n\n## Success Criteria\n\n- Service catalog table lists all discovered services with ports, categories, and purposes\n- API endpoints table lists all discovered endpoints with HTTP method, path, and types\n- Management\u002Fobservability endpoints are cataloged with custom metric names\n- Gateway aggregation\u002Fcomposition patterns are documented with fallback behavior\n- Service technology matrix shows per-service capabilities\n- Communication patterns section describes sync\u002Fasync patterns, resilience policies, and security posture (authentication, authorization, TLS — explicitly stating if none is configured)\n- Mermaid sequence diagram renders correctly showing primary request flow with aggregation and fallback\n- The ```mermaid block is preceded by the `\u003C!-- mermaid-checked: ... -->` attestation comment\n- File saved to `.github\u002Fmodernize\u002Fassessment\u002Fengines\u002Ffacts\u002Fapi-service-contracts.md`\n",{"name":5,"description":7},"main","a9c9469d86e9dc078018e8fb391abc7744088078","plugins\u002Fgithub-copilot-modernization\u002Fskills\u002Fapi-service-contracts",15,"https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fgithub-copilot-modernization","https:\u002F\u002Fgithub.com\u002Fmicrosoft","https:\u002F\u002Fopensource.microsoft.com","Open source projects and samples from Microsoft","2026-09-24 00:17:59",{"source":9,"skillName":5,"commands":48,"prompt":58,"zipAvailable":59},[49,52,55],{"tool":50,"command":51},"npx","npx skills add microsoft\u002Fgithub-copilot-modernization --skill api-service-contracts",{"tool":53,"command":54},"bunx","bunx skills add microsoft\u002Fgithub-copilot-modernization --skill api-service-contracts",{"tool":56,"command":57},"pnpm","pnpm dlx skills add microsoft\u002Fgithub-copilot-modernization --skill api-service-contracts","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fgithub-copilot-modernization\u002Fblob\u002Fmain\u002Fplugins\u002Fgithub-copilot-modernization\u002Fskills\u002Fapi-service-contracts\u002FSKILL.md",true,[],[62,79,96,113,128,140],{"skillNo":63,"name":64,"nameZh":65,"description":66,"descriptionZh":67,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":68,"categories":69,"keywords":76,"publishedAt":33},"01M69B5DBRA354JMQRZP3D1X3X","verify-test-baseline","迁移后基线测试验证","Generate and run post-migration tests from the frozen baseline specification.","根据冻结的基线规范生成并运行迁移后测试。","https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fgithub-copilot-modernization\u002Fblob\u002Fmain\u002Fplugins\u002Fgithub-copilot-modernization\u002Fskills\u002Fverify-test-baseline\u002FSKILL.md",[70,73],{"categoryNo":71,"categoryName":72,"taxonomyType":23,"taxonomyTypeDesc":24},"01M8BQGD5WG86P4AQ5GPSSKBFR","测试工程师",{"categoryNo":74,"categoryName":75,"taxonomyType":28,"taxonomyTypeDesc":29},"01M8BQJH394GT47X57A9Q8G7HX","测试与质量保障",[77,78],"test","verify test baseline",{"skillNo":80,"name":81,"nameZh":82,"description":83,"descriptionZh":84,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":85,"categories":86,"keywords":93,"publishedAt":33},"01M69B5BJWPCN41J5ZAR2XFMBR","team-request","团队连接信息与密钥申请","How team members request infrastructure connection info and handle secrets in team mode","团队成员如何在团队模式下申请基础设施连接信息并处理密钥","https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fgithub-copilot-modernization\u002Fblob\u002Fmain\u002Fplugins\u002Fgithub-copilot-modernization\u002Fskills\u002Fteam-request\u002FSKILL.md",[87,90],{"categoryNo":88,"categoryName":89,"taxonomyType":28,"taxonomyTypeDesc":29},"01M8BRK82SYBDNZ3SG8YAH5A3D","凭证与密钥管理",{"categoryNo":91,"categoryName":92,"taxonomyType":23,"taxonomyTypeDesc":24},"01M8BS5011KJDVSRXG1DC4P666","普通用户",[94,95],"team request","infrastructure",{"skillNo":97,"name":98,"nameZh":99,"description":100,"descriptionZh":101,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":102,"categories":103,"keywords":110,"publishedAt":33},"01M69B58TZ7SNTPB6C508M5HWX","team-charters","多智能体团队角色章程","Provides role charters (mission, ownership, core principles, quality bar) for a multi-agent coding team. Each charter defines the role's mission, ownership scope, core principle (boundary constraints), and quality bar. Most roles also include communication rules. Consumed by the coordinator during task decomposition to assign work to the correct role.\nTriggers: \"look up role charter\", \"what does the architect own\", \"check role boundaries\", \"find team roles\", \"which role handles X\", \"list agent charters\", \"role responsibilities\".\nNOT for: task decomposition (use breaking-down-tasks), implementation (use implementing-code), architecture analysis (use analyzing-architecture).","为多智能体编码团队提供角色章程（使命、职责范围、核心原则、质量标杆）。每份章程定义该角色的使命、职责范围、核心原则（边界约束）和质量标杆。大多数角色还包含沟通规则。协调者在任务分解时读取这些章程，以将工作分配给正确的角色。\n触发场景：\"查找角色章程\"、\"架构师负责什么\"、\"检查角色边界\"、\"查找团队角色\"、\"哪个角色处理 X\"、\"列出智能体章程\"、\"角色职责\"。\n不适用于：任务分解（使用 breaking-down-tasks）、代码实现（使用 implementing-code）、架构分析（使用 analyzing-architecture）。","https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fgithub-copilot-modernization\u002Fblob\u002Fmain\u002Fplugins\u002Fgithub-copilot-modernization\u002Fskills\u002Fteam-charters\u002FSKILL.md",[104,107],{"categoryNo":105,"categoryName":106,"taxonomyType":28,"taxonomyTypeDesc":29},"01M8BRN0DBCRG4XGJMB6QQEP11","编码任务委派",{"categoryNo":108,"categoryName":109,"taxonomyType":23,"taxonomyTypeDesc":24},"01M8BRZZF9D7PVFN5MXSPWWD61","AI 工程师",[111,112],"team charters","architecture",{"skillNo":114,"name":115,"nameZh":116,"description":117,"descriptionZh":118,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":119,"categories":120,"keywords":125,"publishedAt":33},"01M69B56JVPKCS2WWVSCZXHEZJ","struts-to-spring","Struts 2 至 Spring Boot 迁移","Migration guideline for transforming Apache Struts 2 applications to Spring Boot 3.x and Spring MVC.","将 Apache Struts 2 应用程序迁移到 Spring Boot 3.x 和 Spring MVC 的迁移指南。","https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fgithub-copilot-modernization\u002Fblob\u002Fmain\u002Fplugins\u002Fgithub-copilot-modernization\u002Fskills\u002Fstruts-to-spring\u002FSKILL.md",[121,124],{"categoryNo":122,"categoryName":123,"taxonomyType":28,"taxonomyTypeDesc":29},"01M8BQ6TKQDF2K4KQS863Q79P4","开发参考",{"categoryNo":21,"categoryName":22,"taxonomyType":23,"taxonomyTypeDesc":24},[126,127],"struts to spring","boot",{"skillNo":129,"name":130,"nameZh":131,"description":132,"descriptionZh":133,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":134,"categories":135,"keywords":138,"publishedAt":33},"01M69B54QQ6K8SDZ8MJYEKBYHJ","spring-boot-scaffolding","Spring Boot 项目脚手架搭建","Reference guide for creating a new Spring Boot project during rewrite migration.","在重写迁移过程中创建新 Spring Boot 项目的参考指南。","https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fgithub-copilot-modernization\u002Fblob\u002Fmain\u002Fplugins\u002Fgithub-copilot-modernization\u002Fskills\u002Fspring-boot-scaffolding\u002FSKILL.md",[136,137],{"categoryNo":122,"categoryName":123,"taxonomyType":28,"taxonomyTypeDesc":29},{"categoryNo":21,"categoryName":22,"taxonomyType":23,"taxonomyTypeDesc":24},[127,139],"spring boot scaffolding",{"skillNo":141,"name":142,"nameZh":143,"description":144,"descriptionZh":145,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":146,"categories":147,"keywords":154,"publishedAt":33},"01M69B52T5G9CZWHYXWP22WEKY","sharing-learnings","项目经验教训记录与共享","How to record project learnings so that later-phase workers and future agent runs can consume them.","介绍如何记录项目经验教训，以便后续阶段的工作者和未来的智能体运行能够参考使用。","https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fgithub-copilot-modernization\u002Fblob\u002Fmain\u002Fplugins\u002Fgithub-copilot-modernization\u002Fskills\u002Fsharing-learnings\u002FSKILL.md",[148,151],{"categoryNo":149,"categoryName":150,"taxonomyType":28,"taxonomyTypeDesc":29},"01M8BRFRAYBCBW9WKDY9TCSHY3","知识管理与沉淀",{"categoryNo":152,"categoryName":153,"taxonomyType":23,"taxonomyTypeDesc":24},"01M8C31AVFVV99RWJEGF9PS85F","项目经理",[155],"sharing learnings"]