---
name: ai-feature-contract
description: Designs AI features with provider abstraction, mock provider, schemas, fallback behavior, validation, privacy, and tests.
argument-hint: [ai-feature]
---

For any AI feature, define:

1. User problem solved.
2. AI input schema.
3. AI output schema.
4. Provider interface.
5. Mock provider deterministic behavior.
6. Optional external provider behavior.
7. Failure fallback.
8. Privacy/security rules.
9. Prompt-injection considerations.
10. Unit/integration/e2e tests.

Rules:
- Do not require real API key for tests/demo.
- Do not trust raw AI output.
- Validate output with schema.
- Store generated result with provider metadata.
- Document limitations.
