davidbirchall/squad-skills-ai-engineering
AI engineering skills for LLM-powered applications and agent systems: LLM integration, prompt engineering, agent design and orchestration, tool and MCP integration, context engineering, retrieval-augmented generation, evaluation, testing, security, and observability.
Designing a single LLM agent in a TypeScript/Node/NestJS backend - deciding between a single call, a fixed workflow, and an agent; the agent loop; goals and explicit stop conditions; step, token, time, and cost budgets; state and memory; planning; human-in-the-loop approval; failure handling; single-responsibility agents; and autonomy levels. Provider-agnostic. Load when deciding whether to build an agent, designing an agent loop, setting limits, or adding approvals and recovery.
Orchestrating multiple LLM agents and steps in a TypeScript/Node/NestJS backend - sequential, parallel, router, orchestrator-workers, evaluator-optimiser, and handoff patterns; shared state; typed message contracts between agents; concurrency limits; durable and resumable execution; timeouts and cancellation; cost control; preventing runaway loops; and preferring deterministic code over LLM routing. Provider-agnostic. Load when coordinating more than one agent or model call, designing handoffs, or making multi-step runs durable and bounded.
Controlling cost and latency of LLM features in a TypeScript/NestJS chat backend - budgets per user, tenant, and request, token accounting from provider usage fields, prompt caching and stable prefixes, model routing between small and large models, max output tokens, timeouts, fallbacks, retries with jitter and idempotency, time-to-first-token as the primary UX metric, parallel tool calls, semantic and response caching caveats, cost dashboards and alerts, and degradation modes. Provider-agnostic. Load when estimating or capping spend, reducing response latency, adding retries or fallbacks, or setting up cost monitoring.
Measure chat, RAG, and agent quality with versioned datasets, rubrics, graders, trajectory checks, groundedness metrics, human calibration, and regression gates. Load when deciding whether prompts, models, retrieval, or agent changes improved or degraded quality.
Observability for LLM chat and agent systems - tracing model calls, tool calls and agent steps as spans, token, cost, latency and error metrics, logging prompts and completions with redaction, correlation ids across agent runs and conversations, quality feedback signals, sampling, dashboards and alerts, replaying runs from traces, and retention and privacy. Load when instrumenting LLM calls or agent loops, debugging a bad answer or runaway run, tracking cost, or deciding what to log and keep.
Security for LLM chat apps and agent systems - direct and indirect prompt injection, untrusted content boundaries, least-privilege tool permissions, output handling and sanitisation, data exfiltration channels, PII and secrets in prompts and logs, tenant isolation in RAG, jailbreaks and abuse, rate and cost abuse, human approval for risky actions, and red-teaming with regression cases. Load when exposing tools to a model, ingesting external or user documents, designing agent permissions, handling model output, or reviewing an AI feature for risk.
Deterministic testing around non-deterministic LLM components in TypeScript with vitest - fake and scripted model clients, recording and replaying provider responses, fixtures, contract tests for tool schemas and structured output, testing orchestration and agent loops with fake models, property and invariant checks, streaming and error-path tests, snapshot cautions, flaky test handling, and keeping cost-aware live tests separate from the default suite. Load when writing tests for chat, agent, tool or RAG code, mocking provider calls, or fixing flaky AI tests.
End-to-end architecture of a conversational AI application in TypeScript with NestJS, Prisma, PostgreSQL and a Nuxt client - performance first (time-to-first-token, fast thread list and open, coalesced streaming writes, responsive long threads), projects that group conversations with shared instructions and reference files, conversation and message-tree data model with edit/regenerate branching, typed message parts, run records and status lifecycle, idempotent sends, server-owned truth versus optimistic client state, request flow, stop/regenerate/edit/retry semantics, attachments, titles, deletion, per-conversation model selection, and instruction layering. Provider-agnostic. Load when designing or reviewing the data model, API, performance, or request flow of a chat application.
Context engineering for chat and agent systems - context window budgeting, deciding what to include, ordering and placement, conversation history trimming, summarisation and compaction, memory tiers (working, session, long-term), tool result truncation, prompt caching friendly layout, avoiding context rot and distraction, per-request context assembly in TypeScript, and measuring context quality. Load when a conversation grows long, an agent loses track or degrades, token cost or latency is high, or when designing how history, memory, tools and retrieved data are assembled into a prompt.
Store and assemble branch-aware chat history, summaries, pinned instructions, and explicit editable user memories with token budgets, invalidation, deletion, and consent. Load when chats must remember, summarise, personalise, or recover context over time.
Integrating LLM providers into a TypeScript/NestJS backend - provider-agnostic abstraction, streaming to clients, structured output with schema validation and repair, timeouts, cancellation, retries with backoff and jitter, rate limit handling, fallbacks across models and providers, token and cost budgets, usage accounting, API key handling, idempotency, and error mapping. Load when adding or changing a model call, wiring a new provider, handling streaming responses, or debugging flaky, slow or expensive LLM requests.
Using and building Model Context Protocol (MCP) servers and clients from a TypeScript/Node/NestJS backend - tools, resources, and prompts; stdio versus HTTP transports; authentication and least privilege; server trust, pinning, and review; tool-description injection risk; schema and spec versioning; connection lifecycle; testing servers; and deciding between an MCP server and a plain in-process tool. Provider-agnostic; verify protocol details against the current spec. Load when connecting an agent to MCP servers, writing an MCP server, or assessing the risk of a third-party server.
Prompt engineering for a TypeScript chat and agent backend - prompt structure, system vs user vs tool roles, instructions and constraints, few-shot examples, output contracts and format specs, delimiting untrusted input, prompt templates, versioning prompts as code, change review, regression-tested prompt changes, and common failure fixes. Load when writing or editing system prompts, designing output formats, adding examples, templating prompts, or changing a prompt that already ships.
Retrieval-augmented generation for a TypeScript/NestJS backend - ingestion pipelines, document parsing, chunking strategy, embeddings and model versioning, vector store choice, hybrid keyword plus vector search, reranking, metadata filtering, query rewriting, citations and grounded answers, freshness and re-indexing, access control on retrieved documents, and evaluating retrieval and answer quality. Load when building or tuning search over private documents, adding a knowledge base to a chat or agent, debugging irrelevant or ungrounded answers, or designing an indexing pipeline.
Implement provider-to-server LLM token streaming, event normalisation, partial tool-call arguments, cancellation, persistence, reconnects, resume IDs, ordering, and stream tests. Load when model output arrives incrementally or users need stop, resume, retry, or live tool-call updates.
Designing tools (function calling) that LLM agents invoke in a TypeScript/Node/NestJS backend - schema design, naming and descriptions, input validation, idempotency, error results the model can act on, permissions and authorisation, side-effect classification, confirmation for destructive tools, result size limits, parallel tool calls, and timeouts. Provider-agnostic. Load when defining, reviewing, or debugging tools an agent or chat model can call.