Skip to content

Commit 687a925

Browse files
committed
feat: add SKILL.md
1 parent b49b011 commit 687a925

2 files changed

Lines changed: 58 additions & 0 deletions

File tree

‎CHANGELOG.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
88
## [Unreleased] - 0.2.0
99

1010
### Added
11+
- Added `SKILL.md` to instruct agents on how to use this tool
1112
- Rich terminal UI: live-streaming hook output, progress bar for link application, styled branch/path colours
1213
- `gw ls` renders a Rich table with Branch, Path, and Age columns, sorted by age then alphabetically
1314
- `gw root` command — prints workspace root path and exits 0/1, intended for agent/scripting use

‎SKILL.md‎

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
---
2+
name: git-workspace
3+
description: How to work with branches in a git-workspace repository
4+
---
5+
6+
## What is git-workspace
7+
8+
A git plugin that manages isolated development environments on top of git worktrees. Each branch gets its own fully configured environment — dependencies installed, configuration files applied, environment variables loaded, lifecycle hooks executed. All commands are invoked as `git workspace <command>`.
9+
10+
## When to use this skill
11+
12+
Use `git workspace` commands when any of these apply:
13+
- The user wants to work on a feature, hotfix, or any other branch
14+
- The user mentions workspaces, environments, or spinning up a branch context
15+
16+
Before using any `git workspace` command, confirm you are in a workspace:
17+
18+
```bash
19+
git workspace root # exit 0 → workspace, exit 1 → not a workspace
20+
```
21+
22+
If exit 1, fall back to regular git commands. Standard git operations (commit, push, pull, rebase, merge) always use plain `git` regardless.
23+
24+
## Activating a branch
25+
26+
```bash
27+
WORKTREE=$(git workspace up <branch> --detached -o)
28+
```
29+
30+
- `--detached` skips interactive hooks not meant for agents
31+
- `-o` prints the worktree path to stdout and suppresses all other output
32+
- Use `$WORKTREE` as the working directory for all subsequent operations on that branch
33+
34+
`up` installs dependencies, applies configuration files and symlinks, loads environment variables, and runs any other setup the human has defined. Do not replicate this with raw `git worktree` commands — you will produce an incomplete environment.
35+
36+
## Resetting a branch
37+
38+
```bash
39+
git workspace reset <branch>
40+
```
41+
42+
Reapplies configuration, symlinks, and setup hooks after a pull or merge so the environment reflects the updated branch state. Do not call after `git workspace up` — `up` already performs this setup.
43+
44+
## Typical workflow
45+
46+
```
47+
1. git workspace root # confirm workspace
48+
2. git workspace up <branch> --detached -o # activate branch
49+
3. git pull / commit / push # standard git inside $WORKTREE
50+
4. git workspace reset <branch> # after pull/merge, reapply environment
51+
```
52+
53+
## Constraints
54+
55+
- Always run `git workspace root` before any `git workspace` command
56+
- Always pass `--detached` and `-o` to `git workspace up`
57+
- Never call `git worktree` directly inside a workspace

0 commit comments

Comments
 (0)