release-compliance-gatepublicClosed-loop release-compliance gate: discover scope, audit against a numbered checklist, fix CRITICAL+HIGH, re-audit until zero violations — terminal summary doubles as the compliance certificate.
release-compliance-gatepublicClosed-loop release-compliance gate: discover scope, audit against a numbered checklist, fix CRITICAL+HIGH, re-audit until zero violations — terminal summary doubles as the compliance certificate.
/stagent:start --flow=cloud://release-compliance-gate <task_description>Paste in Claude Code and replace <task_description>
Click any stage above to view its instructions below.
discover_scopeinline· interruptible · transitions: done → audit
Runtime config (canonical): workflow.json → stages.discover_scope
Purpose: Read the repo and interview the user to determine which regulations apply to this release, then produce scope.md — applicable regulations plus a numbered checklist (C1, C2, …) of concrete, testable requirements that downstream stages will audit and fix against.
Output artifact: write to the absolute path provided in your I/O context (the scope.md body lives in the artifact body — the artifact IS scope.md for this workflow).
Valid results this stage writes: pending (drafting / awaiting user answers), done (scope finalized).
This is an interruptible inline stage. The stop hook allows natural pauses for Q&A.
You are the main agent. Read
state.mdfor the current epoch. Then immediately write the artifact at the path shown in your I/O context withresult: pendingso the stop hook knows the stage is in progress. Iterate the body in place; flipresult:todoneonly when the scope checklist is locked.
Read every input from the path shown in your I/O context — never construct or hardcode paths.
release_target run file — the snapshot of detected manifests, store metadata, deployment regions, and SDKs captured at workflow start. Read this first; it answers many questions you would otherwise have to ask.Read the release_target run file. Then look at the repo directly to fill in gaps:
AndroidManifest.xml, Info.plist, package.json, app.json, next.config.*, vercel.json, Dockerfile, etc.fastlane/metadata/, metadata/, app/src/main/play/, listing-text filesprivacy*.md, PRIVACY*, app-privacy.json, App Store privacy plist entriesPodfile.lock, app/build.gradle, package.json, requirements.txt, pyproject.toml, go.mod)vercel.json, wrangler.toml, fly.toml, IaC under terraform/, infra/stripe, paypal, coppa, age, gdpr, ccpa, cmp, consent, analyticsAsk ONLY what the snapshot + repo can't determine. Cover (in priority order, as needed):
Rules:
## Open assumptions of scope.md with conservative defaults (e.g. "assumed EU + US scope; re-run with explicit markets if narrower").Based on app type, markets, industry, and age target, list every regulation that applies. Common ones (non-exhaustive — add what applies):
For every applicable regulation, derive concrete, testable requirements. Each item is one row, numbered C1, C2, … and includes:
C7)GDPR Art. 13, App Store Guideline 5.1.1(i), COPPA §312.4)Each item must be independently auditable by reading code/config — no item should require running the app or interviewing humans again.
scope.md (the artifact body)---
epoch: <epoch from state.md>
result: done
---
# Scope — <App name or repo>
## Release target snapshot
<2–4 lines: app type, primary platform, target markets, age target, industry, release cadence>
## Applicable regulations
- <Regulation 1> — why it applies (1 line)
- <Regulation 2> — why it applies
- ...
## Open assumptions
> Items the user couldn't confirm in 5 questions. Auditor treats these as in-scope by default; user can override on a re-run.
- <assumption 1>
- ...
## Compliance checklist
| C-ID | Regulation | What to check | Where in repo |
|------|------------|---------------|---------------|
| C1 | <ref> | <yes/no claim>| <paths/globs/search terms> |
| C2 | ... | ... | ... |
| ... | ... | ... | ... |
## Notes for the auditor
<Any context the auditor needs that doesn't fit a single C-ID — e.g. "this app uses a custom analytics SDK at packages/analytics; treat all data exports through that module as in-scope".>Show the user the full checklist (or a summary if very long) and ask:
"Scope locked: <N> checklist items across <K> regulations. Confirm to proceed to audit, or call out any items to add/remove/adjust."
If they request changes, iterate on the body — keep result: pending. Once they confirm, edit the artifact: change result: pending → result: done.
That's the only action needed here. The main loop's stage-runner reads the artifact's result: and calls update-status.sh to advance to audit.
## Open assumptions.update-status.sh from this stage — that's the main loop's job.drives the state machine above