본문으로 건너뛰기
Skillpedia
테스트48k · #5096

logic-diff

하는 일

두 버전의 코드를 비교해 같은 일을 하는지 확인합니다. 코드를 단계별로 분석해 동작에서 중요한 차이를 찾아냅니다.

사용하는 경우

  • ✓코드를 리팩터링하고 아무것도 깨지지 않았는지 확인하고 싶을 때.
  • ✓코드를 새 버전으로 옮긴 뒤 결과가 같은지 확인할 때.
  • ✓두 가지 구현(A/B)을 테스트한 뒤 둘이 똑같이 작동하는지 알고 싶을 때.

스킬 링크

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

복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.

사용 방법

가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/logic-diff/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

AI에게 요청하는 예시

“이 두 버전의 코드가 여전히 같은 방식으로 작동하는지 비교해 주세요.”

매주 새 스킬 5개. 읽는 데 1분.

작동 방식

AI는 두 코드 버전을 나란히 분석하며 각 실행 단계를 따라갑니다. 경로나 결과가 어디서부터 달라지는지 기록합니다.

기술 내용 (원본 SKILL.md)

작성자의 영어 원문을 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.
자주 묻는 질문

‘의미적 동등성’이란 무엇인가요?

코드가 다르게 보이거나 다시 작성되었더라도, 같은 입력에 대해 같은 결과를 내거나 실제로 같은 효과를 낸다는 뜻입니다.

‘준형식적 추적(semi-formal tracing)’이란 무엇인가요?

코드의 논리를 단계별로 따라가며 어떤 일이 일어나는지 지도처럼 그려서, 아무것도 놓치지 않도록 하는 방법입니다.

코드의 동작이 의도적으로 다르다면 어떻게 되나요?

계획된 동작 변경을 AI에 알려 주면, 그 내용을 기록하고 예상치 못한 차이만 지적합니다.

상세 정보

작성자의 원본 설명

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

repo: sickn33/agentic-awesome-skills

인기도

GitHub 스타
48k
순위
#5096
라이선스
MIT
업데이트
2026. 10. 15.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