1.7 KiB
1.7 KiB
- AI Agent Instructions
Instructions for AI agents (Claude Code, GitHub Copilot, etc.) working on this module.
Module Context
- Primary Language: C# (.NET 10)
- Project Type: Library / WebService / Worker
- Test Framework: xUnit with Testcontainers
Key Files
| File | Purpose |
|---|---|
src/<Module>/__Libraries/StellaOps.<Module>.Core/ |
Core business logic |
src/<Module>/StellaOps.<Module>.WebService/Program.cs |
Service entry point |
src/<Module>/__Tests/ |
Test projects |
Common Tasks
Adding a New Feature
- Start with the interface in
*.Core - Implement in the appropriate layer
- Add tests in the corresponding
*.Testsproject - Update API contracts if WebService
Fixing a Bug
- Write a failing test first
- Fix the implementation
- Verify all related tests pass
Patterns to Follow
- Dependency Injection: All dependencies via constructor injection
- Async/Await: Propagate CancellationToken through all async chains
- Error Handling: Use Result pattern, not exceptions for expected failures
- Logging: Structured logging with semantic properties
Anti-Patterns to Avoid
- Direct
new HttpClient()- use IHttpClientFactory DateTime.UtcNow- use TimeProvider injectionGuid.NewGuid()- use IGuidGenerator injection- Culture-sensitive string operations - use InvariantCulture
Testing Requirements
- Unit tests for all public APIs
- Integration tests for database operations
- Snapshot tests for serialization
- All tests must be deterministic
Related Documentation
- Architecture
- CLAUDE.md - Global coding rules
- src/__Tests/AGENTS.md - Test infrastructure