Getting Started

Sample Code

If you've never used PlotStax before, the sample .NET solutions each provide a working introduction to the code.

Creating Your First PlotStax Solution

If you've already looked at the sample applications and want to set up a completely new solution with PlotStax, the basic steps are listed below along with some tips.

If you prefer to tell an LLM-based coding tool to start a new solution, you can guide it to this path for learning the PlotStax API:

https://plotcourse.com/llms.txt

If you're using Claude Code, here's an example CLAUDE.md. NOTE: This is only an example and intended for review and modification to meet your needs.

1. Start with an empty .NET Aspire solution targeting .NET 10 and .NET Aspire SDK version 13 or higher using Visual Studio 2026.

2. Decide on what solution folders you want to use, if any. Folders containing the word "Shared", "Contract", "Client", or "Component"* are specially recognized by PlotStax so that when it generates projects of these types they'll be placed in the matching folder. This is completely optional and the absence of folders won't negatively impact tool behavior. The folders can be added quickly by pasting the following into the solution file:

<Folder Name="/0 - Code Generation/" /> <Folder Name="/1 - AppHostAndContainers/" /> <Folder Name="/2 - Shared/" /> <Folder Name="/3 - Contracts/" /> <Folder Name="/4 - Clients/" /> <Folder Name="/5 - Tests/" />

*A "Components" folder is not included in the suggested folders here but could be added if desired. By leaving it out, the main component projects that will contain most of the dev-managed code for your solution remain easiest to access in the root of the solution.

3. Add at least one project using the template "ASP.NET Core Web API" and enlist it in .NET Aspire orchestration. If using solution folders, the suggested folder for this project is "1 - AppHost and Containers".

4. Add Console App projects for a Generator and Initializer. Both should reference the NuGet package "PlotStax.Gen.Client" as well as the AspNetCore framework. The framework reference can just be pasted into the csproj files:

<ItemGroup> <FrameworkReference Include="Microsoft.AspNetCore.App" /> </ItemGroup>

And the Initializer project should reference your .NET Aspire App Host project.

5. The Program.cs of the Initializer project can then have something like this (replacing "Earth" with your solution name):

using PlotStax.Gen.Client; var initializer = new Initializer<Projects.Earth_AppHost>("Earth"); initializer .UseAllAvailableProjectsAsWebApis() .WriteFiles();

6. After running the Initializer project to setup some Generator files, the next step is to change how the token is configured in the Generator "Solution.cs", typically by changing it to pull the token from the registry using "WithStoredToken()". If the token hasn't been stored in the registry yet, a one time call to "WithTokenAndStoreInRegistry" can be used to put it there. When using the registry to store the token, the Generator project file should ideally be changed to make the registry (Windows) dependency clear in the build. This can be done in the csproj file by adding -windows to the target framework, like this:

<TargetFramework>net10.0-windows</TargetFramework>

7. The Generator is ready now for defining your application. Minimally, the Program.cs will have something like this:

using PlotStax.Gen.Client; using Earth.Generator; var slnBuilder = Solution .GetSolutionBuilder(); slnBuilder.Build();

8. Consider filtering your first run to report the basic project structure to confirm it's what you want before writing the files. This can be done like this:

slnBuilder.WithFileFilter(f => { if (f.EndsWith(".csproj") || f.EndsWith("vite.config.ts")) { Console.WriteLine(f); } return false; });

9. If you're designing a large-scale application with sets of components that will repeat a consistent pattern, such as a particular structure per application domain, you might want to consider using the Initializer to generate component definitions from a template.