agentleFS
MicrosoftKnown publishermicrosoft/aspire.dev/.agents/skills/update-samples/SKILL.md

update-samples

Skill212 starsChanged 6 months agoMITView on GitHub

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.

  • Reads credentials

The file

We split this skill into the rules it gives an agent

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

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    After running the script:

    line 133

≈ “Common” is an estimate: at least 1 in 5 of the 408,460 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

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 (bun 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:

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
  1. 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
  2. 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

TagMatched by
csharpC#, .NET references
pythonPython references
javascriptJavaScript references
nodeNode.js references
goGo/Golang references
javaJava, Spring Boot, Quarkus, Maven, Gradle references

Services & Technologies

TagMatched by
redisRedis references
postgresqlPostgreSQL, Postgres, Npgsql references
sql-serverSQL Server, MSSQL references
mysqlMySQL references
mongodbMongoDB references
rabbitmqRabbitMQ references
kafkaKafka references
prometheusPrometheus references
grafanaGrafana references
dockerDocker, container references

Azure Services

TagMatched by
azureAzure references
azure-functionsAzure Functions references
azure-storageAzure Storage references
azure-service-busAzure Service Bus references

Frameworks & Features

TagMatched by
blazorBlazor references
orleansOrleans references
grpcgRPC references
ef-coreEntity Framework Core references
metricsMetrics, OpenTelemetry references
health-checksHealth check references
containersContainer build/deployment references
databasesDatabase-related references
migrationsDatabase migration references
volumesVolume mount references
dashboardDashboard references

4. Output format

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

[
  {
    "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

VariableRequiredDescription
GITHUB_TOKENNoGitHub personal access token for higher API rate limits (60 → 5000 requests/hour)
SAMPLES_BRANCHNoOverride 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:

bun run update:samples

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

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.