From restruct
Review tool permission decisions across sessions and propose auto-approval rules. Analyzes which tools the user consistently approves, then suggests additions to .restruct/permissions.yaml to eliminate repetitive permission dialogs.
How this skill is triggered — by the user, by Claude, or both
Slash command
/restruct:review-permissions-restructThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
You are reviewing tool permission decision data to propose auto-approval rules. This is a data-driven workflow — base all proposals on actual usage patterns, not assumptions.
You are reviewing tool permission decision data to propose auto-approval rules. This is a data-driven workflow — base all proposals on actual usage patterns, not assumptions.
Query the restruct database for unreviewed tool decisions where the hook passed through but the user approved the tool (it executed successfully):
sqlite3 "$(find ~/.claude/plugins/data -name 'restruct.db' 2>/dev/null | head -1)" \
"SELECT tool_name, tool_input_summary, COUNT(*) as count,
COUNT(DISTINCT session_id) as sessions
FROM tool_decisions
WHERE reviewed = FALSE
AND hook_decision = 'passthrough'
AND outcome = 'executed'
GROUP BY tool_name, tool_input_summary
HAVING count >= 2
ORDER BY count DESC
LIMIT 30;"
If no results, inform the user there are no unreviewed decisions to process and stop.
Group the results into categories:
allowed_paths entries.trusted_urls.For each pattern, note:
Read the current permissions config:
cat .restruct/permissions.yaml 2>/dev/null || echo "No permissions.yaml found"
For each identified pattern, propose a specific change to .restruct/permissions.yaml:
Format each proposal as:
[tool_name] [summarized input][specific YAML entry] to [section]Do NOT propose rules for:
After presenting all proposals, ask the user which ones to accept. For accepted proposals:
.restruct/permissions.yaml with the new rules (create if it doesn't exist)sqlite3 "$(find ~/.claude/plugins/data -name 'restruct.db' 2>/dev/null | head -1)" \
"UPDATE tool_decisions SET reviewed = TRUE, reviewed_at = datetime('now')
WHERE reviewed = FALSE
AND hook_decision = 'passthrough'
AND outcome = 'executed';"
Report:
Remind the user they can run /restruct:review-permissions-restruct again after more sessions to continue improving auto-approvals.
npx claudepluginhub thejustinwalsh/claude-plugins --plugin restructCreates, edits, and optimizes skills for Claude Code, including drafting, evaluating with test prompts, iterating on performance, and improving skill descriptions for better triggering accuracy.