Skip to content
Back to skills

Generative Ai Patterns

ASecurity

Use when implementing generative AI applications.

  • 2 stars
  • 0 votes
  • 0 copies
  • 4 views
  • Added September 10, 2026
ai-agentspythonrailsdatabase

Security analysis

A100/100

Scanned September 10, 2026

npx -y skills add LoopyLuci/Skills --skill generative-ai-patterns --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Generative Ai Patterns?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Generative Ai Patterns
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/loopyluci-generative-ai-patterns/badge)](https://www.skillsdirectory.com/skills/loopyluci-generative-ai-patterns)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: generative-ai-patterns
description: "Use when implementing generative AI applications."
version: 1.0.0
author: Hermes Agent
license: MIT
metadata:
  hermes:
    tags: [generative-ai, LLM, diffusion, RAG, agent-patterns, GenAI, vector-databases]
    related_skills: [rag-system-design, large-language-model-optimization, advanced-reasoning-patterns, few-shot-prompting-advanced]
---

# Generative AI Patterns

Implementing generative AI applications — from LLM-based patterns (RAG, agents, chains) through diffusion models, structured generation, and evaluation frameworks.

## When to Use

- Building LLM-powered applications
- Implementing RAG (Retrieval-Augmented Generation)
- Building AI agents with tools and memory
- Generating images, code, or structured data
- Evaluating and monitoring GenAI outputs

## GenAI Application Patterns

```python
GENAI_PATTERNS = {
    'rag': 'Retrieval-Augmented Generation — ground LLM in external knowledge',
    'agent': 'Tool-using LLM that plans, acts, and observes',
    'chain': 'Composed LLM calls — sequential or parallel with intermediate outputs',
    'structured': 'LLM outputs structured data (JSON, schema) from natural language',
    'multi_modal': 'Generate or understand across text, image, audio, video',
    'evaluation': 'LLM-as-judge, assertion-based, or human evaluation',
}

class GenAIApplication:
    """Pattern-based generative AI application builder."""
    
    def rag_chain(self, vector_store, llm, query: str) -> str:
        docs = vector_store.similarity_search(query, k=3)
        context = '\n'.join(d.page_content for d in docs)
        prompt = f"Answer using context:\n{context}\n\nQuestion: {query}"
        return llm.invoke(prompt)
    
    def structured_output(self, llm, text: str, schema: Dict) -> Dict:
        prompt = f"Extract {schema} from: {text}. Return as valid JSON."
        result = llm.invoke(prompt)
        return json.loads(result)
```

## Verification Checklist

- [ ] Application pattern chosen (RAG, agent, chain, structured, multi-modal)
- [ ] LLM provider and model selected
- [ ] Vector store configured (if RAG)
- [ ] Prompt engineering optimized for the pattern
- [ ] Evaluation framework in place (LLM-as-judge, assertions)
- [ ] Cost and latency measured per inference
- [ ] Guardrails for safety, accuracy, and bias

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.