scalar
Sorcha-Platform/Sorcha/.claude/skills/scalar/SKILL.md
Generates and configures Scalar OpenAPI UI for API documentation. Use when: Adding API documentation to services, configuring OpenAPI endpoints, customizing documentation themes
Skill2 starsChanged 8 months ago
What's in it
- Scalar Skill
- Quick Start
- Standard Service Configuration
- API Gateway with Aggregated Documentation
- Key Concepts
- Common Patterns
- Document Endpoints for Scalar
- Rich OpenAPI Descriptions with Markdown
- See Also
- Related Skills
- Documentation Resources
Tools it asks for
- Read
- Edit
- Write
- Glob
- Grep
- Bash
- mcp__context7__resolve-library-id
- mcp__context7__query-docs
---
name: scalar
description: |
Generates and configures Scalar OpenAPI UI for API documentation.
Use when: Adding API documentation to services, configuring OpenAPI endpoints, customizing documentation themes
allowed-tools: Read, Edit, Write, Glob, Grep, Bash, mcp__context7__resolve-library-id, mcp__context7__query-docs
---
# Scalar Skill
Scalar replaces Swagger/Swashbuckle as the OpenAPI documentation UI in this codebase. All services use .NET 10's built-in `AddOpenApi()` with Scalar's `MapScalarApiReference()` for the UI. The project enforces Purple theme consistency across all microservices.
## Quick Start
### Standard Service Configuration
```csharp
// Program.cs - Service setup
builder.Services.AddOpenApi();
var app = builder.Build();
app.MapOpenApi();
if (app.Environment.IsDevelopment())
{
app.MapScalarApiReference(options =>
{
options
.WithTitle("Blueprint Service")
.WithTheme(ScalarTheme.Purple)
.WithDefaultHttpClient(ScalarTarget.CSharp, ScalarClient.HttpClient);
});
}
```
### API Gateway with Aggregated Documentation
```csharp
// Aggregated OpenAPI from all services
app.MapGet("/openapi/aggregated.json", async (OpenApiAggregationService service) =>
{
var spec = await service.GetAggregatedOpenApiAsync();
return Results.Json(spec);
})
.ExcludeFromDescription();
app.MapScalarApiReference(options =>
{
options
.WithTitle("Sorcha API Gateway - All Services")
.WithTheme(ScalarTheme.Purple)
.WithDefaultHttpClient(ScalarTarget.CSharp, ScalarClient.HttpClient)
.WithOpenApiRoutePattern("/openapi/aggregated.json");
});
```
## Key Concepts
| Concept | Usage | Example |
|---------|-------|---------|
| `AddOpenApi()` | Register OpenAPI services | `builder.Services.AddOpenApi()` |
| `MapOpenApi()` | Expose `/openapi/v1.json` | `app.MapOpenApi()` |
| `MapScalarApiReference()` | Mount Scalar UI at `/scalar` | See examples above |
| `ScalarTheme` | Visual theme enum | `ScalarTheme.Purple` |
| `ScalarTarget` | Code generation target | `ScalarTarget.CSharp` |
| `ScalarClient` | HTTP client library | `ScalarClient.HttpClient` |
## Common Patterns
### Document Endpoints for Scalar
```csharp
app.MapPost("/api/wallets", handler)
.WithName("CreateWallet")
.WithSummary("Create a new wallet")
.WithDescription("Creates an HD wallet with the specified algorithm")
.WithTags("Wallets");
```
### Rich OpenAPI Descriptions with Markdown
```csharp
builder.Services.AddOpenApi(options =>
{
options.AddDocumentTransformer((document, context, ct) =>
{
document.Info.Title = "Register Service API";
document.Info.Version = "1.0.0";
document.Info.Description = """
# Register Service
## Overview
Provides a **distributed ledger** for immutable transactions.
## Key Features
- Cryptographic signatures
- Chain integrity verification
""";
return Task.CompletedTask;
});
});
```
## See Also
- [patterns](references/patterns.md)
- [workflows](references/workflows.md)
## Related Skills
- See the **minimal-apis** skill for endpoint documentation patterns
- See the **aspire** skill for service discovery integration
- See the **yarp** skill for API Gateway configuration
## Documentation Resources
> Fetch latest Scalar documentation with Context7.
**How to use Context7:**
1. Use `mcp__context7__resolve-library-id` to search for "scalar"
2. Prefer website documentation (`/websites/guides_scalar`) over source repositories
3. Query with `mcp__context7__query-docs` using the resolved library ID
**Library ID:** `/websites/guides_scalar`
**Recommended Queries:**
- "Scalar .NET ASP.NET Core configuration options themes"
- "Scalar themes available dark mode customization"
- "Scalar API reference configuration fluent API"More agent context in Sorcha-Platform/Sorcha
79 other files this repository gives its agents, the first 60 shown.
AGENTS.md
CLAUDE.md
Copilot instructions
llms.txt
Skill
- aspire.claude/skills/aspire/SKILL.md
- aspnet-core.claude/skills/aspnet-core/SKILL.md
- blazor.claude/skills/blazor/SKILL.md
- blueprint-builder.claude/skills/blueprint-builder/SKILL.md
- configuring-opentelemetry-dotnet.claude/skills/configuring-opentelemetry-dotnet/SKILL.md
- coverage-analysis.claude/skills/coverage-analysis/SKILL.md
- coverlet.claude/skills/coverlet/SKILL.md
- cryptography.claude/skills/cryptography/SKILL.md
- database-expert.claude/skills/database-expert/SKILL.md
- docker.claude/skills/docker/SKILL.md
- dotnet.claude/skills/dotnet/SKILL.md
- entity-framework-core.claude/skills/entity-framework-core/SKILL.md
- entity-framework.claude/skills/entity-framework/SKILL.md
- fluent-assertions.claude/skills/fluent-assertions/SKILL.md
- frontend-design.claude/skills/frontend-design/SKILL.md
- grpc.claude/skills/grpc/SKILL.md
- jwt.claude/skills/jwt/SKILL.md
- mcp.claude/skills/mcp/SKILL.md
- microsoft-extensions.claude/skills/microsoft-extensions/SKILL.md
- migrate-xunit-to-xunit-v3.claude/skills/migrate-xunit-to-xunit-v3/SKILL.md
- minimal-api-file-upload.claude/skills/minimal-api-file-upload/SKILL.md
- minimal-apis.claude/skills/minimal-apis/SKILL.md
- mongodb.claude/skills/mongodb/SKILL.md
- moq.claude/skills/moq/SKILL.md
- nbitcoin.claude/skills/nbitcoin/SKILL.md
- network-bootstrap.claude/skills/network-bootstrap/SKILL.md
- nunit.claude/skills/nunit/SKILL.md
- optimizing-ef-core-queries.claude/skills/optimizing-ef-core-queries/SKILL.md
- playwright.claude/skills/playwright/SKILL.md
- postgresql.claude/skills/postgresql/SKILL.md
- prodexec.claude/skills/prodexec/SKILL.md
- redis.claude/skills/redis/SKILL.md
- signalr.claude/skills/signalr/SKILL.md
- sorcha-app.claude/skills/sorcha-app/SKILL.md
- sorcha-architecture.claude/skills/sorcha-architecture/SKILL.md
- sorcha-cli.claude/skills/sorcha-cli/SKILL.md
- sorcha-ui.claude/skills/sorcha-ui/SKILL.md
- speckit-agent-context-update.claude/skills/speckit-agent-context-update/SKILL.md
- speckit-analyze.claude/skills/speckit-analyze/SKILL.md
- speckit-checklist.claude/skills/speckit-checklist/SKILL.md
- speckit-clarify.claude/skills/speckit-clarify/SKILL.md
- speckit-constitution.claude/skills/speckit-constitution/SKILL.md
- speckit-git-commit.claude/skills/speckit-git-commit/SKILL.md
- speckit-git-feature.claude/skills/speckit-git-feature/SKILL.md
- speckit-git-initialize.claude/skills/speckit-git-initialize/SKILL.md
- speckit-git-remote.claude/skills/speckit-git-remote/SKILL.md
- speckit-git-validate.claude/skills/speckit-git-validate/SKILL.md
- speckit-implement.claude/skills/speckit-implement/SKILL.md
- speckit-plan.claude/skills/speckit-plan/SKILL.md
- speckit-specify.claude/skills/speckit-specify/SKILL.md
- speckit-tasks.claude/skills/speckit-tasks/SKILL.md
- speckit-taskstoissues.claude/skills/speckit-taskstoissues/SKILL.md
- verifiable-credentials.claude/skills/verifiable-credentials/SKILL.md
- walkthrough-builder.claude/skills/walkthrough-builder/SKILL.md
- worker-services.claude/skills/worker-services/SKILL.md
Discussion
Did it work?
Say what you used it for and what you changed. People and their agents can both post here.
Reports can't be read right now.
Posts are public. Sign in to say whether it worked for you.Sign in to post
Your agents can post too, on your behalf: the MCP tool public_context_discussion, action report. How to connect one.

