agentleFS
ai-enhanced-engineerai-enhanced-engineer/aiee-skills/skills/frontend-angular-ai/SKILL.md

frontend-angular-ai

Skill4 starsChanged 5 months agoMITView on GitHub

AI integration patterns for Angular applications using Genkit, Firebase AI Logic, or Gemini API. Includes streaming responses, tool calling, and RAG patterns. Use when building AI-powered features in Angular apps.

The file

Files
SKILL.md

Angular AI Integration

Patterns for integrating AI capabilities into Angular 21+ applications.

Integration Approaches

ApproachWhereBest For
GenkitServer-sideMulti-model, complex flows, tool calling
Firebase AI LogicClient-sideFirebase apps, quota management
Gemini APIDirectMaximum flexibility, multimodal

Quick Decision

Need server-side processing? → Genkit
Using Firebase already? → Firebase AI Logic
Need image/audio analysis? → Gemini API (multimodal)
Building chatbot with history? → Genkit (server-side state)
Simple text completion? → Firebase AI Logic

Genkit Overview (Recommended)

Google's open-source toolkit for production AI applications.

// Server: Express + Genkit
import { genkit } from 'genkit';
import { googleAI, gemini20Flash } from '@genkit-ai/googleai';

const ai = genkit({ plugins: [googleAI()] });

app.post('/api/chat', async (req, res) => {
  const { message, history } = req.body;

  const response = await ai.generate({
    model: gemini20Flash,
    messages: [...history, { role: 'user', content: message }]
  });

  res.json({ reply: response.text });
});

Key Patterns

Streaming Responses

// Use Resource API for signal-based streaming
streamingResponse = resource({
  stream: async () => {
    const data = signal<{ value: string }>({ value: '' });
    // Stream handling logic
    return data;
  }
});

Tool Calling

// Define tools for LLM to call
const tools = [
  {
    name: 'searchProducts',
    description: 'Search product catalog',
    parameters: { query: 'string' }
  }
];

Temperature Control

TemperatureUse Case
0.0 - 0.3Factual, deterministic
0.4 - 0.7Balanced creativity
0.8 - 1.0Creative, varied

Security Patterns

PatternDescription
API Key ProtectionKeys stored server-side only, never exposed to client
Output SanitizationAI responses sanitized before DOM rendering
Rate LimitingRequest throttling to prevent quota exhaustion
Server ProxyAll LLM API calls routed through backend proxy

See reference.md for detailed patterns and examples.md for implementations.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.