From software-engineering
Use when implementing .NET/C# features or bugfixes, writing xUnit tests, working with Testcontainers, or asked to use TDD, write tests first, or do red-green-refactor. Apply to all .NET/C# coding tasks.
How this skill is triggered — by the user, by Claude, or both
Slash command
/software-engineering:tdd-netThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
All code is written test-first. These rules are non-negotiable and apply to every coding task.
All code is written test-first. These rules are non-negotiable and apply to every coding task.
Apply this skill to all coding tasks involving implementation, tests, or refactoring.
PLAN → Write test plan (see development-workflow skill)
RED → Write a failing test for the next behaviour
GREEN → Write minimum code to pass it
REFACTOR → Clean up with all tests green; no new behaviour
REVIEW → Stop. Show diff to user. Await approval.
COMMIT → git commit accepted changes; mark cycle done in plan
Cycles are short — minutes, not hours.
REQUIRED: Follow the development-workflow skill for planning, per-cycle review, and git commits. Use the tdd- prefix for plan files (e.g. .claude/plans/tdd-<feature-name>.md). Each TDD cycle (RED → GREEN → REFACTOR) is one unit of work.
When the first test against a new method won't compile, stub immediately so it can run and fail:
throw new NotImplementedException()Do not implement any real logic at stub stage.
WhenDoingABehaviourThe_outcome_described_in_plain_englishpublic class WhenAddingAUser
{
[Fact]
public async Task The_user_is_created_against_the_correct_account() { }
[Fact]
public async Task A_duplicate_email_returns_a_conflict_response() { }
}
Prefer FluentAssertions (NuGet: FluentAssertions) over bare xUnit Assert.*.
result.Should().Be(42);
user.Should().NotBeNull();
response.StatusCode.Should().Be(HttpStatusCode.Conflict);
users.Should().ContainSingle(u => u.Email == "[email protected]");
act.Should().ThrowAsync<ValidationException>();
Use in-memory implementations. Never use Moq or NSubstitute.
public class InMemoryUserRepository : IUserRepository
{
private readonly List<User> _users = new();
public Task Save(User user)
{
_users.RemoveAll(u => u.Id == user.Id);
_users.Add(user);
return Task.CompletedTask;
}
public Task<User?> GetById(string id) =>
Task.FromResult(_users.FirstOrDefault(u => u.Id == id));
}
When setup recurs, extract a GivenA[Thing] builder. Builder methods name domain state — not raw setters.
var match = new GivenAMatch()
.WithHomeTeam(Team.England)
.ThatIncludesAnInjury()
.Build();
Rules:
GivenA[Thing] or GivenAn[Thing].ThatIsAnAdmin(), .ThatGoesToPenalties()Build() always produces a valid default with no required configurationTest behaviours — observable outcomes from the outside:
Do not test private methods, internal data structures, or how the implementation achieves its result. If a private method feels like it needs its own test, it belongs on a separate class.
Progress through test cases in this order:
Let complexity emerge from the tests — don't anticipate it. One test, one implementation step at a time. Complete red → green → refactor before moving to the next case.
Provides behavioral guidelines to reduce common LLM coding mistakes, focusing on simplicity, surgical changes, assumption surfacing, and verifiable success criteria.
Searches, retrieves, and installs Agent Skills from prompts.chat registry using MCP tools like search_skills and get_skill. Activates for finding skills, browsing catalogs, or extending Claude.
Creates, edits, and optimizes skills for Claude Code, including drafting, evaluating with test prompts, iterating on performance, and improving skill descriptions for better triggering accuracy.
npx claudepluginhub de-anchorite/claude-skills --plugin software-engineering