/sdlc-documentation:11-ai-architecture-specfrom sdlc-documentation
Guides architecture decisions for production AI features: direct calls, RAG, fine-tuning, agents, model gateways, knowledge stores, evaluation, observability, and tenant security. Produces AI Architecture Specification and ADR seeds.
Ships in sdlc-documentation. 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.
Read when SKILL.md points to them.
| Artefact | Source or provider | Required? | Missing behaviour |
|---|---|---|---|
| Approved AI feature requirements and HLD | PRD/SRS and Phase 03 architecture | Required | Stop if feature acceptance or data ownership is unresolved. |
| Data, evaluation, security, latency and cost constraints | AI, data, security and finance owners | Required | Return architecture options and verification gaps when current provider facts are unavailable. |
| Artefact | Consumer | Observable acceptance condition |
|---|---|---|
| AI Architecture Specification and ADR seeds | AI, data, service, security, test and operations teams | Each feature maps to a justified pattern; data boundaries, evaluation, fallback and observability have testable contracts, as do any applicable provider, cost and tenancy controls. |
| Evidence | Consumer | Acceptance condition |
|---|---|---|
| Source and decision trace | Reviewer and downstream owner | Each material statement cites an approved input, named decision or qualified open issue. |
| Completed verification record | Release or phase gate owner | Every applicable check records pass/fail; unavailable checks remain not assessed. |
Read-only is the default for analysis, review, evaluation and planning. Read and search access to authorised project artefacts are required. Editing is limited to an explicitly requested project deliverable. Execution may run document, syntax or validation checks. Network access is used only for facts that require current verification. Do not publish, spend, change production, approve policy, or claim certification without explicit authority.
If any required capability is unavailable, return the narrowest useful qualified AI Architecture Specification and ADR seeds draft plus a gap register showing the missing item, affected sections, risk and owner. Never convert an unassessed check into a pass.
| Choice | Action | Failure or risk avoided |
|---|---|---|
| Need is grounded retrieval over governed sources | Choose RAG with citation/evaluation path | Fine-tuning does not mask knowledge freshness |
| Task needs bounded tool planning | Route to agent architecture | Agent controls are not omitted |
The AI-distinctive architecture artefact. Sits alongside the multi-tenancy spec and the generic HLD. Captures the model gateway, vector store, eval harness, prompt registry, observability bus, and the multi-tenant AI security boundaries.
Read the HLD, AI feature PRD, AI data spec and, for a tenant system, its multi-tenancy spec. Identify in-scope AI features, models, patterns, and the tenant boundaries.
Include the problem/non-AI alternative, human and affected-non-user map, model/system/input/output boundaries, human control, consent/notice, drift signals, staged promotion, rollback and re-promotion criteria. Use the oversight reference before selecting a runtime pattern.
Choose the pattern using Step 3 before placing services. For a local predictor or ranker, trace inputs, versioned artefact, evaluation, serving and fallback. Show the external model gateway only for provider calls, the vector store only for embedding-backed retrieval, and the prompt registry only for prompt-driven features. In the document's fixed sections, mark unused components inapplicable with the reason. Apply the matching detail from Steps 4 to 10.
For retrieval and ranking, compare a simple baseline on the same eligible queries. Separate candidate coverage from ranking quality and include revoked or absent results. Select user-visible latency, quality and access measures and assign staged rollout and rollback to their owners.
Possible services include:
Diagram with Mermaid; place every AI service.
For each AI feature select the pattern:
| Pattern | When | Components |
|---|---|---|
| Direct LLM call | input is self-contained, no external data | gateway + prompt + model |
| RAG | grounding in customer data | gateway + retrieval + reranker + prompt + model + citation post-processor |
| Agent | multi-step, tool-using, planned | gateway + planner + tool catalogue + executor + audit log + per-step approval UI |
| Fine-tune | repetitive narrow task, cost reduction | training pipeline + model artefact + eval suite + rollback artefact |
| Classical ML | structured prediction | versioned features, model artefact and monitoring, with a feature store when justified |
State the verdict per feature with rejected alternatives.
The gateway is the sole egress to model providers. Capture:
For each retrieval index: store technology, partitioning model (per-tenant index / namespace / metadata-filter), embedding model + version, dimensions, ANN parameters, freshness, encryption posture, key management.
Versioned, tagged, changes proposed via PR with regression eval attached. State the registry source-of-truth, deploy pipeline, rollback procedure.
The eval harness is a first-class production system, not a notebook. State: dataset and labels, scoring method appropriate to the task, CI gate hook, scheduled regression, alerting on score drop.
Trace serving latency, fallback, data drift and feature quality to the user outcome. For a ranker, examine candidate coverage, ranking quality and visibility failures. For generative features, add applicable measures such as token use, abstention, grounded citations and provider cost.
Seed ADRs for decisions the design actually makes. Capture the baseline, quality threshold, operational limit and fallback. Add retrieval, store, prompt or provider decisions where the selected pattern uses them.
AI_Architecture_Spec.md sections: 1) AI Plane Diagram, 2) Feature-to-Pattern Map, 3) Model Gateway, 4) Vector Store, 5) Prompt Registry, 6) Eval Harness, 7) Observability, 8) Security Boundaries, 9) ADR Seed Index, 10) Traceability.
05-ai-red-team-test-plan/references/red-team-scenario-library.md)For human-owned decisions, governed memory, correction, drift, and fallback, load human agency and system boundaries.
README.md (opens in a new tab)logic.prompt (opens in a new tab)references/ai-agent-runtime-crosslink.md (opens in a new tab)references/ai-architecture-oversight-and-drift.md (opens in a new tab)references/ai-architecture-patterns.md (opens in a new tab)references/ai-architecture-spec-template.md (opens in a new tab)references/human-agency-and-system-boundaries.md (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
ai-architecture, rag, fine-tuning, agents, model-gateway, knowledge-store
npx claudepluginhub peterbamuhigire/chwezi-sdlc-documentation --plugin sdlc-documentation160 skills in this plugin
/01-deployment-guideUse when producing or updating deployment guide for release prerequisites, migration choreography, verification, rollback, and ownership. Use runbook for the neighbouring concern; this skill owns the named document contract and its acceptance evidence./01-high-level-designUse when approved requirements need a system-level architecture with boundaries, components, critical flows, deployment topology and ADRs, or an as-built design must be recovered from existing code; use system-overview for orientation, low-level-design for module internals, and infrastructure-design for infrastructure depth./01-initialize-srsUse when writing a new SRS (software requirements specification) for a business system or module: create the Waterfall SRS workspace, IEEE structure, identifiers and source context; use context-engineering next for boundaries and actors.Other plugins' skills for the same job