Update V8 Version
openinterpreter/openinterpreter
Bumps the pinned v8 and rusty_v8 versions in Codex, validates the release-candidate path with the v8-canary check, and traces failures to upstream build changes.
Expert Rust guidance for diffsitter: tree-sitter FFI patterns, lifetime management, unsafe optimization, edition 2024 idioms.
$ npx skills add afnanenayet/diffsitter --skill rust-expert -a claude-codeProject install by default; add -g for ~/.claude/skills/.
$ gh skill install afnanenayet/diffsitter rust-expert --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/rust-expert .claude/skills/rust-expert && 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 "rust-expert" agent skill from https://github.com/afnanenayet/diffsitter/tree/main/.claude/skills/rust-expert into .claude/skills/rust-expert/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "rust-expert", 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/rust-expertType 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 rust-expert -a codexProject install goes to .agents/skills/; add -g for ~/.codex/skills/.
$ gh skill install afnanenayet/diffsitter rust-expert --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/rust-expert .agents/skills/rust-expert && rm -rf skills-srcUse ~/.agents/skills/ instead of .agents/skills for a personal install.
Codex skills documentation · loads skills from .agents/skills/
Install the "rust-expert" agent skill from https://github.com/afnanenayet/diffsitter/tree/main/.claude/skills/rust-expert into .agents/skills/rust-expert/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "rust-expert", 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 rust-expert -a cursorProject install goes to .agents/skills/; add -g for ~/.cursor/skills/.
$ gh skill install afnanenayet/diffsitter rust-expert --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/rust-expert .cursor/skills/rust-expert && 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 "rust-expert" agent skill from https://github.com/afnanenayet/diffsitter/tree/main/.claude/skills/rust-expert into .cursor/skills/rust-expert/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "rust-expert", 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/rust-expert--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 rust-expert -a gemini-cliProject install goes to .agents/skills/; add -g for ~/.gemini/skills/.
$ gh skill install afnanenayet/diffsitter rust-expert --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/rust-expert .gemini/skills/rust-expert && 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 "rust-expert" agent skill from https://github.com/afnanenayet/diffsitter/tree/main/.claude/skills/rust-expert into .gemini/skills/rust-expert/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "rust-expert", 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 rust-expertInstalls 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 rust-expert -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/rust-expert .github/skills/rust-expert && 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 "rust-expert" agent skill from https://github.com/afnanenayet/diffsitter/tree/main/.claude/skills/rust-expert into .github/skills/rust-expert/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "rust-expert", 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 rust-expert -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 rust-expert --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/rust-expert .opencode/skills/rust-expert && 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 "rust-expert" agent skill from https://github.com/afnanenayet/diffsitter/tree/main/.claude/skills/rust-expert into .opencode/skills/rust-expert/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "rust-expert", 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.
rust-expertExpert Rust guidance for diffsitter: tree-sitter FFI patterns, lifetime management, unsafe optimization, edition 2024 idioms.
Rust Expert is an agent skill from afnanenayet/diffsitter. Expert Rust guidance for diffsitter: tree-sitter FFI patterns, lifetime management, unsafe optimization, edition 2024 idioms. Use when the user needs help with Rust patterns, tree-sitter API, or advanced idioms.
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 works with Rust. The repository describes itself as: A tree-sitter based AST difftool to get meaningful semantic diffs. The licence is MIT.
10 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.
No scripts in the folder and no shell commands in SKILL.md (its code samples are rust).
From 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.
Rust Expert loads about 2.4k tokens when it runs. Until then it costs about 56 tokens; SKILL.md has 894 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). 894 words, ~2,395 tokens.
.claude/skills/rust-expert/SKILL.md (or your agent's skills folder).You are an expert Rust consultant for the diffsitter codebase. When answering questions, ground your advice in the actual patterns used in this project. Below are the key Rust patterns and idioms employed throughout the codebase.
grep 'rust-version' Cargo.tomlgrep '^tree-sitter' Cargo.tomlFile: src/parse.rs
Parser creation follows this sequence: create a Parser, generate a Language from the grammar, set it on the parser, then parse text into a Tree:
let mut parser = Parser::new();
let ts_lang = generate_language(resolved_language, config)?;
parser.set_language(&ts_lang)?;
let tree = parser.parse(&text, None);Node traversal uses TreeCursor via node.walk() and node.children(&mut cursor). See src/input_processing.rs function build() which walks the tree recursively:
let mut cursor = node.walk();
for child in node.children(&mut cursor) {
build(vector, child, text, pseudo_leaf_types);
}Key lifetime constraint: Node<'a> borrows from the Tree. The Tree must outlive all Node references. This is why VectorData owns the Tree and text separately from the Vector<'a> that references them -- see the doc comment on VectorData in src/input_processing.rs.
File: src/parse.rs, function construct_ts_lang_from_shared_lib
When loading dynamic grammars, the shared library must remain in memory for the entire program lifetime. The code intentionally leaks it:
let shared_library = Box::new(libloading::Library::new(parser_path.as_os_str())?);
let static_shared_library = Box::leak(shared_library);
let constructor = static_shared_library.get::<libloading::Symbol<
unsafe extern "C" fn() -> Language,
>>(constructor_symbol_name.as_bytes())?;
constructor()Why: The Language object returned by the constructor references function pointers inside the shared library. If the library were dropped, those pointers would dangle, causing segfaults when tree-sitter later calls grammar functions. Box::leak converts the Box<Library> into a &'static mut Library, ensuring it is never deallocated.
When to use this pattern: Only when an FFI object's lifetime must extend to program termination and there is no safe way to track it with Rust's ownership system.
File: src/input_processing.rs, function from_ts_tree
A RefCell<Vec<VectorLeaf>> is used to accumulate leaves during recursive tree traversal, then consumed with into_inner():
let leaves = RefCell::new(Vec::new());
build(&leaves, tree.root_node(), text, pseudo_leaf_types);
Vector {
leaves: leaves.into_inner(),
source_text: text,
}Inside build(), the vector is mutated via vector.borrow_mut().push(...). The RefCell is needed because the recursive build function takes &RefCell<Vec<...>> rather than &mut Vec<...>, avoiding mutable borrow conflicts during recursion. After traversal completes, into_inner() unwraps the RefCell with zero overhead (no runtime borrow check needed since we have ownership).
File: src/diff.rs, functions common_prefix_len and common_suffix_len
The Myers diff algorithm's inner loops use get_unchecked for performance:
unsafe {
while a_range.start + l < a_range.end
&& b_range.start + l < b_range.end
&& a.get_unchecked(a_range.start + l) == b.get_unchecked(b_range.start + l)
{
l += 1;
}
}Safety argument: The loop conditions (a_range.start + l < a_range.end and b_range.start + l < b_range.end) are checked before accessing the elements, proving the indices are in bounds. The unsafe block eliminates redundant bounds checks that the compiler cannot elide.
Convention: Always pair get_unchecked with debug_assert! guards elsewhere in the code (see middle_snake which has numerous debug_assert! calls verifying coordinate ranges). Debug builds will catch violations; release builds skip the checks for speed.
<T>File: src/diff.rs, around line 235
The DocumentType<T> enum encodes whether data comes from the old or new document at the type level:
pub enum DocumentType<T: Debug + PartialEq + Serialize + Clone> {
Old(T),
New(T),
}It implements AsRef<T>, AsMut<T>, and a consume(self) -> T method for ergonomic access without matching. This avoids passing separate is_old: bool flags and makes it impossible to confuse which document data belongs to.
RichHunk<'a> is defined as type RichHunk<'a> = DocumentType<Hunk<'a>>, so every hunk carries its provenance.
File: build.rs (codegen) and src/parse.rs (usage)
The FILE_EXTS map is a phf::Map providing O(1) perfect hash lookup from file extensions to language names:
static FILE_EXTS: phf::Map<&'static str, &'static str> = phf_map! {
"rs" => "rust",
"py" => "python",
// ...
};The LANGUAGES map (mapping language names to grammar constructor functions) is generated by build.rs using codegen_language_map(), which emits:
static LANGUAGES: phf::Map<&'static str, unsafe extern "C" fn() -> Language> = phf_map! {
"rust" => tree_sitter_rust,
// ...
};This is included at compile time via include!(concat!(env!("OUT_DIR"), "/generated_grammar.rs")) in src/parse.rs.
File: src/render/mod.rs
The Renderer trait uses enum_dispatch for static dispatch instead of Box<dyn Renderer>:
#[enum_dispatch(Renderers)]
pub trait Renderer {
fn render(
&self,
writer: &mut dyn Write,
data: &DisplayData,
term_info: Option<&Term>,
) -> anyhow::Result<()>;
}
#[enum_dispatch]
#[derive(Clone, Eq, PartialEq, Debug, Serialize, Deserialize, Display, EnumIter, EnumString)]
#[strum(serialize_all = "snake_case")]
#[serde(tag = "type", rename_all = "snake_case")]
pub enum Renderers {
Unified,
Json,
}enum_dispatch auto-generates match-based dispatch, eliminating vtable indirection. Each variant is a concrete type (Unified, Json) that implements Renderer. Adding a new renderer only requires adding a variant to Renderers and implementing the trait.
<str> for Optional Text TransformationsFile: src/input_processing.rs, Entry struct
pub struct Entry<'node> {
pub text: Cow<'node, str>,
// ...
}Cow<'node, str> avoids allocation when text does not need transformation. If strip_whitespace is false, the entry borrows directly from the source text (Cow::from(leaf.text) which is Cow::Borrowed). If whitespace stripping is needed, Cow::from(leaf.text.trim()) may allocate only if the trimmed result differs. This is a zero-cost abstraction when no transformation is needed.
File: src/input_processing.rs, Entry struct
pub struct Entry<'node> {
pub reference: TSNode<'node>,
pub kind_id: u16,
// ...
}The kind_id is cached from TSNode::kind_id() at construction time. This avoids crossing the FFI boundary on every comparison during diffing, where kind_id is checked via the PartialEq implementation:
impl PartialEq for Entry<'_> {
fn eq(&self, other: &Entry) -> bool {
self.kind_id == other.kind_id && self.text == other.text
}
}The comment notes: "Caching it here saves some time because it is queried repeatedly later. If we don't store it inline then we have to cross the FFI boundary which incurs some overhead." A future optimization note suggests cross-language LTO could potentially make this unnecessary.
File: build.rs, function compile_static_grammars
The codegen emits unsafe extern "C" blocks, which is the edition 2024 syntax for declaring foreign functions:
writeln!(
codegen,
"unsafe extern \"C\" {{ pub fn tree_sitter_{language}() -> Language; }}"
)?;In edition 2024, extern "C" blocks are no longer implicitly unsafe -- the unsafe keyword must be explicit on the block itself. This is a breaking change from edition 2021 where extern "C" { ... } was implicitly unsafe. If you are writing new FFI declarations, always use unsafe extern "C" { ... }.
Cow<str> for optional transforms, cache FFI values, prefer enum_dispatch over trait objects).debug_assert! guards.Node<'a> borrows from Tree -- any API that returns nodes must keep the tree alive.ts_language_abi_checked.© 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/rust-expert of afnanenayet/diffsitter.
Open the folder on GitHubat commit a5a6681
Rust Expert 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 |
|---|---|---|---|---|---|---|
| Rust Expert this skillafnanenayet/diffsitter | 2.4k | — | ~2.4k | Automated safety check: Notes | MIT | |
| Update V8 Versionopeninterpreter/openinterpreter | 69k | 2 repos | ~845 | Automated safety check: Pass | Apache-2.0 | |
| Firecrawl Page Scrape Integrationfirecrawl/firecrawl | 190k | 1 repos | ~944 | Automated safety check: Pass | ISC | |
| Migrate Core Code to Submodulestinyhumansai/openhuman | 42k | — | ~2.6k | Automated safety check: Pass | GPL-3.0 | |
| Rust TDD Workflowrtk-ai/rtk | 83k | — | ~753 | Automated safety check: Notes | Apache-2.0 | |
| OpenLogi macOS Permissions TriageAprilNEA/OpenLogi | 23k | — | ~2.5k | Automated safety check: Notes | Apache-2.0 |
openinterpreter/openinterpreter
Bumps the pinned v8 and rusty_v8 versions in Codex, validates the release-candidate path with the v8-canary check, and traces failures to upstream build changes.
firecrawl/firecrawl
Adds Firecrawl's /scrape endpoint to application code to pull markdown, HTML, links, screenshots or structured data from a single known URL.
tinyhumansai/openhuman
Plans and carries out moving non-host-specific code and its tests from the OpenHuman core into vendored tiny submodule libraries, then releases the submodule and re-pins the host.
rtk-ai/rtk
Enforces red-green-refactor for Rust work, with idiomatic test patterns, a naming convention and a pre-commit gate of cargo fmt, clippy and test.
AprilNEA/OpenLogi
Decides whether an OpenLogi device problem on macOS is a privacy-permission (TCC) problem, using agent log lines, and says which identity needs which grant.
farm-fe/farm
Guide for writing idiomatic Rust code based on Apollo GraphQL's best practices handbook.
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
Diagnose unexpected diff output by tracing the pipeline from parsing through AST processing to hunk generation.
Works with
Expert Rust guidance for diffsitter: tree-sitter FFI patterns, lifetime management, unsafe optimization, edition 2024 idioms. Rust Expert is an agent skill from afnanenayet/diffsitter. Expert Rust guidance for diffsitter: tree-sitter FFI patterns, lifetime management, unsafe optimization, edition 2024 idioms.
Rust Expert fits situations like: the user needs help with Rust patterns; tree-sitter API; advanced idioms.
Run `npx skills add afnanenayet/diffsitter --skill rust-expert -a claude-code`. Or copy the skill folder (.claude/skills/rust-expert in afnanenayet/diffsitter) into .claude/skills/rust-expert in your project. Claude Code loads it when a task matches its description.
Run `npx skills add afnanenayet/diffsitter --skill rust-expert -a codex`. Or copy the skill folder (.claude/skills/rust-expert in afnanenayet/diffsitter) into .agents/skills/rust-expert 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 rust-expert -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/rust-expert, .gemini/skills/rust-expert, .github/skills/rust-expert and .opencode/skills/rust-expert in your project.
SKILL.md names no scripts, command-line tools or credentials: Rust Expert is instructions for the agent only. 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.
Rust Expert 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.6k 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 Rust Expert: Update V8 Version (openinterpreter/openinterpreter, 69k stars), Firecrawl Page Scrape Integration (firecrawl/firecrawl, 190k stars), Migrate Core Code to Submodules (tinyhumansai/openhuman, 42k stars) and Rust TDD Workflow (rtk-ai/rtk, 83k 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.