Skip to main content

Posts

Showing posts from November, 2026

Bending Aspire to your will - Custom icons, URLs and a command to export your OpenAPI spec

I spend a lot of time testing and debugging APIs, and so do my AI agents. Lately I notice that my agents lose time and tokens on it. They look for the right port, guess at endpoints, fight with a terminal, and try to get the database back into a known state. Every run starts with the same detective work. So for this series of posts I picked one scenario and I’m sticking with it: the API-testing loop . The goal is to adapt Aspire so that I (and my agents) can debug and test easily and efficiently. Note: this post is part of a series about the demos from my session “Bending Aspire to your will” . The app is the aspire-shop sample: a frontend, a catalog service, a basket service, a catalog DB manager, PostgreSQL and Redis. The loop I run by hand looks like this: Get the OpenAPI spec Fire a test call at an endpoint Reset the state for a repeatable run Browse and try the API in one place Out of the box, that means four tools and a handful of terminals. The goal i...

Visug XL 2026 - Bending Aspire to your will - Q&A

 After my Aspire talk I got multiple questions. Two of them deserve some further explanation.  How does Testcontainers relate to Aspire?  And do Dev Containers solve the same problem? Both involve containers, so the confusion is understandable. They solve different problems, though. How does Testcontainers relate to Aspire? Both tools start containers for your dependencies (a database, a message broker, a cache). The difference is when and for whom . Testcontainers is a library you call from your test code. It starts a container, waits until it’s ready, and throws it away when the test finishes. Aspire is an application model. In the AppHost you describe your services and their dependencies, and Aspire orchestrates them for your local dev loop, including service discovery, connection strings, telemetry and the dashboard. With Testcontainers , the test owns the infrastructure: var postgres = new PostgreSqlBuilder() .WithImage("postgres:16") .Build(); a...

Visug XL 2026 - Bending Aspire to your will

Yesterday I had the pleasure of presenting “Bending Aspire to Your Will” at VISUG XL , where we celebrated 20 years of the Visual Studio User Group (VISUG). It was a great occasion to share ideas with the developer community, get inspired and see a lot of familiar faces again. I started with a quick tour of Aspire 'as-is': its AppHost, dashboard, resources and observability features. Then, using an API-testing scenario as an example, I showed how to shape and customize Aspire around a developer’s workflow: Customizing dashboard icons and URLs to make resources easier to navigate. Adding a command to export an OpenAPI specification. Running a test call against an API endpoint from the dashboard. Resetting application state by clearing Redis and recreating the database. Creating a custom Scalar resource to bring API references together in one place. The takeaway: Aspire isn’t just a way to run your application locally. Its resource model and extension p...

Setting a spending limit in GitHub Copilot CLI

There’s a moment when you hand a bigger task to Copilot CLI and wonder what it’s going to cost you. By default GitHub Copilot runs until the task is done or until you step in. Yesterday I showed how to tackle this in Claude Code. Today let’s have a look on how GitHub lets you cap that. Remark: Like with Claude Code, this isn’t a token limit. Copilot tracks AI credits, where each credit equals $0.01 USD. Usage depends on the model and the number of tokens consumed. Setting a limit in an interactive session Use /limits set : /limits set max-ai-credits 100 That’s a ceiling of $1.00. The limit applies to the entire session and depletes with every message, no matter how many messages you send.  To remove it again: /limits unset Setting a limit in non-interactive mode When you run the CLI programmatically, pass --max-ai-credits : copilot -p "Run the test suite and fix the failing tests" --max-ai-credits 100 Here the limit applies for the duration of Copilot’s...

Setting a spending limit on a Claude Code session

