git-sandbox

GitHub

定义在受限沙箱和 Worktree 环境下的 Git 工作流协议,指导 Agent 执行本地操作、分支管理及非交互式冲突解决。

resources/platform_skills/git-sandbox/SKILL.md GoogleCloudPlatform/scion

Trigger Scenarios

Git 相关任务 Worktree 环境下的代码操作

Install

npx skills add GoogleCloudPlatform/scion --skill git-sandbox -g -y
More Options

Non-standard path

npx skills add https://github.com/GoogleCloudPlatform/scion/tree/main/resources/platform_skills/git-sandbox -g -y

Use without installing

npx skills use GoogleCloudPlatform/scion@git-sandbox

指定 Agent (Claude Code)

npx skills add GoogleCloudPlatform/scion --skill git-sandbox -a claude-code -g -y

安装 repo 全部 skill

npx skills add GoogleCloudPlatform/scion --all -g -y

预览 repo 内 skill

npx skills add GoogleCloudPlatform/scion --list

SKILL.md

Frontmatter
{
    "name": "git-sandbox",
    "description": "Git workflow protocol for agents in sandbox\/worktree environments. Covers local-only operations, worktree-aware branch management, and non-interactive conflict resolution. Injected only for git-associated workspaces.",
    "inject_when": "git_workspace"
}

Git Workflow Protocol: Sandbox & Worktree Environment

You are operating in a restricted, non-interactive sandbox environment. Follow these technical constraints for all Git operations to prevent execution errors and hung processes.

1. Local-Only Operations (No Network Access)

  • Restriction: The environment is air-gapped from origin. Commands like git fetch, git pull, or git push will fail.
  • Directive: Always assume the local main branch is the source of truth.
  • Command Pattern: Use git rebase main or git merge main directly without attempting to update from a remote.

2. Worktree-Aware Branch Management

  • Restriction: You are working in a Git worktree. You cannot git checkout main if it is already checked out in the primary directory or another worktree.
  • Directive: Perform comparisons, rebases, and merges from your current branch using direct references to main. Do not attempt to switch branches to inspect code.
  • Reference Patterns:
    • Comparison: git diff main...HEAD (to see changes in your branch).
    • File Inspection: git show main:path/to/file.ext (to view content on main without switching).
    • Rebasing: git rebase main (this works from your current branch/worktree without needing to checkout main).

3. Non-Interactive Conflict Resolution (Bypass Vi/Vim)

  • Restriction: You cannot interact with terminal-based editors (Vi, Vim, Nano). Any command that triggers an editor will cause the process to hang.
  • Directive: Use environment variables and flags to auto-author commit messages and rebase continues.
  • Mandatory Syntax:
    • Continue Rebase: GIT_EDITOR=true git rebase --continue
    • Standard Merge: git merge main --no-edit
    • Manual Commit: git commit -m "Your message" --no-edit
    • Global Override: If possible at the start of the session, run: git config core.editor true

4. Conflict Resolution Loop

If a rebase or merge results in conflicts:

  1. Identify conflicted files via git status.
  2. Resolve conflicts in the source files.
  3. Stage changes: git add <resolved-files>.
  4. Finalize: GIT_EDITOR=true git rebase --continue.

Version History

  • 0.1.0-dev Current 2026-07-25 08:01

Same Skill Collection

.scion/templates/web-dev/skills/chrome-devtools/SKILL.md
resources/platform_skills/git-operations/SKILL.md
resources/platform_skills/scion-agent-manage/SKILL.md
resources/platform_skills/scion-cli-operations/SKILL.md
resources/platform_skills/scion-messaging/SKILL.md
resources/platform_skills/scion-scheduler/SKILL.md
resources/platform_skills/team-creation/SKILL.md

Metadata

Files
0
Version
0.1.0-dev
Hash
c2726e53
Indexed
2026-07-25 08:01

Accueil - Wiki
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-08-25 07:00
浙ICP备14020137号-1 $Carte des visiteurs$