Skip to content

fix(command): add allowed-tools and parameterize hardcoded path in upgrade-patches#17

Closed
xiaolai wants to merge 1 commit intoykdojo:mainfrom
xiaolai:fix/nlpm-upgrade-patches-bugs
Closed

fix(command): add allowed-tools and parameterize hardcoded path in upgrade-patches#17
xiaolai wants to merge 1 commit intoykdojo:mainfrom
xiaolai:fix/nlpm-upgrade-patches-bugs

Conversation

@xiaolai
Copy link
Copy Markdown

@xiaolai xiaolai commented Apr 20, 2026

Automated audit: This PR was generated by NLPM, a natural language programming linter, running via claude-code-action. Please evaluate the diff on its merits.

Summary

This PR fixes two bugs in .claude/commands/upgrade-patches.md identified by an automated NLPM audit:

Bug 1: Missing allowed-tools frontmatter

The command invokes Bash tools (npm, tmux) but has no allowed-tools field in its frontmatter. Without this, Claude Code may prompt for permission on every tool use or fail to execute the steps reliably.

Fix: Added allowed-tools: [Bash] to the frontmatter.

Bug 2: Hardcoded absolute path /Users/yk/Desktop/projects/safeclaw

The Container section contains a hardcoded path specific to the author's machine (/Users/yk/Desktop/projects/safeclaw). Any contributor running this command will get a path-not-found error and be unable to create the upgrade container.

Fix: Replaced the hardcoded path with $SAFECLAW_DIR and added a brief note for users to set the environment variable to their local safeclaw checkout.

Test plan

  • Verify the frontmatter parses correctly (YAML linting or claude command list)
  • Confirm the Container step no longer references a machine-specific path

…grade-patches

- Add `allowed-tools: [Bash]` frontmatter so Claude Code grants Bash
  permission without prompting on every tool use
- Replace hardcoded `/Users/yk/Desktop/projects/safeclaw` with `$SAFECLAW_DIR`
  env variable so the command works for contributors beyond the original author

Co-Authored-By: Claude Code <noreply@anthropic.com>
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.

2 participants