r/dotnet • u/CertifiedNoob5455 • 20d ago
Promotion Wrote an agent skill so AI coding tools stop hallucinating API's for my WPF UIKIT.
I have been building and maintaining UI-Framework a small declarative C# framework and WPF on .NET 10 (MIT). The project was based on my love for swiftui.
Full Disclosure i did use ai tools to help me build it.
After my first initial releases i attempted to use my lib with other tools and it quickly became annoying. The frustration came in when using tools like Claude code or Cursor with a small niche lib, the ais quickly started spitting out code that looked right but either the API's didn't exist or for example they kept treating VStack/Hstack like css flexbox. Creating state<T> inside a Body leading to so any change would then cause a rebuild leaving stable keys off list rows and making up methods that did not exist.
This led me to write an agent skill that exposes the real contract (skills/ui-framework/SKILL.md, install steps in docs/agent-skill.md):
VStack/HStack size to their content. They aren't flexbox.
Keep State<T> out of Body().
Give list rows stable .Id() keys so identity survives updates and reorders.
Check signatures against the installed package version instead of guessing.
Repo: https://github.com/signalnotnoise/ui-framework Install: dotnet add package SignalNotNoise.UI.Wpf --version 1.0
For those maintaining lib, are you utilizing this method.
1
u/Discordbothost 20d ago
tiny typo in the install command: --vesion should be --version. worth fixing before people copy it and get stuck at the install step.
1
1
u/AutoModerator 20d ago
Thanks for your post CertifiedNoob5455. Please note that we don't allow spam, and we ask that you follow the rules available in the sidebar. We have a lot of commonly asked questions so if this post gets removed, please do a search and see if it's already been asked.
I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.
3
u/OccassionalBaker 20d ago
A considered workspace - it looks like every single AI generated UI!