ios-clean
The facts
Its description
Remove the DebugBridge SPM package and all #if DEBUG wiring from an iOS app. (gstack) Triggers: clean the ios debug bridge; remove debugbridge; strip the gstack ios instrumentation
The description the agent reads to decide when to use it. Phrases the author says should start it.
When it starts
A person working on an iOS app asks to take the gstack DebugBridge instrumentation back out — removing the SPM package, the #if DEBUG wiring, and the generated files — often before a security audit or when leaving gstack. The description and triggers are all about cleaning/removing the debug bridge, so any request phrased that way would pull it in.
Things a person might say (the model's guesses)
- “remove the DebugBridge package from my iOS app”
- “clean the ios debug bridge before our security audit”
- “strip the gstack ios instrumentation out of this project”
A model's summary of when it is used.
Tools it may use, or may not
allowed-tools: Bash, Read, Edit, Glob, Grep, AskUserQuestion
Tools it may use while it runs without asking you first.
Runs scripts
bin/gstack-skill-start, scripts/question-registry.ts, bin/gstack-question-preference, bin/gstack-question-log, bin/gstack-skill-end
Scripts the text names. Found by matching words, so treat them as pointers.
Stops for a person
5 lines stop to ask a person
Lines that stop and wait for a person before going on. Found by matching words, so treat them as pointers.
What leads to it
- gstack hands off to this PROACTIVE all, or user names it gstack, line 249
- ios-qa calls this before a Release build ios-qa, line 392
Other skills that hand off to this one, call it, require it or offer it instead, as a model read them.
Licence
MIT, from LICENSE
The terms its author shares it under, which let it be shown here.
Other files in this skill (1) Close
The text
Most marks come from matching words in the file, so treat them as pointers.
<!-- AUTO-GENERATED from SKILL.md.tmpl — do not edit directly --> <!-- Regenerate: bun run gen:skill-docs -->
Raw lines 1 to 20Boilerplate, lines 21 to 77. The same text appears in 45 other files here. Close
Telemetry (run last)
After workflow completion, log telemetry with ONE command. OUTCOME is success/error/abort/unknown; SESSION_ID and TEL_START are the values the preamble's skill-start output echoed. It also drains the artifacts-sync queue (the former skill-end sync step — do not run gstack-brain-sync separately).
PLAN MODE EXCEPTION — ALWAYS RUN: This writes telemetry to $GSTACK_STATE_ROOT/analytics/, matching preamble analytics writes.
~/.claude/skills/gstack/bin/gstack-skill-end --skill "ios-clean" --outcome OUTCOME \
--session-id "SESSION_ID" --tel-start "TEL_START" --used-browse USED_BROWSE \
--error-message "ERROR_MESSAGE" --failed-step "FAILED_STEP" 2>/dev/null || trueReplace OUTCOME and USED_BROWSE (yes/no) before running; substitute SESSION_ID/TEL_START from the skill-start echoes. ERROR_MESSAGE/FAILED_STEP are "" unless outcome is error. If the command is missing (stale install), skip telemetry — it never blocks the workflow.
Strip the DebugBridge from an iOS app
This skill is a convenience flow, not a safety mechanism. The structural guard against shipping DebugBridge in Release is in Package.swift.template (.when(configuration: .debug)) plus the CI invariant test that runs swift build -c release and asserts the DebugBridge symbol is absent. Both ship as part of /ios-qa's template installation.
This skill exists for developers who:
- Manually copied DebugBridge files (without using
/ios-qa's SPM install). - Want a guided, reversible removal flow before a security audit.
- Are migrating away from gstack and want a clean exit.
What it removes
Each item is reverted only after AskUserQuestion confirmation:
- The
DebugBridgeSPM target fromPackage.swift. - The
#if DEBUGblock in the app's@mainentry that callsDebugBridgeManager.shared.start(). - Any standalone
// @Snapshotablegenerator marker comments on the canonical app state class. - The generated
DebugBridge/package directory andDebugBridgeGenerated/(accessors and.gstack-version) thatgstack-ios-qa-regenwrote under the app source, plus any other generatedStateAccessor.swiftfiles. - The
gstack-ios-qa.tokenfile underNSTemporaryDirectory()on the device (best-effort — only works if device is connected when /ios-clean runs).
What it does NOT touch
- App business logic, view models, view code.
- Anything outside
#if DEBUGblocks. - Other test or QA infrastructure.
Phase 1: Inventory
- Glob for
import DebugBridgeacross the app source. - Glob for
#if DEBUG ... DebugBridgeManagerblocks. - Grep
StateAccessor.swiftfiles for the generator header// AUTO-GENERATED — DO NOT EDIT. Regenerate with /ios-sync. - Parse
Package.swiftfor the DebugBridge dependency entry. - Show the user what's about to be removed (file list + line counts). AskUserQuestion: proceed, dry-run, or abort.
Phase 2: Remove
For each item the user approved:
- Use Edit tool to strip the import + the
#if DEBUGblock (keep the surrounding code intact). - Use Edit tool to remove the local
.package(path: ...DebugBridge...)entry fromPackage.swiftand every target dependency on aDebugBridge*product (DebugBridgeUI,DebugBridgeCore,DebugBridgeTouch). - Delete the generated
DebugBridge/andDebugBridgeGenerated/directories and any other generatedStateAccessor.swiftfiles. - Run
xcodebuild -scheme <SchemeName> -destination 'platform=iOS,id=<UDID>' build install -configuration Releaseto verify Release builds without the bridge. If it fails on a missing DebugBridge symbol, the removal was incomplete — STOP and report.
Phase 3: Verify
! grep -r "DebugBridge" <app-source-dir>(no matches).! grep -r "@Snapshotable" <app-source-dir>(no matches).swift build -c releasesucceeds.nm -jon the built binary doesn't show DebugBridge symbols.
Report the cleanup result + a one-line summary of what got removed.
Raw lines 161 to 169Reversibility
Every Edit + delete is a git operation; the user can git restore to undo. This skill never force-pushes, never amends, never deletes the SPM cache — those are user choices.
From garrytan/gstack at 3f79d81, 2026-11-01. Skills read by DeepSeek V4.1 Flash on 2026-11-04. Summary and techniques by Claude Opus 5.5 on 2026-11-06.