MILTON Project Context
This is the MILTON system: a multi-service .NET application for AI-powered documentation generation with traceability between documents.
Service Map
| Service | Project | Responsibility |
|---|---|---|
| API | MILTON/ | Main ASP.NET Core API; owns milton-db and core business logic |
| Clustering | MILTON.Clustering/ | Python FastAPI code analysis + C# proxy endpoints |
| DocumentGenerator | MILTON.DocumentGenerator/ | Wolverine worker for AI document generation |
| GitOperations | MILTON.GitOperations/ | Wolverine worker for Git clone / analysis / S3 upload |
| NotificationService | MILTON.NotificationService/ | SignalR + Wolverine real-time notifications |
| ReactClient | MILTON.ReactClient/ | React + TypeScript frontend |
| Platform | MILTON.Platform/ | Shared AI and storage abstractions |
| ServiceDefaults | MILTON.ServiceDefaults/ | Shared Aspire/service defaults |
| AppHost | MILTON.AppHost/ | .NET Aspire orchestration |
| McpServer | MILTON.McpServer/ | MCP server exposing MILTON knowledge graph |
| KnowledgeSeedingService | MILTON.KnowledgeSeedingService/ | Neo4j/PGVector seeding worker |
Which Mode Are You In?
- Orchestrator (Tech Lead) mode — You are running as the
tech-leadagent, or the user has asked for work to be planned and delegated. Do not read or modify code directly: plan the contracts, collaborate on Acceptance Criteria, then delegate to domain expert subagents (api-agent,documentgenerator-agent, etc.). - Direct mode — Default for a normal session. The user is talking directly to you and expects you to do the work. Implement it yourself; do not spin up subagents unless explicitly asked.
If you are unsure which mode you are in, you are in direct mode.
The milton-knowledge MCP Server
Prioritize the milton-knowledge MCP server tools (search_code_context, get_system_architecture_map, get_service_dependencies_map) before exploring or modifying code across services.
- Vector Database Search (
search_code_context):- Global/Feature namespaces: query system architecture and codebase concepts.
- Dedicated external namespaces: specify
agentNamespaceto access framework docs (framework_docs), frontend docs (frontend_docs), or security standards (security). - HARD RULE: When evaluating security, performance, or compliance, query the
securitynamespace (OWASP Top 10) to retrieve project baseline standards before auditing code.
- Do Not Brute-Force Code Sweeps: Unless a specific path is named, use vector search or graph tools first rather than speculative grep sweeps.
Universal Conventions & Constraints
- Vertical Slice Architecture: One self-contained directory per capability.
- CQRS with Wolverine: Per-producer
[MessageIdentity]records bound at the wire. - Test-Driven Development (TDD): Failing test first → minimal implementation → refactor green.
- No External CDNs: All frontend assets (CSS, JS, fonts) must be vendored locally for air-gapped environments.
- Platform-Agnostic Paths: Always use
Path.Combine(), never hardcoded/or\string concatenation. - No Hardcoded Secrets: Use
IConfigurationwith user secrets or environment variables. - Offline-First: Avoid calling external APIs unless explicitly mandated by the architecture.
Git Workflow & Lifecycle (Mandatory)
- Issue-first: Every non-trivial change starts as a GitHub issue with Acceptance Criteria and Definition of Done (
Closes #N). - Base PRs on
dev:devis the integration branch;mainis the release branch. - PR Delegation: Only the Tech Lead merges PRs into
dev. - Stacked PRs: For multi-part work, use
gh-stackto keep changes reviewable. - Commit Messages: Follow Conventional Commits (
feat:,fix:,docs:, etc.).
Work Item Lifecycle
GitHub issue (AC + DoD) → Kanban task (assigned to domain agent)
→ Worker implements (TDD) → PR (Closes #N, base dev) → Tech Lead review & merge
→ Issue closed
System Commands & Aspire Basics
# Run full application via Aspire
aspire run
# Build solution
dotnet build --configuration Release
# Run test suite
dotnet test --no-build --configuration Release --verbosity normal- Aspire Diagnostics: When inspecting application issues, use Aspire log tools (
list_console_logs,list_structured_logs,list_traces) before modifying app host or service code.