marketplace/bundles/plan-marshall/skills/tools-permission-fix/SKILL.md
Write operations for fixing and managing Claude Code permissions - add, remove, consolidate, ensure, apply-fixes, executor migration, wildcard generation.
npx skillsauth add cuioss/plan-marshall tools-permission-fixInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
PURPOSE: Write operations for fixing and managing host-platform permissions, including marketplace permission synchronization and executor pattern migration.
COMPLEMENTARY SKILL: Use plan-marshall:tools-permission-doctor for read-only analysis before applying fixes.
Execution mode: Run scripts exactly as documented; use --dry-run before applying changes.
Prohibited actions:
tools-permission-doctor)Constraints:
python3 .plan/execute-script.py plan-marshall:tools-permission-fix:permission_fix {command} {args}--dry-run first to preview changes before applying| Script | Notation | Purpose |
|--------|----------|---------|
| permission_fix | plan-marshall:tools-permission-fix:permission_fix | Write operations for permissions |
Shared dependency: Imports permission_common from tools-permission-doctor/scripts/. The executor's PYTHONPATH ensures this is resolvable.
Normalize paths, remove duplicates, sort, and add default permissions.
python3 .plan/execute-script.py plan-marshall:tools-permission-fix:permission_fix apply-fixes \
--settings ~/.claude/settings.json \
--dry-run
Output (TOON):
duplicates_removed: 2
paths_fixed: 1
defaults_added[2]:
- Edit(.plan/**)
- Write(.plan/**)
sorted: true
changes_made: true
dry_run: true
Add a single permission to settings.
python3 .plan/execute-script.py plan-marshall:tools-permission-fix:permission_fix add \
--permission "Bash(docker:*)" \
--target project
Output (TOON):
success: true
action: added
settings_file: /path/to/.claude/settings.json
Remove a single permission from settings.
python3 .plan/execute-script.py plan-marshall:tools-permission-fix:permission_fix remove \
--permission "Bash(docker:*)" \
--target project
Output (TOON):
success: true
action: removed
settings_file: /path/to/.claude/settings.json
Ensure multiple permissions exist (add missing, skip existing).
python3 .plan/execute-script.py plan-marshall:tools-permission-fix:permission_fix ensure \
--permissions "Bash(git:*),Bash(npm:*),Bash(docker:*)" \
--target global
Output (TOON):
success: true
added[1]:
- Bash(docker:*)
already_exists[2]:
- Bash(git:*)
- Bash(npm:*)
added_count: 1
total_permissions: 45
Replace timestamped permissions with wildcards.
python3 .plan/execute-script.py plan-marshall:tools-permission-fix:permission_fix consolidate \
--settings ~/.claude/settings.json \
--dry-run
Output (TOON):
consolidated: 5
removed[2]:
- Read(target/output-2024-01-01.log)
- ...
wildcards_added[1]:
- Read(target/output-*.log)
dry_run: true
Ensure all marketplace bundle wildcards exist in settings.
python3 .plan/execute-script.py plan-marshall:tools-permission-fix:permission_fix ensure-wildcards \
--settings ~/.claude/settings.json \
--marketplace-json marketplace/.claude-plugin/marketplace.json \
--dry-run
Output (TOON):
added[2]:
- Skill(new-bundle:*)
- SlashCommand(/new-bundle:*)
already_present: 14
total: 16
dry_run: true
Remove permissions from local/project settings that are exact duplicates of global settings, covered by a broader global wildcard, or marketplace permissions that should live in global settings.
python3 .plan/execute-script.py plan-marshall:tools-permission-fix:permission_fix remove-redundant \
--scope both \
--dry-run
Or with explicit paths:
python3 .plan/execute-script.py plan-marshall:tools-permission-fix:permission_fix remove-redundant \
--global-settings ~/.claude/settings.json \
--local-settings .claude/settings.json \
--dry-run
Output (TOON):
removed_redundant[2]:
- Bash(git:*)
- Edit(.plan/**)
moved_to_global[1]:
- Skill(pm-dev-java:*)
already_in_global[0]:
marketplace_skipped[0]:
removed_count: 2
moved_count: 1
dry_run: true
changes_made: true
applied: false
local_path: .claude/settings.json
global_path: /Users/me/.claude/settings.json
Options:
--move-marketplace (default: true): Move marketplace permissions (Skill/SlashCommand) from local to global settings--no-move-marketplace: Skip moving marketplace permissions; only remove exact duplicates and wildcard-covered entries--dry-run: Preview changes without modifying filesUsage: Run after tools-permission-doctor detect-redundant to clean up permission drift. The health check in marshall-steward uses this operation to fix the "duplicate global rules + marketplace permissions in project-local settings" issue.
Append Skill({skill}) allow rules for every project:{skill} entry in marshal.json under phase-5-execute.steps and phase-6-finalize.steps that does not already have a matching rule (exact or covering wildcard).
python3 .plan/execute-script.py plan-marshall:tools-permission-fix:permission_fix apply-project-step-permissions \
--marshal .plan/marshal.json \
--settings .claude/settings.json \
--dry-run
Output (TOON):
added[1]:
- Skill(finalize-step-plugin-doctor)
missing[1]{skill,step,phase,rule}:
finalize-step-plugin-doctor project:finalize-step-plugin-doctor phase-6-finalize Skill(finalize-step-plugin-doctor)
already_present[1]{skill,step,phase,covered_by}:
sync-plugin-cache project:sync-plugin-cache phase-6-finalize Skill(sync-plugin-cache)
summary:
added_count: 1
already_present_count: 1
project_steps_checked: 2
dry_run: true
applied: false
Usage: Pair with tools-permission-doctor:detect-missing-project-step-permissions to close the gap surfaced by the health check — run doctor to detect, then fix to apply.
The add, remove, and ensure operations support --target:
| Target | File |
|--------|------|
| global | ~/.claude/settings.json |
| project | .claude/settings.json or .claude/settings.local.json |
All write operations support --dry-run to preview changes without modifying files.
Recommended workflow:
tools-permission-doctor detect-redundant or detect-suspicioustools-permission-fix apply-fixes or specific operationsapply-fixes automatically adds these if missing:
| Permission | Reason |
|------------|--------|
| Edit(.plan/**) | Plan file modifications |
| Write(.plan/**) | Plan file creation |
| Read(~/.claude/plugins/cache/**) | Skills reference files via relative paths |
Generate Skill and SlashCommand wildcards from marketplace inventory.
# Scan marketplace directory directly
python3 .plan/execute-script.py plan-marshall:tools-permission-fix:permission_fix generate-wildcards \
--marketplace-dir marketplace
# Or from pre-existing inventory JSON file
python3 .plan/execute-script.py plan-marshall:tools-permission-fix:permission_fix generate-wildcards \
--input inventory.json
Ensure the executor permission exists in settings.
python3 .plan/execute-script.py plan-marshall:tools-permission-fix:permission_fix ensure-executor \
--target global \
--dry-run
Remove individual script path permissions (redundant with executor pattern).
python3 .plan/execute-script.py plan-marshall:tools-permission-fix:permission_fix cleanup-scripts \
--target global \
--remove-broad-python \
--dry-run
Complete migration: add executor permission + cleanup redundant permissions.
python3 .plan/execute-script.py plan-marshall:tools-permission-fix:permission_fix migrate-executor \
--target global \
--remove-broad-python \
--dry-run
The executor pattern uses a single permission for all marketplace scripts:
Bash(python3 .plan/execute-script.py *)This replaces individual script path permissions because the executor invokes scripts via subprocess (not checked by the host platform's permission system).
ensure-executor to add the executor permissioncleanup-scripts to remove redundant individual permissionsmigrate-executor to do both in one stepAll operations return TOON with error details:
error: Settings file not found: /path/to/settings.json
success: false
The canonical argparse surface for permission_fix.py. The plugin-doctor analyzer (_analyze_manage_invocation.py) reads this section as source-of-truth for the manage-invocation-invalid and missing-canonical-block rules. Consuming docs xref this section by name instead of restating the command inline. See pm-plugin-development:plugin-script-architecture cross-skill-integration.md § "Script invocation in documentation".
python3 .plan/execute-script.py plan-marshall:tools-permission-fix:permission_fix apply-fixes \
(--settings SETTINGS | --scope {global,project}) [--dry-run]
--settings and --scope are mutually exclusive.
python3 .plan/execute-script.py plan-marshall:tools-permission-fix:permission_fix add \
--permission PERMISSION [--target {global,project}]
python3 .plan/execute-script.py plan-marshall:tools-permission-fix:permission_fix remove \
--permission PERMISSION [--target {global,project}]
python3 .plan/execute-script.py plan-marshall:tools-permission-fix:permission_fix ensure \
--permissions PERMISSIONS [--target {global,project}]
python3 .plan/execute-script.py plan-marshall:tools-permission-fix:permission_fix consolidate \
(--settings SETTINGS | --scope {global,project}) [--dry-run]
--settings and --scope are mutually exclusive.
python3 .plan/execute-script.py plan-marshall:tools-permission-fix:permission_fix ensure-wildcards \
--settings SETTINGS --marketplace-json MARKETPLACE_JSON [--dry-run]
python3 .plan/execute-script.py plan-marshall:tools-permission-fix:permission_fix remove-redundant \
(--scope both | --global-settings GLOBAL_SETTINGS) [--local-settings LOCAL_SETTINGS] \
[--move-marketplace] [--no-move-marketplace] [--dry-run]
--scope and --global-settings are mutually exclusive; --global-settings requires --local-settings.
python3 .plan/execute-script.py plan-marshall:tools-permission-fix:permission_fix apply-project-step-permissions \
--marshal MARSHAL --settings SETTINGS [--dry-run]
python3 .plan/execute-script.py plan-marshall:tools-permission-fix:permission_fix generate-wildcards \
[--marketplace-dir MARKETPLACE_DIR | --input INPUT]
--marketplace-dir and --input are mutually exclusive; --input defaults to stdin.
python3 .plan/execute-script.py plan-marshall:tools-permission-fix:permission_fix ensure-executor \
[--target {global,project}] [--dry-run]
python3 .plan/execute-script.py plan-marshall:tools-permission-fix:permission_fix cleanup-scripts \
[--target {global,project}] [--remove-broad-python] [--dry-run]
python3 .plan/execute-script.py plan-marshall:tools-permission-fix:permission_fix migrate-executor \
[--target {global,project}] [--remove-broad-python] [--dry-run]
tools
Plan-marshall-domain implementor of the ext-self-review-{domain} extension point. Surfaces deterministic candidates (regexes, user-facing strings, markdown sections, symmetric-pair functions, flag-guard pairs, contract sources, schema-bearing files) for pre-submission structural self-review.
development
The single shared contract every untrusted-external-content ingestion surface loads — reader/orchestrator/writer isolation, the deterministic validator script as the containment boundary, and the output-schema discipline for candidate structs parsed from web pages, GitHub issue/PR/comment bodies, and Sonar issue messages
development
Domain-invariant recipe for deliberate wide-scope simplification campaigns across a scope x thoroughness cell, with a T4+ relation-graph pre-deliverable
testing
A test skill for README generation