← ClaudeAtlas

git-protocollisted

Git protocol implementation patterns using gitoxide for Guts repository operations
aiskillstore/marketplace · ★ 329 · Code & Development · score 79
Install: claude install-skill aiskillstore/marketplace
# Git Protocol Skill for Guts You are implementing Git-compatible repository operations using gitoxide (gix). ## Gitoxide Overview Gitoxide is a pure-Rust Git implementation. Key crates: - `gix`: High-level Git operations - `gix-object`: Git object types - `gix-hash`: Object ID handling - `gix-pack`: Pack file operations - `gix-transport`: Git protocol transport ## Repository Operations ### Opening/Creating Repositories ```rust use gix::Repository; use std::path::Path; pub async fn open_or_create(path: &Path) -> Result<Repository> { match gix::open(path) { Ok(repo) => Ok(repo), Err(_) => { // Create new bare repository gix::init_bare(path)? } } } ``` ### Working with Objects ```rust use gix::ObjectId; use gix::object::Kind; pub struct ObjectStore { repo: Repository, } impl ObjectStore { pub fn get_object(&self, id: &ObjectId) -> Result<Object> { let object = self.repo.find_object(id)?; match object.kind { Kind::Blob => self.decode_blob(object), Kind::Tree => self.decode_tree(object), Kind::Commit => self.decode_commit(object), Kind::Tag => self.decode_tag(object), } } pub fn write_blob(&self, data: &[u8]) -> Result<ObjectId> { let id = self.repo.write_blob(data)?; Ok(id) } } ``` ### Commits ```rust use gix::actor::Signature; pub struct CommitBuilder<'a> { repo: &'a Repository, tree: ObjectI