optimize-permissions

Analyze opencode permission prompts and config to recommend guardrail changes.

2|Updated Mar 30, 2026
One-click install
npx skills add https://github.com/michaeldwan/opencode-permission-optimizer --skill optimize-permissions
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: optimize-permissions
Source: https://github.com/michaeldwan/opencode-permission-optimizer/tree/main/skills/optimize-permissions
Command: npx skills add https://github.com/michaeldwan/opencode-permission-optimizer --skill optimize-permissions

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill analyzes opencode permission prompts and actual usage to identify wasteful checks and misconfigurations, enabling teams to reduce friction while maintaining security.

Core Features & Use Cases

  • Usage-analysis: scans the opencode database to surface the most frequent prompts and denial counts, prioritizing guardrails where they matter.
  • Config-audit: reviews current permission rules (including last-match-wins semantics) to find redundant, conflicting, or missing guardrails.
  • Actionable guidance: provides concrete recommendations and a plan to update the global opencode.jsonc with minimal risk.

Quick Start

Ask your agent to run the optimize-permissions analysis and generate recommended guardrails for your permission config.

Frequently Asked Questions about optimize-permissions

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I reduce repeated permission prompts in opencode?

Reduce repeated opencode permission prompts by analyzing usage data from the opencode database to identify frequent checks, then applying targeted guardrails to your config. This reveals inefficiencies in bash command patterns and MCP tool usage, allowing you to relax or tighten rules.

What is the best way to audit opencode permission config for redundant rules?

Auditing opencode permission config involves reviewing current rules to find redundant or conflicting guardrails using last-match-wins semantics. Config-audit identifies misconfigurations by analyzing prompt frequency and denial counts, producing concrete config changes with minimal risk.

How do I configure opencode guardrails for bash commands and MCP tools?

Configure opencode guardrails by scanning the opencode database to target bash command patterns and MCP tool usage. Scenario-driven recommendations help tighten or relax non-destructive read and write actions, generating actionable config updates for your global opencode.jsonc file.

Can I analyze opencode database queries to optimize non-destructive read/write actions?

Yes, you can analyze opencode database queries to surface frequent prompts and denial counts for non-destructive read/write actions. This usage-analysis targets inefficiencies across tools and provides a plan to update your global opencode.jsonc with concrete guardrail recommendations.

Why does my opencode config still trigger prompts after setting permission rules?

Opencode config may still trigger prompts due to conflicting rules caused by last-match-wins semantics. A config-audit reviews your current permission setup to identify missing guardrails and redundant checks, providing concrete recommendations to tighten or relax rules efficiently.

Does opencode permission analysis work without external dependencies?

Opencode permission analysis works without external dependencies by inspecting the opencode database via opencode db queries. It applies guardrails internally to analyze bash command patterns, MCP tool usage, and read/write actions, producing concrete config changes and rationale directly.