agentleFS
Sorcha-PlatformSorcha-Platform/Sorcha/.claude/skills/yarp/SKILL.md

yarp

Skill2 starsChanged 10 months agoMITView on GitHub

Configures YARP reverse proxy for API gateway routing. Use when: Setting up API gateway routes, configuring path transformations, proxying requests to backend services, or aggregating microservice endpoints.

The file

We split this skill into the rules it gives an agent

1 rule. About 0 are common, 0 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈0

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Use mcp__context7__resolve-library-id to search for "yarp"

    line 114

≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

YARP Skill

YARP (Yet Another Reverse Proxy) is the .NET reverse proxy used for API gateway routing in Sorcha. The gateway routes external requests to internal microservices while handling path transformations, security headers, and CORS. Key pattern: gateway-specific endpoints execute BEFORE MapReverseProxy() which must be called last.

Quick Start

Basic Setup

// Program.cs - Add YARP with configuration-based routes
builder.Services.AddReverseProxy()
    .LoadFromConfig(builder.Configuration.GetSection("ReverseProxy"));

// CRITICAL: MapReverseProxy() must be called LAST
app.MapReverseProxy();

Route Configuration

{
  "ReverseProxy": {
    "Routes": {
      "blueprint-route": {
        "ClusterId": "blueprint-cluster",
        "Match": { "Path": "/api/blueprint/{**catch-all}" },
        "Transforms": [{ "PathPattern": "/api/{**catch-all}" }]
      }
    },
    "Clusters": {
      "blueprint-cluster": {
        "Destinations": {
          "destination1": { "Address": "http://blueprint-service:8080" }
        }
      }
    }
  }
}

Key Concepts

ConceptUsageExample
RouteMaps external path to cluster"Path": "/api/blueprint/{**catch-all}"
ClusterBackend service destination(s)"Address": "http://service:8080"
TransformRewrites path before forwarding"PathPattern": "/api/{**catch-all}"
Catch-allCaptures remaining path segments{**catch-all} or {*any}

Common Patterns

Path Prefix Stripping

When: External API has service prefix, backend doesn't

{
  "Match": { "Path": "/api/blueprint/{**catch-all}" },
  "Transforms": [{ "PathPattern": "/api/{**catch-all}" }]
}

Request: GET /api/blueprint/blueprints → Backend: GET /api/blueprints

Health Endpoint Mapping

When: Unified health checks across services

{
  "blueprint-status-route": {
    "ClusterId": "blueprint-cluster",
    "Match": { "Path": "/api/blueprint/status" },
    "Transforms": [{ "PathPattern": "/api/health" }]
  }
}

X-Forwarded Headers

When: Backend needs original client info

"Transforms": [
  { "PathPattern": "/api/{**catch-all}" },
  { "X-Forwarded": "Set" }
]

See Also

  • patterns - Route patterns and transformations
  • workflows - Setup and testing workflows

Related Skills

  • See the aspire skill for service discovery integration
  • See the minimal-apis skill for gateway-specific endpoints
  • See the jwt skill for authentication pass-through
  • See the docker skill for container networking

Documentation Resources

Fetch latest YARP documentation with Context7.

How to use Context7:

  1. Use mcp__context7__resolve-library-id to search for "yarp"
  2. Query with mcp__context7__query-docs using the resolved library ID

Library ID: /dotnet/yarp

Recommended Queries:

  • "YARP configuration routes clusters transforms"
  • "YARP load balancing health checks"
  • "YARP request transforms path rewriting"

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.