This is the full version of the "🔐 Operating Modes" and "🛡️ Governance Layer" sections in the README. 中文版:操作模式与治理层
UnitySkills ships with a true server-side permission system aligned with Claude Code permission modes. All mode switching happens in the Unity panel — open Window > UnitySkills, click the ⚙ (Settings) button, and use the Server section — chat trigger words (e.g. "full auto" / "semi-auto") are no longer supported.
| Mode | Default | Behavior | Use Case |
|---|---|---|---|
| Approval | — | AI must request → user approves → execute (returns MODE_RESTRICTED + grant token) |
Manual control, sensitive projects |
| Auto | New installs | AI runs FullAuto skills directly; server only blocks auto-detected high-risk ops (NeverInSemi) | Day-to-day development |
| Bypass | Existing installs (upgrade) | All skills run unrestricted; only ConfirmationToken gate remains for high-risk ops |
Automation, CI, fast iteration |
- Dialog (default) — AI explains intent + grant token, user agrees in chat, AI replays the token via
POST /permission/grant - Panel (opt-in) — grant token only takes effect after user clicks [Approve] in the Unity panel; AI-issued grants without panel approval return
GRANT_PENDING_APPROVAL
The plugin detects legacy UnitySkills_* EditorPrefs keys and keeps Bypass as the default, preserving the previous Full-Auto behavior with no action required. New installations default to Auto — FullAuto skills run directly, only NeverInSemi (Delete / MayEnterPlayMode / MayTriggerReload / high-risk) operations are blocked. Switch to Approval from the ⚙ Settings drawer's Server section if you need per-skill manual gating.
Library/UnitySkillsAudit.jsonl (per-project, jsonl, auto-rolls at 1MB, keeps 3 files) records every grant / revoke / restricted hit / call. Open it from the ⚙ Settings drawer → View Audit Log (or press Alt+Shift+L) to browse, filter, delete individual entries (✕), or wipe everything (🗑 Clear All) — deletions themselves are appended as audit_deleted / audit_cleared events so the log stays auditable.
The Skill Installer card shows a per-scope uninstall button that auto-adapts: disabled when nothing's installed, a single button labeled with its scope when only one is installed, and a dropdown (Uninstall ▾) listing Project / Global when both are installed.
One-click installation (AI Config tab → Install) copies the unity-skills~/ template directory from the package to the target location, generating:
SKILL.mdskills/references/scripts/unity_skills.pyscripts/agent_config.json(contains Agent identifier)
After you upgrade the package, tools you already installed are refreshed to the new version automatically (nothing new is ever installed for you); turn it off in ⚙ Settings ▸ AI Tools.
29 advisory design modules (architecture, performance, design patterns, testability, package-specific source rules, etc.) are available in all modes and loaded on demand.
An AI driving the Editor writes to real scenes, prefabs and .meta files. The interesting question isn't whether it can — it's what happens when it gets something wrong. UnitySkills answers that at four points in the call lifecycle.
- Before execution —
?mode=dryRun/?mode=plan:POST /skill/{name}?mode=dryRunwrites nothing and returns parameter validation (missingParams/unknownParams/typeErrors/semanticErrors/warnings) plus an impact estimate (mutatesScene/mutatesAssets/mayTriggerReload/mayEnterPlayMode/riskLevel). Skills with a semantic planner also returnsteps/changes. - At execution — per-operation risk gating: every skill declares
RiskLevel/Operation/MayEnterPlayMode/MayTriggerReloadin its[UnitySkill]metadata, and the server derives NeverInSemi from that metadata — gating never depends on the AI behaving well. Allowlist grants a persistent pass to individual skills; the optionalConfirmationTokenhandshake (off by default — ⚙ Settings → Runtime → Require Confirmation) adds one more gate on high-risk skills. - After execution — JSONL audit trail: every call, grant, revoke and blocked hit is appended to
Library/UnitySkillsAudit.jsonl(1 MB rotation, primary + 3 historical files), browsable and filterable in the panel. Deleting audit entries is itself recorded, asaudit_deleted/audit_cleared. - After a mistake — typed, persistent snapshot rollback: Workflow snapshots are typed (
Modified/Created/Deleted/Moved/Setting), and the asset file and its.metaare content-addressed independently (fileHash/metaFileHash) underLibrary/UnitySkills/, so history survives Domain Reloads and editor restarts.workflow_undo_taskrolls back one task, not the whole project. - Batch as a transaction:
POST /skills/batchsupports fail-fast orcontinueOnError, cross-step$refto reuse an earlier step's output, rollback on failure, and?diff=1for the aggregated net change.