sf-permissions
Use this skill when the user needs permission analysis and access auditing: Permission Set / Permission Set Group hierarchy views, “who has access to X?” investigations, user-permission analysis, or permission-set metadata review.
When This Skill Owns the Task
Use sf-permissions when the work involves:
- permission set / permission set group analysis
- user access investigation
- finding which permission grants object / field / Apex / flow / tab / custom-permission access
- auditing or exporting permission configuration
- reviewing permission metadata impacts
Delegate elsewhere when the user is:
Required Context to Gather First
Ask for or infer:
- target org alias
- whether the question is about an object, field, Apex class, flow, tab, custom permission, or specific user
- whether the goal is hierarchy visualization, access detection, export, or metadata generation
- whether the output should be terminal-focused or documentation-friendly
Recommended Workflow
1. Classify the request
| Request shape |
Default capability |
| “who has access to X?” |
permission detector |
| “what does this user have?” |
user analyzer |
| “show me the hierarchy” |
hierarchy viewer |
| “export this permset” |
exporter |
| “generate metadata from analysis” |
generator or handoff |
2. Connect to the correct org
Verify sf auth before running permission analysis.
3. Use the narrowest useful query
Prefer focused analysis over broad org-wide scans unless the user explicitly wants a full audit.
When choosing identifiers, prefer stable metadata names first:
PermissionSet.Name
PermissionSetGroup.DeveloperName
CustomPermission.DeveloperName
- object and field API names such as
Account or Account.AnnualRevenue
Assignee.Username / email for user-centric checks
Use Salesforce record IDs only when:
- the underlying object model requires
ParentId or SetupEntityId, or
- you are drilling into records returned by a prior read-only query in the same investigation
4. Render findings clearly
Use:
- ASCII tree or table output for terminal work
- Mermaid only when documentation benefit is clear
- concise summaries of which permission source grants access
5. Hand off creation or deployment work
Use:
High-Signal Rules
- distinguish direct Permission Set grants from grants via Permission Set Groups
- prefer
Name / DeveloperName / API names over org-specific record IDs for first-pass investigation queries
- be explicit about whether access is object-level, field-level, class-level, flow-level, or custom-permission-based
- use Tooling API where required for setup entities and advanced visibility questions
- for agent access questions, verify exact agent-name matching in permission metadata
- when a follow-up child query requires
ParentId or SetupEntityId, resolve the ID from a prior result instead of starting with copied IDs
Output Format
When finishing, report in this order:
- What was analyzed
- Org / subject scope
- Which permissions grant access
- Whether access is direct or inherited
- Recommended follow-up
Suggested shape:
Permission analysis: <hierarchy / detect / user / export>
Scope: <org, user, permission target>
Findings: <permsets / groups / access level>
Source: <direct assignment or via group>
Next step: <export, generate metadata, or deploy changes>
Cross-Skill Integration
| Need |
Delegate to |
Reason |
| generate or modify permission metadata |
sf-metadata |
metadata authoring |
| deploy permission changes |
sf-deploy |
rollout |
| identify Apex classes needing grants |
sf-apex |
implementation context |
| bulk user assignment analysis |
sf-data |
larger data operations |
Reference Map
Start here
- references/permission-model.md
- references/soql-reference.md
- references/workflow-examples.md
Specialized analysis
- references/agent-access-guide.md
- references/usage-examples.md
Score Guide
| Score |
Meaning |
| 90+ |
strong permission analysis with clear access sourcing |
| 75–89 |
useful audit with minor gaps |
| 60–74 |
partial visibility only |
| < 60 |
insufficient evidence; expand analysis |
1---2name: sf-permissions3description: Permission Set analysis, hierarchy viewer, and access auditing. TRIGGER when: user asks "who has access to X?", analyzes permission sets/groups, or touches .permissionset-meta.xml / .permissionsetgroup-meta.xml files. DO NOT TRIGGER when: creating new metadata (use sf-metadata), deploying permission sets (use sf-deploy), or Apex sharing logic (use sf-apex).4license: MIT5---6
7# sf-permissions
8
9Use this skill when the user needs **permission analysis and access auditing**: Permission Set / Permission Set Group hierarchy views, “who has access to X?” investigations, user-permission analysis, or permission-set metadata review.
10
11## When This Skill Owns the Task
12
13Use `sf-permissions` when the work involves:
14- permission set / permission set group analysis
15- user access investigation
16- finding which permission grants object / field / Apex / flow / tab / custom-permission access
17- auditing or exporting permission configuration
18- reviewing permission metadata impacts
19
20Delegate elsewhere when the user is:
21- creating new metadata definitions → [sf-metadata](../sf-metadata/SKILL.md)
22- deploying permission sets → [sf-deploy](../sf-deploy/SKILL.md)
23- analyzing Apex-managed sharing logic → [sf-apex](../sf-apex/SKILL.md)
24
25---
26
27## Required Context to Gather First
28
29Ask for or infer:
30- target org alias
31- whether the question is about an object, field, Apex class, flow, tab, custom permission, or specific user
32- whether the goal is hierarchy visualization, access detection, export, or metadata generation
33- whether the output should be terminal-focused or documentation-friendly
34
35---
36
37## Recommended Workflow
38
39### 1. Classify the request
40| Request shape | Default capability |
41|---|---|
42| “who has access to X?” | permission detector |
43| “what does this user have?” | user analyzer |
44| “show me the hierarchy” | hierarchy viewer |
45| “export this permset” | exporter |
46| “generate metadata from analysis” | generator or handoff |
47
48### 2. Connect to the correct org
49Verify `sf` auth before running permission analysis.
50
51### 3. Use the narrowest useful query
52Prefer focused analysis over broad org-wide scans unless the user explicitly wants a full audit.
53
54When choosing identifiers, prefer stable metadata names first:
55- `PermissionSet.Name`
56- `PermissionSetGroup.DeveloperName`
57- `CustomPermission.DeveloperName`
58- object and field API names such as `Account` or `Account.AnnualRevenue`
59- `Assignee.Username` / email for user-centric checks
60
61Use Salesforce record IDs only when:
62- the underlying object model requires `ParentId` or `SetupEntityId`, or
63- you are drilling into records returned by a prior read-only query in the same investigation
64
65### 4. Render findings clearly
66Use:
67- ASCII tree or table output for terminal work
68- Mermaid only when documentation benefit is clear
69- concise summaries of which permission source grants access
70
71### 5. Hand off creation or deployment work
72Use:
73- [sf-metadata](../sf-metadata/SKILL.md) for richer metadata generation
74- [sf-deploy](../sf-deploy/SKILL.md) for deployment
75
76---
77
78## High-Signal Rules
79
80- distinguish direct Permission Set grants from grants via Permission Set Groups
81- prefer `Name` / `DeveloperName` / API names over org-specific record IDs for first-pass investigation queries
82- be explicit about whether access is object-level, field-level, class-level, flow-level, or custom-permission-based
83- use Tooling API where required for setup entities and advanced visibility questions
84- for agent access questions, verify exact agent-name matching in permission metadata
85- when a follow-up child query requires `ParentId` or `SetupEntityId`, resolve the ID from a prior result instead of starting with copied IDs
86
87---
88
89## Output Format
90
91When finishing, report in this order:
921. **What was analyzed**
932. **Org / subject scope**
943. **Which permissions grant access**
954. **Whether access is direct or inherited**
965. **Recommended follow-up**
97
98Suggested shape:
99
100```text
101Permission analysis: <hierarchy / detect / user / export>
102Scope: <org, user, permission target>
103Findings: <permsets / groups / access level>
104Source: <direct assignment or via group>
105Next step: <export, generate metadata, or deploy changes>
106```
107
108---
109
110## Cross-Skill Integration
111
112| Need | Delegate to | Reason |
113|---|---|---|
114| generate or modify permission metadata | [sf-metadata](../sf-metadata/SKILL.md) | metadata authoring |
115| deploy permission changes | [sf-deploy](../sf-deploy/SKILL.md) | rollout |
116| identify Apex classes needing grants | [sf-apex](../sf-apex/SKILL.md) | implementation context |
117| bulk user assignment analysis | [sf-data](../sf-data/SKILL.md) | larger data operations |
118
119---
120
121## Reference Map
122
123### Start here
124- [references/permission-model.md](references/permission-model.md)
125- [references/soql-reference.md](references/soql-reference.md)
126- [references/workflow-examples.md](references/workflow-examples.md)
127
128### Specialized analysis
129- [references/agent-access-guide.md](references/agent-access-guide.md)
130- [references/usage-examples.md](references/usage-examples.md)
131
132---
133
134## Score Guide
135
136| Score | Meaning |
137|---|---|
138| 90+ | strong permission analysis with clear access sourcing |
139| 75–89 | useful audit with minor gaps |
140| 60–74 | partial visibility only |
141| < 60 | insufficient evidence; expand analysis |