一键导入
gh-debug-x
Debug and fix iOS Swift/ObjC bugs with Morph-X blueprint, transform, audit, and memory fingerprinting to reduce template-code repetition risk.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Debug and fix iOS Swift/ObjC bugs with Morph-X blueprint, transform, audit, and memory fingerprinting to reduce template-code repetition risk.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
Generate and critically evaluate grounded improvement ideas for the current project. Use when asking what to improve, requesting idea generation, exploring surprising improvements, or wanting the AI to proactively suggest strong project directions before brainstorming one in depth. Triggers on phrases like 'what should I improve', 'give me ideas', 'ideate on this project', 'surprise me with improvements', 'what would you change', or any request for AI-generated project improvement suggestions rather than refining the user's own idea.
Create structured plans for any multi-step task -- software features, research workflows, events, study plans, or any goal that benefits from structured breakdown. Also deepen existing plans with interactive review of sub-agent findings. Use for plan creation when the user says 'plan this', 'create a plan', 'write a tech plan', 'plan the implementation', 'how should we build', 'what's the approach for', 'break this down', 'plan a trip', 'create a study plan', or when a brainstorm/requirements document is ready for planning. Use for plan deepening when the user says 'deepen the plan', 'deepen my plan', 'deepening pass', or uses 'deepen' in reference to a plan.
[BETA] Execute work with external delegate support. Same as gh:work but includes experimental Codex delegation mode for token-conserving code implementation.
Execute work efficiently while maintaining quality and finishing features
Refresh stale or drifting learnings and pattern docs in docs/solutions/ by reviewing, updating, consolidating, replacing, or deleting them against the current codebase. Use after refactors, migrations, dependency upgrades, or when a retrieved learning feels outdated or wrong. Also use when reviewing docs/solutions/ for accuracy, when a recently solved problem contradicts an existing learning, when pattern docs no longer reflect current code, or when multiple docs seem to cover the same topic and might benefit from consolidation.
Document a recently solved problem to compound your team's knowledge or update CONCEPTS.md, the project's shared domain vocabulary.
基于 SOC 职业分类
| name | gh:debug-x |
| description | Debug and fix iOS Swift/ObjC bugs with Morph-X blueprint, transform, audit, and memory fingerprinting to reduce template-code repetition risk. |
| argument-hint | [issue reference, error message, test path, or iOS broken behavior] |
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:
memory_root="$(gale-memory resolve-root 2>/dev/null || true)"
[ -n "$memory_root" ] && export HKT_MEMORY_DIR="$memory_root"
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:
memory_root="$(gale-memory resolve-root 2>/dev/null || true)"
[ -n "$memory_root" ] && export HKT_MEMORY_DIR="$memory_root"
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:
memory_root="$(gale-memory resolve-root 2>/dev/null || true)"
[ -n "$memory_root" ] && export HKT_MEMORY_DIR="$memory_root"
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.