gabrie30/ghorg/ghorg-create-vscode-generic-workspace
- community
Checking that the SKILL.md file is still in the repository.
Use when the user wants a reusable ghorg reclone "generic workspace" that clones the same set of repositories into a fresh, separately named VSCode workspace on every run, such as `ghorg reclone <prefix>-generic-workspace` producing `<prefix>-<name>` directories.
Install
npx vskill@latest install gabrie30/ghorg/ghorg-create-vscode-generic-workspaceSKILL.md
Create ghorg generic workspace
A generic workspace is a ghorg reclone entry that acts as a template. Every run of ghorg reclone <PREFIX>-generic-workspace clones the same repositories into a staging directory, then a post_exec_script asks for a name and renames the directory to <PREFIX>-<name>. Each run produces a new, independent workspace (one per feature, investigation, or task).
This differs from the ghorg-create-vscode-workspace skill, which creates one fixed workspace that is updated in place on each reclone.
Prerequisites
- ghorg must be installed and on the system
PATH. - Network access to the SCM provider (GitHub, GitLab, Bitbucket, etc.).
bashandgitmust be available.
Platform support
macOS and Linux. The post-exec script is a bash script that ghorg executes directly, so on Windows it only works under WSL.
Environment variables
| Variable | Description | Default | |
|---|---|---|---|
| HOME_DIR | Base directory for all paths | $HOME_DIR if set, otherwise $HOME | |
| SCM_ORG | SCM organization to clone from | $SCM_ORG if set, otherwise ask What is the SCM organization to clone from? (example: my-github-org) |
Stop with an error if HOME_DIR is empty or the user does not provide an SCM_ORG.
Paths
| Variable | Path | |
|---|---|---|
| GHORG_CONFIG_DIR | HOME_DIR/.config/ghorg | |
| GHORG_RECLONE_CONFIG | $GHORG_RECLONE_PATH if set, otherwise HOME_DIR/.config/ghorg/reclone.yaml | |
| BASE_DIR | HOME_DIR/workspaces | |
| RECLONE_KEY | <PREFIX>-generic-workspace | |
| REPO_FILE | GHORG_CONFIG_DIR/<PREFIX>-all-repos-generic.txt | |
| POST_EXEC_SCRIPT | GHORG_CONFIG_DIR/post-exec-<PREFIX>-generic-workspace.sh | |
| TEMPLATE | post-exec-template.sh in this skill's directory |
Workflow
Step 1: Resolve environment
Resolve HOME_DIR and SCM_ORG as described above.
Step 2: Ask for the prefix
Ask the user:
What prefix should workspaces created from this template use?
Example: payments produces workspaces like payments-fix-refunds.
Validation: Must match ^[a-z0-9-]+$. Ask again until valid. Store as PREFIX.
Step 3: Ask for repositories
Ask the user:
List the repositories to clone into every workspace, one per line.
Store as REPO_LIST. At least one repository is required.
Step 4: Ask for files to copy (optional)
Ask the user:
Are there local files to copy into every new workspace (for example `.env` files that are not in git)? Give one `source|destination` pair per line, or leave empty.
sourceis an absolute path on this machine.destinationis relative to the workspace root, usually<repo>/<path>.
Example: /path/to/my-app/.env|my-app/.env
Store as COPY_FILES. Empty is fine.
Step 5: Check for conflicts
Stop and report an error, without changing anything, if any of these already exist:
- A top-level key RECLONE_KEY in GHORG_RECLONE_CONFIG (
grep -q '^<RECLONE_KEY>:' <GHORG_RECLONE_CONFIG>). - The file REPO_FILE.
- The file POST_EXEC_SCRIPT.
Step 6: Create files
- Create GHORG_CONFIG_DIR and BASE_DIR (with parents) if missing. Create an empty GHORG_RECLONE_CONFIG if missing.
- Write REPO_FILE with REPO_LIST, one repository per line.
- Copy TEMPLATE to POST_EXEC_SCRIPT and edit the copy:
- Replace
__PREFIX__with PREFIX. - Replace
__BASE_DIR__with the absolute BASE_DIR. - Add one quoted line per COPY_FILES entry inside
COPY_FILES=(), for example"/path/to/my-app/.env|my-app/.env".
- Make it executable:
chmod +x <POST_EXEC_SCRIPT>. - Check the syntax:
bash -n <POST_EXEC_SCRIPT>.
Step 7: Append the reclone entry
Append to GHORG_RECLONE_CONFIG, replacing placeholders with resolved absolute values:
- Preserve all existing content. Add a newline first if the file does not end with one.
- Validate the file still parses:
GHORG_RECLONE_PATH="<GHORG_RECLONE_CONFIG>" ghorg reclone --list > /dev/null. Discard the output because it can contain tokens.
Step 8: Create the first workspace (optional)
Ask the user whether to create a workspace now. If yes, ask for its name and run:
GENERIC_WORKSPACE_NAME skips the interactive prompt, which needs a terminal that agent shells do not have.
ghorg still exits 0 when the post-exec script fails. Treat the run as failed if the output contains ERROR: Running post_exec_script or the directory from the INFO: Workspace ready at line does not contain a <directory name>.code-workspace file, and show the post-exec logs section to the user.
If the name was already taken, the clone stays in BASE_DIR/<PREFIX>-generic-workspace and the next run reuses it. Ask for a different name and run the command again.
Step 9: Explain what was added
Tell the user the generic workspace was created, then explain what was added and how the pieces fit together, using this structure with resolved values. Include item 4 only if Step 8 created a workspace.
How a run works
- ghorg clones REPO_LIST into
BASE_DIR/<PREFIX>-generic-workspace. - The post-exec script takes the name from
GENERIC_WORKSPACE_NAMEor prompts on the terminal, then slugifies it (My Fix!becomesmy-fix). - It renames the staging directory to
BASE_DIR/<PREFIX>-<slug>and aborts if that already exists. - It writes a
.ghorg-generic-workspacemarker, runsgit initat the workspace root, creates<PREFIX>-<slug>.code-workspace, copies COPY_FILES, and opens the workspace in VS Code when it can find it.
To change copied files or stop VS Code from opening, edit COPY_FILES or OPEN_IN_VSCODE in POST_EXEC_SCRIPT.
VS Code workspace file
Every workspace gets a VS Code workspace file in its root, named after the workspace folder:
BASE_DIR/<PREFIX>-<slug>/<PREFIX>-<slug>.code-workspace
Example: HOME_DIR/workspaces/payments-fix-refunds/payments-fix-refunds.code-workspace
With the following contents:
The post-exec script writes this file on every run and overwrites any existing one. The content comes from the heredoc in post-exec-template.sh, so keep the two in sync when editing either.
Failure conditions
Stop and report an error. Never silently continue when:
- HOME_DIR or SCM_ORG cannot be resolved.
- RECLONE_KEY, REPO_FILE, or POST_EXEC_SCRIPT already exists.
- A file or directory cannot be written, or
bash -nfails. - GHORG_RECLONE_CONFIG no longer parses after appending.
ghorg reclonefails in Step 8 (non-zero exit, or a post-exec error as described there).
Security
- Security scanPassed, 90 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/ghorg-create-vscode-generic-workspace/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/gabrie30/ghorg/ghorg-create-vscode-generic-workspace)