update-samples

$npx mdskill add microsoft/aspire.dev/update-samples

This skill synchronizes the samples data file with the `microsoft/aspire-samples` GitHub repository. It enumerates all sample projects in the `samples/` directory, fetches each sample's README.md, and generates a structured JSON catalog.

SKILL.md

.github/skills/update-samplesView on GitHub ↗
---
name: update-samples
description: Update the samples data file by fetching sample metadata from the microsoft/aspire-samples GitHub repository. Use when adding new samples, refreshing sample data, or ensuring samples.json stays in sync with the upstream repo.
---

# Update Samples Data

This skill synchronizes the samples data file with the `microsoft/aspire-samples` GitHub repository. It enumerates all sample projects in the `samples/` directory, fetches each sample's README.md, and generates a structured JSON catalog.

## Overview

The aspire.dev site maintains a data file for samples:

- **`src/frontend/src/data/samples.json`** — Sample metadata including titles, descriptions, tags, deep links, and README content extracted from the upstream repo.

This skill keeps that file in sync with the `microsoft/aspire-samples` repository on GitHub.

## Prerequisites

- Node.js installed and available on `PATH`
- Working directory is the repository root
- The frontend project dependencies are installed (`pnpm install` in `src/frontend/`)
- Optional: `GITHUB_TOKEN` environment variable for higher GitHub API rate limits

## Step-by-Step Process

### 1. Run the update script

Fetch the latest sample data from the GitHub API:

```bash
cd src/frontend && node scripts/update-samples.js
```

This writes updated sample metadata to `src/frontend/src/data/samples.json`. The script queries the GitHub Contents API for directories in `microsoft/aspire-samples/samples/`, fetches each sample's README.md, and extracts structured metadata.

### 2. What the script does

For each subdirectory in `samples/`:

1. **Lists directories** — Calls the GitHub Contents API to enumerate entries in `samples/` and filters to directories only (skipping files like `global.json`, `Directory.Build.props`).

2. **Fetches README.md** — Downloads the raw README.md for each sample directory.

3. **Extracts metadata** from the README:
   - **`name`** — The directory name (e.g., `aspire-shop`)
   - **`title`** — Extracted from the first `# heading` in the README
   - **`description`** — The first paragraph of body text after the title (before any `##` heading)
  - **`href`** — Deep link to the sample on GitHub: `https://github.com/microsoft/aspire-samples/tree/main/samples/{name}`
   - **`readme`** — The full Markdown content of the README.md, with image paths rewritten to local assets (see below)
   - **`tags`** — Auto-detected tags based on technologies, languages, services, and features mentioned in the README and directory name
   - **`thumbnail`** — Local asset path to the first image referenced in the README (if any), or `null`

4. **Downloads images** — For each image referenced in the README (`![alt](src)`):
   - Resolves the remote URL (relative paths are resolved against the GitHub raw content URL)
   - Downloads the image to `src/frontend/src/assets/samples/{name}/{filename}`
   - Rewrites the image reference in the README to use the local asset path: `~/assets/samples/{name}/{filename}`
   - This ensures images are bundled with the site and served locally rather than hotlinked from GitHub

5. **Writes output** — Saves the result as a sorted JSON array to `src/frontend/src/data/samples.json`.

### 3. Tag detection

Tags are automatically inferred from the README content and sample name. The script detects:

#### Languages
| Tag | Matched by |
|---|---|
| `csharp` | C#, .NET references |
| `python` | Python references |
| `javascript` | JavaScript references |
| `node` | Node.js references |
| `go` | Go/Golang references |

#### Services & Technologies
| Tag | Matched by |
|---|---|
| `redis` | Redis references |
| `postgresql` | PostgreSQL, Postgres, Npgsql references |
| `sql-server` | SQL Server, MSSQL references |
| `mysql` | MySQL references |
| `mongodb` | MongoDB references |
| `rabbitmq` | RabbitMQ references |
| `kafka` | Kafka references |
| `prometheus` | Prometheus references |
| `grafana` | Grafana references |
| `docker` | Docker, container references |

#### Azure Services
| Tag | Matched by |
|---|---|
| `azure` | Azure references |
| `azure-functions` | Azure Functions references |
| `azure-storage` | Azure Storage references |
| `azure-service-bus` | Azure Service Bus references |

#### Frameworks & Features
| Tag | Matched by |
|---|---|
| `blazor` | Blazor references |
| `orleans` | Orleans references |
| `grpc` | gRPC references |
| `ef-core` | Entity Framework Core references |
| `metrics` | Metrics, OpenTelemetry references |
| `health-checks` | Health check references |
| `containers` | Container build/deployment references |
| `databases` | Database-related references |
| `migrations` | Database migration references |
| `volumes` | Volume mount references |
| `dashboard` | Dashboard references |

### 4. Output format

The output `samples.json` is a JSON array with entries like:

```json
[
  {
    "name": "aspire-shop",
    "title": "Aspire Shop",
    "description": "The app consists of four .NET services including a Blazor frontend, catalog API, catalog database manager, and basket service.",
    "href": "https://github.com/microsoft/aspire-samples/tree/main/samples/aspire-shop",
    "readme": "# Aspire Shop\n\n![Screenshot...](~/assets/samples/aspire-shop/aspireshop-frontend-complete.png)...",
    "tags": ["csharp", "blazor", "postgresql", "redis", "grpc", "ef-core"],
    "thumbnail": "~/assets/samples/aspire-shop/aspireshop-frontend-complete.png"
  }
]
```

