Tool Updater
Overview
Use this skill to refresh an existing CLI tool safely: research current best practices, compare against current implementation, generate a TDD patch backlog, apply updates, and verify CLI invocation.
When to Use
- Tool has broken require() paths or runtime errors
- Tool's CLI interface needs updating (new flags, changed behavior)
- Reflection flags stale or low-performing tool
- User asks to audit/refresh an existing tool
The Iron Law
Never update a tool blindly. Every refresh must be evidence-backed, TDD-gated, and integration-validated.
Workflow
Step 0: Evaluate Current State
- Read the tool file and understand its purpose
- Check if it's registered in package.json scripts
- Test
node <tool-path> --help for CLI interface
- Identify issues: broken requires, missing error handling, stale logic
Step 1: Research Best Practices
- Read
.claude/tools/cli/CLAUDE.md for tool conventions
- Review similar tools for patterns (especially
cli-wrapper.cjs usage)
- Check if tool uses
wrapCLITool() from ../../lib/utils/cli-wrapper.cjs
- Use
Skill({ skill: 'research-synthesis' }) if external research needed
Step 2: Generate Patch Backlog
- List specific changes needed
- Prioritize: broken requires > CLI interface > error handling > logic
- Estimate scope: <30 lines = auto-apply, >30 lines = plan mode
Step 3: Apply Updates
- Write or update tests first (RED phase)
- Apply tool changes (GREEN phase)
- Refactor for clarity (REFACTOR phase)
- Use
Edit tool — never rewrite the entire file
Step 4: Verify Integration
- Verify tool loads without MODULE_NOT_FOUND errors
- Verify
--help output is correct and complete
- Verify tool handles missing args gracefully (exit 1 with usage)
- If CLI tool, verify package.json script entry exists or add one
- Run
pnpm lint:fix && pnpm format
- Run tool-specific tests
Step 5: Record
- Log changes via
MemoryRecord if significant
- Update CHANGELOG.md entry
Domain-Specific Validation
- Tool MUST load without MODULE_NOT_FOUND errors
- Tool MUST handle
--help flag and missing arguments gracefully
- Tool require() paths MUST be file-relative, not CWD-relative
- Tool MUST use
shell: false for any child process spawning (SE security rule)
- Tool SHOULD use
wrapCLITool() for consistent CLI behavior
- Tool SHOULD be registered in package.json if user-facing
Anti-Patterns
- Using CWD-relative requires (
./.claude/lib/...) instead of file-relative (../../lib/...)
- Swallowing errors silently in catch blocks
- Hardcoding paths that should be computed from
__dirname
- Using
shell: true in spawn/exec calls
1---2name: tool-updater3description: Research-backed CLI tool refresh workflow for updating existing tools with TDD checkpoints and CLI invocation validation.4version: 1.0.05model: sonnet6invoked_by: both7user_invocable: true8tools: [Read, Write, Edit, Glob, Grep, Bash, Skill, MemoryRecord]9args: '--tool <name-or-path> [--trigger reflection|evolve|manual|stale] [--mode plan|execute]'10error_handling: graceful11streaming: supported12verified: true13lastVerifiedAt: '2026-04-07'14dependencies: [research-synthesis]15category: framework-management16tags: [tools, cli, updater, maintenance, framework]17aliases: [update-tool, refresh-tool]18source: builtin19trust_score: 10020provenance_sha: 414c640407561b9321metadata:22 source: https://skillmd.com/skills/oimiragieo/tool-updater23---2425# Tool Updater2627## Overview2829Use this skill to refresh an existing CLI tool safely: research current best practices, compare against current implementation, generate a TDD patch backlog, apply updates, and verify CLI invocation.3031## When to Use3233- Tool has broken require() paths or runtime errors34- Tool's CLI interface needs updating (new flags, changed behavior)35- Reflection flags stale or low-performing tool36- User asks to audit/refresh an existing tool3738## The Iron Law3940Never update a tool blindly. Every refresh must be evidence-backed, TDD-gated, and integration-validated.4142## Workflow4344### Step 0: Evaluate Current State45461. Read the tool file and understand its purpose472. Check if it's registered in package.json scripts483. Test `node <tool-path> --help` for CLI interface494. Identify issues: broken requires, missing error handling, stale logic5051### Step 1: Research Best Practices52531. Read `.claude/tools/cli/CLAUDE.md` for tool conventions542. Review similar tools for patterns (especially `cli-wrapper.cjs` usage)553. Check if tool uses `wrapCLITool()` from `../../lib/utils/cli-wrapper.cjs`564. Use `Skill({ skill: 'research-synthesis' })` if external research needed5758### Step 2: Generate Patch Backlog59601. List specific changes needed612. Prioritize: broken requires > CLI interface > error handling > logic623. Estimate scope: <30 lines = auto-apply, >30 lines = plan mode6364### Step 3: Apply Updates65661. Write or update tests first (RED phase)672. Apply tool changes (GREEN phase)683. Refactor for clarity (REFACTOR phase)694. Use `Edit` tool — never rewrite the entire file7071### Step 4: Verify Integration72731. Verify tool loads without MODULE_NOT_FOUND errors742. Verify `--help` output is correct and complete753. Verify tool handles missing args gracefully (exit 1 with usage)764. If CLI tool, verify package.json script entry exists or add one775. Run `pnpm lint:fix && pnpm format`786. Run tool-specific tests7980### Step 5: Record81821. Log changes via `MemoryRecord` if significant832. Update CHANGELOG.md entry8485## Domain-Specific Validation8687- Tool MUST load without MODULE_NOT_FOUND errors88- Tool MUST handle `--help` flag and missing arguments gracefully89- Tool require() paths MUST be file-relative, not CWD-relative90- Tool MUST use `shell: false` for any child process spawning (SE security rule)91- Tool SHOULD use `wrapCLITool()` for consistent CLI behavior92- Tool SHOULD be registered in package.json if user-facing9394## Anti-Patterns9596- Using CWD-relative requires (`./.claude/lib/...`) instead of file-relative (`../../lib/...`)97- Swallowing errors silently in catch blocks98- Hardcoding paths that should be computed from `__dirname`99- Using `shell: true` in spawn/exec calls