SkillAtlasSkill 详情

git-protocol

This is the open-source content repository behind

审核状态:已审核Quality 80Security 100

复制安装命令

用 Codex 或 Claude 安装复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它先审查 Skill 页面再帮你安装。

复制前请先查看来源、License 和安全提示。

项目 README

来源文件:README.md

抓取于 2026年9月5日

Skill Store — Marketplace Repository

This is the open-source content repository behind Skill Store. It stores every approved Agent Skill, the records that go with it, and the automated security audits published with each skill.

This repo is a companion to the Skill Store platform, not the place to submit skills. Skills are added through skillstore.io — its review pipeline writes to this repo automatically. Please do not open a pull request here to add a skill; PRs adding skills will be closed. See Contributing a skill below.

Installing a skill

The recommended way to install any skill is the skillstore CLI — one command works for both Claude Code and Codex:

npx skillstore add author/skill-name

For example:

npx skillstore add aiskillstore/code-review

It downloads the skill and drops it into the right skills/ directory for your tool. Claude Code auto-discovers it; for Codex, restart the session.

Prefer to do it by hand, or installing via Claude Web? See the full Installation Guides for every method (CLI, manual, and ZIP upload) and the scope directories (~/.agents/skills/, .claude/skills/, ~/.claude/skills/, .codex/skills/, …).

Contributing a skill

Submit through the platform — not through a pull request:

  1. Go to skillstore.io/submit.
  2. Enter the GitHub repository URL that contains your SKILL.md.
  3. Your submission runs through automated security analysis.
  4. A maintainer reviews and approves it.
  5. On approval, the skill is published here and appears on skillstore.io.

What makes a valid skill

  • SKILL.md — the skill definition (required, per the Agent Skills spec)
  • Supporting files the skill references (optional)
  • LICENSE (recommended)

Security audit

Every submission is scanned automatically before it can be published. The audit flags things like:

  • Dangerous code patterns (eval, exec, raw system commands)
  • File access outside the project scope
  • Network calls to external hosts
  • Obfuscated or minified code
  • Credential / secret handling

Security analysis is report-only: findings inform maintainers and users, but a risk result does not automatically block an otherwise approved skill from being published. See our Security Trust Center for the methodology, limitations, and risk-level definitions.

Live Security Passport example:

Skillstore security

Repository layout

.
├── skills/        # Approved, published skills (one folder each, with SKILL.md)
├── pending/       # Submissions awaiting review
├── packages/
│   ├── cli/       # The `skillstore` CLI (npx skillstore add …)
│   └── skillstore/
├── schemas/       # JSON schemas for skill records
├── scripts/       # Maintenance & scoring scripts
└── .github/workflows/   # Submission, audit, and sync automation

The contents of this repo are maintained by Skill Store's automated pipeline. Manual changes are limited to maintainers.

Links

License

The marketplace catalog is MIT-licensed. Individual skills carry their own licenses — check each skill's LICENSE file.

商业与运营

低风险

  • 来源需自行核对维护者身份。
  • 未检测到明显脚本安装指令。
  • 未检测到明显外部权限要求。
  • 未检测到高风险命令。
  • 扫描发现:0 条。

Codex — Git Clone 安装

  1. 安装前请先查看来源仓库和风险报告。
  2. 克隆仓库:git clone https://github.com/aiskillstore/marketplace.git
  3. 将 "skills/abdelstark/git-protocol" 文件夹复制到 Codex 的 skills 目录中。
  4. 重启 Codex 让新的 skill 生效。

Codex — 手动复制安装

  1. 安装前请先查看来源仓库和风险报告。
  2. 从源仓库下载 SKILL.md 及相关文件。
  3. 在 Codex 的 skills 目录中创建新文件夹。
  4. 将所有 skill 文件复制到新文件夹中。
  5. 重启 Codex 让新的 skill 生效。

Claude Code — Git Clone 安装

  1. 安装前请先查看来源仓库和风险报告。
  2. 克隆仓库:git clone https://github.com/aiskillstore/marketplace.git
  3. 将 "skills/abdelstark/git-protocol" 文件夹复制到 Claude Code 的 skills 目录中。
  4. 重启 Claude Code 让新的 skill 生效。

