This document provides guidance for AI coding assistants and autonomous agents working with the FizzBuzz Enterprise Edition codebase.
FizzBuzz Enterprise Edition is an enterprise-grade FizzBuzz solution using event-driven architecture and LLM-powered divisibility detection. AI agents should understand the system's architecture before making changes.
Numbers → Kafka → Fizz/Buzz Services (LLM) → Aggregator → API
- Event-Driven: All communication happens via Kafka topics
- Polyglot: TypeScript (services), Go (ingestion), Python (analytics)
- AI-Powered: Divisibility determined by Claude API calls
/services/
fizz-service/ # TypeScript - divisibility by 3
buzz-service/ # TypeScript - divisibility by 5
fizzbuzz-aggregator/ # TypeScript - stream join
api-service/ # TypeScript - GraphQL API
number-ingestion-service/ # Go - number ingestion
/analytics/
dbt/ # dbt models for analytics
scripts/ # Python analytics scripts
/prompts/ # Versioned LLM prompts (CRITICAL)
/evals/ # Evaluation datasets and results
/mcp-server/ # MCP tool server
/docs/ # Documentation, ADRs, runbooks
/terraform/ # Infrastructure as code
EXTREME CAUTION REQUIRED when modifying files in /prompts/.
- Always create a new version (e.g.,
fizz-divisibility-v13.txt) - Never modify existing versioned prompts in place
- Run the full evaluation suite before committing:
npm run evals - Document changes in the prompt file header
- See ADR-031 for why this matters
Example of what NOT to do:
# BAD: Modifying existing prompt
# prompts/fizz-divisibility-v12.txt was changed
# GOOD: Create new version
# Created prompts/fizz-divisibility-v13.txt with changes
Do not create, delete, or rename Kafka topics without explicit user confirmation. Topic changes require:
- Update to Terraform
- Update to all consuming services
- Coordination with data platform team
Existing topics:
number-topic- Input numbersfizz-topic- Fizz determination resultsbuzz-topic- Buzz determination resultsfizzbuzz-topic- Final FizzBuzz results
- Never hardcode API keys or secrets
- Use
.env.exampleas the source of truth for required variables - When adding new environment variables, update
.env.example
Before suggesting changes are complete:
- Run
npm testfor TypeScript services - Run
go test ./...in Go service - Run
pytestfor Python code - Run
npm run typecheckfor type checking
For significant architectural changes, create an ADR:
- Copy
docs/adrs/ADR-TEMPLATE.md - Use next available number
- Document context, decision, and consequences
If asked to add a new divisor (e.g., "Bazz" for divisibility by 7):
- Create new service in
/services/bazz-service/ - Create new prompt in
/prompts/bazz-divisibility-v1.txt - Create new Kafka topic configuration
- Update aggregator to join the new topic
- Update API schema
- Add evaluation dataset in
/evals/datasets/ - Update documentation
- Create ADR documenting the decision
- Create new prompt version in
/prompts/ - Update
.env.examplewith new version - Run evaluations:
cd evals && python run_evals.py - Compare accuracy metrics
- Document tradeoffs
- Update GraphQL schema in
/services/api-service/src/schema/ - Add resolver
- Add tests
- Update API documentation
The MCP server exposes FizzBuzz tools to AI assistants via the Model Context Protocol.
Location: /mcp-server/
Key files:
src/tools/- Tool implementations (fizzbuzz, recent-results, stats)src/api-client.ts- GraphQL client for API servicesrc/config/- Environment configuration
When modifying:
- Tools must validate inputs with Zod schemas
- All API calls must be traced with OpenTelemetry
- Run tests:
cd mcp-server && pnpm test - Test manually with MCP Inspector:
pnpm inspect
See ADR-048 for architecture decisions.
- Do not commit to
maindirectly - all changes require PR - Do not modify evaluation golden datasets without explicit approval
- Do not change Kafka consumer group IDs (causes reprocessing)
- Do not skip DCO sign-off on commits
- Do not decrease test coverage
# Run all TypeScript tests
npm test
# Run Go tests
cd services/number-ingestion-service && go test ./...
# Run Python tests
cd analytics && pytest
# Run linting
npm run lint
# Type check
npm run typecheck
# Run evaluations
cd evals && python run_evals.py
# Generate GraphQL types
npm run codegen --workspace=services/api-serviceIf you encounter issues or need clarification:
- Check existing ADRs in
/docs/adrs/ - Check runbooks in
/docs/runbooks/ - Reference incident retrospectives in
/docs/incidents/
This document applies to FizzBuzz Enterprise Edition v4.2.x.
Last updated: 2026-01-31 Maintainer: @fizzbuzz-platform-team