一键导入
git-changes-context
// Reliably obtain a non-empty unified git diff for the current branch using safe fallbacks (origin/HEAD...HEAD, origin/main...HEAD, origin/master...HEAD) and return structured JSON containing the diff and the command used.
// Reliably obtain a non-empty unified git diff for the current branch using safe fallbacks (origin/HEAD...HEAD, origin/main...HEAD, origin/master...HEAD) and return structured JSON containing the diff and the command used.
Use when AI-generated or AI-modified changes need a Code Health gate before commit, handoff, or pull request.
Run linting and unit tests against the current repository, auto-discovering the correct commands from Justfile, Makefile, pyproject.toml, or package.json.
Create a conventional commit from staged changes, with a diff-derived description body.
Produce an implementation plan with a functional-leaning, idiomatic style mindset; prefers lightweight data structures over dataclasses/pydantic unless justified.
Coding style policy for generated code: prefer idiomatic language conventions with a functional-leaning approach (pure-ish functions, composability), and prefer lightweight data structures over heavy schema/class abstractions unless clearly justified.
| name | git-changes-context |
| description | Reliably obtain a non-empty unified git diff for the current branch using safe fallbacks (origin/HEAD...HEAD, origin/main...HEAD, origin/master...HEAD) and return structured JSON containing the diff and the command used. |
Provide a deterministic way to obtain the actual change set (unified diff) for use by other agents (code review, security audit, test analysis, etc).
This skill MUST be used whenever a task depends on reviewing changes.
Follow these steps strictly and in order.
Important: You MUST attempt every step below until you find a non-empty diff.
Do not return NO_DIFF_FOUND after running only one command.
For each step:
diff_source_command to the exact command string, set diff_context to the raw unified diff, and stop.Run:
git diff origin/HEAD...HEAD
Run:
git diff origin/main...HEAD
Run:
git diff origin/master...HEAD
If ALL of the above steps either error or produce empty output:
Return:
diff_source_command = nulldiff_context = ""error = "NO_DIFF_FOUND"Do not guess. Do not fabricate changes. Do not continue silently.
You MUST return JSON only.
Return exactly this shape:
{ "diff_source_command": string | null, "diff_context": string, "error": string | null }
Rules:
diff_context must contain raw unified diff text.error must be "NO_DIFF_FOUND".This skill guarantees: