From galeharness-cli
Debug and fix iOS Swift/ObjC bugs with Morph-X blueprint, transform, audit, and memory fingerprinting to reduce template-code repetition risk.
npx claudepluginhub wangrenzhu-ola/galeharnesscodingcli --plugin galeharness-cliThis skill uses the workspace's default tool permissions.
Find the root cause first, then fix it with normal debug discipline plus Morph-X safeguards for iOS Swift/ObjC changes. This reduces template-code repetition risk; it does not guarantee App Review success and does not replace genuine product, UI, content, metadata, or feature differentiation.
Creates isolated Git worktrees for feature branches with prioritized directory selection, gitignore safety checks, auto project setup for Node/Python/Rust/Go, and baseline verification.
Executes implementation plans in current session by dispatching fresh subagents per independent task, with two-stage reviews: spec compliance then code quality.
Dispatches parallel agents to independently tackle 2+ tasks like separate test failures or subsystems without shared state or dependencies.
Find the root cause first, then fix it with normal debug discipline plus Morph-X safeguards for iOS Swift/ObjC changes. This reduces template-code repetition risk; it does not guarantee App Review success and does not replace genuine product, UI, content, metadata, or feature differentiation.
<bug_description> #$ARGUMENTS </bug_description>
Run:
gale-task log skill_started --skill gh:debug-x --title "<bug-description>" 2>/dev/null || true
If gale-task is unavailable, skip silently. This must never block debugging.
| Phase | Name | Purpose |
|---|---|---|
| 0 | Triage | Parse input, fetch issue if referenced, retrieve memory |
| 1 | Investigate | Reproduce the bug and trace the code path |
| 2 | Root Cause | Test hypotheses, enforce causal chain gate |
| 3 | Fix | Test-first fix with Morph-X blueprint constraints |
| 4 | Morph-X | Apply transform, audit similarity, store fingerprints |
| 5 | Close | Structured summary and handoff |
Parse the input and create a clear problem statement.
If the input references an issue tracker, fetch the issue when possible and extract symptoms, expected behavior, reproduction steps, and environment details. If the tracker cannot be fetched, ask the user for the relevant issue content.
Retrieve related bugs, root causes, implementation constraints, and prior Morph-X blueprint/strategy fingerprints:
hkt-memory retrieve \
--query "<error, symptom, iOS component, Swift/ObjC file, blueprint or strategy tags>" \
--layer all --limit 10 --min-similarity 0.35 \
--vector-weight 0.7 --bm25-weight 0.3
Use results as context only. They may inform hypotheses and blueprint constraints, but do not copy historical code structure. If retrieval fails or returns nothing, proceed silently without blocking investigation.
Search related historical debug sessions:
hkt-memory session-search \
--query "gh:debug-x <error message or bug summary>" \
--limit 5
Use returned sessions as supplementary context. If unavailable, continue silently; session search is non-blocking.
Ask questions only when ambiguity blocks investigation. If the user mentions prior failed attempts, ask what was tried before reproducing.
Form ranked hypotheses. For each:
Causal chain gate: Do not proceed to Phase 3 until the full causal chain has no gaps, unless the user explicitly authorizes proceeding with the best available hypothesis.
Present findings before fixing: root cause, proposed fix, files likely to change, tests to add or update, and whether existing tests should have caught the bug.
If the user chose diagnosis-only handoff, skip the fix and move to close.
Before writing Swift/ObjC fix code:
git status and protect uncommitted user work..morph-config.yaml from the target iOS project root if present; otherwise use in-memory defaults.Then fix test-first:
After the fix is implemented:
Apply safe transformation when available:
gale-harness morph --apply --config .morph-config.yaml --report .morph-report.json
The transform must preserve semantics. If the command, SwiftSyntax, or ObjC support is unavailable, skip it, record the degraded reason, and continue.
Run similarity audit:
gale-harness audit --similarity --config .morph-config.yaml --report .morph-audit.json
Capture AST/structure fingerprint, token n-gram, statement Jaccard, and control-flow approximation metrics when available. Missing baselines or tools are non-blocking degraded signals.
Handle thresholds:
.morph-config.yaml sets a blocking threshold and the audit exceeds it, pause and ask the user how to proceed.After diagnosis, or after the fix and Morph-X audit when a fix was applied, store a concise memory record:
hkt-memory store \
--content "<bug, root cause, fix or diagnosis-only result, repo-relative files, blueprint constraints, strategy fingerprint, audit status, degraded fallback notes>" \
--title "<debug-x bug title>" \
--topic "debug-x morph blueprint strategy fingerprint" \
--layer all
Store only summaries, tags, and fingerprints; do not store full source code. On error, note it as non-blocking and do not fail the debug workflow.
Return:
## Debug-X Summary
**Problem**: [what was broken]
**Root Cause**: [full causal chain with file references]
**Fix**: [what changed or diagnosis only]
**Blueprint**: [constraints and strategy fingerprint]
**Morph Apply**: [report path or degraded reason]
**Similarity Audit**: [report path, threshold result, blocking/warning decision]
**Tests**: [commands run and results]
**Compliance Boundary**: Reduces template-code repetition risk; does not guarantee App Review success.
Handoff options: commit the fix, document as a learning, post findings to the issue, view in Proof, or done.
Run gale-task log skill_completed 2>/dev/null || true. If unavailable, skip silently.