{"id":50490872,"url":"https://github.com/melonask/moka-skills","last_synced_at":"2026-06-02T02:31:19.085Z","repository":{"id":353009116,"uuid":"1216391418","full_name":"melonask/moka-skills","owner":"melonask","description":"Rust Concurrent Cache Skill","archived":false,"fork":false,"pushed_at":"2026-04-22T03:27:02.000Z","size":16,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-04-22T05:32:02.386Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/melonask.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-04-20T21:23:29.000Z","updated_at":"2026-04-22T03:27:05.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/melonask/moka-skills","commit_stats":null,"previous_names":["melonask/moka-skills"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/melonask/moka-skills","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/melonask%2Fmoka-skills","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/melonask%2Fmoka-skills/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/melonask%2Fmoka-skills/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/melonask%2Fmoka-skills/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/melonask","download_url":"https://codeload.github.com/melonask/moka-skills/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/melonask%2Fmoka-skills/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33803734,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-02T02:00:07.132Z","response_time":109,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-06-02T02:31:18.277Z","updated_at":"2026-06-02T02:31:19.076Z","avatar_url":"https://github.com/melonask.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# moka-skills\n\nA comprehensive AI skill for building high-performance caching solutions using the [Moka](https://github.com/moka-rs/moka) Rust library. Moka is a fast, concurrent, in-memory cache library inspired by Java's Caffeine, providing near-optimal hit ratios through the TinyLFU eviction policy.\n\n## Overview\n\nThis skill enables an LLM to accurately use and develop solutions based on the Moka caching library. It covers the full API surface of Moka v0.12, including synchronous and asynchronous cache types, eviction policies, expiration strategies, and advanced features — all with concrete Rust code examples.\n\nThe skill is structured as a single `SKILL.md` file that serves as a complete reference and coding guide. It follows progressive disclosure principles: the metadata (name + description) is always in context for triggering, and the full instructions load when the skill is invoked.\n\n## Installation\n\n```bash\nnpx skills add melonask/moka-skills\n```\n\n## What This Skill Covers\n\n### Cache Types\n\n- **`sync::Cache`** — Thread-safe synchronous cache for general-purpose use\n- **`sync::SegmentedCache`** — Multi-segment sync cache for high-contention workloads\n- **`future::Cache`** — Async-aware cache for tokio, async-std, and actix-rt\n\n### Eviction Policies\n\n- **TinyLFU** (default) — Near-optimal hit ratios combining LFU admission with LRU eviction\n- **LRU** — Simple least-recently-used eviction for recency-biased workloads\n- **Size-aware eviction** — Bounded by total weighted size via custom `weigher` closures\n\n### Expiration\n\n- **TTL** (time-to-live) — Max age from creation/update\n- **TTI** (time-to-idle) — Max age since last access\n- **Per-entry custom expiry** — Fine-grained control via the `Expiry` trait (variable TTL per key/value)\n\n### Advanced Features\n\n- **Atomic get-or-initialize** — `get_with`, `try_get_with`, `get_with_if`, `optionally_get_with`\n- **Entry API** — Fine-grained insertion control via `entry()` / `entry_by_ref()` selectors\n- **Eviction listeners** — Sync and async callbacks on entry removal (`Expired`, `Explicit`, `Replaced`, `Size`)\n- **Invalidation** — Single, bulk, and predicate-based (`invalidate_entries_if`)\n- **Borrowed-key lookups** — Zero-allocation lookups via the `Equivalent` trait\n- **Custom hashers** — Support for `ahash`, `dashmap`, or any `BuildHasher`\n- **Housekeeper model** — No background threads; maintenance runs on caller threads\n\n## File Structure\n\n```\nmoka/\n└── SKILL.md          # Complete skill definition (~500 lines)\n    ├── YAML frontmatter (name, description — triggering metadata)\n    └── Markdown body (instructions, API reference, code examples)\n```\n\n## Quick Start Example\n\n```toml\n# Cargo.toml\n[dependencies]\nmoka = { version = \"0.12\", features = [\"sync\"] }\n```\n\n```rust\nuse moka::sync::Cache;\n\nfn main() {\n    let cache: Cache\u003cString, String\u003e = Cache::new(10_000);\n\n    // Atomic get-or-initialize with concurrent deduplication\n    let value = cache.get_with(\"key\".to_string(), || {\n        expensive_database_lookup()\n    });\n\n    println!(\"Got: {}\", value);\n}\n```\n\n## Trigger Phrases\n\nThe skill triggers automatically when the user asks about:\n\n- In-memory caching in Rust\n- Concurrent or thread-safe caches\n- TTL, TTI, or expiration in caching\n- Cache eviction policies (TinyLFU, LRU)\n- Async caches with tokio or async-std\n- The `moka` crate by name\n- Any request to speed up a Rust application with caching\n\n## Requirements\n\n- **Moka crate**: v0.12.x\n- **Rust MSRV**: 1.71.1+\n- **Rust Edition**: 2021\n- At least one of `sync` or `future` feature flags must be enabled\n\n## License\n\nThis skill document is provided for educational and development purposes. The Moka library is licensed under MIT OR Apache-2.0.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmelonask%2Fmoka-skills","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmelonask%2Fmoka-skills","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmelonask%2Fmoka-skills/lists"}