Compare commits
3
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f35cd61e2d | ||
|
|
9e445a3a1b | ||
|
|
6d50f1246d |
+3
-1
@@ -2,7 +2,9 @@ bin
|
|||||||
packages
|
packages
|
||||||
obj
|
obj
|
||||||
*.userprefs
|
*.userprefs
|
||||||
|
*.log
|
||||||
.idea
|
.idea
|
||||||
VendingMachine.sln.DotSettings.user
|
VendingMachine.sln.DotSettings.user
|
||||||
donstro/remote.secrets
|
donstro/remote.secrets
|
||||||
|
mise.toml
|
||||||
|
.local
|
||||||
|
|||||||
@@ -1 +0,0 @@
|
|||||||
../.github/skills/
|
|
||||||
@@ -0,0 +1,68 @@
|
|||||||
|
# Agentic Coding Standards
|
||||||
|
|
||||||
|
This repository follows strict agentic coding practices to ensure high-quality, maintainable C# implementations.
|
||||||
|
|
||||||
|
## Zero Defects Policy
|
||||||
|
|
||||||
|
All code changes must maintain a **zero defects policy**:
|
||||||
|
- Every feature or bug fix must be validated by passing tests before merge
|
||||||
|
- Code reviews focus on correctness, clarity, and adherence to style guidelines
|
||||||
|
- No known issues or technical debt should be introduced
|
||||||
|
- When defects are discovered, they are fixed immediately before proceeding with new work
|
||||||
|
|
||||||
|
## Test-Driven Development (TDD)
|
||||||
|
|
||||||
|
We follow the **Red-Green-Refactor** cycle strictly. You must invoke `dotnet test` in each phase:
|
||||||
|
|
||||||
|
1. **Red**: Write a failing test that describes the desired behavior
|
||||||
|
2. **Green**: Write the minimum code necessary to make the test pass
|
||||||
|
3. **Refactor**: Improve the code while keeping tests passing
|
||||||
|
|
||||||
|
All development must start with a test. The repository includes one intentional failing test as a starting point for TDD workflow.
|
||||||
|
|
||||||
|
## Test Execution
|
||||||
|
|
||||||
|
Run the test suite using:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
dotnet test
|
||||||
|
```
|
||||||
|
|
||||||
|
This command:
|
||||||
|
- Restores NuGet packages if needed
|
||||||
|
- Builds the solution (Vending library + test project)
|
||||||
|
- Executes all NUnit test cases
|
||||||
|
- Reports results with clear pass/fail status
|
||||||
|
|
||||||
|
The test suite must pass entirely before any code is merged.
|
||||||
|
|
||||||
|
## Code Quality Standards
|
||||||
|
|
||||||
|
### Testing Framework
|
||||||
|
- **Test Framework**: NUnit
|
||||||
|
- **Coverage**: All public API members must have test coverage
|
||||||
|
- **Organization**: Tests are located in `Vending.Tests/TestVendingMachine.cs`
|
||||||
|
|
||||||
|
### Code Style
|
||||||
|
- **Language**: C# (latest available)
|
||||||
|
- **Target Framework**: .NET 8.0
|
||||||
|
- **Style Tool**: `dotnet format` (configured via `.editorconfig` if present)
|
||||||
|
- **Enforcement**: All code should follow standard C# conventions (PascalCase for public members, camelCase for locals/parameters, etc.)
|
||||||
|
|
||||||
|
## Agent Responsibilities
|
||||||
|
|
||||||
|
When assisting with code changes, agents must:
|
||||||
|
1. Respect the zero defects policy — all code must be tested and passing
|
||||||
|
2. Follow the Red-Green-Refactor workflow — tests first, implementation second
|
||||||
|
3. Enforce code style using .NET formatting standards
|
||||||
|
4. Ensure all tests pass before considering work complete
|
||||||
|
5. Maintain clarity and maintainability in all refactoring activities
|
||||||
|
|
||||||
|
## Getting Started
|
||||||
|
|
||||||
|
0. User stories are in stories/ Use the task-breakdown skill to help the user break down each acceptance criterion individually.
|
||||||
|
1. Read the failing test in `Vending.Tests/TestVendingMachine.cs`
|
||||||
|
2. Implement the vending machine code in `Vending/` (e.g., `Vending/VendingMachine.cs`)
|
||||||
|
3. Run `dotnet test` frequently to verify progress
|
||||||
|
4. Refactor once tests pass to improve code quality
|
||||||
|
5. Repeat for each new requirement
|
||||||
@@ -1,2 +1,25 @@
|
|||||||
# Vending Machine C# - Test Driven Development exercise with agent skills
|
# Vending Machine C# - Test Driven Development exercise with agent skills
|
||||||
|
|
||||||
|
See AGENTS.md or CLAUDE.md (same contents, symlinked) for agent instructions.
|
||||||
|
|
||||||
|
User stories are in stories/ . They are an invitation for communication - as Ron Jeffries says: "Card, Conversation, Confirmation".
|
||||||
|
|
||||||
|
Agent skills are in:
|
||||||
|
|
||||||
|
```
|
||||||
|
.claude/skills
|
||||||
|
├── task-breakdown
|
||||||
|
│ └── SKILL.md
|
||||||
|
├── task-execution
|
||||||
|
│ └── SKILL.md
|
||||||
|
├── tdd-minimalism
|
||||||
|
│ └── SKILL.md
|
||||||
|
├── tdd-test-refactoring
|
||||||
|
│ └── SKILL.md
|
||||||
|
├── test-focus-isolation
|
||||||
|
│ └── SKILL.md
|
||||||
|
└── testcase-common-setup
|
||||||
|
└── SKILL.md
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -6,6 +6,6 @@ public class TestVendingMachine
|
|||||||
[Test]
|
[Test]
|
||||||
public void ItFails()
|
public void ItFails()
|
||||||
{
|
{
|
||||||
Assert.That(0, Is.EqualTo(1));
|
Assert.That(1, Is.EqualTo(0));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
# Buy Can
|
||||||
|
|
||||||
|
## User Story
|
||||||
|
|
||||||
|
As a thirsty bastard I want to buy a can of soda so that I can fix my thirst
|
||||||
|
|
||||||
|
## Acceptance Criteria
|
||||||
|
|
||||||
|
- Delivers can of choice
|
||||||
|
- Costs money
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
# Change
|
||||||
|
|
||||||
|
## User Story
|
||||||
|
|
||||||
|
As a Scrooge McDuck I want my change to be able to keep swimming
|
||||||
|
|
||||||
|
## Acceptance Criteria
|
||||||
|
|
||||||
|
- Returns change on request
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
# Stock
|
||||||
|
|
||||||
|
## User Story
|
||||||
|
|
||||||
|
As a vending machine owner, I want to refill my machine with cans, so that I can keep on selling drinks
|
||||||
|
|
||||||
|
## Acceptance Criteria
|
||||||
|
|
||||||
|
- Stock is limited
|
||||||
|
- When stock runs out, money is returned
|
||||||
Reference in New Issue
Block a user