selinuxproject/refpolicy/refpolicy-interface-authoring
Claude Code and agent skill by selinuxproject/refpolicy
- community
Checking that the SKILL.md file is still in the repository.
Add, rename, extend, or review SELinux Reference Policy public interfaces and templates in .if files. Use for interface naming, placement, documentation, ownership, parameters, and caller compatibility.
Install
npx vskill@latest install selinuxproject/refpolicy/refpolicy-interface-authoringSKILL.md
Reference Policy Interface Authoring
Create interfaces only when they provide a reusable policy abstraction or access pattern.
Research Existing Policy
Before editing:
- Read
doc/STYLE_GUIDE.mdanddoc/INTERFACE_NAMING.md. - Read the owning module's
.te,.if, and.fcfiles. - Search the repository for interfaces with the same concept, target type or attribute, access
level, and object class.
- Search for all callers of an interface before renaming it or changing its behavior.
- Inspect neighboring interfaces in the same section for documentation,
gen_require, parameter,
and ordering conventions.
Prefer an existing interface. Do not add a public interface solely to avoid a simple internal rule within the owning module.
Ownership and Boundaries
- Put reusable public interfaces and templates in the
.iffile of the module that owns the
target type or attribute.
- Prefer calls to owning-module interfaces over direct rules against foreign types.
- Preserve optional-policy, tunable-policy, and build-option boundaries at call sites.
- Keep declarations and local rules in
.teand path labeling expressions in.fc.
Naming and Placement
Follow the modulename[_modifier]_verb_predicate() convention.
Organize .if files in this order:
- Templates.
- Transform interfaces.
- Access interfaces.
- Administrative interfaces.
- Unconfined interface.
Within access interfaces, sort by primary object type or attribute, then by increasing access:
getattr, setattr, read, append, write, rw, create, rename, delete, manage, relabelto, relabelfrom, relabel.
Place an allow interface before its matching dontaudit interface. Put a module-wide administrative interface after component-specific administrative interfaces.
Implementation
- Use established policy patterns and permission sets rather than spelling out equivalent raw
rules.
- Include only required symbols in
gen_require. - Keep parameter names, ordering, and documentation consistent with their use.
- Document the access granted and each parameter using the neighboring XML documentation style;
use doc/example.if as the canonical reference when neighboring interfaces are inconsistent or under-documented.
- State notable side effects, implied permissions, domain transitions, or incompatibilities in
the description.
- Avoid granting more access than the interface name and documentation promise.
- When changing an existing interface, inspect every caller for compatibility and unintended
privilege expansion.
Validate
Apply the refpolicy-validation workflow. Apply the refpolicy-semantic-review workflow when the interface is called by policy or its compiled behavior changes.
Verify:
- Naming and ordering against the authoritative guides.
- Documentation and parameters against the implementation.
- All existing callers after a rename or behavior change.
- Generated policy output, without committing generated artifacts.
Report whether the interface is new or changed, why an existing interface was insufficient, which callers were reviewed, and the validation results.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryChecking.github/skills/refpolicy-interface-authoring/SKILL.md
Popularity
- 7-day trend score
- 5
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/selinuxproject/refpolicy/refpolicy-interface-authoring)