Skip to content

feat: semantic diff explainer command#71

Open
marcus wants to merge 1 commit intomainfrom
semantic-diff
Open

feat: semantic diff explainer command#71
marcus wants to merge 1 commit intomainfrom
semantic-diff

Conversation

@marcus
Copy link
Copy Markdown
Owner

@marcus marcus commented Mar 22, 2026

Summary

  • Adds td diff command that explains the semantic meaning of code changes
  • Parses unified git diffs into structured FileDiff/Hunk data via internal/diff/parse.go
  • Uses Go AST analysis (internal/diff/semantic.go) to identify symbol-level changes: functions, types, methods, imports, consts, vars added/removed/modified
  • Supports --staged, --ref HEAD~N, --issue (diff since issue start snapshot), and --json output

Test plan

  • Parser tests: add/delete/modify/rename/multiple files, hunk range edge cases
  • AST analysis tests: added function, removed type, modified method signature, changed imports, const/var changes, nil source handling
  • Command tests: registration, flag defaults, flag existence, parse+summarize integration
  • Full go build ./... and go test ./... pass

🤖 Generated with Claude Code

Parses unified git diffs into structured data, then uses Go AST analysis
to identify symbol-level changes (functions/types/methods/imports
added/removed/modified). Supports --staged, --ref, --issue, and --json.

Nightshift-Task: semantic-diff
Nightshift-Ref: https://github.com/marcus/nightshift

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant