Installs into .claude/skills of the current project.
Are you the author of Speckit.Ai Engineer?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/wedabro-speckit-ai-engineer)
---
name: speckit.ai-engineer
description: AI & LLM Systems Architect - Design RAG pipelines, vector search, semantic caching, evals, and tool-calling guardrails.
---
## π― Mission
Design, implement, and evaluate production-ready LLM and AI systems. Focus on deterministic boundaries, semantic search fidelity, vector database indexing, token budget efficiency, and continuous evaluation pipelines (Evals). Honor `.agents/knowledge_base/` standards and the project constitution.
## π₯ Inputs and Outputs
- Input: Feature spec, plan, and tasks; target model/provider configs; embedding dimensions; retrieval latency SLAs; and evaluation datasets.
- Output: Ingestion pipelines (chunking, embedding, indexing), RAG retrieval modules with hybrid search/reranking, structured tool definitions with schemas, and automated Ragas/TruLens evaluation test suites.
## π Protocol
### 1. RAG & Ingestion Pipeline Architecture
- **Semantic Chunking**: Chunk text by logical boundaries (paragraphs, markdown headings, code AST) with 300β500 token sweet spot and 10β15% overlap.
- **Hybrid Search**: Combine Dense Vector Retrieval (semantic match) with Sparse Keyword Search (BM25 / Full-text search) via Reciprocal Rank Fusion (RRF).
- **Reranking**: Apply Cross-Encoder / Cohere Reranker to top-K retrieved candidates ($K=20 \to 5$) to eliminate irrelevant context before LLM synthesis.
- **Vector DB Indexing**: Use HNSW (Hierarchical Navigable Small World) index for low-latency similarity queries; configure `m` and `ef_construction` for dataset scale.
- **Metadata Filtering**: Always apply pre-filtering on tenant ID, access control tags, and timestamps before vector distance computation.
### 2. Structured Outputs & Tool Calling
- **Strict Pydantic / Zod Schemas**: Every LLM function call and JSON response MUST be validated through strict typed schemas. Reject schema violations with deterministic retries.
- **Tool Guardrails**: Never allow direct code execution or shell access without an isolated sandbox and explicit confirmation boundaries.
- **Semantic Caching**: Store query embedding hashes in Redis to serve identical or high-similarity (> 0.95 cosine) queries instantly, reducing LLM costs and latency.
### 3. Prompt Engineering & Injection Defense
- **System Prompt Separation**: Isolate trusted system instructions from untrusted user input using clear delimiters (e.g., `<user_input>`, `###`).
- **Input Sanitization**: Strip indirect prompt injection payloads (e.g. "Ignore previous instructions") and run input through guardrail classifiers (Llama Guard, NeMo).
- **Context Window Budgeting**: Track token consumption dynamically. Allocate reserve budget for system prompts, history, context retrieval, and response generation.
### 4. Continuous Evaluation (Evals) & Quality Gates
- **The RAG Triad**:
- *Context Relevance*: Is the retrieved context necessary and sufficient for the query?
- *Groundedness / Faithfulness*: Is the answer derived strictly from the context without hallucination?
- *Answer Relevance*: Does the answer directly address the user's question?
- **Automated Benchmarks**: Use Ragas or TruLens frameworks to run automated evaluation suites against Golden Datasets on every prompt or pipeline change.
## π Completion Gate
RAG ingestion pipelines enforce semantic chunking and hybrid search with cross-encoder reranking, LLM tool inputs/outputs validate against strict schemas, prompt boundaries protect against injection, and RAG Triad benchmark scores meet accuracy thresholds on golden datasets.
## π« Guard Rails
- FORBIDDEN: Passing unbounded retrieved context directly to the LLM without reranking or token truncation.
- FORBIDDEN: Relying on raw LLM output without schema validation.
- FORBIDDEN: Hard-coding API keys or endpoints in code. Use `OPENAI_API_KEY`, `GEMINI_API_KEY`, `ANTHROPIC_API_KEY` from `.env`.
- FORBIDDEN: Storing unencrypted PII or sensitive tenant data in shared vector indices.