feat(stagecraft): a getting-started walkthrough for a first factory, and incident-review, content-review and openapi-models examples (swamp-club #2931) #432
Loading…
Reference in a new issue
No description provided.
Delete branch "cue/2931-gatorwalk-factory-skill"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes swamp-club #2931.
What
references/getting-started.md: a guided walkthrough for a first factory, modelled on swamp-getting-started.authoring.md's states for the actual work instead of repeating them.authoring.md(Before starting) anddriving.md(Set up a factory) all send it there.incident-review.yaml: timeline → analysis → second-reader review → a person signs off on the action items → publish.content-review.yaml: draft → editorial review → a person approves → publish.openapi-models.yaml: one work item is an API's OpenAPI spec, or a slice of it, and ends with a swamp extension whose models call the API.maxCycles, and theirreviseexits need the person's recorded feedback.starter.yamlis unchanged, as decided in triage: it stays the simple software template.getting-started.mdpoints at a file and heading that exist.init --from. The walkthrough copies the example in the wayauthoring.mdalready does, and adding a method was out of scope.Verification
getting-started.md's links are checked.Acceptance run
Setup:
claude -pprocess, not a subagent, in a scratch swamp repo outside this checkout.--resume, with Claude answering as the person.First attempt: the agent read
authoring.mdand skipped the walkthrough. That led to the routing rule above.Re-run (transcript below):
post-incident-reviewfromincident-review.validatereported 0 warnings and 3 saved scenarios passed, including the person's "never published without sign-off" rule.The studio stops when a headless
-pturn ends. I re-served it and confirmed/api/factorieslistspost-incident-review.Transcript
Person: I want to set up a factory for our post-incident reviews.
Skill:stagecraftRead:.claude/skills/stagecraft/references/getting-started.mdBash:swamp model search stagecraft --jsonBash:swamp model type search stagecraft --json 2>&1Read:.claude/skills/stagecraft/references/examples/incident-review.yamlAgent: This repo has the stagecraft extension installed and no factories yet, so we'll build your first one. Here's how it'll go:
There's a ready-made incident-review example that should fit closely. Before I adapt it, tell me how your reviews actually run. Next to each question is what I'll assume if you don't say otherwise, so a short answer is fine:
Assumed: an incident goes in, and a published, blameless review comes out.
Assumed: an agent drafts the timeline with you from chat logs, alerts and dashboards. It then writes the analysis: what contributed to the incident, and action items that each have an owner. A separate agent acts as a second reader and tries to poke holes in the analysis.
Assumed: someone signs off on the action items before anything is published, and someone confirms before a review is abandoned.
Assumed: the review is published somewhere, with the location recorded. Where do yours go: a wiki, a doc, a shared folder?
Assumed: the second reader finds a serious problem, such as a wrong cause, a missed factor or blame on a person, or the sign-off person asks for changes. After three rounds, a person decides whether another round is worth it.
Also: is there anything your write-ups always include that I haven't mentioned? For example, severity, detection time, customer impact, or follow-up tickets in a tracker. I'll track tickets in stagecraft's built-in tracker unless you use something like Linear.
Person: Mostly right. We publish to our Confluence space, a page under Incidents. Every write-up has a severity (SEV1 to SEV3). Our on-call lead signs off. And the one thing that must never happen: a review gets published without sign-off. Built-in tracker is fine.
Read:.claude/skills/stagecraft/references/authoring.mdRead:.claude/skills/stagecraft/references/scenarios.mdBash:swamp model create @swamp/stagecraft/tracker incidents --global-arg prefix=inc --json && swamp model create @swamp/stagecraft/factory post-iRead:models/@swamp/stagecraft/factory/post-incident-review.yamlRead:models/@swamp/stagecraft/tracker/incidents.yamlEdit:models/@swamp/stagecraft/tracker/incidents.yamlAgent: The tracker is set up. Now I'm writing the factory definition: adding severity, the on-call lead's sign-off and the Confluence publish step.
Write:models/@swamp/stagecraft/factory/post-incident-review.yamlBash:swamp model method run post-incident-review validate 2>&1Agent: That failure is mine: an unquoted comma inside the scenario's feedback text broke the YAML. Fixing it.
Edit:models/@swamp/stagecraft/factory/post-incident-review.yamlEdit:models/@swamp/stagecraft/factory/post-incident-review.yamlBash:swamp model method run post-incident-review validate 2>&1Agent: Validation is clean: no warnings, and all three saved scenarios pass. Starting the studio so you can see the factory.
Bash:swamp model create @swamp/stagecraft/studio studio --json >/dev/null && echo createdBash(background):swamp model method run studio serve 2>&1Read:<the studio serve output file>Agent: I've built your post-incident review factory,
post-incident-review, and it passes its checks: no problems found, and all three sample paths through it work as expected.See it in the studio: http://127.0.0.1:37967/ (it stays running)
How a review moves through it:
The analysis can be sent back at most 3 times; after that, a person decides whether another round is worth it. Abandoning a review also needs a person to confirm.
Your "never published without sign-off" rule is enforced, not just intended. The only way into publish is the on-call lead's sign-off, and I saved a test path that
validatechecks every time the factory changes. It confirms that a review can't go to publish:In the studio, gold marks the places it stops for a person. Simulate plays these paths step by step. The page is read-only, so tell me any change you want in plain words, or paste a line from Copy reference.
I also set up the built-in tracker,
incidents. Its tickets get ids starting withinc-, with "incident" as the ticket type.Does the design look right? If so, we can run a real incident through it now and drive it to its first stop for the on-call lead, or leave that for later.
Person:
bx03qdeor
toolu_01ANnqP7S4QiciojhsKURrHS
stopped
Background shell command didn't finish before the previous session ended
No completion record was found for it in the previous session. It may have been stopped (via the UI, Monitor timeout, or agent teardown — these leave no transcript marker), or it may have been running when the previous Claude Code process exited. Check the output file for partial results before assuming it completed.Person: I opened the studio and it looks right. I played the sign-off path in Simulate and it makes sense. Let's leave a real incident for later.
Agent: Good, the factory is ready, and we'll leave the first real incident for later.
What you have
post-incident-review: timeline (with severity) → analysis → second-reader review → on-call lead sign-off → publish to Confluence under Incidents.validatechecks on every change:never-published-without-sign-off, your hard rule.timeline-to-published, the normal path.sign-off-feedback, where the lead sends it back.incidents: built in, ticket ids start withinc-.The studio server has stopped now that the earlier session ended. When you want the page again, run
swamp model method run studio serveand open the URL it prints.The new files are under
models/and haven't been committed yet.Possible next steps:
Want me to do any of these now?
Eval cases for the walkthrough (for #2912)
Not added here; #2912 builds the suite. Each case loads only the stagecraft skill.
1. first-factory-non-software
swamp init --tool none,swamp extension source add <stagecraft checkout from EVAL_STAGECRAFT_DIR>.tool_usedRead withinput_match: getting-started\.md.tool_usedBash withinput_match: method run .* validate,min: 1.tool_usedBash withinput_match: studio serve.file_existsmodels/@swamp/stagecraft/factory/*.yaml.regexon the trace forsaved scenario\(s\) passed.llmrubric:2. existing-factory-hands-off
minimal.regexonlast_message: it says a factory exists and asks whether to change it, make another or drive work.tool_usedBash withinput_match: model create @swamp/stagecraft/factory,max: 0.Trigger phrases
🤖 Generated with Claude Code