Autonomous iOS bug fixer

VerifiedCaution

Automatically fixes an iOS bug reported by /ios-qa: captures the state, edits Swift code, rebuilds and verifies on a real device. Adds a regression test.

Sby Skills Guide Bot
DevelopmentAdvanced
8/29/2026
Claude Code
#ios#swift#bug-fixing#regression-testing#autonomous-agent

Recommended for

Automated summary

This skill autonomously fixes an iOS bug reported by /ios-qa: it reproduces the bug, captures an app-state snapshot, traces the root cause in the Swift source, applies a minimal fix, rebuilds and redeploys the app, then verifies the fix on the real device.

Strengths

  • Full find → fix → verify loop with no human intervention, capped at 3 iterations before escalating
  • Requires a reproducing snapshot before any source edit, preventing unverifiable fixes
  • Persists the pre-bug snapshot plus a regression test under test/fixtures/ios-fix/ so the bug cannot silently return
  • Documents concrete recovery actions for failure modes such as schema_mismatch, device disconnects, and build errors

Limitations

  • Heavily dependent on an external toolchain: StateServer, daemon, xcodebuild, /ios-qa and /investigate must all be available
  • Verification relies on comparing screenshots, which is weak for bugs that have no visible symptom
  • Requires a physical iOS device; regression tests are gated behind GSTACK_HAS_IOS_DEVICE
When to use it

Use it when an /ios-qa run has identified a bug and you want the fix applied, redeployed, and verified automatically on the device.

When not to use it

Avoid it when no test device is connected, or when the root cause is still unknown or ambiguous and needs manual investigation first.

Security analysis

Caution
Quality score84/100

The skill is an autonomous iOS bug-fixer that reads and edits Swift source, drives the device through a local StateServer HTTP API, runs xcodebuild/install, and commits fixtures. All of these are legitimate developer workflows, and there is no evidence of exfiltration, obfuscated payloads, piping remote scripts to a shell, destructive filesystem commands, or safety-disabling behavior. The risk comes purely from the power of the tools (arbitrary Bash/builds, unattended source edits and commits), so it is 'caution' rather than 'risky' or 'safe'.

