Agent Skills › rohitg00/pro-workflow › permission-tuner

permission-tuner

GitHub

分析权限提示与自动模式拒绝,生成精准规则以消除提示疲劳。通过收集数据、诊断症状并生成 autoMode 或 permissions 配置来优化工作流。

skills/permission-tuner/SKILL.md rohitg00/pro-workflow

Trigger Scenarios

权限提示频繁中断操作 自动模式持续阻塞或回退到提示 新项目中配置权限

Install

npx skills add rohitg00/pro-workflow --skill permission-tuner -g -y
More Options

Use without installing

npx skills use rohitg00/pro-workflow@permission-tuner

指定 Agent (Claude Code)

npx skills add rohitg00/pro-workflow --skill permission-tuner -a claude-code -g -y

安装 repo 全部 skill

npx skills add rohitg00/pro-workflow --all -g -y

预览 repo 内 skill

npx skills add rohitg00/pro-workflow --list

SKILL.md

Frontmatter
{
    "name": "permission-tuner",
    "description": "Analyze permission prompts and auto mode denials, then generate permission rules and autoMode entries that cut prompt fatigue. Use when prompts keep interrupting, auto mode falls back to prompting, or after sessions with many denials.",
    "user-invocable": true
}

Permission Tuner

Reduce permission prompts by fixing their causes, not by piling up rules.

Trigger

Use when:

  • Permission prompts interrupt flow repeatedly
  • Auto mode keeps blocking routine work or falls back to prompting everything
  • Starting a new project and want to configure permissions

How Prompts Happen

  • Rules resolve first: deny > ask > allow. A matching ask rule prompts even in auto mode, and a PreToolUse hook returning allow cannot override it.
  • In auto mode, anything no rule resolves goes to a classifier. After 3 blocks in a row or 20 in a session, auto mode pauses and prompts for everything until you approve one.
  • Auto mode drops broad allow rules: Bash(*), wildcarded interpreters like Bash(node *), package-manager run commands, Agent, and Monitor.
  • Hooks that exit 2 on harmless commands count as denials and push the session toward that fallback.

Workflow

Step 1: Gather data

Rules merge across scopes, so check every file that exists, not only the user file. /permissions shows the rules Claude Code actually loaded, and claude auto-mode config shows the effective autoMode (the classifier ignores autoMode in .claude/settings.local.json).

for f in ~/.claude/settings.json .claude/settings.json .claude/settings.local.json; do
  [ -f "$f" ] && jq --arg f "$f" '{file: $f, mode: .permissions.defaultMode, allow: (.permissions.allow|length), ask: (.permissions.ask|length), deny: (.permissions.deny|length), autoMode: (.autoMode != null)}' "$f"
done
claude auto-mode config
ls -t ~/.claude/projects/*/*.jsonl | head -20 | xargs grep -ho '"toolDenialKind":"[^"]*"' | sort | uniq -c | sort -rn

toolDenialKind values seen in transcripts (undocumented, may change): permission-rule (rule or hook), automode-blocked (classifier), automode-parsing-error and automode-unavailable (no verdict, not tunable), user-rejected (you said no).

Step 2: Pick the right fix

Symptom Fix
Prompt on something you always approve Remove or narrow the ask rule
permission-rule on a harmless command Fix the hook false positive or narrow the deny rule
Classifier blocks work in your own repos, registries, local services Add an autoMode.environment entry
Classifier blocks one routine pattern Add an autoMode.allow entry
Want outward actions only when you asked Add an autoMode.soft_deny entry
Want a human check every time Keep a short permissions.ask rule

Step 3: Generate rules

{
  "permissions": {
    "allow": [
      "Bash(git status)",
      "Bash(npm test)",
      "Bash(npm run lint)"
    ],
    "ask": [
      "Bash(git push --force*)",
      "Bash(git push * main)",
      "Bash(git push * main *)",
      "Bash(git push *:main)",
      "Bash(git push *:main *)",
      "Bash(git push * master)",
      "Bash(git push * master *)",
      "Bash(git push *:master)",
      "Bash(git push *:master *)",
      "Bash(gh pr merge *)",
      "Bash(npm publish*)"
    ],
    "deny": [
      "Bash(rm -rf *)",
      "Read(**/.env)",
      "Read(**/.env.*)"
    ]
  },
  "autoMode": {
    "environment": [
      "$defaults",
      "Source control: repositories under github.com/your-org are trusted; feature-branch pushes are routine."
    ],
    "allow": ["$defaults"],
    "soft_deny": [
      "$defaults",
      "Merging a pull request needs the user's approval for that specific merge."
    ]
  }
}

