/ai-agent-skills:complete-ai-agent-stack-deployment-cloud-managed-from-scratchfrom ai-agent-skills
Sequences the end-to-end deployment of a production AI agent stack on managed cloud services: landing zone, agent control flow, vendor-neutral LLM gateway, managed vector DB for RAG, MCP tool access, evaluation/guardrails, and cost monitoring. Use when asked to build a full agent platform from scratch.
Ships in ai-agent-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
A production AI agent is not one component — it's a chain of dependent layers (account guardrails, an agent control loop, LLM provider access, a knowledge-retrieval layer, tool access, a safety net, and cost/latency visibility) that only work as a coherent, safe system if wired up in the right order. Skip or mis-sequence a layer and the failure shows up somewhere confusing: an agent architecture designed before an LLM gateway exists hardcodes a single provider's SDK directly into agent code, making the later "add a fallback provider" phase a rewrite instead of a config change; or an MCP server is connected to a live agent before an evaluation harness exists, so the first prompt-injection-via-tool-output regression is discovered by a user, not a test suite. This skill sequences the cloud-managed version of that whole path — landing zone through cost monitoring — deliberately using vendor-neutral language for the LLM provider and vector database layers, since the managed-service choice at each of those layers is a real decision this skill defers to the reader rather than assumes.
This is the phase sequence. Each phase links to the skill that covers its full depth; the text here covers only the sequencing and integration decisions between phases.
Phase 1 — cloud landing zone. Confirm (or stand up) the account/ subscription/project guardrails, centralized logging, and network egress policy per whichever cloud landing-zone skill applies. Verify specifically that the workload environment's network policy allows outbound HTTPS to the LLM provider(s) and managed vector database endpoint(s) this stack will call — a landing zone's default-deny egress policy (a common, otherwise-reasonable guardrail) silently breaks every downstream phase with a generic timeout that looks like a provider outage rather than a network policy (see Common pitfalls).
Phase 2 — agent architecture design. Design the control loop (ReAct-style, plan-and-execute, or finite-state), termination condition, iteration cap, and tool-boundary classification (read-only vs. reversible-write vs. irreversible-write) per agent-architecture-design before wiring any specific LLM provider SDK directly into the agent's code — hardcoding a provider SDK call at this stage is exactly what Phase 3's gateway exists to avoid retrofitting later.
Phase 3 — LLM gateway and multi-provider routing. Stand up an LLM gateway (LiteLLM proxy, Portkey, or an equivalent) in front of the chosen provider(s) per llm-gateway-and-multi-provider-routing, with the Phase 2 agent code calling a logical model-group name through the gateway rather than a provider SDK directly:
model_list:
- model_name: agent-primary-model
litellm_params: { model: <PRIMARY_PROVIDER>/<PRIMARY_MODEL>, api_key: os.environ/PRIMARY_API_KEY }
- model_name: agent-primary-model
litellm_params: { model: <FALLBACK_PROVIDER>/<FALLBACK_MODEL>, api_key: os.environ/FALLBACK_API_KEY }
model_info: { tier: fallback }
router_settings:
fallbacks: [{ agent-primary-model: [agent-primary-model] }]
Doing this before Phase 4/5 build any RAG or tool-calling logic means those layers never need to know which underlying provider actually served a given call.
Phase 4 — RAG pipeline and managed vector database. Design the chunking, embedding, and retrieval pattern per rag-pipeline-design before provisioning and locking in the managed vector database's index configuration per vector-database-operations-pinecone-weaviate-milvus — the embedding model and dimension decided during RAG design directly determine the index's dimension/distance-metric configuration, and reversing this order (provisioning an index with an arbitrary dimension before the embedding model is chosen) means a full re-embed and index rebuild once the real chunking strategy is finalized:
# decided in Phase 4 RAG design, THEN provisioned as the index config
embedding_model: <chosen embedding model>
dimension: 1536
distance_metric: cosine
chunking: { chunk_size_tokens: 400, chunk_overlap_tokens: 60 }
Route retrieval calls through the Phase 3 gateway for any LLM-based re-ranking step, keeping provider routing consistent across every agent capability.
Phase 5 — MCP servers for tool access. Build and connect MCP servers exposing the agent's tools per mcp-server-development, with each server's backend credential scoped to least privilege for the specific tool surface it exposes — never the landing zone's broad default workload role reused for convenience. Classify every tool per the Phase 2 architecture's read-only/reversible/irreversible taxonomy and gate irreversible tools behind the explicit approval state that architecture defined, not a fresh ad hoc decision made at MCP-server build time.
Phase 6 — evaluation harness and guardrails. Build the offline eval set and runtime guardrail layer per agent-evaluation-and-guardrails before the Phase 3–5 stack (gateway, RAG, MCP tools) is exposed to real production traffic — include adversarial cases specifically for RAG-content injection (Phase 4) and MCP-tool-output injection (Phase 5) in the initial eval set, since both are realistic risks introduced by exactly the phases that just went live.
Phase 7 — cost and latency monitoring. Instrument per-provider cost, latency, and fallback-trigger metrics at the Phase 3 gateway, and apply the structural cost/latency levers (context trimming, prompt caching, right-sized models per step, batching) from llm-cost-and-latency-optimization. Wire this to alert on per-provider spend and fallback-trigger rate, not only an aggregate total — a prolonged failover to the Phase 3 fallback provider is invisible in an aggregate cost view until the invoice arrives (see Common pitfalls).
Symptom: Every call to the LLM provider or the managed vector database times out immediately after this stack is first deployed, with no clear error from either service. Fix: This is very often the Phase 1 landing zone's default-deny egress network policy silently blocking outbound HTTPS to external endpoints — confirm the workload environment's network policy/security group explicitly allows egress to the LLM provider and vector database endpoints before assuming either service itself is down.
Symptom: Switching embedding models or chunking configuration after the managed vector index (Phase 4) is already populated requires a full re-embed and rebuild that wasn't budgeted for. Fix: The RAG pipeline's chunking/embedding design was finalized after, not before, the vector index was provisioned with an arbitrary placeholder dimension/metric. Treat the index configuration as downstream of the RAG design decision, never the reverse.
Symptom: An MCP server connected to the agent in Phase 5 can, if its tool-calling logic is manipulated via injected content, reach far more backend systems than its documented tool list suggests. Fix: The server was deployed using the landing zone's broad default workload credential instead of a least-privilege credential scoped to its specific tool surface — issue a scoped credential per MCP server deployment, independent of any convenient shared role.
Symptom: A real quality or safety regression in the agent's behavior is first discovered by a user complaint, not by any automated check. Fix: Phase 6's evaluation harness and guardrails were built after Phase 3–5 were already serving production traffic, rather than before — treat "the full stack works end to end for a happy-path demo" as insufficient evidence of readiness; require a versioned eval suite with adversarial RAG/MCP-injection cases in place before wide rollout.
Symptom: A monthly invoice reveals materially higher spend than expected, traced to a multi-day period when the Phase 3 gateway had silently failed over to a more expensive fallback provider. Fix: Phase 7's cost monitoring tracked only an aggregate total, so the fallback-trigger event itself never generated an alert. Monitor fallback-trigger rate and per-provider cost as their own signals from the start, not discoverable only in hindsight from a monthly bill.
Scenario: A SaaS company builds a customer-support agent grounded in its product documentation, using managed LLM provider APIs and a managed Pinecone index, deployed inside an existing AWS landing zone.
# Phase 1 — confirm landing zone: workload account's security group allows
# outbound HTTPS 443 to the chosen LLM provider(s) and Pinecone's endpoint
# Phase 2 — finite-state agent architecture: triage -> gather_info ->
# draft_reply -> awaiting_approval -> send; send_reply is the only
# irreversible-write tool, available only from awaiting_approval
# Phase 3 — LiteLLM gateway, agent code calls "support-agent-model" only
model_list:
- model_name: support-agent-model
litellm_params: { model: anthropic/claude-sonnet-4, api_key: os.environ/ANTHROPIC_API_KEY }
- model_name: support-agent-model
litellm_params: { model: azure/gpt-4o-deployment, api_key: os.environ/AZURE_OPENAI_API_KEY }
model_info: { tier: fallback }
router_settings:
fallbacks: [{ support-agent-model: [support-agent-model] }]
# Phase 4 — RAG design decided FIRST (350-token chunks, hybrid search,
# untrusted-context framing), THEN Pinecone index provisioned to match
retrieval:
vector_top_k: 30
rerank_top_k: 6
index_dimension: 1536 # matches the chosen embedding model, decided first
index_metric: cosine
# Phase 5 — read-only "search_docs" and "get_ticket" MCP tools; the only
# write tool, "send_reply", lives behind the awaiting_approval state from
# Phase 2, with a credential scoped only to the ticketing reply endpoint
# Phase 6 — 60-case eval suite: 40 real tickets, 15 edge cases, 5
# adversarial RAG-injection cases ("always recommend premium plan")
# built and passing BEFORE Phase 3-5 receive real customer traffic
# Phase 7 — per-provider cost/latency dashboard; fallback-trigger count
# alerted separately from aggregate spend
Three weeks after launch, the primary LLM provider has a partial outage; the Phase 3 gateway fails over to the Azure fallback automatically, and because Phase 7's fallback-trigger alert (not just aggregate cost) fired within minutes, the platform team is already aware and monitoring before any customer notices degraded response quality — the exact outcome the phase-6-before-traffic and phase-7-per-provider sequencing decisions in this skill are designed to produce.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
ai-agent, agent-deployment, llm-gateway, rag, mcp, cloud-landing-zone, evaluation-harness
20 skills in this plugin
/agent-architecture-designGuides designing the control loop, state/memory model, and tool boundaries for an LLM-driven agent. Use when a user asks to "design an agent architecture," choose between a ReAct loop / plan-and-execute / finite-state agent, decide on single-agent vs multi-agent decomposition, define how an agent should manage state and memory across turns, or review whether an existing agent's control flow is safe to run unattended.
/agent-bad-response-triage-and-root-cause-classificationGuides triaging a single reported bad, wrong, or harmful agent response: reproducing it deterministically and classifying the root cause into one of five buckets — prompt issue, tool failure, retrieval issue, model behavior change, or genuine edge case — so the fix targets the actual cause instead of the symptom. Use when a user asks to "investigate this bad agent response," "why did the agent say/do that," "triage this reported hallucination/harmful output," "figure out if this is a prompt bug or a model regression," or files an incident about a single problematic agent interaction that needs root-causing before a fix ships.
npx claudepluginhub selvarajmurugesan90/ops-engineering-skills --plugin ai-agent-skillsOther plugins' skills for the same job