An agent that runs on its own stops when the task is done, not when your budget is. That’s fine for a quick question, but it’s a different story for a refactoring job in CI or a scheduled run overnight. So, the question becomes: how do you put a ceiling on a Claude Code session? Remark: Strictly speaking you can’t set a token limit. Claude Code caps on spend (tokens × price), so that’s what we’ll use. The naive approach Just run it and see what happens: claude -p "Run the test suite, fix the failing tests in src/ and commit the fix" There is no limit by default. Claude keeps going until it thinks it’s finished, and you find out the cost afterwards. Two flags can help Claude Code has two flags that act as a safety net in print mode ( -p ): claude -p "Run the test suite, fix the failing tests in src/ and commit the fix" \ --max-budget-usd 3.00 \ --max-turns 30 --max-budget-usd stops the run once the estimated spend on API calls reaches the...

Driving your AI agents in ECO mode

Planning and implementing are not the same kind of work. Planning needs a strong reasoning model that explores the codebase and weighs options. Implementing a clear, approved plan is mostly mechanical, and a cheaper, faster model can handle that. Picking one model for everything is not a good idea. You either overpay for the build, or you underpay for the plan. A colleague recently pointed out that JetBrains AI can split this, and it turns out Copilot can do something similar. Let’s look at both. Plan and build in VS Code The Plan agent in VS Code has its own model setting. Two settings matter: { "chat.planAgent.defaultModel": "<planning model>", "github.copilot.chat.implementAgent.model": "<implementation model>" } chat.planAgent.defaultModel is the model used by the Plan agent. github.copilot.chat.implementAgent.model is the model used when you click Start Implementation . Prefer to do it by hand in a Copil...

Let your agents cleanup after they leave your desk

If you let multiple agents work in parallel on your code base, you need a way to start an agent session with code isolation. The typical way to do this is by creating separate Git worktrees for each agent. This avoids that parallel agents overwrite each other’s files. But the sessions pile up, and so do the worktrees. Each one is a full checkout on your disk. Until recently I did the cleanup work myself, but now VSCode has a worktree cleanup feature to deal with this. Why do we need this? Before this feature, you had two options: do it by hand or ignore it. By hand meant something like this: git worktree list git worktree remove <path> git worktree prune That works. But it doesn’t tell you which worktree belongs to which agent session, whether the session is still relevant, or how much space you’ll get back. Archive, done or delete? Cleanup builds on how VS Code already finishes sessions. There are three actions: Close a chat tab: hides the conversation, not...

Track used skills, agents and MCP servers with the Copilot usage metrics API

