/wicked-garden:wicked-garden-qe-incident-to-scenario-synthesizerfrom wicked-garden
Converts production incidents into reproducible scenario files by extracting stack traces, endpoint details, and request bodies from incident reports or direct fields. Writes scenarios/<incident-id>.md and queues a human review task.
Ships in wicked-garden. 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 prod incident is a free test case — nature already generated the input. You extract it and lock it down as a reproducible scenario. You never mark the scenario active; a human always verifies that the reproducer actually reproduces before it joins the regression suite.
Script-backed steps use the wicked-garden launcher: wicked-garden run <plugin-root-relative path, e.g. scripts/…> [args]. It is on PATH after npm i -g wicked-garden; otherwise use npx wicked-garden run …; inside a wicked-crew run it is "$WICKED_GARDEN_ROOT/scripts/wicked-garden".
If none of these is available, or Python 3 is missing, skip the script-backed step, say so, and follow the manual alternative where one is given next to it — never invent the script's output.
Relative paths in this skill are relative to the directory that contains this SKILL.md.
Accept either path A (incident report) OR path B (direct fields). Reject if neither is provided.
# input
incident_report: docs/postmortems/INC-4829.md
incident_id: INC-4829 # optional; inferred from filename if omitted
The report is expected to contain, at minimum:
stack or traceback).http or curl).^(endpoint|route|path):.error: <Exception or message>.# input
incident_id: INC-4829
stack_trace: |
TypeError: Cannot read property 'amount' of undefined
at applyCoupon (/app/src/pricing/coupon.ts:42:15)
at Checkout.finalize (/app/src/checkout.ts:188:7)
endpoint: POST /api/checkout
request_body: { "cart_id": "c_abc", "coupon": "SAVE10" }
expected_error_class: TypeError
run_id — UUID of the current runs row; defines EVIDENCE_DIR..wicked-qe/config.json — optional; used to pick the default
test framework for the synthesized steps.scenarios/. Must exist. One file per
incident id.# Path A: parse the markdown with a deterministic extractor that pulls
# the four required fenced/labelled blocks. No LLM judgement in the
# extraction itself — a missing block is ERR_INCIDENT_MALFORMED.
node {WT_LIB}/incident/extract.mjs \
--report "${INCIDENT_REPORT}" \
--out "${EVIDENCE_DIR}/extracted.json"
# Path B: normalize the inputs into the same extracted.json shape.
node {WT_LIB}/incident/normalize-direct.mjs \
--stack "${STACK_TRACE_FILE}" \
--endpoint "${ENDPOINT}" \
--method "${METHOD}" \
--body "${REQUEST_BODY_FILE}" \
--error-class "${ERROR_CLASS}" \
--out "${EVIDENCE_DIR}/extracted.json"
extracted.json shape:
{
"incident_id": "INC-4829",
"endpoint": { "method": "POST", "path": "/api/checkout" },
"request_body": { /* parsed JSON or raw string */ },
"expected_error_class": "TypeError",
"stack_summary": {
"top_frame_file": "src/pricing/coupon.ts",
"top_frame_line": 42,
"top_frame_function": "applyCoupon",
"depth": 6
},
"source_excerpt_path": "docs/postmortems/INC-4829.md"
}
Write exactly one file: scenarios/<incident_id>.md. Use the
qe scenario format (see the wicked-garden-qe skill's refs/scenario-format.md).
---
name: Regression — INC-4829 coupon-reuse 500
status: pending-review
source: incident
linked_to_incident: INC-4829
authored_by: wicked-garden-qe-incident-to-scenario-synthesizer
authored_at: 2026-04-21T14:02:11Z
target: POST /api/checkout
trust_level: sandbox
tools:
required: [curl, jq]
expected_error_class: TypeError
---
## Steps
1. POST to /api/checkout with the reproducer body below.
2. Expect a 5xx response OR an exception whose class matches
`TypeError: Cannot read property 'amount' of undefined`.
3. Capture the server stack trace; assert `applyCoupon` appears in the
top 3 frames.
## Reproducer
```bash
curl -sS -X POST "${TARGET_HOST}/api/checkout" \
-H "content-type: application/json" \
-d '{"cart_id":"c_abc","coupon":"SAVE10"}' \
-w '\n%{http_code}\n' \
> "${EVIDENCE_DIR}/response.txt"
response.txt — HTTP response body + status code.server-trace.txt — captured exception trace (from log shipper).TypeError and the top frame MUST be
applyCoupon in src/pricing/coupon.ts.Synthesized from docs/postmortems/INC-4829.md by
wicked-garden-qe-incident-to-scenario-synthesizer.
Human review required — scenario is pending-review until approved.
## 4. Evidence output
Under `.wicked-qe/evidence/<run_id>/`:
| File | manifest `kind` | Required |
|-----------------------------------|-----------------|----------|
| `extracted.json` | `misc` | Yes |
| `synthesized-scenario-path.txt` | `log` | Yes |
| `source-excerpt.md` | `log` | Yes (copy of the incident report) |
| `synthesis-log.md` | `log` | Yes |
`synthesized-scenario-path.txt` is a single line containing the
absolute path of the scenario file that was written — this is the
machine-readable handoff.
`synthesis-log.md` documents the extraction decisions: which block
was used for the stack trace, how the endpoint was parsed, which
fields came from the report vs defaults.
## 5. DomainStore + event bus
```js
// 1. Verdict — always PASS for authoring; verdict is "scenario authored".
// A FAIL here means extraction failed, not that the incident recurred.
store.create("verdicts", {
run_id: RUN_ID,
verdict: "PASS",
reviewer: "wicked-garden-qe-incident-to-scenario-synthesizer",
reason: `Authored scenarios/${incidentId}.md (pending-review) from ${sourcePath}.`,
evidence_path: `evidence/${RUN_ID}/`,
// Inside a governed wicked-crew run, name it, so crew attributes this verdict by stamp.
...(process.env.WICKED_RUN_ID ? { crew_run_id: process.env.WICKED_RUN_ID } : {}),
});
// 2. Task — human review is mandatory before the scenario goes active.
store.create("tasks", {
project_id: PROJECT_ID,
title: `Review synthesized scenario: ${incidentId}`,
status: "open",
assignee_skill: "incident-to-scenario-synthesizer:review",
body: JSON.stringify({
incident_id: incidentId,
scenario_path: scenarioPath,
extracted_endpoint: extracted.endpoint,
expected_error_class: extracted.expected_error_class,
top_frame: extracted.stack_summary,
action_on_approve: "set status: active in scenario frontmatter",
}),
});
// 3. Bus event so downstream listeners (e.g. a reviewer dashboard) can
// surface the authored scenario immediately.
bus.emit("wicked.qe.scenario.authored", {
scenario_path: scenarioPath,
incident_id: incidentId,
source: "incident",
status: "pending-review",
run_id: RUN_ID,
});
| code | meaning | class |
|---|---|---|
ERR_NO_INPUT | neither incident_report nor direct fields provided | user |
ERR_INCIDENT_MALFORMED | report missing one of stack / endpoint / error class | user |
ERR_SCENARIO_EXISTS | scenarios/<incident_id>.md already exists | user |
ERR_UNSAFE_ENDPOINT | endpoint path matches a deny-list (prod-only URL) | user |
ERR_INCIDENT_ID_MISSING | cannot infer incident_id from filename or inputs | user |
ERR_SCENARIO_WRITE_FAILED | filesystem write to scenarios/ failed | system |
On ERR_SCENARIO_EXISTS: do NOT overwrite. Surface the existing path
and ask the caller to choose a new incident_id or delete the existing
file first. A scenario overwrite is a human decision.
status: pending-review is the only valid status on synthesis.
Never mark a synthesized scenario active. A human confirms it
actually reproduces, then flips the status.linked_to_incident: is required frontmatter. Every synthesized
scenario must trace back to the incident id; orphaned regressions
are a source-control smell.${TARGET_HOST} — a reviewer should execute it in
one paste and see the error class.## Incident-to-Scenario: {incident_id}
source: {incident_report | direct-fields}
endpoint: {method} {path}
expected_error_class: {class}
top_frame: {file}:{line} ({function})
synthesized: scenarios/{incident_id}.md status: pending-review
emitted event: wicked.qe.scenario.authored source=incident run_id={RUN_ID}
queued task: incident-to-scenario-synthesizer:review ({incident_id})
VERDICT: PASS
REVIEWER: wicked-garden-qe-incident-to-scenario-synthesizer
RUN_ID: {RUN_ID}
{WT_LIB}){WT_LIB} is the plugin's own qe helper directory — the helper modules ship
in-catalog (scripts/qe/lib/, ported from the retired wicked-testing package
in Phase 6c). Resolve it (cross-platform):
WT_LIB="$(wicked-garden path scripts/qe/lib)"
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub mikeparcewski/wicked-garden --plugin wicked-garden91 skills in this plugin
/wicked-garden-agenticAgentic-systems domain skill: review, design, audit, and framework selection
for AI agent systems. Routes to one of four actions (review | design | audit |
frameworks) backed by the rubrics in refs/.
Use when: "agentic review", "review this agent system", "full agentic codebase
review", "trust and safety audit", "audit my agents for GDPR/HIPAA/SOC2/NIST
compliance", "design an agentic system", "design a multi-agent architecture",
"which agentic framework should I use", "compare LangChain vs CrewAI vs
AutoGen", or any former /wicked-garden:agentic:{review|design|audit|frameworks}
invocation.
Disambiguation: this domain reviews and designs **AI agent systems**. For
ordinary source code use the engineering review; for a binding go/no-go
verdict use the archetype review (see docs/domains.md → "review appears in
three domains").
/wicked-garden-agentic-architectFive-layer architecture validation, agent topology analysis, orchestration
pattern assessment, and framework detection for agentic systems.
Use when: architecture review of an AI agent system, agent topology analysis,
validating the five-layer model (cognition/context/interaction/runtime/
governance), assessing orchestration patterns, or as a parallel worker in a
heavyweight wicked-garden-agentic review.
/wicked-garden-agentic-performance-analystToken optimization, latency budgets, cost analysis, caching strategy, and
parallelization assessment for agentic systems.
Use when: performance optimization of an AI agent system, cost analysis or
token-budget review, latency profiling, cache-strategy assessment,
parallelization opportunities, or as a parallel worker in a heavyweight
wicked-garden-agentic review.
/wicked-garden-agentic-safety-reviewerGuardrails, prompt injection defense, PII protection, human-in-the-loop
gates, and hallucination mitigation for agentic systems.
Use when: safety review of an AI agent system, guardrail assessment, prompt
injection audit, PII/compliance exposure check, HITL gate verification, or
as a parallel worker in a heavyweight wicked-garden-agentic review.
Cross-ref: EXECUTING injection/jailbreak/refusal-rate/drift probes against
a live LLM feature with evidence artifacts + a ledger verdict is
`wicked-garden-qe-ai-feature-test-engineer` (executor); THIS skill is the
design-time safety review.
/wicked-garden-appsChange, review or accept an Apps app: a declarative UI over live data
and the system's knowledge that a person builds in wicked-studio's Apps
section. An app is a spec
(apps.json: pages, components, layout, theme, bindings, queries and
actions) plus query texts under queries/. A turn's builder edits those
two and nothing else, from the data catalog the task names, and never
calls a write tool or an action (a live read goes only through crew's
broker). A distinct reviewer judges the turn's tree. A publish's QE seat
judges the publish check's evidence.
Use when: a phase of the `apps-turn` workflow (build, review) or the
`apps-publish` workflow (qe), "add a KPI to my app", "chart this query",
"add a filter", "add an Assign to me button", "review this app turn".
NOT for running a query, testing a connection, granting an action or
deploying an app (crew and studio do those, behind a person's click),
and NOT for building studio editor plugins (that is
wicked-garden-editor-scaffold).
/wicked-garden-archetypev11 work-shape archetype runner. When a prompt has been routed to one
of the archetypes (triage, explore, specify, decide, ship, review,
incident, build, migrate, modernize), this skill is the entry point. It
picks the right per-archetype playbook from refs/ and executes the phase
shape declared in `.claude-plugin/archetypes.json`.
Use when: a `<wg archetype="X">` or `<wg archetypes>` system-reminder
tag appears, an explicit "let's run the X archetype" request, or a
direct per-archetype ask — "triage this prompt", "review this PR /
artifact", "build this feature", "decide between these options",
"explore this problem", "handle this incident", "run this migration",
"modernize / port this legacy app", "ship this release", "write
acceptance criteria" (invoke with archetype=<name> plus the user's
args — see the Direct invocation table).
Other plugins' skills for the same job