docs re-org, audit fixes, build fixes
This commit is contained in:
57
docs/modules/_template/AGENTS.md
Normal file
57
docs/modules/_template/AGENTS.md
Normal file
@@ -0,0 +1,57 @@
|
||||
# <Module Name> - 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
|
||||
1. Start with the interface in `*.Core`
|
||||
2. Implement in the appropriate layer
|
||||
3. Add tests in the corresponding `*.Tests` project
|
||||
4. Update API contracts if WebService
|
||||
|
||||
### Fixing a Bug
|
||||
1. Write a failing test first
|
||||
2. Fix the implementation
|
||||
3. 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<T> 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 injection
|
||||
- `Guid.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](./architecture.md)
|
||||
- [CLAUDE.md](../../../CLAUDE.md) - Global coding rules
|
||||
- [src/__Tests/AGENTS.md](../../../src/__Tests/AGENTS.md) - Test infrastructure
|
||||
62
docs/modules/_template/README.md
Normal file
62
docs/modules/_template/README.md
Normal file
@@ -0,0 +1,62 @@
|
||||
# <Module Name>
|
||||
|
||||
> One-line description of what this module does.
|
||||
|
||||
## Purpose
|
||||
|
||||
A brief paragraph (2-3 sentences) explaining the module's purpose, its primary responsibility, and why it exists in the StellaOps platform.
|
||||
|
||||
## Quick Links
|
||||
|
||||
- [Architecture](./architecture.md) - Technical design and implementation details
|
||||
- [Operations](./operations/) - Operational runbooks and dashboards
|
||||
- [API Reference](./api/) - API documentation (if applicable)
|
||||
|
||||
## Status
|
||||
|
||||
| Attribute | Value |
|
||||
|-----------|-------|
|
||||
| **Maturity** | Production / Beta / Alpha |
|
||||
| **Last Reviewed** | YYYY-MM-DD |
|
||||
| **Maintainer** | Guild/Team Name |
|
||||
|
||||
## Key Features
|
||||
|
||||
- Feature 1: Brief description
|
||||
- Feature 2: Brief description
|
||||
- Feature 3: Brief description
|
||||
|
||||
## Dependencies
|
||||
|
||||
### Upstream (this module depends on)
|
||||
- **Authority** - Authentication and authorization
|
||||
- **Other Module** - Why this dependency exists
|
||||
|
||||
### Downstream (modules that depend on this)
|
||||
- **Other Module** - How they use this module
|
||||
|
||||
## Quick Start
|
||||
|
||||
```csharp
|
||||
// Minimal code example showing how to use this module
|
||||
var builder = Host.CreateApplicationBuilder(args);
|
||||
builder.Services.Add<ModuleName>Services();
|
||||
```
|
||||
|
||||
## Configuration
|
||||
|
||||
```yaml
|
||||
# Minimal configuration example
|
||||
module_name:
|
||||
setting_1: value
|
||||
setting_2: value
|
||||
```
|
||||
|
||||
## Related Documentation
|
||||
|
||||
- [Implementation Guides](../../<category>/) - If applicable
|
||||
- [Related Module](../other-module/) - Cross-references
|
||||
|
||||
## Notes
|
||||
|
||||
Any important caveats, migration notes, or known issues.
|
||||
98
docs/modules/_template/architecture.md
Normal file
98
docs/modules/_template/architecture.md
Normal file
@@ -0,0 +1,98 @@
|
||||
# <Module Name> Architecture
|
||||
|
||||
> Technical architecture specification for <Module Name>.
|
||||
|
||||
## Overview
|
||||
|
||||
High-level description of the module's architecture and how it fits into the StellaOps platform.
|
||||
|
||||
## Design Principles
|
||||
|
||||
1. **Principle 1** - Description of how this module follows or implements this principle
|
||||
2. **Principle 2** - Description
|
||||
3. **Principle 3** - Description
|
||||
|
||||
## Components
|
||||
|
||||
```
|
||||
<module-name>/
|
||||
├── __Libraries/
|
||||
│ ├── StellaOps.<ModuleName>.Core/ # Core business logic
|
||||
│ ├── StellaOps.<ModuleName>.Storage/ # Data persistence (if applicable)
|
||||
│ └── StellaOps.<ModuleName>.Client/ # Client SDK (if applicable)
|
||||
├── StellaOps.<ModuleName>.WebService/ # HTTP API (if applicable)
|
||||
├── StellaOps.<ModuleName>.Worker/ # Background processing (if applicable)
|
||||
└── __Tests/
|
||||
└── StellaOps.<ModuleName>.*.Tests/ # Test projects
|
||||
```
|
||||
|
||||
## Data Flow
|
||||
|
||||
```
|
||||
[Input Source] → [Processing] → [Output/Storage]
|
||||
```
|
||||
|
||||
Describe the primary data flow through this module.
|
||||
|
||||
## Key Abstractions
|
||||
|
||||
### Interface 1
|
||||
```csharp
|
||||
public interface I<Something>
|
||||
{
|
||||
Task<Result> DoSomethingAsync(Input input, CancellationToken ct);
|
||||
}
|
||||
```
|
||||
|
||||
Purpose and usage of this interface.
|
||||
|
||||
### Interface 2
|
||||
```csharp
|
||||
public interface I<SomethingElse>
|
||||
{
|
||||
// ...
|
||||
}
|
||||
```
|
||||
|
||||
Purpose and usage.
|
||||
|
||||
## Database Schema (if applicable)
|
||||
|
||||
| Table | Purpose |
|
||||
|-------|---------|
|
||||
| `schema.table_1` | Description |
|
||||
| `schema.table_2` | Description |
|
||||
|
||||
## Invariants
|
||||
|
||||
Non-negotiable design constraints that must always be maintained:
|
||||
|
||||
1. **Invariant 1** - Description and why it matters
|
||||
2. **Invariant 2** - Description
|
||||
3. **Invariant 3** - Description
|
||||
|
||||
## Error Handling
|
||||
|
||||
How errors are handled, propagated, and logged in this module.
|
||||
|
||||
## Observability
|
||||
|
||||
- **Metrics**: Key metrics exposed by this module
|
||||
- **Traces**: OpenTelemetry trace spans
|
||||
- **Logs**: Structured logging patterns
|
||||
|
||||
## Security Considerations
|
||||
|
||||
Security-relevant aspects of this module's design.
|
||||
|
||||
## Performance Characteristics
|
||||
|
||||
- Expected throughput
|
||||
- Latency budgets
|
||||
- Resource constraints
|
||||
|
||||
## References
|
||||
|
||||
- [Module README](./README.md)
|
||||
- [API Documentation](./api/)
|
||||
- [Operations Guide](./operations/)
|
||||
Reference in New Issue
Block a user