Create a new project workspace folder with workbench, worktree, Cursor rules, and .code-workspace file. Use when the user wants to set up a new project workspace, create a workspace for a new project, or start working on a new project initiative. Also handles adding new initiatives to an existing workspace.
Set up a standardized project workspace at ~/workspace/<project>_workspace/ with a workbench, git worktree, Cursor rules, and multi-root .code-workspace file.
The main project repository must already be cloned at ~/workspace/<project>/. This skill does NOT clone from GitLab.
<project>_workspace/ folderAsk the user for the following. Use sensible defaults where noted.
kairos, ethel, nutrition-service). Verify it exists at .~/workspace/<project>/coverage_transfer_bug, saturated_fat_trend). This becomes both the workbench subfolder and part of the worktree directory name. Use lowercase_with_underscores.build-jw-<initiative-name-with-hyphens>.ethel, kairos). The user can skip this.~/workspace/<project>/ exists and is a git repo~/workspace/<project>_workspace/ already exists
cd ~/workspace/<project> && git branch --list <branch_name>mkdir -p ~/workspace/<project>_workspace
cd ~/workspace/<project>_workspace
git init
mkdir -p workbench/<initiative_name>
mkdir -p .cursor/rules
mkdir -p .cursor/skills
.gitignore# Worktree directories (created from ~/workspace/<project>)
<project>-*/
# OS files
.DS_Store
*.swp
*.swo
# Large data files
*.csv
*.parquet
cd ~/workspace/<project>
git worktree add ~/workspace/<project>_workspace/<project>-<initiative_slugified> -b <branch_name>
Where <initiative_slugified> converts underscores to hyphens (e.g., coverage_transfer_bug → coverage-transfer-bug).
.code-workspace FileWrite to ~/workspace/<project>_workspace/workbench/<initiative_name>/<initiative_name>.code-workspace:
{
"folders": [
{
"name": "worktree: <project>-<initiative_slugified>",
"path": "../../<project>-<initiative_slugified>"
},
{
"name": "workbench: <initiative_name>",
"path": "."
}
],
"settings": {}
}
If the user specified reference projects, add entries for each:
{
"name": "ref: <ref_project> (read-only)",
"path": "../../../<ref_project>"
}
The path ../../../<ref_project> navigates from workbench/<initiative>/ up to ~/workspace/ and into the reference project.
Write to ~/workspace/<project>_workspace/.cursor/rules/commit-only-in-worktree.mdc:
# Commit Only in Worktrees
When working in this workspace, ONLY commit code changes to git worktree directories (folders matching `<project>-*/`). Never commit directly to the main project repository at `~/workspace/<project>/`.
## Rules
1. All code changes (features, bug fixes, refactors) MUST be committed in the worktree directory for the current initiative.
2. The workbench directory is tracked by this workspace's own git repo — workbench changes (docs, plans, output) are committed to the workspace repo at `~/workspace/<project>_workspace/`.
3. Never run `git push` from within a worktree without explicit user approval.
4. When creating new files, place them in the correct git context:
- Code files → worktree directory
- Documentation, plans, analysis output → workbench initiative folder
5. Before committing, verify you are in the correct directory by checking `git remote -v` — the worktree remote should point to the project's GitLab origin, not the workspace repo.
Check if ~/workspace/<project>_workspace/.cursor/skills/<project>-worktree-setup/SKILL.md exists.
<project>. Running it now..." and follow its instructions to configure the new worktree.<project>. Some projects need special worktree setup (Docker config, .env files, credential scripts, etc.). Want to create a setup skill now?" If yes, scaffold a SKILL.md at .cursor/skills/<project>-worktree-setup/SKILL.md by asking what setup steps are needed for this project's worktrees.Write to ~/workspace/<project>_workspace/README.md:
# <project>-workspace
Workspace for <project>-focused investigations and feature work. Worktrees are created from `~/workspace/<project>/` (the main clone).
## Structure
- `workbench/` — Planning docs, analysis scripts, experiments (tracked in this repo)
- `<project>-<branch>/` — Git worktrees for active work (created from main clone)
- `.cursor/rules/` — Workspace-level Cursor rules
- `.cursor/skills/` — Project-specific Cursor skills
## Setup
```bash
# Open an initiative in Cursor with scoped context
cursor ~/workspace/<project>_workspace/workbench/<initiative_name>/<initiative_name>.code-workspace
# Create a new worktree for a feature/bug
cd ~/workspace/<project>
git worktree add ~/workspace/<project>_workspace/<project>-<feature> -b build-jw-<feature>
| Worktree | Branch | Initiative |
|---|---|---|
<project>-<initiative_slugified>/ | <branch_name> | <initiative_name> |
| Location | Tracks |
|---|---|
<project>_workspace/.git | workbench/ contents |
~/workspace/<project>/.git | Project code (worktree parent) |
When done with a worktree:
cd ~/workspace/<project>
git worktree remove ~/workspace/<project>_workspace/<project>-<feature>
# Update the Active Worktrees table above
# Remove its entry from the relevant .code-workspace file
## Step 9: Initial Commit
```bash
cd ~/workspace/<project>_workspace
git add .
git commit -m "Initialize <project> workspace with <initiative_name> workbench"
Tell the user:
~/workspace/<project>_workspace/~/workspace/<project>_workspace/<project>-<initiative_slugified>/ on branch <branch_name>cursor ~/workspace/<project>_workspace/workbench/<initiative_name>/<initiative_name>.code-workspace~/workspace/<project>_workspace/workbench/<initiative_name>/If ~/workspace/<project>_workspace/ already exists, add a new initiative without re-creating the workspace:
workbench/<initiative_name>/ directorycd ~/workspace/<project>
git worktree add ~/workspace/<project>_workspace/<project>-<initiative_slugified> -b <branch_name>
.code-workspace file in workbench/<initiative_name>/.gitignore — add the new worktree directory pattern if not already covered by the globREADME.md — add a row to the Active Worktrees table.cursor/skills/<project>-worktree-setup/SKILL.mdcd ~/workspace/<project>_workspace
git add .
git commit -m "Add <initiative_name> initiative with worktree <project>-<initiative_slugified>"