c-sharp-engineer

Implement Project Aegis .NET 8 / Unity-adapter C# from an approved story or failing TDD test: plain systems in src/ProjectAegis.*, MonoBehaviours only at Unity edge. TDD-friendly; path approval unless

SKILL.md

GitHub

C# Engineer — Project Aegis

Primary target is .NET 8 Project Aegis (src/ProjectAegis.*), not a greenfield Unity game. Unity adapter code lives under ProjectAegis.Delegation.UnityAdapter.

TDD with gauntlet / autonomy

When handed a failing xUnit test from /c-sharp-test-engineer (gauntlet Phase D or user TDD):

  1. Confirm RED: dotnet test … --filter <TestName> fails for the right reason.
  2. GitNexus / impact before symbol edits when available; never touch DelegationBridge.cs hotpath or locked-eval surfaces without explicit quarantine.
  3. Minimal production fix only — no drive-by refactors.
  4. GREEN: failing test passes; full dotnet test ProjectAegis.sln count ≥ baseline; ReplayGolden filter still green when sim/delegation changed.
  5. Gauntlet autonomy: skip "May I write" approval when the orchestrator prompt grants override; otherwise ask before Write/Edit.

Layout

Change in Tests in
src/ProjectAegis.Sim/... src/ProjectAegis.Sim.Tests/...
src/ProjectAegis.Data/... src/ProjectAegis.Data.Tests/...
src/ProjectAegis.MissionEditor.Cli/... src/ProjectAegis.MissionEditor.Cli.Tests/...

xUnit + Microsoft.NET.Test.Sdk — not NUnit for core assemblies.


Phase 1: Load Context

Read:

  • The story/spec in the argument, plus any linked architecture sketch or ADR.
  • CLAUDE.md and .claude/docs/coding-standards.md.
  • The existing source the change touches (Glob/Grep for the relevant types and asmdef).

If no architecture contract exists for a non-trivial system, recommend running /c-sharp-architect first rather than inventing structure.


Phase 2: Confirm the Implementation Shape

Restate the contract: which classes/files, where logic lives (plain C# vs. MonoBehaviour edge), how dependencies are injected, and which values are data-driven. Surface ambiguities and ask before coding. Confirm test seams with the acceptance criteria in mind.


Phase 3: Implement

Write code that obeys the C# / Unity standards:

  • Naming: PascalCase members/types, _camelCase private fields, I-interfaces.
  • [SerializeField] private inspector fields; cache components in Awake().
  • No Find/FindObjectOfType/SendMessage/Resources.Load in production code.
  • No allocations in hot paths (no LINQ/closures/string-concat in Update/physics); use pooling, NonAlloc, Span<T>.
  • == null for Unity-object checks; guard destroyed objects.
  • Task/UniTask/Awaitable async; no async void except event handlers; honor CancellationToken.
  • XML doc comments on public APIs; readonly/const where applicable; no boxing.
  • Tunable values from data assets/config, never hardcoded.

If the contract proves unworkable mid-implementation, STOP and escalate to /c-sharp-architect rather than improvising structure.


Phase 4: Approval Gate

Show the full code (or a detailed per-file summary for large changes). Then ask: "May I write this to [filepath(s)]?" List every file. Use Write/Edit only after "yes".


Phase 5: Verify & Hand Off

  • If a build/test command is available, run it and report results honestly (dotnet build/dotnet test, or Unity batchmode where possible).
  • Use AskUserQuestion:
    • [A] Write tests now → /c-sharp-test-engineer
    • [B] Review the code → /c-sharp-reviewer
    • [C] Mark the story done → /story-done
    • [D] Continue with the next piece