Skip to content
Back to skills

Windows Workspace Ops

ASecurity

Windows workspace plumbing - directory junctions, paths containing "!" and spaces, git overlay repositories, push recovery, and byte-exact edits that survive PowerShell quoting.

  • 5 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added September 3, 2026
ai-agentspythongoc++shellbashgitapi

Works with

  • terminal
  • api

Security analysis

A100/100

Pro scans all 4 files and shows the line behind each finding

Scanned September 20, 2026

npx -y skills add ShugokiFable/Ultimate-AI-Starter-Bundle --skill windows-workspace-ops --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Windows Workspace Ops?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Windows Workspace Ops
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/shugokifable-windows-workspace-ops/badge)](https://www.skillsdirectory.com/skills/shugokifable-windows-workspace-ops)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: windows-workspace-ops
description: Windows workspace plumbing - directory junctions, paths containing "!" and spaces, git overlay repositories, push recovery, and byte-exact edits that survive PowerShell quoting.
---

# Windows workspace ops (git-bash / Hermes terminal)

Plumbing layer for Windows workspaces: project paths may contain `!` on any
drive (examples: `D:\!Projects\!!!Workspace\...`,
`Z:\Backup\!Skyrim AE\!!!SkyrimAEaiWorkspace`). Never treat one drive root
as the only `!` path. Single-quote every path containing `!`. Projects are
snapshot-heavy (version folders), and CommonLibSSE-style
junctions break on every folder move/copy. These are the exact, verified
methods.

## NTFS junctions

- **`cp -a` FOLLOWS junctions.** Copying a folder tree that contains an
  `extern/CommonLibSSE` junction duplicates the whole target (hundreds of MB).
  Plan around it: after copying, delete the copied contents and re-create the
  junction (see below).
- **`cmd /c mklink /J` from bash is unreliable here:** the spawned cmd can run
  with the wrong CWD (junction lands at the drive root) and MSYS mangles
  `Z:\...` backslash targets into `/z/Z:/...`. Do not fight it.
- **Reliable, no-admin method (Python 3.12+):**
  `python -c "import _winapi; _winapi.CreateJunction(r'TARGET', r'LINK')"`
  - `_winapi.CreateJunction(src, dst)`: `dst` is the link, `src` the target.
  - Verify: `os.path.exists(dst + r'\install\lib\cmake\CommonLibSSE')` (any
    marker file inside the target).
  - Remove a stray/mangled junction with `os.rmdir(path)` — works on junctions
    without admin.
  - Reusable helper: `scripts/create_junction.py <target> <link>`.
- Re-create junctions after ANY copy/move/rename of a version folder
  (absolute targets go stale) before configuring or building.

## Quoting paths that contain `!`

Interactive bash history-expands `!`: `!!` splices in the previous command, so
a path like `D:\!Projects\!!!Workspace\...` inside DOUBLE
quotes gets expanded mid-path, breaking the argument into pieces at spaces.
Rule: **single-quote every path containing `!`**. Avoid `find ... | xargs`
pipelines with such paths — the expansions compound.

## Byte-exact edits when the `patch` tool refuses

`patch` trips its escape-drift guard on C++ string-literal blocks containing
`\"` and `\n` sequences (e.g. `settings.cpp` WriteDefaultINI style), and it has
been seen literalizing a `newline="\r\n"` escape into a real newline. When it
fails or mangles, do the edit in Python instead:

```python
with open(path, 'r', encoding='utf-8') as f: c = f.read()
assert old in c            # exact bytes; fail loudly if drifted
c = c.replace(old, new, 1)
with open(path, 'w', encoding='utf-8', newline='') as f: f.write(c)
```

Re-read the file to verify. This is the fallback for any tooling that fights
the text, not just `patch`.

## Workspace-folder to GitHub publication (overlay flow)

Project convention (Modern NPC Pathing and its kin): GitHub main IS the tree;
the local version folder is the source of truth for a release. Verified flow:

1. `gh repo clone <owner>/<repo> $LOCALAPPDATA/Temp/<name>` (use
   `$LOCALAPPDATA/Temp` for scratch — native tools handle it cleanly).
2. Review the source and copy only release-owned files into the clone. Inspect
   junctions first; do not blindly copy dependency trees or delete directory globs.
   Resolve any cleanup targets inside this disposable clone before removal.
3. Expect phantom `git status` entries: with `core.autocrlf=true`, line-ending
   swaps show as modified but have no real diff. Confirm real changes with
   `git diff --name-only` (not `git status`) and `git diff <file> | head`.
4. Unstage workspace-only artifacts that were never tracked (historical
   audit docs, previous-version Nexus changelogs) with `git reset -q -- <files>`.
5. Commit with the repository's configured identity and push its working branch.
   Wait for every required check on the exact pushed SHA to succeed, then build
   and tag that same commit. Publish only with the user's authorization.
6. Download every published asset; compare nonempty size and SHA-256 with the
   verified build and checksum records. Follow `release-checklist`; an older
   green run or a release page existing is not proof of these artifact bytes.

## Pitfalls

- Batch/PowerShell launchers and artifact checks:
  `references/bat-and-powershell-tooling.md`.
- `gh run watch` on a queued run can block: give it a few seconds first, or
  run it as a background process with notify on completion.
- A fresh Windows clone is LF on disk: do not judge "modified" files by
  `git status` alone; always diff before staging.

Files in this skill

  • SKILL.md4.2 KB
  • references/git-push-recovery.md2.2 KB
  • references/publishing-pitfalls.md4 KB
  • scripts/create_junction.py2.8 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.