# iOS Debug Bridge Cleaner Skill

> Strips leftover debugging tools and code from your iOS app.

- **What it does:** Cleans out the temporary debugging tools and the code that supports them from your iPhone app project. You end up with a tidier app without leftover test-only parts.
- **Agents:** Claude Code and Codex (through orbit-connect), Claude and ChatGPT (through the Orbit connector)
- **Install:** `npx -y --loglevel=error orbit-connect@0.3.33 install skl_fc3164c3af89955fe62556b8`
- **Creator:** Mariah Brunner (@itsmariahbrunner) on Instagram
- **Posted by:** 4 creators: [@okaashish](https://www.instagram.com/reel/Da7xf8rviQU/), [@waitwhatdidyoudo](https://www.instagram.com/reel/DfclqC_qO1I/), [@ia digital web](https://www.youtube.com/watch?v=yR39Pk98yRk), [@alex hitt](https://www.youtube.com/watch?v=W2fQILoKozs)
- **Reach:** Creators' posts about it have 1,066,893 views
- **Safety:** Checked by Orbit: use with care. Broad Bash; runs local scripts, telemetry, follows embedded directive blocks
- **Last updated:** 2026-11-25
- **Page:** https://orbitinbox.app/s/gstack-skill-to-clean-ios-debug-packages

## Skill

---
name: ios-remove-debugbridge
description: Use when removing the DebugBridge SPM package and #if DEBUG wiring from an iOS app: inventories, removes with confirmation, verifies Release build.
---

# Remove iOS DebugBridge

## What this does
Strips the DebugBridge SPM package and all debug-only wiring from an iOS app. This is a convenience flow, not a safety mechanism. Release safety should come from the package manifest's `.when(configuration: .debug)` condition plus a CI check that a release build lacks the DebugBridge symbol.

## When to use
- DebugBridge files were copied in manually.
- You want a guided, reversible removal before a security audit.
- You are migrating away from gstack and want a clean exit.

## What it removes (each item only after user confirmation)
1. The `DebugBridge` SPM target/dependency in `Package.swift`.
2. The `#if DEBUG` block in the `@main` entry that calls `DebugBridgeManager.shared.start()`.
3. Standalone `// @Snapshotable` marker comments on the app state class.
4. The generated `DebugBridge/` package directory, `DebugBridgeGenerated/` (accessors, `.gstack-version`), and other generated `StateAccessor.swift` files.
5. Best-effort: the `gstack-ios-qa.token` file under `NSTemporaryDirectory()` on a connected device.

It does NOT touch app business logic, view models, views, anything outside `#if DEBUG` blocks, or other test/QA infrastructure.

## How to run it

### Phase 1: Inventory
1. Glob for `import DebugBridge` across the app source.
2. Glob for `#if DEBUG ... DebugBridgeManager` blocks.
3. Grep `StateAccessor.swift` files for the header `// AUTO-GENERATED — DO NOT EDIT. Regenerate with /ios-sync.`
4. Parse `Package.swift` for the DebugBridge dependency entry.
5. Show the user the file list and line counts. Ask: proceed, dry-run, or abort.

### Phase 2: Remove
For each approved item:
1. Edit out the import and the `#if DEBUG` block, leaving surrounding code intact.
2. Edit `Package.swift` to remove the local `.package(path: ...DebugBridge...)` entry and every target dependency on a `DebugBridge*` product (`DebugBridgeUI`, `DebugBridgeCore`, `DebugBridgeTouch`).
3. Delete the generated `DebugBridge/` and `DebugBridgeGenerated/` directories and other generated `StateAccessor.swift` files.
4. Run `xcodebuild -scheme {SchemeName} -destination 'platform=iOS,id={UDID}' build install -configuration Release`. If it fails on a missing DebugBridge symbol, the removal was incomplete: STOP and report.

### Phase 3: Verify
1. `! grep -r "DebugBridge" {app-source-dir}` (no matches)
2. `! grep -r "@Snapshotable" {app-source-dir}` (no matches)
3. `swift build -c release` succeeds
4. `nm -j` on the built binary shows no DebugBridge symbols

## Reversibility
Every edit and delete is a git operation, so the user can `git restore`. Never force-push, amend, or delete the SPM cache; those are user choices.

## Output
The cleanup result plus a one-line summary of what was removed.

## Credit
Based on public content by garrytan, packaged by Orbit.

Shared by Mariah Brunner, credited on Orbit.