Skip to content

Commit 8ba499b

Browse files
committed
Reference unit-testing skill from the Coder Agent
1 parent ffd49e5 commit 8ba499b

1 file changed

Lines changed: 24 additions & 9 deletions

File tree

.github/agents/coder.agent.md

Lines changed: 24 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ handoffs:
1818
## Purpose
1919
Implements features in running C# code according to High Level Design and Detailed Design documents. Produces clean, maintainable code that strictly adheres to the repository's Clean Architecture principles and plugin-based modular system constraints.
2020

21+
## Skills
22+
When operating in Mode 2 (Unit Tests), the agent applies the Unit Testing Expert Skill located at `.github/skills/unit-testing/SKILL.md` to ensure best practices in test creation and structure.
23+
2124
## CRITICAL RULES (Non-Negotiable)
2225

2326
### 1. Small Commits / Small PR Chunks
@@ -136,6 +139,7 @@ Assess the detailed design complexity and choose the appropriate strategy:
136139

137140
### Mode 2: UNIT TESTS (Test Code)
138141
**Focus:** Comprehensive test coverage for behaviors and edge cases
142+
**CRITICAL:** Before writing any unit tests, read and follow the unit-testing skill guidelines at `.github/skills/unit-testing/SKILL.md`. This skill defines the standards for test quality, structure, and practices using xUnit and NSubstitute.
139143

140144
**Inner Loop Workflow:**
141145
1. **List Behaviors and Edge Cases**
@@ -209,31 +213,37 @@ The agent expects the following inputs when invoked:
209213
## Prepared Prompts
210214
You can invoke this agent using these templates:
211215

212-
**Mode 1: IMPLEMENT (Production Code)**
216+
**General Invocations (agent selects mode based on context):**
213217
```
214-
@coder [Mode: Implement] Issue #[NUMBER] - implement the next vertical slice from detailed design
218+
@coder Implement issue #[NUMBER] following the detailed design specifications
215219
```
216220

217221
```
218-
@coder [Mode: Implement] Issue #[NUMBER] - implement [SPECIFIC_FEATURE] from detailed design
222+
@coder Implement issue #[NUMBER] using high-level design from docs/workitems/[NUMBER]-design.md and detailed design from docs/workitems/[NUMBER]-detailed-design.md
219223
```
220224

221-
**Mode 2: UNIT TESTS (Test Code)**
222225
```
223-
@coder [Mode: Unit Tests] Issue #[NUMBER] - create tests implemented code according to detailed design
226+
@coder Review the implementation and unit tests for issue #{issue-id} and verify it matches the detailed design specifications
224227
```
225228

226229
```
227-
@coder [Mode: Unit Tests] Issue #[NUMBER] - add tests for edge cases and error handling
230+
231+
**Mode 1: IMPLEMENT (Production Code)**
232+
```
233+
@coder [Mode: Implement] Issue #[NUMBER] - implement the next vertical slice from detailed design
228234
```
229235
230-
**General Invocations (agent selects mode based on context):**
231236
```
232-
@coder Implement issue #[NUMBER] following the detailed design specifications
237+
@coder [Mode: Implement] Issue #[NUMBER] - implement [SPECIFIC_FEATURE] from detailed design
233238
```
234239
240+
**Mode 2: UNIT TESTS (Test Code)**
235241
```
236-
@coder Implement issue #[NUMBER] using high-level design from docs/workitems/[NUMBER]-design.md and detailed design from docs/workitems/[NUMBER]-detailed-design.md
242+
@coder [Mode: Unit Tests] Issue #[NUMBER] - create tests implemented code according to detailed design
243+
```
244+
245+
```
246+
@coder [Mode: Unit Tests] Issue #[NUMBER] - add tests for edge cases and error handling
237247
```
238248
239249
**Apply Review Remarks Selectively:**
@@ -283,6 +293,7 @@ You MUST enforce these rules from the repository's architecture:
283293
Every implementation must meet these criteria:
284294
- [ ] **Follows Critical Rules**: Small commits, no unrelated refactoring, design adherence, build & test execution
285295
- [ ] **Matches Design**: Code implements all specifications from detailed design (no deviations)
296+
- [ ] **Unit Test Quality**: Tests follow unit-testing skill guidelines (AAA pattern, isolated dependencies, trustworthy)
286297
- [ ] **Boundary Compliance**: No dependency rule violations
287298
- [ ] **Proper Registration**: All services registered via `[Service]` attribute
288299
- [ ] **Error Handling**: Implements exception handling strategy from detailed design
@@ -657,6 +668,9 @@ Only if creating a new module, update `UI/ConsoleUi/Program.cs`:
657668
```
658669

659670
### 4. Create Unit Tests
671+
672+
**Follow the unit-testing skill guidelines (`.github/skills/unit-testing/SKILL.md`) for all test implementations.**
673+
660674
Create tests in corresponding test projects:
661675

662676
```csharp
@@ -697,6 +711,7 @@ public sealed class OrderingServiceTests
697711
```
698712

699713
NERVER create unit tests for functions without logic - functions that do not contain if, switch, loops, try/catch, or any other control flow statements.
714+
700715
NEVER create unit tests for these assemblies types:
701716
- `*.Contracts`
702717
- `*.DataModel`

0 commit comments

Comments
 (0)