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.
npx claudepluginhub thejustinwalsh/claude-plugins --plugin restructThis skill uses the workspace's default tool permissions.
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.
Guides Next.js Cache Components and Partial Prerendering (PPR) with cacheComponents enabled. Implements 'use cache', cacheLife(), cacheTag(), revalidateTag(), static/dynamic optimization, and cache debugging.
Guides building MCP servers enabling LLMs to interact with external services via tools. Covers best practices, TypeScript/Node (MCP SDK), Python (FastMCP).
Generates original PNG/PDF visual art via design philosophy manifestos for posters, graphics, and static designs on user request.
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 again after more sessions to continue improving auto-approvals.