Langsung ke konten
Skillpedia
Testing48k · #5096

logic-diff

Fungsinya

Membandingkan dua versi kode untuk melihat apakah keduanya menjalankan hal yang sama. Alat ini menganalisis kode langkah demi langkah untuk menemukan perbedaan penting dalam perilakunya.

Kapan dipakai

  • ✓Saat Anda melakukan refactor kode dan ingin memastikan tidak ada yang rusak.
  • ✓Saat memindahkan kode ke versi baru dan memeriksa apakah hasilnya tetap sama.
  • ✓Setelah menguji dua implementasi berbeda (A/B) dan ingin tahu apakah keduanya berfungsi sama.

Link skill

https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/logic-diff/SKILL.md

Salin lalu tempelkan ke AI Anda (Claude, ChatGPT, atau Cursor) dan minta AI mengikuti instruksinya.

Cara pakai

Cara paling mudah: salin pesan ini dan tempelkan ke AI Anda. AI akan membaca skill dan mengikuti instruksinya.

Pesan siap tempel

Gunakan skill ini untuk membantu saya: https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/logic-diff/SKILL.md Baca file SKILL.md di link tersebut dan ikuti instruksinya untuk tugas saya.
Mau AI Anda menemukan skill seperti ini sendiri?Pasang MCP Skillpedia gratis: cukup satu baris, dan AI mencari di antara 15.000+ skill sebelum tiap tugas.Pasang dalam 1 menit →

Contoh permintaan ke AI

“Bandingkan dua versi kode saya ini untuk melihat apakah keduanya masih berperilaku sama.”

5 skill baru setiap minggu. 1 menit baca.

Cara kerjanya

AI menganalisis kedua versi kode secara berdampingan, dengan mengikuti langkah eksekusi masing-masing. AI mencatat bagian mana alur atau hasilnya mulai berbeda.

Konten teknis (SKILL.md asli)

Teks asli dari pembuat, dalam bahasa Inggris, langsung dari GitHub.

Logic-Lens — Semantic Diff

When to Use

Use this skill when you need compare two code versions for semantic equivalence via semi-formal tracing of both versions side-by-side. Trigger when the user shares a refactor, rewrite, migration, or A/B implementation and wants to confirm behavior is unchanged — "did I break anything", "is this equivalent", "are...

Setup

Use lazy loading per ../_shared/common.md §13:

  1. Read ../_shared/common.md only for language, Iron Law, Verdict header, scope routing, Remedy discipline, config fields, and loading budget.
  2. Read only the relevant step in logic-diff-guide.md as you reach it.
  3. Load ../_shared/logic-risks.md, ../_shared/semiformal-guide.md, ../_shared/semiformal-checklist.md, and ../_shared/report-template.md on demand when the current step needs them.

Process

Step 0. Language + scope routing. Detect language per common.md §1. Confirm two versions are provided. If only one version, switch to logic-review.

Step 1. Identify the shared specification (guide Step 1) — what inputs should both versions handle; what outputs/side effects are expected. If the user states the refactor intentionally changed behavior in a specific area (e.g., "I changed the error path to raise instead of returning None"), record that as a declared spec change and treat divergences within that area as expected. Flag only divergences outside the declared change as findings.

Step 2. Build independent premises for each version (guide Step 2) — apply the Premises Construction Checklist to Version A and Version B separately.

Step 3. Trace both versions for the common case (guide Step 3) — parallel trace, same input, note the first divergence if any.

Step 4. Trace boundary cases (guide Step 4) — empty/null/zero, max/min, error inputs, first/last of collections. Start with at most three highest-risk boundary scenarios unless the user asks for exhaustive equivalence or the shared specification requires more.

Step 5. Identify and classify semantic divergences (guide Step 5) — each divergence is a finding with Premises → Trace → Divergence → Trigger → Remedy and an L-code.

Step 6. Equivalence verdict (guide Step 6) — one of: ✅ Semantically Equivalent, ⚠️ Conditionally Equivalent (state the condition precisely), ❌ Semantically Divergent.

Step 7. Output (guide Step 7) — Report Template with the Verdict header per common.md §5; localize headers if the user wrote in Chinese. Format is mandatory even for trivially short snippets: every divergence finding MUST use the five labeled fields (Premises / Trace / Divergence / Trigger / Remedy); never substitute with a plain paragraph or table.

Mode line in report: Semantic Diff (Chinese: 语义对比).

Limitations

  • Use this skill only when the task clearly matches its upstream source and local project context.
  • Verify commands, generated code, dependencies, credentials, and external service behavior before applying changes.
  • Do not treat examples as a substitute for environment-specific tests, security review, or user approval for destructive or costly actions.
Pertanyaan umum

Apa arti 'semantic equivalence'?

Artinya, meskipun kode terlihat berbeda atau sudah ditulis ulang, kode tersebut tetap menghasilkan hasil atau dampak praktis yang sama untuk input yang sama.

Apa itu 'semi-formal tracing'?

Itu adalah cara menelusuri logika kode langkah demi langkah, seperti membuat peta dari apa yang terjadi, untuk memastikan tidak ada yang terlewat.

Bagaimana jika kode memang sengaja memiliki perilaku yang berbeda?

Jika Anda memberi tahu AI tentang perubahan perilaku yang direncanakan, AI akan mencatatnya dan hanya menunjukkan perbedaan yang tidak terduga di luar area tersebut.

Detail

Deskripsi asli dari pembuat

Compare two code versions for semantic equivalence via semi-formal tracing of both versions side-by-side.

repo: sickn33/agentic-awesome-skills

Popularitas

Bintang GitHub
48k
Peringkat
#5096
Lisensi
MIT
Diperbarui
15/10/2026

Apakah skill ini berguna?

0

Masuk untuk memberi suara.

Komentar

  • …

Skill lain dari repositori ini

Skill serupa