Guidance for AI agents and coding assistants working in this repository.
Prereqs
- Install the .NET SDK from
global.json:dotnet --list-sdksto verify. - Install Blazor WASM tooling once:
dotnet workload install wasm-tools. - IDE users can open
Pkmds.slnx. CLI builds target individual projects (e.g.,Pkmds.Web.csproj).
Local dev (Blazor WASM)
- From repo root (PowerShell):
./watch.ps1- Equivalent from
Pkmds.Web:dotnet watch run -c Debug -v n --no-hot-reload - Launch profiles expose: http
http://localhost:5283, httpshttps://localhost:7267(seePkmds.Web/Properties/launchSettings.json).
- Equivalent from
Restore and build
- Restore:
dotnet restore - Build Web (Debug/Release):
dotnet build Pkmds.Web/Pkmds.Web.csproj -c Debugdotnet build Pkmds.Web/Pkmds.Web.csproj -c Release
Format/lint
- Uses
.editorconfig; Debug builds treat warnings as errors. - Run:
dotnet formatthendotnet build -c Debug.
Tests
- Test project:
Pkmds.Tests(xUnit + bUnit; coverage via coverlet collector). - Run all:
dotnet test -c Release - Filter:
dotnet test --filter "FullyQualifiedName~Namespace.Class.TestMethod"
Publish locally (static site)
dotnet publish Pkmds.Web/Pkmds.Web.csproj -c Release -o release --nologoCopy-Item release/wwwroot/index.html release/wwwroot/404.html -ForceNew-Item -ItemType File release/wwwroot/.nojekyll -Force | Out-Null- Deployable output:
release/wwwroot/.
Directory.Build.props: sets globalTargetFrameworktonet10.0, repo metadata, nullable + implicit usings, andTreatWarningsAsErrorsin Debug.Directory.Packages.props: central package management (PKHeX.Core, MudBlazor, Serilog, FileSystemAccess, etc.).- Projects
Pkmds.Core/(Class Library): PKHeX utilities and extensions. Reusable, UI-independent logic for working with PKHeX.Core (species validation, shiny handling, markings, etc.).Pkmds.Rcl/(Razor Class Library): shared UI/components and services. Tailwind integrated viaTailwind.targets(input atPkmds.Rcl/wwwroot/css/tailwind.input.css). ReferencesPkmds.Core.Pkmds.Web/(Blazor WebAssembly): PWA host. Linking and compression enabled; service worker assets generated on publish. JS libs vialibman.json(crypto-js).Pkmds.Tests/(tests):net10.0, references RCL and Core.
Runtime wiring (Web)
- Serilog to Browser Console with adjustable level (via
LoggingLevelSwitch). - DI:
IAppState,IRefreshService,IAppService, drag/drop, logging service, File System Access, MudBlazor, JS interop. - PKHeX crypto bridged to JS:
RuntimeCryptographyProvider.Aes/Md5set to Blazor providers at startup.
.github/workflows/buildandtest.yml(dev branches; PRs to main):- Setup .NET (from
global.json), install wasm tools, restore/build Web (Release), rundotnet test.
- Setup .NET (from
.github/workflows/main.yml(main):- Setup .NET + wasm tools, restore, publish Web to
release/, copyindex.html→404.html, add.nojekyll, replace%%CACHE_VERSION%%inservice-worker.published.js, deployrelease/wwwroottogh-pages.
- Setup .NET + wasm tools, restore, publish Web to
.github/workflows/codeql.yml: CodeQL for C# and JS/TS (manual C# build step).
This app depends heavily on PKHeX.Core. When implementing features, use the PKHeX WinForms app as a reference for how to leverage PKHeX.Core — both for UI/UX patterns and for understanding the correct API usage. The first place you should look when referencing PKHeX is ../PKHeX/ (or probably ~/Code/PKHeX), which contains the PKHeX WinForms app source code. The PKHeX.Core project within that solution is the library we consume here, and the WinForms app is a separate project that references it. The PKHeX WinForms app is a great reference for how to use PKHeX.Core effectively, as it demonstrates real-world usage of the library's APIs in a production application. If you can't find the source there, the PKHeX Wiki and source code are also valuable resources for understanding how to work with PKHeX.Core.
If you encounter bugs or limitations in PKHeX.Core while working on an issue or PR, note them in a code comment at the relevant site and report them on the GitHub issue or PR you are working on.
- Respect the existing code style. Reference
.editorconfigfor formatting rules; Debug builds treat warnings as errors. - Use
watch.ps1for a consistent local dev experience. - If WASM crypto errors occur, ensure
libman restorehas brought downcrypto-js(or run LibMan in your IDE). CI publishes without requiring LibMan on the runner because the published output contains required assets.