OpenParable
Skip to content
← Back to skills

Nuget Guard

Testing & Quality
nuget-guard

Nuget Guard is an Agent Skill for testing & quality published in the abbaye/WpfHexEditorIDE repository on GitHub: a SKILL.md instruction file an AI agent can load to do this task.

INTERNAL DEV WORKFLOW for WpfHexEditor — Claude self-invokes after editing any *.cs or *.csproj that belongs to one of the 13 packages published on nuget.org by abbaye (WpfHexEditor.Core.ByteProvider, .BinaryAnalysis, WPFHexaEditor, WpfCodeEditor, WpfDocking, WpfColorPicker, WpfTerminal, whfmt.Analysis/.Backfill/.CodeGen/.Fuzz/.Validate/.FileFormatCatalog). Protects the standalone-mode contract when IDE features are added: detects IDE-only references leaking into a NuGet package, TFM drift, UseWPF leak on core-xplat packages, WPF/WinForms usings in core-xplat, and public-API regressions vs git HEAD (api-removed, api-renamed). Extending the API is always allowed; removing/renaming is not. Skip on files outside protected packages, Tests/, Samples/, *.Designer.cs, *.g.cs.

View on GitHub ↗
QUICK START

How to use this skill

Bring this guide into your coding agent with a prompt tailored to the tool you use.

  1. Open your project in Codex.
  2. Copy and paste the prompt below.
  3. Review files and risks before approving any action.
Prompt to paste
Inspect the Agent Skill at https://github.com/abbaye/WpfHexEditorIDE/blob/HEAD/Sources/.claude/skills/nuget-guard/SKILL.md and all supporting files. Report provenance, permissions, scripts, dependencies, and security risks. Propose an exact installation into .agents/skills/nuget-guard, but wait for my approval before writing files or running scripts.

Copying this prompt does not install or run the skill. Review third-party files before use.

nuget-guard (internal)

Protects the standalone contract of the 13 published packages. IDE shell is a consumer — packages must work without it.

Categories:

  • core-xplat (net8.0, zero WPF/WinForms, no IDE refs): ByteProvider, BinaryAnalysis, whfmt.FileFormatCatalog, whfmt.Analysis/Backfill/CodeGen/Fuzz/Validate
  • wpf-control (net8.0-windows, WPF allowed, no WpfHexEditor.App/Editor/Plugins.* refs): WPFHexaEditor, WpfCodeEditor, WpfDocking, WpfColorPicker, WpfTerminal

Full path table: data/package-policy.json. WpfCaret (other repo) not protected.

When I invoke

SituationRun?
Edit *.cs or *.csproj under a protected packageyes
Non-protected csproj, Tests/, Samples/, *.Designer.cs, *.g.cs, XAML/resxno

Pipeline

  1. Resolve edited file's owning csproj → check <PackageId> against policy. Not found → skip.
  2. Run scripts/nuget-guard.ps1 -Files <paths>.
  3. Exit code = ERR count (capped 100). WARN-only ⇒ exit 0.
  4. Suppress: // nuget-ignore: <reason> (reason mandatory).

Rules

RuleSevDetects
nuget-api-removederrorpublic type/member in git HEAD removed from working tree
nuget-api-renamederrorpublic signature removed + similar-named added (rename breaks consumers)
nuget-tfm-drifterror<TargetFramework> doesn't match policy (e.g. ByteProvider must stay net8.0)
nuget-usewpf-leakerror<UseWPF>true or <UseWindowsForms>true on a core-xplat package
nuget-ide-projreferror<ProjectReference> to IDE-only assembly (WpfHexEditor.App/Editor/Plugins.*; Editor.*.Core allowed)
nuget-ide-usingerrorIDE-only type ref (IDEHostContext, IdeMessageBox, DockManager, …)
nuget-wpf-using-in-xplaterrorusing System.Windows.* / System.Windows.Forms / WebView2.* in core-xplat
nuget-version-regressionerror<Version> numerically lower than git HEAD
nuget-release-notes-stalewarn<Version> bumped, <PackageReleaseNotes> unchanged

Extending public API (new types, members, overloads), changing internal/private members, and bumping <Version> upward are all allowed.

Maintenance

  • New NuGet package → add entry in data/package-policy.json.
  • New IDE-only type that must not leak → add to ide_only_types in policy.
  • TFM rollout → update tfm arrays per package in single coordinated commit.