install-hunkwise
Skill91 starsChanged 8 months agoMITView on GitHub
Install the hunkwise VSCode extension from source. Use this skill whenever the user asks to install, build, package, or reinstall hunkwise, or when they want to load the latest changes into VSCode.
- Deletes or force-pushes
- Installs packages
In this repository2 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- copilot-review-loopSkill
The file
We split this skill into the rules it gives an agent
4 rules. About 0 are common, 3 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 46
If compilation fails, stop and surface the TypeScript errors to the user.
- Very specific: line 124
If the key already exists with other values, append "molon.hunkwise" rather than replacing the array.
- Distinctive: line 128
Delete the cloned directory:
- Distinctive: line 144
If the extension fails to activate, check the exthost log:
≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Install hunkwise
hunkwise is a VSCode extension that uses a proposed (private) API — editorInsets — so it cannot be installed from the marketplace and requires a special setup.
Prerequisites
- Node.js (>=18) and npm available
- git available
codeCLI resolvable (see Step 3 for platform-specific paths)
Steps
Step 1: Clone the repository
Clone into a uniquely named temp directory to avoid conflicts:
HUNKWISE_TMP=$(mktemp -d /tmp/hunkwise-XXXXXX)
git clone https://github.com/molon/hunkwise.git "$HUNKWISE_TMP"
cd "$HUNKWISE_TMP"On Windows, use a timestamp-based name:
set HUNKWISE_TMP=%TEMP%\hunkwise-%DATE:~-4%%DATE:~3,2%%DATE:~0,2%-%TIME:~0,2%%TIME:~3,2%%TIME:~6,2%
git clone https://github.com/molon/hunkwise.git %HUNKWISE_TMP%
cd %HUNKWISE_TMP%Remember the directory path — you'll need it for cleanup in Step 6.
Step 2: Install dependencies and compile
npm install
npm run compileIf compilation fails, stop and surface the TypeScript errors to the user.
Step 3: Package with vsce
npx @vscode/vsce package --allow-missing-repositoryThis produces hunkwise-<version>.vsix in the project root. Do NOT use --no-dependencies — runtime dependencies (ignore, diff) must be bundled.
Step 3.5: Linux stable compatibility check
Before proceeding on Linux, check whether the target is a VS Code stable build (not Insiders). On some Linux distributions (e.g. CachyOS), the proposed editorInsets API may not work in the stable build. If the user is on Linux and only has VS Code stable installed, warn them:
⚠️ hunkwise may not work on VS Code stable on some Linux distributions. If it fails to activate, please switch to VS Code Insiders. See issue #20 for details.
Continue with installation — but surface this warning so the user is aware before restarting.
Step 4: Detect installed VSCode builds and install the .vsix
First, detect which VSCode builds are installed, then install into all of them.
Known CLI paths by platform:
| Platform | Build | CLI path |
| macOS | Stable | /Applications/Visual Studio Code.app/Contents/Resources/app/bin/code |
| macOS | Insiders | /Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/bin/code |
| Windows | Stable | %LOCALAPPDATA%\Programs\Microsoft VS Code\bin\code.cmd |
| Windows | Insiders | %LOCALAPPDATA%\Programs\Microsoft VS Code Insiders\bin\code-insiders.cmd |
| Linux | Stable | code (in PATH) |
| Linux | Insiders | code-insiders (in PATH) |
macOS/Linux — detect and install into all present builds:
VSIX=$(ls -t hunkwise-*.vsix | head -1)
for CLI in \
"/Applications/Visual Studio Code.app/Contents/Resources/app/bin/code" \
"/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/bin/code" \
"$(command -v code 2>/dev/null)" \
"$(command -v code-insiders 2>/dev/null)"; do
[ -x "$CLI" ] && "$CLI" --install-extension "$VSIX" --force
doneWindows — detect and install into all present builds:
REM Use the actual .vsix filename produced by vsce in Step 3
for %%f in (hunkwise-*.vsix) do set VSIX=%%f
set STABLE=%LOCALAPPDATA%\Programs\Microsoft VS Code\bin\code.cmd
set INSIDERS=%LOCALAPPDATA%\Programs\Microsoft VS Code Insiders\bin\code-insiders.cmd
if exist "%STABLE%" "%STABLE%" --install-extension %VSIX% --force
if exist "%INSIDERS%" "%INSIDERS%" --install-extension %VSIX% --forceStep 5: Configure proposed API (one-time setup per build)
Because hunkwise uses a proposed API, each installed VSCode build must be told to enable it via its own argv.json in the user config directory. Apply to every build detected in Step 4 — skip any build where "molon.hunkwise" is already present.
argv.json locations (same builds as Step 4):
| Platform | Build | Path |
| macOS/Linux | Stable | ~/.vscode/argv.json |
| macOS/Linux | Insiders | ~/.vscode-insiders/argv.json |
| Windows | Stable | %USERPROFILE%\.vscode\argv.json |
| Windows | Insiders | %USERPROFILE%\.vscode-insiders\argv.json |
For each relevant argv.json: read the existing file, then add or merge "enable-proposed-api" — do not overwrite other fields:
{
"enable-proposed-api": ["molon.hunkwise"]
}If the key already exists with other values, append "molon.hunkwise" rather than replacing the array.
Step 6: Clean up
Delete the cloned directory:
rm -rf "$HUNKWISE_TMP"On Windows: rmdir /s /q %HUNKWISE_TMP%
Step 7: Restart VSCode
Tell the user to fully quit and reopen VSCode (not just close the window) for the extension and proposed API setting to take effect.
Notes
- The
enabledApiProposals: ["editorInsets"]field inpackage.jsonenablesvscode.window.createWebviewTextEditorInset, used to embed per-hunk Accept/Discard buttons inline in the editor. Without this, the buttons will not appear. - Settings are stored in
.vscode/hunkwise/settings.jsonwithin the workspace, not in VSCode global settings. - If the extension fails to activate, check the exthost log:
- macOS:
~/Library/Application Support/Code[-Insiders]/logs/<timestamp>/window1/exthost/exthost.log - Windows:
%APPDATA%\Code[-Insiders]\logs\<timestamp>\window1\exthost\exthost.log
- macOS:
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

