"Apply targeted, surgical edits to an existing Arazzo scenario -- operationId or event renames, step add/remove, actor changes, extension updates, version bumps, deprecation -- then re-validate. Use when modifying an existing scenario rather than creating one; can auto-detect renames from recent git history and guides version-bump decisions."
Install
npx skillscat add specfuse/authoring/update-scenario Install via the SkillsCat registry.
Update an existing Arazzo scenario -- handles operationId renames, step additions/removals, actor changes, extension updates, version bumps, and deprecation.
Enforces: .specfuse/authoring/handbooks/Arazzo_Handbook.md
Before modifying any files, read and internalize the authoritative rules:
- Read
.specfuse/authoring/handbooks/Arazzo_Handbook.md-- especially Section 10 (versioning and deprecation), Section 13 (Do/Don't) - Read
.specfuse/authoring/samples/scenario-samples.yaml-- canonical scenario template - Note the report format of the
scenario-validatorsubagent (provided by the specfuse-authoring plugin) -- you will spawn it to validate
Then read the target scenario file the user wants to update.
What this command does
Applies targeted changes to an existing Arazzo scenario file and re-validates. Unlike /design-scenario (which starts from PM intent and walks through an 11-step flow), this command starts from an existing file and makes surgical edits -- think "modify" rather than "create."
Input clarification
Ask the user:
Which scenario? Accept a file path or domain + name. If ambiguous, list matching files:
"Which scenario do you want to update? Provide the file path or the domain and use-case name."
If the user says something like "update the order scenario", scan for matches:
api/specs/v1/domains/order/scenarios/order-lifecycle.arazzo.yaml api/specs/v1/domains/order/scenarios/order-context-sync.arazzo.yamland ask them to pick.
What kind of change? Present the supported change types:
"What would you like to change?"
- A. Rename an operationId (or auto-detect renames from recent git changes)
- B. Rename an event (
{Entity}.{Action}) - C. Add step(s) to a workflow
- D. Remove step(s) from a workflow
- E. Change actors (add, remove, rename, change role)
- F. Update extensions (x-doc, x-mcp, x-ui, tags, x-setup, etc.)
- G. Version bump or deprecation
The user may also describe the change in plain language. Map it to the appropriate handler.
Specifics. Each handler (below) has its own follow-up questions.
Multiple changes may be applied in sequence within a single session. After each change, re-validate before proceeding to the next.
Change type handlers
A. operationId rename
An operationId in the OpenAPI spec was renamed. All scenario references must follow.
Clarify:
- The old operationId and the new operationId. If the user is unsure, offer to auto-detect (see "Auto-detection of renames" below).
Apply:
Find every occurrence of the old operationId in the scenario file:
steps[].operationIdx-async.poll.operationId
Replace each with the new operationId.
Verify the new operationId exists in OpenAPI by reading
api/specs/v1/domains/{domain}/operations/for a file containing it.Check if the new operation has different response codes or a different request body shape. If so, warn the user:
"The new operation '{newId}' has a different response shape. Review the successCriteria and outputs for these steps: [{stepIds}]."
Determine if a version bump is warranted (see "Version bump guidance").
B. Event name change
An event's x-label in AsyncAPI was changed, so {Entity}.{Action} references in the scenario must follow.
Clarify:
- The old event name (
Entity.Action) and the new event name.
Apply:
- Find every occurrence of the old event name:
x-async.emit[].eventx-async.await.event
- Replace each with the new event name.
- Verify the new event name exists in AsyncAPI by reading
api/specs/v1/domains/{domain}/messages/for a message with matchingx-label. - Check if
x-async.emit[].expectorx-async.await.matchpayload field names need updating (if the event's payload schema changed alongside the rename). - Determine if a version bump is warranted.
C. Add step(s)
Insert one or more new steps into an existing workflow.
Clarify:
- Which workflow within the file (if multiple exist).
- What the new step does (brief description).
- Where in the step sequence it should go (before/after which existing step).
Apply:
- Read the domain's available operationIds (Glob
api/specs/v1/domains/{domain}/operations/*.yaml). Present candidates relevant to the described action. - Confirm the operationId, actor (
x-as), parameters, expected status code, and outputs. - If the operation is a write (POST/PUT/PATCH/DELETE), check its
x-emitsin the OpenAPI operation file. Addx-async.emitfor each declared event. - If the step needs to wait for an async outcome, add
x-async.awaitorx-async.pollas appropriate. - Insert the step at the specified position. Update any downstream
$steps.{id}.outputs.Xreferences if the new step provides outputs that subsequent steps should use. - If the user wants UI hints, collect
x-uiactions following the same pattern as/design-scenariostep 7. - This change warrants a version bump (new steps change the observable behavior).
D. Remove step(s)
Remove one or more steps from an existing workflow.
Clarify:
- Which workflow and which step(s) to remove.
Apply:
Check for dangling references. Scan all remaining steps and workflow outputs for
$steps.{removedStepId}.outputs.Xexpressions. List every dangling reference found.If dangling references exist, present them:
"Removing step '{stepId}' will break these references:
- Step '{downstreamStep}' uses
$steps.{stepId}.outputs.{output}in its parameters - Workflow output '{outputName}' references
$steps.{stepId}.outputs.{output}
How should these be resolved? Options: (a) rewire to another step's output, (b) remove the downstream reference too, (c) cancel the removal."
- Step '{downstreamStep}' uses
Do NOT proceed until all dangling references are resolved.
Remove the step(s).
This change warrants a version bump.
E. Actor changes
Add, remove, rename, or change the role of actors.
Clarify:
- What to change: add a new actor, remove an existing one, rename an actor key, or change a role.
Apply -- add actor:
Confirm the actor key (camelCase), role (registered in the OpenAPI
info.x-rolesregistry), description, and optionalrefbinding to a recipe output.Add to
x-actors.If the setup recipe does not provide an output for the new actor's
ref, flag:"The recipe '{recipeName}' does not provide output '{outputKey}'. The recipe may need to be updated, or the ref can be omitted."
Apply -- remove actor:
Check for
x-asreferences to the actor being removed. List every step that uses this actor.If steps reference the actor, those steps must be reassigned:
"These steps use
$actorKey: [{stepIds}]. Reassign them to another actor before removing."Do NOT remove an actor with active step references.
Apply -- rename actor key:
- Rename the key in
x-actors. - Update every
x-as: $oldKeytox-as: $newKeyacross all steps. - Update any
x-actors.{oldKey}.refcross-references.
Apply -- change role:
Verify the new role is registered in the OpenAPI
info.x-roles.Update
x-actors.{key}.role.Consider whether the role change affects authorization -- a step that worked for a manager-class role might not work for a customer-class role. Warn:
"Changing '{actorKey}' from '{oldRole}' to '{newRole}' may affect authorization. Verify that all operations this actor performs are accessible to the new role."
Actor changes warrant a version bump.
F. Extension updates
Update any workflow-level or step-level extension value.
Clarify:
- Which extension to update (e.g.,
x-doc.summary,x-mcp.exposed,tags,x-setup.recipe, step-levelx-ui). - The new value.
Apply:
- Read the current value and present it for reference.
- Apply the update.
- For
x-setup.recipechanges: verify the new recipe exists and provides the outputs the scenario needs. Check that all$setup.outputs.Xreferences inx-actors.*.refand step parameters still resolve. - For
x-mcp.exposed: true: ensuretoolNameanddescriptionare provided. VerifytoolNameis globally unique by scanning other scenario files. - For
tagschanges: note that addingcritical-pathmeans this scenario will block PR merges once test generation is in place. - Extension-only updates (typos, description rewording) do NOT warrant a version bump. Semantic changes (different recipe, changed
x-mcpexposure) DO.
G. Version bump and deprecation
Explicitly bump the version or deprecate the scenario.
Version bump:
- Increment
x-version.currentby 1. - Optionally update
info.versionsemver (minor bump for additive changes, major for breaking changes).
Deprecation:
Set
x-version.statustodeprecated.Require
deprecatedAt(ISO date -- use today's date as default).Require
replacedBy(file stem of the successor scenario).Optionally set
removalDate.Verify the
replacedByscenario exists. If not, warn:"The replacement scenario '{replacedBy}' does not exist yet. Create it with
/design-scenariobefore finalizing deprecation."
Auto-detection of operationId renames
When the user says "update for recent renames" or is unsure which operationIds changed, offer to scan git for renames:
Run
git diff HEAD~5..HEAD --name-status -- 'api/specs/v1/domains/{domain}/operations/'to find renamed or modified operation files.For each modified file, compare the old and new
operationIdvalues usinggit diff HEAD~5..HEAD -- '{file}'.For renamed files (
Rstatus in git), extract the operationId from both the old and new file.Present the detected rename mappings:
"I detected these operationId changes in the last 5 commits:
getRefunds->listRefunds(inlist-refunds.yaml)createRefund->requestRefund(inrequest-refund.yaml)
Apply these renames to the scenario?"
On confirmation, apply each rename using handler A.
Also scan for event name changes:
- Run
git diff HEAD~5..HEAD -- 'api/specs/v1/domains/{domain}/messages/'and comparex-labelvalues. - Present detected changes and apply using handler B on confirmation.
If no renames are detected:
"No operationId or event name changes detected in the last 5 commits for the '{domain}' domain."
Version bump guidance
After applying changes, determine whether a version bump is warranted. Present the recommendation to the user -- they can override, but the default should be correct.
Bump x-version.current (breaking or behavioral change):
- Steps added or removed
- Actor added, removed, or role changed
x-setup.recipechanged to a recipe with a different output contractsuccessCriteriaassertions tightenedx-asynctimeout or assertion changes that could fail previously-passing tests- operationId or event name renames (the scenario's observable behavior changed)
No bump (non-breaking / cosmetic):
x-doctext changes (summary, tutorialNote, businessOutcome)x-uiaction text rewording- Tag additions
x-mcpdescription changes- Typo fixes in descriptions or summaries
Present the recommendation:
"This change warrants a version bump because [reason]. Current version: {N}. Bump to {N+1}?"
Or:
"This change is cosmetic (description update). No version bump needed."
Post-update validation
After every change (or batch of changes), validate the updated file.
Write the modified file to disk.
Spawn the
scenario-validatorsubagent (provided by the specfuse-authoring plugin) to run validation, following its pipeline:./scripts/specfuse/validate-arazzo-spectral.sh(Spectral lint)./scripts/specfuse/validate-arazzo.sh(structural + cross-spec checks)
Process the validation report:
- Auto-fix mechanical issues silently: casing fixes, missing defaults, ISO duration format.
- Surface judgment calls: unresolved references, granularity alerts, cross-spec contradictions.
If new errors were introduced by the change, offer:
"The update introduced {N} validation errors:
{error list}Options: (a) fix them now, (b) revert the change, (c) proceed anyway (not recommended)."
Re-validate after fixes until the report shows zero errors.
Post-update checklist
Verify all of these before reporting completion:
- Target scenario file saved
- All references updated (no dangling
$steps.{id}.outputs.Xor$setup.outputs.X) - All operationIds resolve against OpenAPI
- All event names resolve against AsyncAPI
- Status code assertions still match OpenAPI conventions
- Actor roles are in the closed set
-
x-version.currentbumped if the change is behavioral (not cosmetic) - Granularity still valid (changes did not push step overlap above 80% with another scenario)
- Validation passes with zero errors
- No hardcoded dates -- date tokens used throughout
- No language-specific references