amethyst: Skill for Claude Code

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

account-state is a skill for Claude Code from vitorpamplona/amethyst. It costs 0 tokens per session (1,905 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/. Also seen: mentions AGENTS.md.

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,620 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 0 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,905 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.00000 $0.01905
Opus 5.5 $0.00000 $0.00762
Sonnet 5.5 $0.00000 $0.00381
Haiku 4.5 $0.00000 $0.00191

Measured 15d ago against content hash a851932bbf82, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, 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 15d 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 · 113 lines

How it starts

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

Account, LocalCache and Feeds

The client state backbone, all headless in commons/src/commonMain/kotlin/com/vitorpamplona/amethyst/commons/ (abbreviated commons/…/ below):

  • model/cache/LocalCache.kt — object LocalCache : EventCache(). Every Note / User the client has seen. All logic is in model/cache/EventCache.kt (an open class so tests can build their own); Android and Desktop both use the LocalCache singleton (AppModules.kt, DesktopAppModules.kt).
  • model/Account.kt — one Account per signed-in user: ~50 per-feature state objects (kind3FollowList, nip65RelayList, muteList, bookmarkState, …), each exposing .flow.
  • feeds/ + viewmodels/ + <feature>/dal/ — feeds: a FeedFilter scans LocalCache, a FeedContentState / FeedViewModel keeps the result live.
relay EVENT ─► EventCache.justConsume ─► Note/User updated, indexes, live.newNote(...)
                     │                                   │
                     ▼                                   ▼
   XState pins its addressable note,            LocalCacheFlow.newEventBundles
   note.flow().metadata → XState.flow           → FeedViewModel → FeedFilter.applyFilter
                     │                                   │
                     └────────► ViewModels / composables ◄┘

Account state objects

Pattern, copied from model/nip51Lists/muteList/MuteListState.kt:

  • Pin the note. val muteListNote = cache.getOrCreateAddressableNote(MuteListEvent.createAddress(signer.pubKey)). LocalCache's notes / addressables are LargeSoftCache (weak references), so the state object's field is what keeps its note from being collected.
  • Expose one StateFlow. Map muteListNote.flow().metadata.stateFlow → decrypt (private lists go through a per-feature …DecryptionCache such as MuteListDecryptionCache, held next to it in Account as muteListDecryptionCache) → fall back to the AccountSettings backup (settings.backupMuteList) when the event is absent → stateIn(scope, SharingStarted.Eagerly, …).
  • Mutation helpers return a signed event — publishing it is the caller's job. MuteListState.hideUser(pubkey) returns a MuteListEvent; Account.hideUser does sendMyPublicAndPrivateOutbox(muteList.hideUser(pubkeyHex)). A state change you never send is invisible to every other client and is lost when the next relay copy arrives.
  • Consumers read account.<feature>.flow, never a MutableStateFlow on Account.

Read the full file on GitHub · 113 lines

Files

What ships with it

3 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. 15d ago Changed · +1 lines a851932bbf82
  2. 25d ago Changed · +11 lines · -133 tokens per session 94fb3f144f72
  3. 1mo ago Changed eb9793906e30
  4. 2mo 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,620 stars, last pushed yesterday), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 1,905 tokens. 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

account-state compared with skills from other repositories

account-state next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
account-statevitorpamplona/amethystSkill1.6kyesterdayMITA0Claude Code
android-leak-expertJosephSanjaya/skillsSkill58d agoMITA123Claude Code, Codex
sceneviewsceneview/sceneviewSkill1.4kyesterdayApache-2.0A156Codex
compose-focus-navigationchrisbanes/skillsSkill1.1kyesterdayApache-2.0A41Claude Code
kotlin-androidericrisco/rsc-harnessSkill5032d agoMITA78Claude Code, Codex
compose-multiplatformericrisco/rsc-harnessSkill5032d agoMITA80Claude Code, Codex
deliver-specchrisbanes/skillsSkill1.1kyesterdayApache-2.0A33Claude Code, Codex