Skip to content

fix(guard): tidy small install, uninstall and ci rough edges (#110) - #113

Merged
q-soriarty merged 8 commits into
developfrom
fix/110-guard-rough-edges
Nov 19, 2026
Merged

q-soriarty merged 8 commits into
developfrom
fix/110-guard-rough-edges

Conversation

@q-soriarty

@q-soriarty q-soriarty commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

What does this PR do?

Clears every item of #110, one atomic commit each:

  • Uninstall: no empty "hooks": {} left in the harness config when ours were the only hooks (registry.mjs)
  • User config: install now backs up an unparsable user config to .bak like repair; both share one backup helper and one harness-merge helper, so a non-array harnesses value is ignored in repair too
  • Bash installers: an invalid --scope value exits 1 with usage before anything is written (matches the PowerShell ValidateSet)
  • Workflow name: Lint SKILL.md → Lint and guard tests. The README badge points at the file, and no branch protection refers to the name
  • README: the guard command list shows the absolute path and notes that enable/disable act on the current repository
  • Windows: /cygdrive/<drive>/... maps to the drive like Git Bash /c/...; check.test.mjs and levels.test.mjs also set APPDATA/USERPROFILE
  • CHANGELOG [Unreleased] → Fixed

Closes #110

Test plan

  • TDD: new tests failed first, then passed (uninstall hooks key, install backup, repair non-array harnesses, Cygwin drive paths)
  • node --test hooks/test/ on Linux — 216/216
  • ./scripts/lint.sh — All checks passed
  • install_linux.sh --scope everywhere in a temporary HOME → exit 1, nothing written; --scope=all install + --uninstall → settings left as {}
  • CI lint + guard-tests (ubuntu/macos/windows), including the two isolated tests on Windows — all green

Checklist

  • All workflow invariants are preserved (atomic commits, conventional commits, no AI signatures, gitflow, issue-driven, PR-only merges, semver)
  • Decision guides cover the new/changed rules
  • Tested by invoking the skill in a Claude Code session
  • All content is in English

When our entries were the only hooks in a harness config, unregister
left an empty "hooks": {} behind. Remove the key in that case.

Refs #110
install overwrote an unparsable user config without a backup, while
repair kept a .bak copy; repair also spread a non-array harnesses value
into characters. Share one backup helper and one harness-merge helper
between both commands.

Refs #110
Treat /cygdrive/c/... like the Git Bash /c/... form, so cd and git -C into a Cygwin path keep the protected-branch and freshness checks.

Refs #110
check.test.mjs and levels.test.mjs set only XDG_CONFIG_HOME and HOME, so on Windows a real %APPDATA% config could leak in. Set APPDATA and USERPROFILE too.

Refs #110
An unknown --scope value reached the guard, which printed "install failed" while the script exited 0. Validate opt-in|all up front and exit with usage, like the PowerShell ValidateSet.

Refs #110
The workflow runs the guard tests as well as the SKILL.md lint. The README badge points at the file, so the rename does not break it; no branch protection refers to the workflow name.

Refs #110
@q-soriarty
q-soriarty merged commit e6b98d8 into develop Nov 19, 2026
4 checks passed
@q-soriarty
q-soriarty deleted the fix/110-guard-rough-edges branch November 19, 2026 09:58
@q-soriarty q-soriarty mentioned this pull request Nov 19, 2026
6 of 7 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant