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