SeekDB Code Review
oceanbase/seekdb
Reviews seekdb pull requests and diffs for real defects in correctness, resources, concurrency, security and tests, reporting only Blocker or Major findings.
Step-by-step guide for adding a new tree-sitter language grammar to diffsitter.
$ npx skills add afnanenayet/diffsitter --skill add-grammar -a claude-codeProject install by default; add -g for ~/.claude/skills/.
$ gh skill install afnanenayet/diffsitter add-grammar --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/add-grammar .claude/skills/add-grammar && 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 "add-grammar" agent skill from https://github.com/afnanenayet/diffsitter/tree/main/.claude/skills/add-grammar into .claude/skills/add-grammar/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "add-grammar", 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/add-grammarType 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 add-grammar -a codexProject install goes to .agents/skills/; add -g for ~/.codex/skills/.
$ gh skill install afnanenayet/diffsitter add-grammar --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/add-grammar .agents/skills/add-grammar && rm -rf skills-srcUse ~/.agents/skills/ instead of .agents/skills for a personal install.
Codex skills documentation · loads skills from .agents/skills/
Install the "add-grammar" agent skill from https://github.com/afnanenayet/diffsitter/tree/main/.claude/skills/add-grammar into .agents/skills/add-grammar/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "add-grammar", 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 add-grammar -a cursorProject install goes to .agents/skills/; add -g for ~/.cursor/skills/.
$ gh skill install afnanenayet/diffsitter add-grammar --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/add-grammar .cursor/skills/add-grammar && 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 "add-grammar" agent skill from https://github.com/afnanenayet/diffsitter/tree/main/.claude/skills/add-grammar into .cursor/skills/add-grammar/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "add-grammar", 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/add-grammar--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 add-grammar -a gemini-cliProject install goes to .agents/skills/; add -g for ~/.gemini/skills/.
$ gh skill install afnanenayet/diffsitter add-grammar --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/add-grammar .gemini/skills/add-grammar && 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 "add-grammar" agent skill from https://github.com/afnanenayet/diffsitter/tree/main/.claude/skills/add-grammar into .gemini/skills/add-grammar/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "add-grammar", 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 add-grammarInstalls 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 add-grammar -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/add-grammar .github/skills/add-grammar && 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 "add-grammar" agent skill from https://github.com/afnanenayet/diffsitter/tree/main/.claude/skills/add-grammar into .github/skills/add-grammar/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "add-grammar", 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 add-grammar -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 add-grammar --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/add-grammar .opencode/skills/add-grammar && 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 "add-grammar" agent skill from https://github.com/afnanenayet/diffsitter/tree/main/.claude/skills/add-grammar into .opencode/skills/add-grammar/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "add-grammar", 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.
add-grammarStep-by-step guide for adding a new tree-sitter language grammar to diffsitter.
Add Grammar is an agent skill from afnanenayet/diffsitter. Step-by-step guide for adding a new tree-sitter language grammar to diffsitter. Use when adding support for a new programming language.
Its SKILL.md is about 1.9k 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. It works with C++ and Rust. The repository describes itself as: A tree-sitter based AST difftool to get meaningful semantic diffs. The licence is MIT.
6 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:
ReadGrepGlobBashEditWriteFrom allowed-tools in the SKILL.md frontmatter.
Shell commands in SKILL.md call:
gitcargoFrom the folder's file list and the shell code blocks in SKILL.md.
Hosts in commands or code, which the agent is likely to contact:
github.comFrom 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.
Add Grammar loads about 1.9k tokens when it runs. Until then it costs about 37 tokens; SKILL.md has 647 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, Bash, Edit, WriteAutomated 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). 647 words, ~1,881 tokens.
.claude/skills/add-grammar/SKILL.md (or your agent's skills folder).Follow this checklist to add support for a new language $ARGUMENTS. If the user did not provide a language name, ask for one before proceeding.
Read these files first:
build.rs -- grammars() function and GrammarCompileInfo structsrc/parse.rs -- FILE_EXTS map and language resolutiongit submodule add https://github.com/tree-sitter/tree-sitter-$ARGUMENTS grammars/tree-sitter-$ARGUMENTS
git submodule update --init --recursiveVerify the submodule has a src/ directory containing at minimum parser.c. Check for a scanner.c or scanner.cc file -- this determines whether you need C or C++ compilation.
Tree-sitter grammar repos typically include Rust bindings that would interfere with diffsitter's custom build process. Remove them:
cd grammars/tree-sitter-$ARGUMENTS
rm -rf bindings/rust Cargo.toml build.rs
cd ../..This is critical -- if Cargo.toml or build.rs remain in the grammar directory, Cargo may try to compile the grammar as a separate crate and conflict with diffsitter's build script.
GrammarCompileInfo to build.rsIn build.rs, add a new entry to the grammars() function's vector. The struct has these fields:
GrammarCompileInfo {
/// The language name -- must match what you use in FILE_EXTS and the
/// tree_sitter_$ARGUMENTS() constructor function name
display_name: "$ARGUMENTS",
/// Path to the grammar root (contains src/ directory)
path: PathBuf::from("grammars/tree-sitter-$ARGUMENTS"),
/// C source files in src/ to compile
c_sources: vec!["parser.c"], // always include parser.c
/// C++ source files in src/ to compile (empty if no C++ scanner)
cpp_sources: vec![],
..Default::default()
}Determining sources:
parser.c is always present and always compiled as C.src/scanner.c exists, add "scanner.c" to c_sources.src/scanner.cc exists, add "scanner.cc" to cpp_sources. Do NOT put .cc files in c_sources.json, go, java, c).Examples from the codebase:
C-only (parser + C scanner):
GrammarCompileInfo {
display_name: "rust",
path: PathBuf::from("grammars/tree-sitter-rust"),
c_sources: vec!["parser.c", "scanner.c"],
..Default::default()
}C + C++ scanner:
GrammarCompileInfo {
display_name: "ruby",
path: PathBuf::from("grammars/tree-sitter-ruby"),
c_sources: vec!["parser.c"],
cpp_sources: vec!["scanner.cc"],
..GrammarCompileInfo::default()
}Parser only (no scanner):
GrammarCompileInfo {
display_name: "json",
path: PathBuf::from("grammars/tree-sitter-json"),
c_sources: vec!["parser.c"],
..Default::default()
}src/parse.rsAdd entries to the FILE_EXTS static phf_map! in src/parse.rs. The key is the file extension (without dot), the value is the display_name from Step 3:
static FILE_EXTS: phf::Map<&'static str, &'static str> = phf_map! {
// ... existing entries ...
"$EXT" => "$ARGUMENTS",
};Add all common extensions for the language. For example, C++ has "cc", "cpp", "hpp", and "tpp".
cargo buildThe build script will:
cc crateunsafe extern "C" { pub fn tree_sitter_$ARGUMENTS() -> Language; } declarationLANGUAGES phf_mapIf the build fails, check:
{path}/src/ to each filename.src/ directory exist? Run ls grammars/tree-sitter-$ARGUMENTS/src/.git submodule update --init --recursive.If you want to add integration or snapshot tests, add test input files under resources/ and write tests that parse them.
Run the full test suite:
cargo test --allThe static_load_parsers test in src/parse.rs will automatically test that the new grammar can be loaded by tree-sitter, since it iterates over all entries in the LANGUAGES map.
Some tree-sitter grammars contain multiple languages in one repository. In this case, the path field must point to the subdirectory containing the src/ folder, not the repo root.
Examples from the codebase:
TypeScript: The tree-sitter-typescript repo has typescript/ and tsx/ subdirectories, each with their own src/:
GrammarCompileInfo {
display_name: "typescript",
path: PathBuf::from("grammars/tree-sitter-typescript/typescript"),
// ...
}
GrammarCompileInfo {
display_name: "tsx",
path: PathBuf::from("grammars/tree-sitter-typescript/tsx"),
// ...
}OCaml: tree-sitter-ocaml has grammars/ocaml/ subdirectory:
path: PathBuf::from("grammars/tree-sitter-ocaml/grammars/ocaml"),PHP: tree-sitter-php has a php/ subdirectory:
path: PathBuf::from("grammars/tree-sitter-php/php"),Markdown: tree-sitter-markdown has a tree-sitter-markdown/ subdirectory:
path: PathBuf::from("grammars/tree-sitter-markdown/tree-sitter-markdown"),If the grammar has a C++ scanner (scanner.cc), it must go in cpp_sources, not c_sources. The build script compiles C and C++ sources with different compilers (cc vs c++) and links them into separate static libraries.
If the grammar's headers are not in src/ (the default include path), use the include_paths field:
GrammarCompileInfo {
display_name: "some_lang",
path: PathBuf::from("grammars/tree-sitter-some-lang"),
c_sources: vec!["parser.c"],
include_paths: Some(vec![
PathBuf::from("grammars/tree-sitter-some-lang/include"),
]),
..Default::default()
}The display_name is used to generate the FFI symbol name tree_sitter_{display_name}. This must match the actual symbol exported by the compiled grammar. For languages with hyphens, use underscores in the display name (e.g., c_sharp for tree-sitter-c-sharp).
Grammar submodule updates are coordinated via the diffsitter-grammars repository using nvchecker. For ongoing maintenance, consider adding the grammar there too.
The grammar must have a compatible tree-sitter ABI version. The ts_language_abi_checked function in src/parse.rs verifies this at runtime, checking that the grammar's ABI version falls within MIN_COMPATIBLE_LANGUAGE_VERSION..=LANGUAGE_VERSION. If you see an AbiOutOfRange error, the grammar may need to be rebuilt with a compatible tree-sitter version.
© 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/add-grammar of afnanenayet/diffsitter.
Open the folder on GitHubat commit a5a6681
Add Grammar 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 |
|---|---|---|---|---|---|---|
| Add Grammar this skillafnanenayet/diffsitter | 2.4k | — | ~1.9k | Automated safety check: Notes | MIT | |
| SeekDB Code Reviewoceanbase/seekdb | 3.1k | — | ~2.1k | Automated safety check: Pass | Apache-2.0 | |
| Cppcrazyguitar/cppcheatsheet | 290 | — | ~1.8k | Automated safety check: Pass | MIT | |
| Dbgtheodo-group/debug-that | 158 | — | ~2.5k | Automated safety check: Pass | MIT | |
| Style Checkernoumena-labs/Sipp | 121 | — | ~1.4k | Automated safety check: Pass | Apache-2.0 | |
| Readable Cppcrazyguitar/cppcheatsheet | 290 | — | ~6.4k | Automated safety check: Pass | MIT |
oceanbase/seekdb
Reviews seekdb pull requests and diffs for real defects in correctness, resources, concurrency, security and tests, reporting only Blocker or Major findings.
crazyguitar/cppcheatsheet
Comprehensive C/C++ programming reference covering everything from C11-C23 and C++11-C++23, system programming, CUDA GPU computing, debugging tools, Rust interop, and advanced topics.
theodo-group/debug-that
Debug applications using the dbg CLI debugger. An agent skill from theodo-group/debug-that.
noumena-labs/Sipp
Enforces this monorepo's coding style rules by inspecting git diffs, reading .agents/skills/style-checker/references/styleguidance.md, fixing style violations, and reporting the result.
crazyguitar/cppcheatsheet
Readable C/C++/Rust/CUDA code rules inspired by The Art of Readable Code.
andrew-yangy/gru-ai
Provides comprehensive code review guidance for React 19, Vue 3, Rust, TypeScript, Java, Python, and C/C++.
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.
afnanenayet/diffsitter
Expert Rust guidance for diffsitter: tree-sitter FFI patterns, lifetime management, unsafe optimization, edition 2024 idioms.
Categories
Step-by-step guide for adding a new tree-sitter language grammar to diffsitter. Add Grammar is an agent skill from afnanenayet/diffsitter. Step-by-step guide for adding a new tree-sitter language grammar to diffsitter.
Add Grammar fits situations like: adding support for a new programming language.
Run `npx skills add afnanenayet/diffsitter --skill add-grammar -a claude-code`. Or copy the skill folder (.claude/skills/add-grammar in afnanenayet/diffsitter) into .claude/skills/add-grammar in your project. Claude Code loads it when a task matches its description.
Run `npx skills add afnanenayet/diffsitter --skill add-grammar -a codex`. Or copy the skill folder (.claude/skills/add-grammar in afnanenayet/diffsitter) into .agents/skills/add-grammar 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 add-grammar -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/add-grammar, .gemini/skills/add-grammar, .github/skills/add-grammar and .opencode/skills/add-grammar in your project.
Going by SKILL.md and its folder, Add Grammar needs the command-line tools its instructions call (git and cargo). Its frontmatter pre-approves these tools: Read, Grep, Glob, Bash, Edit, Write.
SKILL.md names 1 domain. In commands or code: github.com; the agent is likely to contact it when it follows the instructions. 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.
Add Grammar is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.
About 1.9k tokens (SKILL.md is roughly 7.5k 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 Add Grammar: SeekDB Code Review (oceanbase/seekdb, 3.1k stars), Cpp (crazyguitar/cppcheatsheet, 290 stars), Dbg (theodo-group/debug-that, 158 stars) and Style Checker (noumena-labs/Sipp, 121 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 9, 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.