# Generator Documentation

This directory contains AI instructions for code generators.

## Structure

```
generators/
├── README.md           # This file
└── service.md          # Service generator instructions
```

## How Instructions Are Loaded

The AI service generator loads instructions in priority order (most specific first):

1. **Generator-specific** (`packages/platform-sdk/docs/generators/service.md`)
   - Detailed rules for the service generator output format
   - Event consumer/publisher workflows
   - File structure requirements

2. **Copilot instructions** (`.github/copilot-instructions.md`)
   - Project-wide coding standards
   - Code style rules
   - Package-specific guidelines

3. **Project AI guidelines** (`docs/ai-guidelines.md`)
   - General architectural principles
   - Validation patterns
   - Testing guidelines

## Adding New Generators

To add instructions for a new generator:

1. Create `<generator-name>.md` in this directory
2. Update `INSTRUCTION_FILES` in `ai-service-generator.ts` if needed
3. Follow the existing format from `service.md`

## Template Variables

The following variables are replaced at runtime:

| Variable | Description |
|----------|-------------|
| `{{scope}}` | Package scope (e.g., `@orderboss`) |
| `{{AVAILABLE_CONTRACTS}}` | Auto-generated list of existing contracts |