As part of our AI adoption journey, we wanted to know which custom skills, agents and MCP servers were actually in use. So, we built a small tool that scanned our repositories for SKILL.md files, .agent.md files and MCP configuration. It worked, but it answered the wrong question. It told us what existed , not what developers used . The Copilot usage metrics API now closes that gap. What changed? In September the API got CLI customization metrics. The catch: every customer-defined skill, agent and MCP server was grouped under other , and slash commands under custom . Useful for trends, useless for “is our new skill being used?”. Since October 22, the totals_by_skill , totals_by_custom_agent , totals_by_mcp , totals_by_slash_cmd and totals_by_plugin arrays show the configured name of your own items. Each list also holds up to 25 entries per record, up from five. Remark: names are reported from Copilot CLI, the Copilot app, clients built on the Copilot SDK (like VS Code ...

Strongly typed IDs in .NET with Vogen

What does this method signature tell you? public Task<Order> GetOrder(Guid customerId, Guid orderId) Nothing that stops you from calling it like this: await repository.GetOrder(orderId, customerId); It compiles, it runs, and it returns nothing (or worse, the wrong thing). Every ID is a Guid , so the compiler can’t help you. This problem is called primitive obsession. We don't take real advantage of our type system but use any of the built-in primitives instead. The solution The obvious fix is a small wrapper type per ID. A readonly struct or a record does the job, but you end up writing the same boilerplate for every ID: equality, ToString , JSON serialization, a type converter for route binding, an EF Core value converter, Luckily someone already did all the hard work for us and created Vogen. Vogen is a source generator that does all the hard work. Add the package: dotnet add package Vogen And declare your ID: using Vogen; [ValueObject<Guid>]...

Generating architecture diagrams with the Archify skill

Keeping architecture diagrams up to date has always been a lot of work. They are outdated the moment your diagram is saved. Thanks to AI, keeping those diagrams up-to-date became a lot easier. I originally did this just by asking the AI to create and update mermaid diagrams, but recently I started experimenting with Archify . You describe a system in plain words (or point your agent at a codebase), and you get back an interactive HTML diagram. What is Archify? Archify is an agent skill and some tooling around it. It works with Claude Code, Codex, Cursor, OpenCode and GitHub Copilot. What makes it different, is that the agent doesn’t draw the diagram directly. It authors typed JSON that describes the system. Archify then renders that JSON and validates it. The output is a single, self-contained HTML file. Installing the skill For Claude Code: npx -y skills@latest add https://archify.si --skill archify --agent claude-code --global --copy --yes For GitHub Copilot: npx ...

DSC 3.0: running your own PowerShell with getScript, testScript and setScript

Sooner or later you hit a setting that no DSC resource manages. A hosts file entry, a certificate with specific properties, some tweak that only exists as a PowerShell snippet on a wiki page. You know the PowerShell to fix it, but there is no resource to wrap it in. One way is to reach for Microsoft.DSC.Transitional/RunCommandOnSet . It runs a command during the set operation, and that is all it does. There is no test, so DSC cannot tell you whether the machine is in the desired state. But it is a good fit as a temporary transitional resource while migrating DSCv3 resources. There is another option: Microsoft.DSC.Transitional/PowerShellScript . It lets you bring your own getScript , testScript and setScript . Note: If you are new to DSC 3.0 check out my blog series about it: Getting started with DSC 3.0 – Part 1: What is DSC and what changed? Getting started with DSC 3.0 – Part 2: Managing a Windows service end to end Getting started with DSC 3.0 – Part 3: Capturin...

Letting GitHub Copilot drive your desktop with computer use

I'm a big fan of the Automations feature in the GitHub Copilot app. It allows me to focus on the most important stuff and I can schedule and delegate a lot of work in the background. Most of the time, these automations can interact with an API, a CLI or an MCP server. But what if you want to interact with a desktop application that only exists as a GUI, a legacy tool nobody wants to touch, a screen you have to click through by hand every week. That is the gap GitHub is trying to close with the recently introduced 'computer use' feature in the GitHub Copilot app and Copilot CLI. What is computer use? Computer use lets Copilot interact with desktop applications on your behalf. It reads the application content through the accessibility tree of your operating system and takes screenshots when it needs visual context. Then it can click controls, enter and edit text, press keys, scroll and drag. Some facts up front: It is in public preview since October 1, 2026 ...

SQL Server Full-Text Search: when a stop word broke our search

One of our users complained that the search functionality was broken. Searches that should have returned results came back empty. The cause turned out to be a single word: 'both'. If you are new to Full-Text Search, start with my previous post. It explains the building blocks I use below. The problem The search in our application is built on SQL Server Full-Text Search. The terms a user types are combined into a CONTAINS query. A simplified version looks like this: SELECT ProductId, Name FROM dbo.Products WHERE CONTAINS(Description, '"bike" AND "both"'); This returned no rows, even though we knew there were products matching both terms. Searching for "bike" alone worked fine. Looking for the cause The cause is simple:  Stop words Stop words are words that are not indexed because they are considered too common to be useful. SQL Server ships with a system stoplist per language, and 'both' is on the English one: S...

SQL Server Full-Text Search: an overview

Although we have ElasticSearch running in our environment, our most important search functionality is still handled by SQL Server. And no, it is not by writing a statement like WHERE Name LIKE '%term%' . That would probably work on a small table, but we have a lot of data to dig through, so we need something smarter than substring matching. SQL Server has a built-in answer for this: Full-Text Search . In this post I walk through the building blocks and the main features. In the next post I'll show what happened when a customer ran into a surprising side effect. Why do we need this? A LIKE with a leading wildcard can't use an index seek. SQL Server has to scan every row and compare strings. On top of that, LIKE knows nothing about language: searching for 'ride' won't find 'riding', and there is no concept of relevance. Full-text search works differently. It builds an inverted index: a list of words (tokens) and, for every word, the rows wh...