### 5. Manual review

After running the script:

- **Review new entries** — Verify titles and descriptions are meaningful
- **Check tags** — The auto-detection may miss niche technologies; manually add tags if needed
- **Verify thumbnails** — Ensure image URLs resolve correctly
- **Remove stale samples** — The script automatically handles this since it rebuilds from source

### 6. Environment variables

| Variable | Required | Description |
|---|---|---|
| `GITHUB_TOKEN` | No | GitHub personal access token for higher API rate limits (60 → 5000 requests/hour) |
| `SAMPLES_BRANCH` | No | Override the `microsoft/aspire-samples` ref to fetch from (default `main`). Useful for staging `samples.json` against a still-open upstream PR — set to the PR's head ref. The generated `href` fields stay anchored to `main` so links remain valid after the PR branch is deleted. |

### 7. Integration with build

The script is registered as an npm script in `src/frontend/package.json`:

```bash
pnpm update:samples
```

It is also included in the `update:all` aggregate script so it runs alongside other data updates during builds.

More from microsoft/aspire.dev

SkillDescription
aspireOrchestrates Aspire distributed applications using the Aspire CLI for running, debugging, and managing distributed apps. USE FOR: aspire start, aspire stop, start aspire app, aspire describe, list aspire integrations, debug aspire issues, view aspire logs, add aspire resource, aspire dashboard, update aspire apphost. DO NOT USE FOR: non-Aspire .NET apps (use dotnet CLI), container-only deployments (use docker/podman), Azure deployment after local testing (use azure-deploy skill). INVOKES: Aspire CLI commands (aspire start, aspire describe, aspire otel logs, aspire docs search, aspire add), bash. FOR SINGLE OPERATIONS: Use Aspire CLI commands directly for quick resource status or doc lookups.
container-imagesExtracts all container image references (registry, image, tag) from the microsoft/aspire source code and produces a JSON data file for the aspire.dev Astro site. USE FOR: update container images JSON, refresh container image data, list all aspire container images, sync container image versions, generate container-images.json. DO NOT USE FOR: updating the container image versions in aspire source code itself (that's a product repo change), NuGet package data (use the integrations skill), or Dockerfile-based images for dev containers. INVOKES: bash, file read/write. FOR SINGLE OPERATIONS: Use grep/find to quickly check a single image tag.
doc-pr-reviewerReviews a single documentation pull request for the aspire.dev repository, verifying that every factual claim it makes about Aspire matches its source of truth — microsoft/aspire (core), CommunityToolkit/Aspire (toolkit integrations), and optionally Azure/azure-sdk-for-net (Azure provisioning APIs) — and validating the docs as a new user would via the doc-tester skill. Use when asked to review, verify, or audit a specific docs PR for accuracy.
doc-testerAgent for validating Aspire documentation against actual behavior. Use when auditing documentation accuracy, testing examples, or identifying discrepancies between documentation and implementation.
getting-started-with-aspireUse this skill when a developer asks how to begin using Aspire — installing the Aspire CLI, creating a new Aspire app, running it locally, or finding the authoritative docs, integration catalog, or API reference on aspire.dev. Use it for questions like \"how do I install aspire?\", \"how do I create a new aspire app?\", \"how do I run my aspire app?\", or \"where is the documentation for aspire?\". Do not use it for operating an existing Aspire AppHost (use the official `aspire` skill at github.com/microsoft/aspire/tree/main/.agents/skills/aspire), authoring AppHost code, or adding integrations to an existing app.
playwright-cliAutomates browser interactions for web testing, form filling, screenshots, and data extraction. Use when the user needs to navigate websites, interact with web pages, fill forms, take screenshots, test web applications, or extract information from web pages.
twoslash-validatorValidate and fix two-slash TypeScript examples for aspire.dev. Use when adding or editing `twoslash` code fences, TypeScript AppHost samples, generated TypeScript API data, or failures from `pnpm test:unit:twoslash-blocks`.
update-integrationsUpdate integration documentation links and API reference data by synchronizing NuGet package names with their documentation URLs and generating per-package API schemas. Use when adding new integrations, refreshing package data, ensuring integration-docs.json stays in sync with aspire-integrations.json, or regenerating API reference JSON files.
whatsnewStep-argument skill that formalizes writing an Aspire \"What's new in N.N\" release-notes page (src/frontend/src/content/docs/whats-new/aspire-N-N.mdx) as a repeatable lifecycle. Invoke as `/whatsnew {modality}` where modality is one of: draft/scaffold (init), research, critique, validate, polish, review. USE FOR: start/scaffold a new what's-new page for a release, research a release's changes into a dossier and author the draft prose, critique a draft, fact-check/validate the diff, polish and run data ingestion, or sign off the PR. DO NOT USE FOR: general docs pages (use doc-writer), reviewing an arbitrary docs PR (use doc-pr-reviewer), or product-repo changes. ORCHESTRATES: doc-writer, doc-pr-reviewer, doc-tester, twoslash-validator, update-integrations, update-samples, container-images.