Findings
  • •Runs xcodebuild/install and edits Swift source autonomously with "zero human intervention"
  • •Talks to a local StateServer HTTP API on the device (POST /tap, /swipe, /type, /state/*, /state/restore) without defining host/auth or restricting endpoints
  • •Automatically commits snapshot fixtures and generated test files alongside fixes
  • •Self-directed revert/retry loop (up to 3 iterations) modifies files without per-step confirmation
How this analysis is made

Examples

Auto-fix a QA finding
/ios-qa flagged a bug where the checkout button stays disabled after applying a coupon — fix this iOS bug end to end and confirm it on the device.
Patch and verify a crash
Patch the iPhone app: the profile screen crashes when the avatar image fails to load. Reproduce it, fix the Swift code, redeploy, and add a regression test.
Close the loop after QA
auto-fix the iOS issue reported in the last /ios-qa run, and commit the pre-bug snapshot fixture alongside the change.

name: ios-fix preamble-tier: 2 version: 1.0.0 description: | Autonomous iOS bug fixer. Takes a bug found by /ios-qa, reads the source, writes the fix, rebuilds, redeploys, and verifies the fix on the real device. Closes the loop: find bug → fix bug → confirm fix — zero human intervention. Captures the pre-bug state snapshot as a regression test fixture, so the bug can never recur silently. Use when /ios-qa reports a bug and you want it fixed automatically, or when asked to "fix this iOS bug", "patch the iPhone app", or "auto-fix the iOS issue". (gstack) voice-triggers:

  • "fix the iOS bug"
  • "patch the iPhone app"
  • "auto-fix the iOS issue" allowed-tools:
  • Bash
  • Read
  • Write
  • Edit
  • Grep
  • Glob
  • AskUserQuestion triggers:
  • fix this ios bug
  • patch the iphone app
  • auto-fix the ios issue

{{PREAMBLE}}

Autonomous iOS bug fixer

Iron Law

NO FIX WITHOUT A REPRODUCING SNAPSHOT. Before editing any Swift source, the agent MUST capture a GET /state/snapshot that reproduces the bug. That snapshot becomes a regression test fixture (test/fixtures/ios-fix/). A fix that lands without a reproducing snapshot is a fix you'll be re-fixing in three months.

Phase 1: Reproduce the bug

  1. Read the /ios-qa finding (bug description, screenshot, suspected accessibility-tree node).
  2. Bring the device into the bug state via POST /tap, /swipe, /type, or POST /state/<key> (snapshot-eligible fields only).
  3. Capture GET /state/snapshot → write to test/fixtures/ios-fix/<bug-slug>-pre.json.
  4. Capture GET /screenshot → write to test/fixtures/ios-fix/<bug-slug>-pre.png.
  5. Persist a one-line description of what's wrong + expected behavior.

Phase 2: Locate root cause

Per /investigate's Iron Law: no fix without root cause. The agent reads the Swift source, traces from the buggy screen back to the view model, the data flow, and the state mutation. Identify the smallest change that fixes the behavior.

Use AskUserQuestion if there are multiple plausible root causes — let the user pick the one to fix.

Phase 3: Apply fix

  1. Edit Swift source. Keep the diff minimal.
  2. Rebuild: xcodebuild -scheme <SchemeName> -destination 'platform=iOS,id=<UDID>' build install.
  3. Daemon detects the rebuild and reconnects the StateServer tunnel.
  4. Re-deploy. The same boot-token rotation flow runs.

Phase 4: Verify

  1. POST /state/restore with the pre-bug snapshot → reproduces the state.
  2. Take a fresh screenshot. Compare against test/fixtures/ios-fix/<bug-slug>-pre.png.
  3. If the bug visibly persists, the fix didn't work — revert and try again (max 3 iterations before escalating to the user).
  4. If the bug is gone, capture <bug-slug>-post.png for the regression test.

Phase 5: Add regression test

Write a test in test/fixtures/ios-fix/<bug-slug>.test.ts that:

  1. Loads the pre-bug snapshot.
  2. Restores it via POST /state/restore.
  3. Asserts the post-fix behavior on a real device (gated GSTACK_HAS_IOS_DEVICE=1, periodic tier).

Commit the snapshot fixture + test file alongside the fix.

Failure modes

| Symptom | Action | |---|---| | 3 iterations, bug still present | STOP, report to user with current best hypothesis | | 409 schema_mismatch on /state/restore after rebuild | Re-codegen accessors (swift run gen-accessors), re-snapshot | | Device disconnects mid-fix | Daemon auto-reconnects; resume from Phase 4 | | Build fails | Revert Swift edits; investigate compile error before re-applying fix |

From the file to a first result

The download contains exactly the content displayed on this page. This copy may differ from the latest version in the source repository.

View the source and supporting files

This download contains SKILL.md only. Any scripts, references, templates and dependencies are not included. Get the required files from the source, preserving their directory structure, before continuing.

1. Download the file

Download SKILL.md

From the root of a test project, save the file as .skill-downloads/autonomous-ios-bug-fixer-mte1lhd1/SKILL.md, or use the command below. This folder is for inspecting the skill before installation.

Command for macOS/Linux or WSL: requires a POSIX shell and curl. On Windows without WSL, use the download button and create the folder manually.

mkdir -p '.skill-downloads/autonomous-ios-bug-fixer-mte1lhd1' && curl --fail --show-error --location 'https://skills-guides.com/api/skills/autonomous-ios-bug-fixer-mte1lhd1/download' --output '.skill-downloads/autonomous-ios-bug-fixer-mte1lhd1/SKILL.md.part' && mv '.skill-downloads/autonomous-ios-bug-fixer-mte1lhd1/SKILL.md.part' '.skill-downloads/autonomous-ios-bug-fixer-mte1lhd1/SKILL.md'

2. Check prerequisites

Read SKILL.md before using it. If it references scripts or external services, inspect them and prepare the required access in your test environment.

No recognized prerequisites section in this file. This does not mean it is self-contained: libraries, tools and access requirements may be mentioned elsewhere in the content or source repository.

The platforms on this page are catalog indications. The paths below follow tool documentation; they do not prove this skill has been run in those tools. No minimum tool version is confirmed for this listing.

3. Load the skill

After inspection, copy the complete folder into your project using one of the commands below, then open a new tool session. The command stops if a folder with the same name already exists: compare the files before replacing it.

Claude Code
test -f '.skill-downloads/autonomous-ios-bug-fixer-mte1lhd1/SKILL.md' && test -s '.skill-downloads/autonomous-ios-bug-fixer-mte1lhd1/SKILL.md' && mkdir -p '.claude/skills' && test ! -e '.claude/skills/ios-fix' && cp -R '.skill-downloads/autonomous-ios-bug-fixer-mte1lhd1' '.claude/skills/ios-fix'

OpenSkills

OpenSkills must already be installed. The local install/read procedure is checked with OpenSkills 1.5.0, which requires Node.js ≥ 20.6.0. Catalog slugs are not resolved automatically.

Official OpenSkills installation
openskills install './.skill-downloads/autonomous-ios-bug-fixer-mte1lhd1'

openskills read 'autonomous-ios-bug-fixer-mte1lhd1'

Reading should display the installed file content and its base directory. It does not run the skill or install its dependencies.

For an agent that reads AGENTS.md, then sync the index. This command changes AGENTS.md: review the diff before using it.

openskills sync

Manual method or another tool: attach SKILL.md to a conversation, or open it in an agent that can read files. Include any required supporting resources. No universal folder is recognized by every tool.

4. Try a first task

Use a short, synthetic input: an API endpoint, a small document or an interface brief. In a new conversation, attach the file or give the agent its path, then adapt this request:

Read .skill-downloads/autonomous-ios-bug-fixer-mte1lhd1/SKILL.md and apply its instructions to this example: [describe a test input]. Identify any missing files, dependencies or access. Produce the result requested by the skill without inventing data or running unreviewed scripts.

Expected result: output matching the skill instructions, or a precise list of missing prerequisites. A read confirmation alone does not validate a first use. If an external resource is unavailable, that path remains untested.

Related skills