Branch: feat/global-install-uninstall-managed-cleanup
Commit: 965d71d
Changes: 7 files, +688 / -9 lines
Reviewer: Claude
Date: 2026-02-28
This PR adds three new shell scripts for global (machine-wide) installation of polyagent-skills to agent config directories (~/.codex, ~/.kiro, ~/.gemini, ~/.openclaw), plus a safe uninstaller. It also introduces OpenClaw as a newly supported agent and updates docs accordingly.
-
Manifest-based uninstall — The install scripts write a manifest file, and the uninstaller only removes paths listed in the manifest with ownership marker verification. This is a safe, well-thought-out pattern that avoids accidentally deleting user files.
-
Backup-before-overwrite — Consistent with the existing
install-to-project.shpattern. Backups go to timestamped directories. -
--dry-runon uninstall — Good UX; lets users preview what would be removed. -
copyvslinkmodes — Useful for both production users and developers actively editing skills. -
SKILL.md frontmatter normalization — Solves a real parser compatibility issue (KI-007) where multi-line YAML
description: >blocks cause problems for OpenClaw. -
Docs updated holistically — README, CONTRIBUTING, KNOWN_ISSUES, and adapter-contract-spec all updated together.
The following functions are duplicated verbatim across both scripts (~100 lines each):
extract_skill_name()extract_skill_description()extract_skill_body()normalize_skill_markdown()backup_if_exists()record_manifest()mark_dir_managed()
Suggestion: Extract shared functions into a scripts/lib-common.sh and source it from both scripts. This aligns with the project's own "shared patterns" philosophy (Layer 1: Common Foundation).
In link mode (line 256-266), the shared library is symlinked, but then install_normalized_skills_copy is called for OpenClaw anyway (line 270). The comment says "normalized copy required" but this means link mode is really "hybrid" mode. This is documented but could confuse users.
Suggestion: Make the output messaging clearer — e.g., "Link mode: OpenClaw still receives a copy (parser requires normalized frontmatter)".
In install-openclaw-global.sh, link mode (line 187-198) symlinks directly without normalization and prints a note: ! Note: link mode does not normalize SKILL.md frontmatter. But this is the exact problem documented in KI-007 — OpenClaw's parser can't handle multi-line frontmatter. So running ./scripts/install-openclaw-global.sh link will install broken skills.
Suggestion: Either (a) disallow link mode for the OpenClaw-specific script, (b) always copy+normalize for OpenClaw (like install-global-all.sh does), or (c) add a much more prominent warning that link mode is incompatible with the current OpenClaw parser.
write_gemini_global_instructions() backs up then overwrites ~/.gemini/instructions.md. If a user already has Gemini global instructions for other purposes, the backup-and-replace approach loses their existing config. The same applies to Codex and Kiro configs.
Suggestion: Consider an append/merge strategy, or at minimum add prominent documentation that these files will be fully replaced.
The PR adds OpenClaw to the README support table and creates global install scripts, but there's no adapters/openclaw/ directory. The existing pattern has per-agent adapters. Is OpenClaw intentionally different (global-only, no per-project adapter)?
Suggestion: Either add an OpenClaw adapter directory or document why the adapter pattern doesn't apply to OpenClaw (perhaps via an ADR note).
The project-level installer still only supports claude-code, codex, kiro, gemini, cursor. OpenClaw is a new supported agent but has no project-level install path.
Suggestion: If OpenClaw is global-only by design, document this explicitly. Otherwise, add OpenClaw support to install-to-project.sh.
Both scripts start with printf ... > "$MANIFEST_FILE" which truncates the manifest. If a user runs the installer twice, only the second run's paths are tracked. Paths from the first run that were replaced become orphaned from the manifest.
Suggestion: This is mostly fine because the installer replaces those same paths anyway, but worth noting. Consider appending (>>) or documenting that re-installs are safe because they replace the same paths.
The output suggests users verify with rg (ripgrep):
openclaw skills list | rg -i 'requirement-study|repo-bootstrap|remote-ops'
Not all users will have rg installed. Consider using grep -i instead.
Lines 19-30 of the README diff are pure trailing-whitespace alignment changes to the ASCII architecture diagram. These add noise to the diff.
The new scripts are substantial bash (~600 lines total). No evidence of shellcheck or shfmt linting. The complex awk scripts would benefit from validation.
The normalize_skill_markdown function has complex awk-based YAML frontmatter parsing. There are no tests to verify edge cases (empty description, special characters, missing frontmatter, etc.).
Suggestion: Consider adding a tests/ directory with test cases for the normalization pipeline.
The PR adds genuinely useful functionality — global install is a natural next step for this project. The manifest-based safe uninstall is well-designed. However, the significant code duplication between the two install scripts and the OpenClaw link-mode footgun (silently installing broken skills) should be addressed before merging.
Recommendation: Request changes — address items 1, 3, and 5 before merging.