Claude Code — 手动复制安装

  1. 安装前请先查看来源仓库和风险报告。
  2. 从源仓库下载 SKILL.md 及相关文件。
  3. 在 Claude Code 的 skills 目录中创建新文件夹。
  4. 将所有 skill 文件复制到新文件夹中。
  5. 重启 Claude Code 让新的 skill 生效。

Cursor — Git Clone 安装

  1. 安装前请先查看来源仓库和风险报告。
  2. 克隆仓库:git clone https://github.com/aiskillstore/marketplace.git
  3. 将 "skills/abdelstark/git-protocol" 文件夹复制到 Cursor 的 skills 目录中。
  4. 重启 Cursor 让新的 skill 生效。

Cursor — 手动复制安装

  1. 安装前请先查看来源仓库和风险报告。
  2. 从源仓库下载 SKILL.md 及相关文件。
  3. 在 Cursor 的 skills 目录中创建新文件夹。
  4. 将所有 skill 文件复制到新文件夹中。
  5. 重启 Cursor 让新的 skill 生效。

GitHub Copilot — Git Clone 安装

  1. 安装前请先查看来源仓库和风险报告。
  2. 克隆仓库:git clone https://github.com/aiskillstore/marketplace.git
  3. 将 "skills/abdelstark/git-protocol" 文件夹复制到 GitHub Copilot 的 skills 目录中。
  4. 重启 GitHub Copilot 让新的 skill 生效。

GitHub Copilot — 手动复制安装

  1. 安装前请先查看来源仓库和风险报告。
  2. 从源仓库下载 SKILL.md 及相关文件。
  3. 在 GitHub Copilot 的 skills 目录中创建新文件夹。
  4. 将所有 skill 文件复制到新文件夹中。
  5. 重启 GitHub Copilot 让新的 skill 生效。

Windsurf — Git Clone 安装

  1. 安装前请先查看来源仓库和风险报告。
  2. 克隆仓库:git clone https://github.com/aiskillstore/marketplace.git
  3. 将 "skills/abdelstark/git-protocol" 文件夹复制到 Windsurf 的 skills 目录中。
  4. 重启 Windsurf 让新的 skill 生效。

Windsurf — 手动复制安装

  1. 安装前请先查看来源仓库和风险报告。
  2. 从源仓库下载 SKILL.md 及相关文件。
  3. 在 Windsurf 的 skills 目录中创建新文件夹。
  4. 将所有 skill 文件复制到新文件夹中。
  5. 重启 Windsurf 让新的 skill 生效。
查看 SKILL.md 原文
name: git-protocol
description: Git protocol implementation patterns using gitoxide for Guts repository operations

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

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

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

use gix::actor::Signature;

pub struct CommitBuilder<'a> {
    repo: &'a Repository,
    tree: ObjectId,
    parents: Vec<ObjectId>,
    message: String,
    author: Signature,
}

impl<'a> CommitBuilder<'a> {
    pub fn new(repo: &'a Repository) -> Self {
        let now = gix::date::Time::now_local_or_utc();
        let default_sig = Signature {
            name: "Guts User".into(),
            email: "user@guts.local".into(),
            time: now,
        };

        Self {
            repo,
            tree: ObjectId::null(),
            parents: vec![],
            message: String::new(),
            author: default_sig,
        }
    }

    pub fn tree(mut self, tree: ObjectId) -> Self {
        self.tree = tree;
        self
    }

    pub fn parent(mut self, parent: ObjectId) -> Self {
        self.parents.push(parent);
        self
    }

    pub fn message(mut self, msg: impl Into<String>) -> Self {
        self.message = msg.into();
        self
    }

    pub fn commit(self) -> Result<ObjectId> {
        let commit = gix::objs::CommitRef {
            tree: self.tree,
            parents: self.parents.into(),
            author: self.author.clone(),
            committer: self.author,
            encoding: None,
            message: self.message.into(),
            extra_headers: vec![],
        };

        let id = self.repo.write_object(&commit)?;
        Ok(id)
    }
}

Git Protocol Implementation

Smart HTTP Protocol

use axum::{Router, routing::post, extract::Path};

pub fn git_http_router() -> Router {
    Router::new()
        .route("/:owner/:repo/git-upload-pack", post(upload_pack))
        .route("/:owner/:repo/git-receive-pack", post(receive_pack))
        .route("/:owner/:repo/info/refs", get(info_refs))
}

async fn upload_pack(
    Path((owner, repo)): Path<(String, String)>,
    body: Bytes,
) -> Result<impl IntoResponse> {
    let repo = get_repository(&owner, &repo).await?;

    // Parse want/have lines
    let request = parse_upload_pack_request(&body)?;

    // Generate packfile with requested objects
    let packfile = generate_packfile(&repo, &request).await?;

    Ok((
        [(header::CONTENT_TYPE, "application/x-git-upload-pack-result")],
        packfile,
    ))
}

async fn receive_pack(
    Path((owner, repo)): Path<(String, String)>,
    body: Bytes,
) -> Result<impl IntoResponse> {
    let repo = get_repository(&owner, &repo).await?;

    // Parse commands and packfile
    let (commands, packfile) = parse_receive_pack(&body)?;

    // Verify permissions
    verify_push_permissions(&owner, &repo).await?;

    // Apply packfile
    apply_packfile(&repo, &packfile).await?;

    // Update refs
    for cmd in commands {
        update_ref(&repo, &cmd).await?;
    }

    Ok((
        [(header::CONTENT_TYPE, "application/x-git-receive-pack-result")],
        "ok\n",
    ))
}

Pack File Generation

use gix::pack;

pub async fn generate_packfile(
    repo: &Repository,
    wants: &[ObjectId],
    haves: &[ObjectId],
) -> Result<Vec<u8>> {
    // Find all objects to include
    let objects = repo.rev_walk(wants)
        .sorting(Sorting::ByCommitTimeNewestFirst)
        .ancestors()
        .filter(|id| !haves.contains(id))
        .collect::<Vec<_>>();

    // Create pack file
    let mut pack_data = Vec::new();
    let mut writer = pack::data::output::bytes::Writer::new(&mut pack_data);

    for oid in objects {
        let object = repo.find_object(oid)?;
        writer.write_entry(object)?;
    }

    writer.finish()?;

    Ok(pack_data)
}

Reference Management

pub struct RefStore {
    repo: Repository,
}

impl RefStore {
    pub fn list_refs(&self) -> Result<Vec<(String, ObjectId)>> {
        let refs = self.repo.references()?;

        refs.all()?
            .map(|r| {
                let r = r?;
                Ok((r.name().to_string(), r.target().id()))
            })
            .collect()
    }

    pub fn update_ref(&self, name: &str, new_id: ObjectId, old_id: Option<ObjectId>) -> Result<()> {
        let ref_log_message = format!("guts: update {}", name);

        if let Some(old) = old_id {
            // Atomic compare-and-swap
            self.repo
                .reference(name, new_id, PreviousValue::MustExistAndMatch(old.into()))?;
        } else {
            // Create new ref
            self.repo
                .reference(name, new_id, PreviousValue::MustNotExist)?;
        }

        Ok(())
    }

    pub fn get_head(&self) -> Result<ObjectId> {
        let head = self.repo.head_commit()?;
        Ok(head.id)
    }
}

Guts Extensions to Git

/// Extended commit with Guts-specific metadata
#[derive(Debug, Clone)]
pub struct GutsCommit {
    /// Standard Git commit
    pub git_commit: gix::Commit,

    /// Ed25519 signature of commit hash
    pub signature: Signature,

    /// Signer's public key
    pub signer: PublicKey,

    /// Consensus round when commit was accepted
    pub consensus_round: Option<u64>,
}

impl GutsCommit {
    pub fn verify(&self) -> Result<bool> {
        let commit_hash = self.git_commit.id.as_bytes();
        self.signer.verify(commit_hash, &self.signature)
    }
}

发现问题?提交给管理员复核

评分:

评论 (0)

暂无评论,成为第一个评论者吧!