Vercel Composition Patterns
supabase/supabase
React composition patterns that scale. An agent skill from supabase/supabase.
Diagnose unexpected diff output by tracing the pipeline from parsing through AST processing to hunk generation.
$ npx skills add afnanenayet/diffsitter --skill debug-diff -a claude-codeProject install by default; add -g for ~/.claude/skills/.
$ gh skill install afnanenayet/diffsitter debug-diff --agent claude-codeProject scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).
$ git clone --depth 1 https://github.com/afnanenayet/diffsitter.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.claude/skills/debug-diff .claude/skills/debug-diff && rm -rf skills-srcUse ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.
Claude Code skills documentation · loads skills from .claude/skills/
Install the "debug-diff" agent skill from https://github.com/afnanenayet/diffsitter/tree/main/.claude/skills/debug-diff into .claude/skills/debug-diff/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "debug-diff", then confirm the skill loads.Claude Code copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$skill-installer install https://github.com/afnanenayet/diffsitter/tree/main/.claude/skills/debug-diffType this inside Codex. $skill-installer <name> installs a curated skill from openai/skills. The installer writes to $CODEX_HOME/skills (default ~/.codex/skills). Restart Codex if the skill does not show up.
$ npx skills add afnanenayet/diffsitter --skill debug-diff -a codexProject install goes to .agents/skills/; add -g for ~/.codex/skills/.
$ gh skill install afnanenayet/diffsitter debug-diff --agent codexProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/afnanenayet/diffsitter.git skills-src && mkdir -p .agents/skills && cp -r skills-src/.claude/skills/debug-diff .agents/skills/debug-diff && rm -rf skills-srcUse ~/.agents/skills/ instead of .agents/skills for a personal install.
Codex skills documentation · loads skills from .agents/skills/
Install the "debug-diff" agent skill from https://github.com/afnanenayet/diffsitter/tree/main/.claude/skills/debug-diff into .agents/skills/debug-diff/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "debug-diff", then confirm the skill loads.Codex copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add afnanenayet/diffsitter --skill debug-diff -a cursorProject install goes to .agents/skills/; add -g for ~/.cursor/skills/.
$ gh skill install afnanenayet/diffsitter debug-diff --agent cursorProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/afnanenayet/diffsitter.git skills-src && mkdir -p .cursor/skills && cp -r skills-src/.claude/skills/debug-diff .cursor/skills/debug-diff && rm -rf skills-srcUse ~/.cursor/skills/ instead of .cursor/skills for a personal install.
Cursor skills documentation · loads skills from .cursor/skills/, .agents/skills/, .claude/skills/, .codex/skills/
Install the "debug-diff" agent skill from https://github.com/afnanenayet/diffsitter/tree/main/.claude/skills/debug-diff into .cursor/skills/debug-diff/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "debug-diff", then confirm the skill loads.Cursor copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gemini skills install https://github.com/afnanenayet/diffsitter.git --path .claude/skills/debug-diff--scope user (default) or --scope workspace; --path is the subfolder of the repo that holds the skill; --consent skips the security confirmation prompt.
$ npx skills add afnanenayet/diffsitter --skill debug-diff -a gemini-cliProject install goes to .agents/skills/; add -g for ~/.gemini/skills/.
$ gh skill install afnanenayet/diffsitter debug-diff --agent gemini-cliProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/afnanenayet/diffsitter.git skills-src && mkdir -p .gemini/skills && cp -r skills-src/.claude/skills/debug-diff .gemini/skills/debug-diff && rm -rf skills-srcUse ~/.gemini/skills/ instead of .gemini/skills for a personal install, then run /skills reload.
Gemini CLI skills documentation · loads skills from .gemini/skills/, .agents/skills/
Install the "debug-diff" agent skill from https://github.com/afnanenayet/diffsitter/tree/main/.claude/skills/debug-diff into .gemini/skills/debug-diff/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "debug-diff", then confirm the skill loads.Gemini CLI copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gh skill install afnanenayet/diffsitter debug-diffInstalls for Copilot at project scope by default; add --scope user for a personal install. Preview a skill first with gh skill preview. Needs GitHub CLI 2.90.0 or later (public preview).
$ npx skills add afnanenayet/diffsitter --skill debug-diff -a github-copilotProject install goes to .agents/skills/; add -g for ~/.copilot/skills/.
$ git clone --depth 1 https://github.com/afnanenayet/diffsitter.git skills-src && mkdir -p .github/skills && cp -r skills-src/.claude/skills/debug-diff .github/skills/debug-diff && rm -rf skills-srcUse ~/.copilot/skills/ instead of .github/skills for a personal install. Commit .github/skills so cloud agent and code review can use it.
GitHub Copilot skills documentation · loads skills from .github/skills/, .claude/skills/, .agents/skills/
Install the "debug-diff" agent skill from https://github.com/afnanenayet/diffsitter/tree/main/.claude/skills/debug-diff into .github/skills/debug-diff/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "debug-diff", then confirm the skill loads.GitHub Copilot copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add afnanenayet/diffsitter --skill debug-diff -a opencodeOpenCode documents no install command of its own. Project install goes to .agents/skills/; add -g for ~/.config/opencode/skills/.
$ gh skill install afnanenayet/diffsitter debug-diff --agent opencodeProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/afnanenayet/diffsitter.git skills-src && mkdir -p .opencode/skills && cp -r skills-src/.claude/skills/debug-diff .opencode/skills/debug-diff && rm -rf skills-srcUse ~/.config/opencode/skills/ instead of .opencode/skills for a personal install.
OpenCode skills documentation · loads skills from .opencode/skills/, .claude/skills/, .agents/skills/
Install the "debug-diff" agent skill from https://github.com/afnanenayet/diffsitter/tree/main/.claude/skills/debug-diff into .opencode/skills/debug-diff/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "debug-diff", then confirm the skill loads.OpenCode copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
debug-diffDiagnose unexpected diff output by tracing the pipeline from parsing through AST processing to hunk generation.
Debug Diff is an agent skill from afnanenayet/diffsitter. Diagnose unexpected diff output by tracing the pipeline from parsing through AST processing to hunk generation. Use when diffsitter produces wrong or surprising results.
Its SKILL.md is about 2.4k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.
It sits in Development. The repository describes itself as: A tree-sitter based AST difftool to get meaningful semantic diffs. The licence is MIT.
8 steps, taken from the step headings in SKILL.md.
Read from SKILL.md and the folder at commit a5a6681. It shows what the files ask for, not the result of running them.
Pre-approves these tools, so the agent can use them without asking each time:
ReadGrepGlobBashFrom allowed-tools in the SKILL.md frontmatter.
Shell commands in SKILL.md call:
jqFrom the folder's file list and the shell code blocks in SKILL.md.
No URLs in SKILL.md.
From URLs in SKILL.md, links to its own repository left out.
Names no API keys, tokens, secrets or passwords.
From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.
Debug Diff loads about 2.4k tokens when it runs. Until then it costs about 45 tokens; SKILL.md has 1,066 words of instructions outside code blocks.
Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.
The automated check noted patterns worth knowing about, such as sudo or a known installer.
allowed-tools: Read, Grep, Glob, BashAutomated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.
The full file from afnanenayet/diffsitter at commit a5a6681, republished under its MIT licence (© afnanenayet). 1,066 words, ~2,360 tokens.
.claude/skills/debug-diff/SKILL.md (or your agent's skills folder).When diffsitter produces wrong or surprising results, trace the issue through the pipeline. The diff pipeline has 7 stages, and problems can originate at any of them.
Ask the user for the following information if not already provided:
The full pipeline (see src/bin/diffsitter.rs, function run_diff):
1. Language detection
2. Tree-sitter parse (file -> AST Tree)
3. AST leaf extraction (Tree -> Vec<VectorLeaf>)
4. Node filtering (exclude_kinds / include_kinds)
5. Grapheme splitting + whitespace stripping (VectorLeaf -> Vec<Entry>)
6. Myers diff (Vec<Entry> x 2 -> Vec<EditType>)
7. Hunk assembly (Vec<EditType> -> RichHunks)
8. Rendering (RichHunks -> terminal output)File: src/parse.rs, function resolve_language_str
The language is resolved from the file extension via the FILE_EXTS phf_map, with optional user overrides from GrammarConfig.file_associations.
Common issues:
.jsx maps to "tsx", .h maps to "c" not "cpp")Debug: Check what language is resolved:
# Enable debug logging to see language resolution
RUST_LOG=debug diffsitter old_file new_file 2>&1 | grep -i "deduced language"Or read FILE_EXTS in src/parse.rs to verify the extension mapping.
File: src/parse.rs, function parse_file
Creates a Parser, sets the language, reads the file to a string, and calls parser.parse(&text, None).
Common issues:
AbiOutOfRange error) -- the grammar was compiled against an incompatible tree-sitter version.None from parser.parse(), resulting in a TSParseFailure error.Debug: If parsing succeeds but the tree looks wrong, the grammar itself may have a bug for that language construct. Check tree-sitter's own playground or CLI to inspect the AST.
File: src/input_processing.rs, function build
Recursively walks the tree via node.children(&mut cursor). Collects leaf nodes (nodes with child_count() == 0) OR nodes whose kind() matches a pseudo_leaf_types entry.
Key behaviors:
node.byte_range().is_empty())\n, \r, \r\n) are skipped -- this is a workaround for the Go parserinput_processing.pseudo_leaf_types) treat certain non-leaf nodes as leaves. Default: {"markdown": {"inline"}}. This is critical for text-heavy documents.Common issues:
pseudo_leaf_types includes the right node types for that language. Without "inline" for markdown, large text blocks are treated as single atoms.File: src/input_processing.rs, method TreeSitterProcessor::should_include_node
Filters nodes based on exclude_kinds and include_kinds from the config:
exclude_kinds takes precedence: if a node's kind() is in this set, it is excluded.include_kinds: if set, only nodes whose kind() is in this set are included (unless also excluded).Common issues:
exclude_kinds or include_kinds that filters out relevant nodes.kind() string doesn't match what the user expects (tree-sitter kind names are grammar-specific).Debug: Check what node kinds exist for a language using tree-sitter's node types. The kind() strings come from the grammar definition.
File: src/input_processing.rs, method VectorLeaf::split_on_graphemes
If split_graphemes is enabled (default: true), each leaf's text is split into individual Unicode graphemes, each becoming its own Entry with precise row/column positions. If strip_whitespace is enabled (default: true), whitespace-only graphemes are skipped.
Common issues:
strip_whitespace: true (the default) means pure whitespace/indentation changes are invisible. This is by design for AST-based diffing. If the user wants to see whitespace changes, they need "strip-whitespace": false in their config.split_graphemes: true generates many entries for large text nodes. Setting "split-graphemes": false trades granularity for speed.line_offset == 0, it offsets from the node's start_position().column. Otherwise it resets the column to idx (the byte offset within the line). Bugs here manifest as incorrect column highlighting in the rendered output.File: src/diff.rs, struct Myers, method diff
Implements the classic Myers "An O(ND) Difference Algorithm" with divide-and-conquer via middle snake. Takes two &[Entry] slices, produces Vec<EditType<&Entry>> where EditType is either Addition or Deletion.
Key optimizations:
common_prefix_len / common_suffix_len which use get_unchecked for speed).Entry equality is based on kind_id AND text (see the PartialEq impl) -- two nodes are equal only if they have the same tree-sitter kind AND identical text content.Common issues:
kind_id differs between them. Two nodes with the same text but different grammar kinds (e.g., identifier vs type_identifier in Rust) are considered different.File: src/diff.rs, struct RichHunksBuilder
Converts the flat edit script into grouped hunks. Each EditType::Addition becomes DocumentType::New, each EditType::Deletion becomes DocumentType::Old. Consecutive edits on adjacent lines are grouped into the same Hunk. Non-adjacent edits start a new hunk.
Common issues:
PriorLine or PriorColumn errors: These indicate the edit script produced entries in non-ascending order, which is a bug in the diff or input processing stage.File: src/render/unified.rs (for unified renderer), src/render/json.rs (for JSON)
Common issues with unified renderer:
print_hunk method accesses lines[line_index]. If line_index >= lines.len(), it logs an error and skips the line (in release) or panics via debug_assert! (in debug).print_line indexes into the line text using byte column ranges from entries. If the entry positions don't align with the actual text bytes, this can panic with a slice bounds error.term_info may be None. The unified renderer still works but won't have terminal width info for title formatting.# Run with full debug logging
RUST_LOG=trace diffsitter old_file new_file 2>debug.log
# Output as JSON to inspect raw diff data
diffsitter --renderer json old_file new_file | jq .
# Force a specific language
diffsitter --file-type python old_file new_file
# Run without config to eliminate config issues
diffsitter --no-config old_file new_file| Symptom | Likely Stage | Check |
|---|---|---|
| "Unsupported extension" error | 1 (Language detection) | Extension in FILE_EXTS? |
| Parse error / empty AST | 2 (Tree-sitter parse) | Grammar ABI compatible? File is valid UTF-8? |
| No diff when content clearly changed | 5 (Whitespace stripping) | strip_whitespace removing the changes? |
| Missing diffs in markdown/prose | 3 (Leaf extraction) | pseudo_leaf_types configured for language? |
| Diffs include too many trivial nodes | 4 (Node filtering) | Set exclude_kinds for noise (e.g., "comment", "string") |
| Wrong columns highlighted | 5 (Grapheme splitting) | Grapheme position calculation bug |
| Panic on "index out of bounds" | 7/8 (Hunk assembly / Rendering) | Line index mismatch between entry positions and actual text |
| Extremely slow on large files | 5/6 (Graphemes / Myers) | Try "split-graphemes": false or check if diff is O(ND) worst-case |
© afnanenayet, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file
Just SKILL.md in .claude/skills/debug-diff of afnanenayet/diffsitter.
Open the folder on GitHubat commit a5a6681
Debug Diff next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.
| Skill | Stars | Used in | Tokens | Auto-check | Licence | Repo updated |
|---|---|---|---|---|---|---|
| Debug Diff this skillafnanenayet/diffsitter | 2.4k | — | ~2.4k | Automated safety check: Notes | MIT | |
| Vercel Composition Patternssupabase/supabase | 111k | 58 repos | ~726 | Automated safety check: Pass | MIT | |
| Finishing a Development Branchobra/superpowers | 297k | 5 repos | ~1.9k | Automated safety check: Pass | MIT | |
| Typescript Advanced Typesrolling-scopes/rsschool-app | 10k | 25 repos | ~4.2k | Automated safety check: Pass | MPL-2.0 | |
| PR Babysitteropeninterpreter/openinterpreter | 69k | 3 repos | ~4.2k | Automated safety check: Pass | Apache-2.0 | |
| Code Review ChecklistshareAI-lab/learn-claude-code | 78k | 5 repos | ~1.1k | Automated safety check: Pass | MIT |
supabase/supabase
React composition patterns that scale. An agent skill from supabase/supabase.
obra/superpowers
Walks the last step of a branch: confirm tests pass, detect the git environment, ask how to integrate, carry out your choice and clean up the worktree.
rolling-scopes/rsschool-app
Master TypeScript's advanced type system including generics, conditional types, mapped types, template literals, and utility types for building type-safe applications.
openinterpreter/openinterpreter
Watches an open GitHub pull request until it merges, handling review comments, diagnosing CI failures and retrying flaky checks along the way.
shareAI-lab/learn-claude-code
Reviews code against a five-part checklist covering security, correctness, performance, maintainability and testing, and reports findings in a fixed format.
onyx-dot-app/onyx
Iteratively improves a PR (GitHub), MR (GitLab), or shelved changelist (Perforce) until Greptile gives it a 5/5 confidence score with zero unresolved comments.
afnanenayet/diffsitter
Step-by-step guide for adding a new tree-sitter language grammar to diffsitter.
afnanenayet/diffsitter
Step-by-step guide for adding a new diff output renderer to diffsitter.
afnanenayet/diffsitter
Expert Rust guidance for diffsitter: tree-sitter FFI patterns, lifetime management, unsafe optimization, edition 2024 idioms.
Categories
Diagnose unexpected diff output by tracing the pipeline from parsing through AST processing to hunk generation. Debug Diff is an agent skill from afnanenayet/diffsitter. Diagnose unexpected diff output by tracing the pipeline from parsing through AST processing to hunk generation.
Debug Diff fits situations like: diffsitter produces wrong; surprising results.
Run `npx skills add afnanenayet/diffsitter --skill debug-diff -a claude-code`. Or copy the skill folder (.claude/skills/debug-diff in afnanenayet/diffsitter) into .claude/skills/debug-diff in your project. Claude Code loads it when a task matches its description.
Run `npx skills add afnanenayet/diffsitter --skill debug-diff -a codex`. Or copy the skill folder (.claude/skills/debug-diff in afnanenayet/diffsitter) into .agents/skills/debug-diff in your project. Codex loads it when a task matches its description.
Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add afnanenayet/diffsitter --skill debug-diff -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/debug-diff, .gemini/skills/debug-diff, .github/skills/debug-diff and .opencode/skills/debug-diff in your project.
Going by SKILL.md and its folder, Debug Diff needs the command-line tools its instructions call (jq). Our summary lists: Python 3. Its frontmatter pre-approves these tools: Read, Grep, Glob, Bash.
SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.
Our automated static check of SKILL.md found notes only (pre-approves every shell command (allowed-tools: bash)), nothing it rates as a warning. It is not a guarantee. Review the folder before installing.
Debug Diff is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.
About 2.4k tokens (SKILL.md is roughly 9.4k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.
Skills that share tags, products or a category with Debug Diff: Vercel Composition Patterns (supabase/supabase, 111k stars), Finishing a Development Branch (obra/superpowers, 297k stars), Typescript Advanced Types (rolling-scopes/rsschool-app, 10k stars) and PR Babysitter (openinterpreter/openinterpreter, 69k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.
afnanenayet (a GitHub user) maintains it in afnanenayet/diffsitter, which has 2,405 GitHub stars. The repository holds 4 skills in this directory. The repository was last updated on October 8, 2026.
Source: afnanenayet/diffsitter on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.