PromptBase
PromptBase SelectGet Select
Close icon
General
Home
Marketplace
Create
Hire
Login
Chat
Sell
Explore

Prompt Details

Model
(claude-5-sonnet)
Token size
771
Example input
[OPPORTUNITY: Goal, users, workflow, outcome]: Agent for monitoring failed CI/CD deployments, identifying likely root causes, collecting relevant logs and recent code-change context, preparing an evidence-backed incident summary, routing the issue to the responsible engineering team, and tracking resolution. It should not deploy code, modify infrastructure, or change production configuration. [CONTEXT: Systems, tools, requirements, constraints, risks, scale, humans]: GitHub Actions, Jira, Slack, Datadog, and an internal runbook system are used. Failures can require investigation over several hours. The repository-to-team mapping is available but occasionally ambiguous. Production changes require human approval. Reliability and accurate evidence are more important than maximum autonomy. [PATTERNS: Patterns to consider, if any]: Event-driven, tool-use, retrieval, durable-state, human-approval, evaluator/verification, supervisor-worker, reflection, and workflow/state-machine patterns
Example output
Compiling test cases and summarizing the final architecture pattern. 1. OPPORTUNITY Problem: engineers currently spend manual effort triaging failed CI/CD deployments — pulling logs, diffing recent code changes, forming a root-cause theory, finding the right owning team, and tracking the incident to close. Users: on-call engineers, incident responders, and engineering managers. Trigger: a GitHub Actions deployment failure (CONFIRMED). Outcome: an evidence-backed incident summary, correctly routed and tracked to resolution (CONFIRMED). Inputs: failure logs and metadata from GitHub Actions, telemetry from Datadog, prior-knowledge from the internal runbook system, and the repo-to-team mapping (CONFIRMED). Decisions: root-cause hypothesis and team-routing decision (CONFIRMED). Actions: collecting logs/diffs, querying Datadog, searching runbooks, creating and routing a Jira ticket, posting to Slack, and polling for resolution (HIGHLY LIKELY, inferred from the tool list and required outcome). Tools: GitHub Actions, Jira, Slack, Datadog, internal runbook system (CONFIRMED). Humans: the owning engineering team, and specifically a human needed when repo-to-team routing is ambiguous (HIGHLY LIKELY). State: an incident record that persists across an investigation lasting up to several hours (CONFIRMED). Completion: ticket resolved and incident closed (CONFIRMED). High-impact actions: none of the destructive kind — deploys, infra changes, and prod-config changes are explicitly excluded (CONFIRMED); the only "high-impact" risk in scope is a wrong or duplicate routing/ticket action. Unknowns: whether GitHub Actions failures arrive as a webhook or must be polled, the exact schema/API for the repo-to-team mapping, Jira's support for idempotent ticket creation, and the expected incident volume (all UNKNOWN). Classification: an event-driven, long-running, multi-tool investigative and reporting agent — not a conversational assistant, and not a fully autonomous actor, since it never performs a write action against production systems. Justification: every explicit requirement (multi-hour investigation, several read-heavy tool integrations, "reliability and accurate evidence over autonomy") points to a workflow-style agent whose job is to gather and verify evidence and hand off a decision, not to act on production. 2. WORKFLOW GitHub Actions failure event arrives and opens a new incident record. Evidence collection runs, largely in parallel: fetch failure logs and the associated code diff from GitHub Actions, query Datadog for telemetry around the failure window, and search the runbook system for a matching known issue. The repo-to-team mapping is checked in parallel for routing. A model-driven step forms a root-cause hypothesis from the collected evidence. An evaluator step then checks whether the evidence is sufficient and the hypothesis/routing confidence is high enough to proceed; insufficient evidence triggers a bounded retry of the collection step or a downgrade of the hypothesis to UNKNOWN/PLAUSIBLE rather than blocking the whole flow. If team routing is unambiguous, the flow proceeds automatically; if ambiguous, a human gate (Slack) resolves it, with a timeout/escalation if no human responds. Once routing is settled, a Jira ticket is created (idempotently, keyed to the failure event) and Slack is notified with the evidence-backed summary. The agent then enters a long-running tracking state, polling Jira/Slack for status until the ticket resolves, at which point the incident record is closed and archived. Deterministic work: event parsing, tool calls, state transitions, dedupe checks. Model-driven work: root-cause hypothesis, evidence-sufficiency judgment, summary drafting. 3. ARCHITECTURAL FORCES Force Requirement Architectural implication State Investigation can span hours Durable, resumable state, not in-memory only Tools 5 external systems, mixed read/write Standardized tool-use layer with retries and idempotency Decisions Root cause + team routing are model-driven Needs a verification step before acting on them Reliability/traceability Evidence accuracy prioritized over autonomy Evaluator/verification pattern, full audit trail per claim Scale Not specified Design for moderate volume; avoid pre-building for scale not evidenced Recovery Tool failures, ambiguous mapping, crashes mid-run Bounded retries, resumable state, defined escalation Oversight Prod changes require approval, but agent never touches prod; mapping is "occasionally ambiguous" Human gate narrowly scoped to routing ambiguity only Security Mostly read-only access; one write surface (Jira/Slack) Minimize write scope, enforce idempotent writes Complexity Single investigative pipeline, no evidence of multi-agent need Favor one orchestrated workflow over multi-agent coordination 4. PATTERN ANALYSIS Pattern Source Purpose Fit Evidence Benefit Complexity Risk Prerequisite Event-driven Given list Start pipeline on CI/CD failure Fit Explicit trigger Timely response Low Missed events if webhook drops Webhook/event access Tool-use Given list Call GH Actions, Jira, Slack, Datadog, runbooks Fit Explicit tool list Enables data collection and action Moderate Tool/API failures Credentials/APIs Retrieval Given list Match runbooks; resolve repo→team mapping Fit "internal runbook system," "mapping available" Grounds hypothesis, reduces invention Low-moderate Stale docs/mapping Indexed runbook + mapping source Durable-state Given list Persist incident record across hours Fit "several hours" investigation window Resumable, resilient Moderate State store needed Persistent store Evaluator/verification Given list Check evidence sufficiency and routing confidence Fit "reliability and evidence over autonomy" Prevents false-confidence reports Moderate Added latency Sufficiency criteria Human-approval Given list Resolve ambiguous team routing only Fit (narrow) "occasionally ambiguous" mapping Prevents misrouting Low Human non-response Confidence signal + Slack channel Workflow/state-machine Given list Orchestrate trigger-to-completion lifecycle Fit Explicit multi-step lifecycle with waits/retries Clear traceability, easy failure reasoning Moderate Rigid transitions if edge cases missed Durable state Supervisor-worker Given list Coordinate multiple specialized agents Rejected No evidence of parallel independent agents needed — High Unjustified coordination overhead — Reflection Given list Self-critique output before finalizing Merged into evaluator, not standalone Same reliability requirement already covered by evaluator — Would duplicate evaluator logic Redundant complexity — Overengineering call-out: supervisor-worker is not justified by anything in the brief — a single orchestrated workflow with tool-use covers the described scope. A standalone reflection pattern is also not justified as a separate architectural component; its function is fully absorbed by the evaluator/verification step. 5. FINAL ARCHITECTURE Primary pattern: workflow/state-machine, driving the full lifecycle. Supporting patterns: event-driven trigger, tool-use for the five systems, retrieval for runbooks and mapping, durable-state for the multi-hour record, evaluator/verification before any routing/ticketing action, and a narrow human-approval gate limited to ambiguous routing. Components: event listener (GitHub Actions failure ingestion); orchestrator/state-machine engine; tool adapters for GitHub Actions, Datadog, Jira, Slack, and the runbook/mapping retrieval; a durable evidence/incident store holding logs, diffs, hypothesis, confidence scores, routing decision, and audit trail; an evaluator module; a human-in-the-loop interface via Slack for ambiguous routing; a resolution tracker polling for ticket closure. Control flow: mostly linear, with one conditional branch (ambiguous routing → human gate), one bounded retry loop (tool-call failures), and one long-duration wait loop (resolution tracking). Architecture in one view: GH Actions failure --> Orchestrator: New --> Collect evidence (logs, diff, Datadog) [parallel] --> Retrieve (runbook match + repo-team mapping) [parallel] --> Hypothesize root cause --> Evaluator: evidence sufficient / confidence high? no --> retry collection, or downgrade to UNKNOWN/PLAUSIBLE yes --> Routing decision ambiguous --> Human gate (Slack) --> confirmed routing clear --> continue --> Create Jira ticket (idempotent) + Slack notify --> Track resolution (durable wait, hours) --> Resolved --> close incident, archive evidence 6. STATE & MEMORY Working context: the current failure event, freshly fetched logs/diffs, and the in-progress hypothesis — ephemeral, scoped to the active reasoning step. Execution state: the state-machine's current node and retry counters, held durably since the run can span hours and must survive interruption. Durable state: the full incident record — event id, evidence references, hypothesis, confidence score, routing decision, ticket id, timestamps, and status — persisted so the investigation can resume. Retrieved knowledge: runbook matches and the repo-to-team mapping pulled per incident; not treated as long-term memory, just per-run retrieval. Audit history: every evidence item, decision, and human interaction logged with timestamp and source, required by the stated reliability/evidence priority. Long-term memory: none is introduced — nothing in the brief supports cross-incident learning or a persistent memory beyond the incident record, so none is added. 7. TOOLS & AUTONOMY Tool Purpose Access I/O Failure handling Idempotency Verification GitHub Actions API Fetch failure logs, code diff Read-only run id → logs/diff Retry w/ backoff; mark evidence UNKNOWN on repeat failure Safe (read) Check log completeness Datadog Pull telemetry around failure window Read-only time range/service → metrics Retry; proceed with partial evidence if degraded Safe (read) Time-window alignment check Internal runbook system Match known-issue documentation Read-only query → matched docs + score Retry; fallback to "no match" Safe (read) Relevance-score threshold Repo-to-team mapping Determine routing target Read-only repo → team On missing/ambiguous, escalate to human gate Safe (read) Confidence score on match Jira Create/update ticket, poll status Write (create/update) + read (poll) incident record → ticket id/status Retry with idempotency key; alert on repeat failure Must dedupe by incident event id Confirm ticket fields before marking complete Slack Notify team; ask human on ambiguous routing Write (post) message → post confirmation Retry; fallback channel if primary fails Dedupe via message id Delivery confirmation Autonomy classification: evidence collection, retrieval, hypothesis drafting, and routing/ticketing when confidence is high are autonomous. Team routing when the mapping is ambiguous is human-approved. Deploying code, modifying infrastructure, or changing production configuration are out of scope entirely — never attempted by this agent under any confidence level. 8. FAILURE & RECOVERY Reasoning failure (low-confidence root cause): detected by the evaluator's confidence threshold; recovered by labeling the hypothesis PLAUSIBLE/UNKNOWN rather than asserting it. Retrieval failure (no runbook match): detected as an empty/low-relevance result; recovered by proceeding without runbook grounding, flagged in the summary. Tool failure (any of the four read APIs): detected via error/timeout; recovered with bounded retry and backoff, then degrade or flag as UNKNOWN. State failure (crash/restart mid-investigation): detected on restart via the durable-state record; recovered by resuming from the last persisted node. Routing failure (ambiguous or conflicting mapping): detected via low-confidence match; recovered via the human gate. Human failure (no response to the ambiguity gate): detected via timeout; recovered by escalating to a default/on-call team per a defined SLA. Duplicate trigger (same failure fired twice): detected via event/run-id dedupe; recovered by ignoring or merging into the existing incident. Partial completion (interrupted mid-evidence-collection): durable state allows resume instead of restart. External system outage (Jira/Slack/Datadog down): detected via connectivity error; recovered by queuing for retry and, where available, notifying via a fallback channel; otherwise the affected evidence is marked UNKNOWN. 9. DECISIONS & IMPLEMENTATION Single orchestrated workflow was chosen over a supervisor-worker multi-agent design; the alternative was rejected as unjustified complexity given no evidence of a need for independent parallel agents. Reflection was merged into the evaluator step rather than built as a separate pattern, avoiding duplicated verification logic. Durable state was chosen over in-memory state because investigations can run for hours. A narrow human gate (routing ambiguity only) was chosen over a broad human-approval pipeline, since the agent never touches production or infrastructure. Flagged assumptions: that the repo-to-team mapping is queryable programmatically (UNKNOWN — not specified as API vs. static file); that Jira supports idempotent ticket creation (UNKNOWN — assumed, not confirmed); that GitHub Actions failures can be delivered as a webhook rather than only polled (UNKNOWN). Revisit conditions: reconsider supervisor-worker if evidence later shows frequent, resource-contending concurrent investigations; revisit runbook retrieval/caching if incident volume grows significantly. Implementation priorities, in order: event ingestion and durable-state schema; tool adapters for GitHub Actions, Datadog, Jira, Slack, and runbook/mapping retrieval; evaluator/confidence logic; the human-approval gate for ambiguous routing; the resolution-tracking loop. High-risk components: Jira ticket idempotency (duplicate-ticket risk), the root-cause evaluator (false-confidence risk), and ambiguous-mapping detection (silent misrouting if not conservative). Definition of done: the incident is detected and durably recorded; evidence is collected and cited in the summary; the hypothesis carries an explicit confidence label; a ticket is created exactly once in the correct team's queue (or escalated to a human when ambiguous); resolution is tracked to closure with a complete audit trail. 10. EVALUATION & ARCHITECTURE PACK Test Pass condition Task success Root cause and evidence match a human-verified diagnosis on a known failure Decisions Low-confidence hypotheses are labeled non-certain, not asserted Routing Unambiguous mapping routes automatically; ambiguous mapping triggers the human gate Grounding Every summary claim ties to retrieved evidence; nothing fabricated Tools Simulated tool failure triggers correct retry/backoff with no duplicate side effects (e.g., no duplicate Jira tickets) State Simulated crash mid-run resumes from last durable state without data loss or duplication Autonomy No deploy/infra/config-change tool call ever occurs, regardless of reasoning Recovery Simulated outage of Jira/Slack/Datadog degrades gracefully and retries/escalates End-to-end Full run from failure event to ticket closure across a multi-hour simulated timeline, with complete audit trail ARCHITECTURE IN ONE VIEW: an event-driven workflow/state-machine that gathers evidence via tool-use and retrieval, verifies confidence before acting, escalates to a human only when team routing is ambiguous, and durably tracks the incident from failure to resolution — investigate-and-report only, never deploy or modify production. PRIMARY PATTERN: workflow/state-machine. SUPPORTING PATTERNS: event-driven, tool-use, retrieval, durable-state, evaluator/verification, narrow human-approval. WHY IT FITS: matches the explicit multi-hour, multi-tool, evidence-first, non-destructive requirement without adding coordination machinery the evidence doesn't call for. REJECTED COMPLEXITY: supervisor-worker multi-agent orchestration; a standalone reflection loop (folded into the evaluator). CONTROL LOOP: trigger → collect → retrieve → hypothesize → evaluate → route (human gate if ambiguous) → notify/ticket → track → resolve. AUTONOMY BOUNDARY: autonomous for investigation, evidence-gathering, drafting, and routing when confidence is high; human-approved for ambiguous routing; deploy/infra/prod-config changes are permanently out of scope. HUMAN GATES: ambiguous repo-to-team routing only. FIRST FAILURE: a tool-call failure during evidence collection (e.g., a Datadog timeout). FIRST COMPONENT: event listener plus the durable-state schema for the incident record. FIRST EVALUATION: the grounding test — every summary claim traces to real retrieved evidence. DO NOT BUILD YET: supervisor-worker multi-agent coordination; a standalone reflection subsystem; cross-incident long-term memory. REVISIT WHEN: concurrent investigations become frequent enough to need coordination, or volume outgrows a single-workflow design. STATUS: draft architecture ready for review, pending confirmation of the mapping data source, Jira's idempotency support, and GitHub Actions' webhook availability.
Claude

Agent Architecture Pattern Analysis

Add to Cart
Instant accessInstant access
Usage rightsCommercial use
Money-back guaranteeMoney‑back
By purchasing this prompt, you agree to our terms of service
CLAUDE-5-SONNET
Tested icon
Guide icon
4 examples icon
Free credits icon
Build smarter agents, not bigger systems. Transform an agent idea into a focused architecture with the right patterns, tools, memory, autonomy, recovery, and safeguards—without adding complexity you don't need.
...more
Added over 1 month ago
Report
Browse Marketplace