ai-feature-worker

Implements AI-integrated features with mock response layers for OpenAI and Anthropic providers.

Updated Apr 1, 2026
One-click install
npx skills add https://github.com/fauzanazz/katalis --skill ai-feature-worker-fauzanazz
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: ai-feature-worker
Source: https://github.com/fauzanazz/katalis/tree/main/.factory/skills/ai-feature-worker
Command: npx skills add https://github.com/fauzanazz/katalis --skill ai-feature-worker-fauzanazz

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Building features that call external AI APIs is slow and expensive to test without a deterministic mock layer. This Skill provides a structured work procedure for implementing AI-powered features (multimodal analysis, quest generation, clustering) with a mock/real toggle so development and testing run without live API keys. ## Core Features & Use Cases - Mock-First AI Development: Create deterministic mock response files in src/lib/ai/mock/ before writing any real API integration, toggled via the USE_MOCK_AI environment variable. - Schema-Validated AI Contracts: Define input/output schemas with Zod, design prompt templates, and validate both mock and real responses through the same parsing path. - End-to-End TDD Workflow: Covers AI client implementation, API route with input sanitization, UI loading/error/retry states, bilingual locale testing, and browser verification via agent-browser. - Use Case: Implementing a GPT-4o image analysis endpoint for a children's talent-discovery app — you create three mock talent-detection responses, write failing tests, build the OpenAI client with mock toggle, and verify the full flow in both English and Indonesian locales. ## Quick Start Use the ai-feature-worker skill to implement the multimodal artifact analysis endpoint with mock responses and tests.

Frequently Asked Questions about ai-feature-worker

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I build an AI feature without real API keys?▼

Create deterministic mock response files matching your output schema, then gate the real API call behind a USE_MOCK_AI environment variable check. Both mock and real paths pass through the same Zod validation, so tests run identically in either mode.

How to mock OpenAI GPT-4o responses in tests?▼

Place realistic mock JSON responses in a dedicated mock directory, with multiple variants covering success cases and different output types. The AI client returns the mock when USE_MOCK_AI is true, so tests never hit the network.

Should I use OpenAI or Anthropic Claude for my feature?▼

This workflow uses OpenAI GPT-4o for multimodal image and audio analysis, and Anthropic Claude for reasoning tasks like quest generation and story analysis. The provider choice is documented per feature before implementation begins.

How do I validate AI API responses in TypeScript?▼

Define a Zod schema for the expected output and parse every response through it, on both mock and real code paths. This catches malformed AI output, unexpected formats, and schema drift before it reaches the UI.

What happens when the AI API call fails or times out?▼

The AI client handles timeouts, rate limits, invalid responses, and network failures gracefully. The API route returns a structured error, and the UI shows an error state with a retry button while disabling the submit button during processing.