git-sandbox
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.
- License 许可
- Apache-2.0
- 最近更新
- 2026-11-15
- Stars
- ★ 2.1k
- Forks
- 310
01 前言 Front Matter
- 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
03 SKILL.md 正文
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 Worktree Operations (When SCION_GIT_DEPTH Is Unset)
- Scope: Applies to host-mounted worktree/shared sandboxes (
SCION_GIT_DEPTHunset). IfSCION_GIT_DEPTHis set, your workspace is an in-container per-agent clone — follow the project's remote policy and thegit-operationsskill (## Shallow Clones) forgit fetch --deepen/--unshallowand remote pushes. - Restriction: Host-mounted worktree sandboxes have no remote credentials and may be air-gapped from
origin;git fetch,git pull, orgit pushwill fail unless the project grants remote access. - Directive: In local worktree sandboxes, assume the local
mainbranch is the source of truth. - Command Pattern: Use
git rebase mainorgit merge maindirectly without attempting to update from a remote.
2. Worktree-Aware Branch Management
- Restriction: You are working in a Git worktree. You cannot
git checkout mainif 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).
- Comparison:
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 - Any Other Command: Set the editor per command:
GIT_EDITOR=true git <subcommand>, orgit -c core.editor=true <subcommand>. - Never run
git config core.editor ...or otherwise writecore.editor,core.hooksPathor any other key outside the repository git config allow-list (pkg/util/git_config_policy.go) into the repository config: brokers refuse to start or resume an agent whose checkout sets one. Pass such options per command (git -c core.editor=true <subcommand>).
- Continue Rebase:
4. Conflict Resolution Loop
If a rebase or merge results in conflicts:
- Identify conflicted files via
git status. - Resolve conflicts in the source files.
- Stage changes:
git add <resolved-files>. - Finalize:
GIT_EDITOR=true git rebase --continue.
04 同仓库更多 Skills
team-creation
Create or extend scion agent team templates from a high-level description of roles and workflow. Use when the user describes a multi-agent team, panel, crew, pipeline, or any scenario requiring coordinated LLM agents with distinct roles. Also use when adding new roles to an existing team, modifying workflows, or restructuring agent coordination. Produces ready-to-use template directories in .scion/templates/ by default, or in a custom path if specified.
scion-web-serving
How to serve a web page, app, API or other HTTP service from inside your agent so a person or program can reach it through the Hub's port proxy: scion expose and unexpose, the URL to hand over, what the proxy carries, and scion tunnel for full apps. The link serves web protocols only; for a non-HTTP port, point the person to scion tunnel. Use before running scion expose. For web pages and apps, also read references/web-apps.md.
scion-scheduler
Schedule one-shot and recurring events for agents using the Scion CLI. Covers self-callbacks, recurring cron schedules and time zones, which schedules an agent can see, lifecycle management, and the blocked-wait pairing rule.
scion-messaging
Use when sending messages to users or agents with scion message, choosing conversations and mentions, or interpreting incoming messages. Covers user-facing formatting, agent delivery, and reading conversation history.
scion-conversation
How to use the scion conversation command for managing conversations. Covers listing, creating, viewing, participant management, and message retrieval. Complements the scion-messaging skill.
scion-cli-operations
Operational constraints for Scion agents running in containerized sandboxes. Covers prohibited commands and hub-only API access. Complements the scion CLI reference and messaging skills.