amethyst: Skill for Claude Code

.claude/skills/account-state/SKILL.md

account-state is a skill for Claude Code from vitorpamplona/amethyst. It costs 133 tokens per session (2,023 once invoked), scanned A, original, MIT.

A guide to account-specific state and the in-memory cache in Amethyst, a Nostr app. It explains how received notes and user profiles are stored and how account settings update through observable data streams.

In plain words
What is it for?
Use it when changing account settings, working with notes or users, adding lists such as mutes or bookmarks, or choosing between account state and the local cache.
Why use it?
It helps developers read and update the right source of data without mixing one user's settings with shared cached content. It also clarifies how changes reach screens and other parts of the app.

Skill for Claude Code

Written for Claude Code: installed under .claude/.

This is vitorpamplona/amethyst's own configuration. It tells Claude Code how to work on amethyst 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 amethyst configures →

About the project

Amethyst is an Android client for Nostr, a social network protocol that lets people control their own social activity and connections. People use it to read and publish Nostr content, follow accounts, and exchange encrypted direct messages from Android and other supported platforms. The catalogue add-ons support workflows for developing or operating the client.

vitorpamplona/amethyst · 1,597 stars · on GitHub · amethyst.social

Reuse

Borrowing it

Nothing to install: this file belongs to vitorpamplona/amethyst. 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/vitorpamplona/amethyst/main/.claude/skills/account-state/SKILL.md
Clone the repo
git clone --depth 1 https://github.com/vitorpamplona/amethyst

Made for: Claude Code.

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 account-state

