Visitar URL original
Ship an AI agent skill in the NuGet package by dennisdoomen · Pull Request #3402 · fluentassertions/fluentassertions · GitHub
Skip to content

Ship an AI agent skill in the NuGet package - #3402

Merged
dennisdoomen merged 4 commits into
fluentassertions:mainfrom
dennisdoomen:claude/fa-skill-nuget-package-62c935
Nov 8, 2026
Merged

dennisdoomen merged 4 commits into
fluentassertions:mainfrom
dennisdoomen:claude/fa-skill-nuget-package-62c935

Conversation

@dennisdoomen

Copy link
Copy Markdown
Member

What

This PR adds an agent skill to the FluentAssertions NuGet package. The skill teaches AI coding agents (Claude Code, GitHub Copilot, Codex, ...) how to write good assertions with Fluent Assertions. It works the same way as in Mockly.

  • SKILL.md (repository root) is based on the documentation. It contains:
    • the main rules, such as "call Should() on the real subject" and "avoid Should().BeTrue()";
    • a rewrite table from weak to expressive assertions, taken from the tips pages;
    • a short reference for each kind of subject, all BeEquivalentTo options, exceptions (sync and async), events, type/architecture assertions, AssertionScope, global configuration, custom assertions and common pitfalls.
  • The package includes the skill under skills/fluentassertions/, with a .gitignore.
  • buildTransitive/FluentAssertions.targets copies both files to .agents/skills/fluentassertions/ in the root of the consuming repository before each build. It finds the root through SourceLink (the git root), the solution directory, or the nearest AGENTS.md. If it finds none, it skips the copy without an error.
  • The copied .gitignore keeps the generated SKILL.md out of source control.
  • Set <FluentAssertionsSkill>false</FluentAssertionsSkill> to turn it off. The introduction page explains this.

How I tested it

  • dotnet pack puts skills/fluentassertions/SKILL.md, skills/fluentassertions/.gitignore and buildTransitive/FluentAssertions.targets in the package.
  • I built a test project in a separate git repository that references the local package. The build copies both files, git ignores SKILL.md, and with FluentAssertionsSkill=false nothing is copied.
  • I compiled the code samples from the skill against the package to make sure the API names and namespaces are correct.

🤖 Generated with Claude Code

Add a SKILL.md, based on the documentation, that teaches AI coding agents
how to write expressive assertions with Fluent Assertions. The package
includes it under skills/fluentassertions, and a buildTransitive targets
file copies it to .agents/skills/fluentassertions in the consuming
repository, together with a .gitignore that keeps the copy out of source
control. Set FluentAssertionsSkill to false to opt out.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Nov 7, 2026

Copy link
Copy Markdown

Qodana for .NET

It seems all right 👌

No new problems were found according to the checks applied

💡 Qodana analysis was run in the pull request mode: only the changed files were checked
☁️ View the detailed Qodana report

Contact Qodana team

Contact us at qodana-support@jetbrains.com

Comment thread SKILL.md Resolved
Comment thread SKILL.md Resolved
- Soften the floating-point rule: exact comparisons are fine for values
  that are not the result of a calculation.
- Explain that assertions inside an AssertionScope must be able to run
  independently, with an example.
- Copy SKILL.md and its .gitignore together or not at all, and never
  overwrite a SKILL.md that Fluent Assertions did not generate.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Projects that build in parallel retry a copy that collides, and an older
version of Fluent Assertions no longer replaces the skill of a newer one.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@jnyrup jnyrup left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No more nit picking from me, time to get pragmatic and try it out.

@dennisdoomen
dennisdoomen merged commit dbcca9b into fluentassertions:main Nov 8, 2026
6 of 7 checks passed
@dennisdoomen
dennisdoomen deleted the claude/fa-skill-nuget-package-62c935 branch November 8, 2026 20:29

This branch is waiting to be deployed

1 waiting deployment
qodana-pr — 0e99a28f Waiting Nov 8, 2026 by dennisdoomen via Qodana Scan #267
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants