termi: Skill for Cursor

.cursor/skills/wire-permission-health-check/SKILL.md

wire-permission-health-check is a skill for Cursor from MannanSaood/termi. It costs 50 tokens per session (989 once invoked), scanned A, original, MIT.

A walkthrough for connecting Rust's permission checker to Android's Storage Access Framework, the Android system for granting apps access to selected files and folders.

In plain words
What is it for?
Use it when implementing the Kotlin permission check and JNI connection that lets Rust ask Android about each mounted location.
Why use it?
It explains how to detect whether access to a mounted location is still valid, temporarily unusable, or revoked and needing user approval again.

Skill for Cursor

Written for Cursor: installed under .cursor/.

This is MannanSaood/termi's own configuration. It tells Cursor how to work on termi itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything termi configures →

Reuse

Borrowing it

Nothing to install: this file belongs to MannanSaood/termi. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/MannanSaood/termi/main/.cursor/skills/wire-permission-health-check/SKILL.md
Clone the repo
git clone --depth 1 https://github.com/MannanSaood/termi

Made for: Cursor.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for wire-permission-health-check

README.md
[![agentmods](https://agentmods.dev/badge/skills/mannansaood/termi/wire-permission-health-check/github.svg)](https://agentmods.dev/skills/mannansaood/termi/wire-permission-health-check)
Your own site
<a href="https://agentmods.dev/skills/mannansaood/termi/wire-permission-health-check"><img src="https://agentmods.dev/badge/skills/mannansaood/termi/wire-permission-health-check/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for wire-permission-health-check

Your own site · 80×15
<a href="https://agentmods.dev/skills/mannansaood/termi/wire-permission-health-check"><img src="https://agentmods.dev/badge/skills/mannansaood/termi/wire-permission-health-check.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 50 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 989 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00050 $0.00989
Opus 5 $0.00025 $0.00495
Sonnet 5 $0.00010 $0.00198
Haiku 4.5 $0.00005 $0.00099

Measured 11d ago against content hash 474d5c83b1ff, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-11, from the pricing page.

Security

Grade A, and why

wire-permission-health-check scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 11d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.cursor/skills/wire-permission-health-check/SKILL.md · 91 lines

How it starts

The opening of the file, as written. The whole thing — 91 lines — stays where its author put it; the contents beside it link to each section on GitHub.

The Rust-side state machine is fully implemented and tested (rust/src/vfs/health.rsPermissionState, PermissionProbe trait, HealthMonitor). What's missing is the real Android-side implementation of PermissionProbe and the JNI plumbing to connect it. This skill walks through closing that gap.

1. Understand what Rust needs from Kotlin

HealthMonitor::scan(&MountTable) calls PermissionProbe::check(&MountPoint) -> PermissionState for every mount. The Android implementation of this trait needs to, per mount:

  1. Ask Kotlin (via JNI) whether the mount's URI permission is still valid.
  2. Distinguish Stale (permission still listed but access fails — usually recoverable) from Revoked (permission no longer listed at all — needs the picker again). See the detailed TODO already written in android/app/src/main/java/com/terminal/vfs/PermissionManager.kt for the Kotlin-side logic to distinguish these.

2. Add a JNI export (Kotlin → Rust direction doesn't apply here — this

is Rust calling INTO Kotlin, which is the less common direction in this codebase)

This needs a callback pattern: Rust holds a reference to a Kotlin object (via jni::objects::GlobalRef, same pattern as SafProvider in vfs/android_saf.rs already uses for helper_ref) and calls a method on it through jni_safe::safe_call_bool_method or similar.

// New file or addition to vfs/android_saf.rs — sketch, not final:
use crate::jni_safe::{self, JniErrorCode};
use crate::vfs::health::{PermissionProbe, PermissionState};
use crate::vfs::mount::MountPoint;
use jni::objects::GlobalRef;
use jni::JNIEnv;

pub struct JniPermissionProbe {
    helper_ref: GlobalRef,
}

impl PermissionProbe for JniPermissionProbe {
    fn check(&self, mount: &MountPoint) -> PermissionState {
        // NOTE: PermissionProbe::check doesn't currently take a JNIEnv
        // parameter (it's designed to be callable from pure Rust test
        // code without one). You'll likely need to either:
        //   (a) store a way to attach to the JVM from any thread
        //       (see jni::JavaVM::attach_current_thread), or
        //   (b) change the trait signature to accept &mut JNIEnv and
        //       update FakeProbe in health.rs's tests accordingly.
        // Option (a) keeps the trait host-testable with zero JNI
        // knowledge required by test code; prefer it unless it proves
        // impractical.
        todo!("call helper_ref.checkHealth(uri) via jni_safe, map result to PermissionState")
    }
}

Read the full file on GitHub · 91 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 11d ago First seen · 91 lines · 50 tokens per session scan A 474d5c83b1ff

Subscribe to this mod's changes

wire-permission-health-check is a skill published in the GitHub repository MannanSaood/termi (8 stars, last pushed 12d ago), licensed MIT. It adds 50 tokens to every session and 989 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

compose-animations

Use when writing or reviewing Jetpack Compose motion: visibility enter/exit, animating one property toward a target, color or size transitions, multiple properties from one state, switching composable content, or choosing between AnimatedVisibility, animateAsState, rememberTransition, AnimatedContent, and Crossfade.

chrisbanes/skills · 64 tokens

compose-focus-navigation

Use when writing or reviewing Jetpack Compose UI for TV, keyboard, desktop, accessibility focus, D-pad navigation, FocusRequester, focusProperties, key events, or initial focus behavior.

chrisbanes/skills · 41 tokens

kotlin-android

Use when building or fixing a native Android app in Kotlin and Jetpack Compose on the UDF layered architecture — ViewModel/StateFlow, Hilt, Room, Retrofit, coroutines, type-safe Navigation, and the Gradle/AGP surface. NOT shared Android and iOS UI from one Kotlin codebase (that is compose-multiplatform).

ericrisco/rsc-harness · 78 tokens

android-expert

Expert in Android development with Jetpack Compose, Material Design, ViewModel, and modern Android architecture. Use when the user mentions mobile, Kotlin, Jetpack Compose, Material Design, or Google, or when the task involves Android Architecture, Android Components, Jetpack Libraries, or Activity/Fragment Lifecycle.

personamanagmentlayer/pcl · 64 tokens

migrating-to-modifier-node

Use this skill to author new custom Jetpack Compose modifiers and migrate legacy ones from Modifier.composed { } to Modifier.Node + ModifierNodeElement . Covers the persistent-node lifecycle (onAttach, onDetach, onReset, coroutineScope), the specialized node interfaces (DrawModifierNode, LayoutModifierNode…

skydoves/compose-performance-skills · 183 tokens

setting-up-compose-hotswan

Use this skill to install and verify Compose HotSwan end to end so a developer goes from zero to working sub-second hot reload on a real device or emulator in one session. Covers the JetBrains IDE plugin install, the com.github.skydoves.compose.hotswan.compiler Gradle plugin wiring, the canonical hotSwanCompiler {…

skydoves/compose-performance-skills · 161 tokens