autoMode only takes effect in ~/.claude/settings.json, managed settings, or --settings. Keep "$defaults" in each list. Check the result with claude auto-mode config and review custom rules with claude auto-mode critique.

Output

PERMISSION TUNER REPORT

Mode: [mode]   Rules: [X] allow, [Y] ask, [Z] deny   autoMode: [yes/no]
Denials: [n] permission-rule, [n] classifier, [n] no verdict, [n] you rejected

Remove (ask rules you always approve):
  - Bash(...) -- approved [n]x

Add to autoMode.environment:
  + "..." -- clears [n] blocks

Add to autoMode.allow / soft_deny:
  + "..."

Fix hooks:
  ! [script] blocked [n] harmless commands

Keep asking:
  ~ force push, merge, publish, deploy

Estimated prompts saved per session: ~[N]

Rules

  • Prefer autoMode entries over new ask rules
  • Destructive operations stay in deny or ask
  • Always present changes for user approval before applying
  • Never write autoMode into project settings
  • Include estimated prompt savings

Version History

  • 7fa2872 Current 2026-09-27 19:48

    引入对 auto mode 机制的详细解析,更新诊断流程以检查所有作用域的配置及 effective autoMode,细化 denial triage 分类。

  • 7f7209d 2026-07-24 11:40

Same Skill Collection

skills/agent-teams/SKILL.md
skills/auto-setup/SKILL.md
skills/batch-orchestration/SKILL.md
skills/bug-capture/SKILL.md
skills/compact-guard/SKILL.md
skills/context-engineering/SKILL.md
skills/context-optimizer/SKILL.md
skills/cost-tracker/SKILL.md
skills/design-engineering/SKILL.md
skills/deslop/SKILL.md
skills/domain-modeling/SKILL.md
skills/file-watcher/SKILL.md
skills/improve-architecture/SKILL.md
skills/insights/SKILL.md
skills/learn-rule/SKILL.md
skills/llm-council/SKILL.md
skills/llm-gate/SKILL.md
skills/mcp-audit/SKILL.md
skills/orchestrate/SKILL.md
skills/parallel-worktrees/SKILL.md
skills/plan-interrogate/SKILL.md
skills/replay-learnings/SKILL.md
skills/safe-mode/SKILL.md
skills/session-handoff/SKILL.md
skills/skill-router/SKILL.md
skills/smart-commit/SKILL.md
skills/sprint-status/SKILL.md
skills/tdd/SKILL.md
skills/thoroughness-scoring/SKILL.md
skills/token-efficiency/SKILL.md
skills/wiki-builder/SKILL.md
skills/wiki-query/SKILL.md
skills/wiki-research-loop/SKILL.md
skills/wiki-viewer/SKILL.md
skills/wrap-up/SKILL.md
skills/writing-guidelines/SKILL.md
skills/pro-workflow/SKILL.md
skills/skill-optimizer/SKILL.md
skills/survey-generator/SKILL.md

Metadata

Files
0
Version
7fa2872
Hash
a33566f6
Indexed
2026-07-24 11:40

ホーム - Wiki
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-09-29 05:10
浙ICP备14020137号-1