README.md
[![agentmods](https://agentmods.dev/badge/skills/vitorpamplona/amethyst/account-state/github.svg)](https://agentmods.dev/skills/vitorpamplona/amethyst/account-state)
Your own site
<a href="https://agentmods.dev/skills/vitorpamplona/amethyst/account-state"><img src="https://agentmods.dev/badge/skills/vitorpamplona/amethyst/account-state/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 account-state

Your own site · 80×15
<a href="https://agentmods.dev/skills/vitorpamplona/amethyst/account-state"><img src="https://agentmods.dev/badge/skills/vitorpamplona/amethyst/account-state.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 133 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,023 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. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
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.00133 $0.02023
Opus 5 $0.00067 $0.01012
Sonnet 5 $0.00027 $0.00405
Haiku 4.5 $0.00013 $0.00202

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

Security

Grade A, and why

account-state 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 10d 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.

.claude/skills/account-state/SKILL.md · 101 lines

How it starts

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

Account & Local Cache State

The backbone of Amethyst's client state: one Account per signed-in user, plus the singleton LocalCache that holds every Note and User the client has seen.

When to Use This Skill

  • Working on amethyst/src/main/java/com/vitorpamplona/amethyst/model/Account.kt
  • Working on amethyst/src/main/java/com/vitorpamplona/amethyst/model/LocalCache.kt
  • Adding a new account-scoped setting (mutes, bookmarks, custom relay lists, private lists)
  • Reading/writing user metadata (User) or note state (Note)
  • Deciding whether to query LocalCache vs subscribe to an Account StateFlow

Mental Model

Relay frame ──► LocalCache.insertOrUpdateNote() ──► LocalCacheFlow emits change
                                                            │
                                                            ▼
                                Account state objects pin the relevant addressable notes
                                                            │
                                                            ▼
                            State-object `.flow` updates (kind3FollowList, nip65RelayList, muteList, …)
                                                            │
                                                            ▼
                                                    ViewModels collect
                                                            │
                                                            ▼
                                                 Composables render

LocalCache is the event store. Account is the derived per-user view (follow list, relays, mutes, emojis, bookmarks, etc.). UI listens to the .flow of Account's state objects, not directly to LocalCache, except for note-level rendering.

Key Files

Account.kt (singleton-per-session)

  • class Account(...) — holds 50+ state objects, one per feature, each wired to a specific Nostr kind:
    • kind3FollowList = Kind3FollowListState(...) ← NIP-02 ContactList (kind 3)
    • nip65RelayList = Nip65RelayListState(...) ← NIP-65 RelayList (kind 10002), plus siblings dmRelayList, searchRelayList, blockedRelayList, trustedRelayList, proxyRelayList, broadcastRelayList, indexerRelayList, …
    • muteList = MuteListState(...) ← NIP-51 MuteList (kind 10000)
    • bookmarkState = BookmarkListState(...) ← NIP-51 Bookmarks (kind 10003), plus labeledBookmarkLists, pinState, interestSets, peopleLists, followLists, hashtagList, geohashList, communityList, emoji, blossomServers, …
    • Derived/merged views: hiddenUsers, allFollows, homeRelays, outboxRelays, dmRelays, notificationRelays, trustedRelays, and the live*FollowListsPerRelay outbox loaders.
  • The pattern: each XState class pins its addressable note via cache.getOrCreateAddressableNote(address) (a long-term reference so GC/eviction can't drop it), exposes val flow: StateFlow<…> derived from the note's metadata flow (decrypted through a per-feature DecryptionCache, with backup fallback from AccountSettings, stateIn(scope, Eagerly, …)), and offers suspend mutation helpers (e.g. MuteListState.hideUser(pubkey)) that build the updated signed event. Consumers read account.muteList.flow, never a raw MutableStateFlow on Account.
  • Encrypted lists pair the state object with a DecryptionCache sibling (muteListDecryptionCache, peopleListDecryptionCache, …) so NIP-44 decryption results are cached per event.
  • UI reads via collectAsStateWithLifecycle on Android and collectAsState on Desktop.
  • Sibling files per feature live alongside: AccountSettings.kt, AccountSyncedSettings.kt, plus per-NIP state classes under model/nip02FollowLists/, model/nip51Lists/, model/nip65RelayList/, etc.

Read the full file on GitHub · 101 lines

Files

What ships with it

2 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 10d ago First seen · 101 lines · 133 tokens per session scan A acd2ab51e1ca

Subscribe to this mod's changes

account-state is a skill published in the GitHub repository vitorpamplona/amethyst (1,597 stars, last pushed today), licensed MIT. It adds 133 tokens to every session and 2,023 once invoked, about $0.0007 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-30.

Related

Other skills, from other repositories

android-leak-expert

Expert guide for detecting, profiling, and resolving memory leaks in Android apps (Java, Kotlin, Compose, JNI). Use when analyzing memory usage, profiling heap dumps, fixing out-of-memory (OOM) issues, checking Compose lifecycle flow collections, resolving WebView/Handler leaks, or configuring LeakCanary. Triggers…

JosephSanjaya/skills · 123 tokens

sceneview

Build 3D and AR apps with the SceneView SDK in Jetpack Compose, SwiftUI (iOS/macOS/visionOS via SceneViewSwift), Web (Filament.js), Flutter and React Native. Use whenever the user asks for "3D in Compose", "AR with ARCore in Compose", a model viewer, or any cross-platform 3D/AR app where the dependency is…

sceneview/sceneview · 156 tokens

sceneview-web

Build 3D and WebXR (AR/VR) experiences in the browser with SceneView for Web — Filament.js (WebGL2/WASM) wrapped in a Kotlin/JS DSL and a plain-JavaScript API on window.sceneview. Use whenever the user asks for "3D in the browser", "a web model viewer", "WebXR AR/VR", or any browser 3D/AR app where the dependency is…

sceneview/sceneview · 147 tokens

to-plan

Use when one ready GitHub issue or an in-chat task needs a repository-aware implementation plan for a later implementation workflow.

chrisbanes/skills · 27 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

netwatch

Network monitoring and security audit. Use when: user asks to scan network, check open ports, network audit, who's on wifi, check connection, port scan, firewall check, network status, or network security. Don't use when: user asks about crypto transactions (use solana tools) or web search (use research skill).

sepivip/SeekerClaw · 68 tokens