skills/using-workspaces/SKILL.md
Use when starting feature work that needs isolation from current workspace or before executing implementation plans - creates isolated workspace with smart base branch detection
npx skillsauth add BubbleBuffer/superpawers using-workspacesInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
OpenCode workspaces provide directory-level isolation for feature work. Each workspace gets its own directory (backed by git worktrees), enabling true parallel agent dispatch without file conflicts.
Core principle: Simple workspace creation + clean baseline verification = reliable isolation.
Announce at start: "I'm using the using-workspaces skill to set up an isolated workspace."
git merge-base HEAD main 2>/dev/null && echo "main" || echo "master"
If the repo has multiple potential base branches, ask:
Which branch should be the base for this feature?
1. main
2. master
3. Other (specify)
Call the workspace_create tool:
workspace_create(name="feature/<name>", base_branch="<detected-base>")
Where the name follows the pattern feature/<name> or fix/<name>.
The tool returns { id, name, directory }. Record the workspace id — you will need it for finishing-a-workspace.
Auto-detect and run appropriate setup in the workspace directory:
# Node.js
if [ -f package.json ]; then npm install; fi
# Rust
if [ -f Cargo.toml ]; then cargo build; fi
# Python
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
if [ -f pyproject.toml ]; then poetry install; fi
# Go
if [ -f go.mod ]; then go mod download; fi
Run tests to ensure workspace starts clean:
# Examples - use project-appropriate command
npm test
cargo test
pytest
go test ./...
If tests fail: Report failures, ask whether to proceed or investigate.
If tests pass: Report ready.
Workspace ready: <workspace-name>
Directory: <workspace-directory>
Tests passing (<N> tests, 0 failures)
Ready to implement <feature-name>
| Situation | Action | |-----------|--------| | On main/master | Create workspace directly | | Already in a workspace | Already isolated, verify tests pass | | Tests fail during baseline | Report failures + ask | | No package.json/Cargo.toml | Skip dependency install |
To remove stale workspaces, use the workspace_clean tool:
workspace_clean(olderThanDays=7)
This removes workspaces older than the specified number of days. You can also target a specific workspace:
workspace_clean(workspaceId="<workspace-id>")
Run cleanup periodically or when workspace directories accumulate.
In those cases, verify the baseline instead of creating a new workspace.
You: I'm using the using-workspaces skill to set up an isolated workspace.
[Detect base branch: main]
[Create workspace: workspace_create("feature/auth", "main")]
[Run npm install]
[Run npm test - 47 passing]
Workspace ready: feature/auth
Directory: /home/user/project/.opencode/workspaces/feature-auth-abc123
Tests passing (47 tests, 0 failures)
Ready to implement auth feature
Never:
Always:
Use after:
Prerequisite for:
Pairs with:
data-ai
Use when a request involves multiple steps or files, or when an approved design must be turned into a detailed implementation plan
development
Use when deciding which SuperPawers skill should govern a new task or workflow step, before taking any other action
development
Use when starting feature work that needs git isolation or before writing committed spec, plan, or code artifacts
development
Use when a task list exists or is being created for multi-step implementation work, whether from a formal plan or an ad-hoc breakdown