fix-issue

Installation
SKILL.md

Fix Issue

Resolve a reported GitHub issue: understand it, trace to the root cause, fix portably, and lock the fix in with a bats test.

Steps

  1. Pull the issuegh issue view <number> for title, body, comments. If the user pasted a URL, extract the number from it.
  2. Reproduce — run the failing flow against a fresh fixture (use setup_test_project from tests/test_helper.bash so you don't contaminate the working tree). A bug you can't reproduce is a bug you can't verify fixed.
  3. Trace to the root cause — work outward from the symptom: bin/agentsync.sh (command routing) → lib/sync.sh (per-tool loop) → lib/helpers/*.sh (file ops, YAML parsing, rule merging, format conversion, path safety) → .ai/src/tools/*.yaml. Don't stop at the first plausible cause.
  4. Fix with the smallest correct change — touch only the code that owns the bug. Three similar lines beat a premature abstraction.
  5. Keep it portable — POSIX sed (write-then-mv), cd "$(dirname "$path")" && pwd instead of realpath, quoted "$var", local in functions, set -euo pipefail stays on.
  6. Lintshellcheck -x -S warning -e SC1091 <changed-scripts>. Resolve warnings; don't paper over with # shellcheck disable=.
  7. Add a bats regression test — fails on main, passes on the fix. Name by behaviour: @test "sync: <what the bug broke> stays correct". Hermetic temp dirs via setup_test_project / teardown_test_project.
  8. Run the full suitebats tests/. Every test green, not just the new one.
  9. Commit referencing the issuefix: <subject> (#<issue-number>) so GitHub auto-closes on merge.

Gotchas

Installs
1
GitHub Stars
9
First Seen
Jun 4, 2026
fix-issue — yelmuratoff/agent_sync