Langsung ke konten
Skillpedia
Pemrograman umum48k Β· #5047

lemmaly

Fungsinya

Lemmaly adalah alat yang membantu Anda memikirkan efisiensi kode sebelum menulisnya. Alat ini memastikan Anda menentukan kompleksitas (seberapa cepat kode berjalan), struktur data (cara data diatur), dan jenis algoritma (strategi yang digunakan) sebelum mulai memprogram.

Kapan dipakai

  • βœ“Saat menulis kode baru yang melibatkan daftar, pencarian, atau pengulangan.
  • βœ“Saat meninjau kode yang terasa lambat atau tidak efisien.
  • βœ“Saat Anda tidak yakin cara terbaik untuk mengatur data dan algoritma.

Link skill

https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/lemmaly/SKILL.md

Salin lalu tempelkan ke AI Anda (Claude, ChatGPT, atau Cursor) dan minta AI mengikuti instruksinya.

Cara pakai

Cara paling mudah: salin pesan ini dan tempelkan ke AI Anda. AI akan membaca skill dan mengikuti instruksinya.

Pesan siap tempel

Gunakan skill ini untuk membantu saya: https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/lemmaly/SKILL.md Baca file SKILL.md di link tersebut dan ikuti instruksinya untuk tugas saya.
Mau AI Anda menemukan skill seperti ini sendiri?Pasang MCP Skillpedia gratis: cukup satu baris, dan AI mencari di antara 15.000+ skill sebelum tiap tugas.Pasang dalam 1 menit β†’

Contoh permintaan ke AI

β€œSaya perlu menulis fungsi untuk mencari item yang paling sering muncul dalam daftar berisi 1 juta angka. Kompleksitas, struktur data, dan algoritma apa yang sebaiknya saya gunakan sebelum mulai?”

5 skill baru setiap minggu. 1 menit baca.

Cara kerjanya

Lemmaly bekerja dengan meminta Anda menyebutkan kompleksitas waktu dan ruang, struktur data yang dipilih beserta alasannya, dan keluarga algoritmanya. Ini memaksa analisis dilakukan di awal sehingga solusi yang tidak efisien bisa dihindari.

Konten teknis (SKILL.md asli)

Teks asli dari pembuat, dalam bahasa Inggris, langsung dari GitHub.

lemmaly β€” Algorithm-First Proof

The model already knows Big-O, hash tables, divide-and-conquer, dynamic programming, sorting, graph algorithms, and amortized analysis. It just does not apply them spontaneously. lemmaly fixes the behavior, not the knowledge.

This skill is the gateway for an algorithm-discipline suite of four skills (lemmaly, mathguard, invariant-guard, complexity-cuts). It enforces the hard rules that every other guard in the suite assumes.

Violating the letter of these rules is violating the spirit of the skill. "Just this once" is how O(nΒ²) ships to production.

When to Use This Skill

Use lemmaly when:

  • Writing, editing, or reviewing code that involves loops, collections, lookups, searches, joins, recursion, graphs, queries, or any computation over more than a handful of items.
  • About to write a for inside a for, .find / .includes / .indexOf inside a loop, await inside for / map / forEach over independent items, or one query per item in a collection.
  • Auditing a codebase / PR for known anti-patterns (await-in-loop, .includes inside .filter, string-concat in loop, SELECT *, N+1, etc.).
  • Reviewing AI-generated code that "looks idiomatic" but might hide O(nΒ²) or N+1.

When in doubt, start at lemmaly β€” it is the gateway and will tell you when to escalate to its three sibling skills.

If you are about to… Use Why
Write new code that loops, queries, joins, recurses, or processes a collection lemmaly Forces complexity + data structure + algorithm family before code is written.
Refactor existing code that is already slow, OOMs, times out, or has nested loops / N+1 / repeated work complexity-cuts Corrective playbook for code that already shipped with bad Big-O.
Implement an algorithm where the obvious version is subtly wrong (binary search variants, in-place dedup, Boyer–Moore, QuickSelect partition, recursion with accumulators, fixed-point / termination concerns) invariant-guard Forces writing the function contract + loop invariant before code. The trap is in the contract, not the loop body.
Work with n β‰₯ 10⁢, similarity search, dedup at scale, top-K, streaming analytics, cardinality estimation, embeddings, FFT/NTT, dimensionality reduction, computational geometry, randomized algorithms mathguard Classical algorithms have hit their lower bound; an approximate or math-heavy technique (Bloom, HLL, Count-Min, MinHash/LSH, FFT, JL projection, sweep line, kd-tree) gives the asymptotic win.

Routing flow

Are you writing new code?
β”œβ”€β”€ yes β†’ lemmaly (state complexity, structure, family BEFORE coding)
β”‚         β”œβ”€β”€ classical algorithm at its lower bound AND n is large? β†’ mathguard
β”‚         └── subtle correctness trap (invariant, base case, off-by-one)? β†’ invariant-guard
└── no, refactoring existing slow / OOM / timed-out code β†’ complexity-cuts
          └── still slow after classical fixes? β†’ mathguard

One-line mental model

  • lemmaly = think first (prevention).
  • complexity-cuts = clean up bad Big-O (correction).
  • invariant-guard = prove it's correct (verification).
  • mathguard = beat the classical floor (acceleration).

The Iron Law

NO NON-TRIVIAL CODE WITHOUT STATED COMPLEXITY, DATA STRUCTURE, AND ALGORITHM FAMILY

Before you write a loop, a recursion, a query, or any computation over more than a handful of items, three things must appear in your message β€” in this order:

  1. time = O(?), space = O(?), with the dominant input dimension named.
  2. The data structure you will use, with a one-phrase reason.
  3. The algorithm family (one of: linear scan, two-pointer, sliding window, binary search, sort+sweep, hash join, BFS/DFS, topo sort, Dijkstra/A*, union-find, DP, greedy, recursion+memo, prefix sum, segment tree, monoid reduction).

If you cannot state all three, you do not understand the problem yet. Ask, or read more code. Do not write code.

Non-negotiable rules

  1. State complexity before writing any non-trivial code. In one line:
    • time = O(?), space = O(?)
    • Dominant input dimension: n = what, with realistic magnitude (e.g. n ~ 10^6 rows)
    • If you cannot state these, you do not yet understand the problem. Ask, or read more code.

…

Pertanyaan umum

Apa itu 'Big-O'?

Big-O (atau kompleksitas) adalah cara untuk menggambarkan seberapa cepat sebuah algoritma berjalan ketika ukuran data input bertambah. Misalnya, O(n) berarti waktu eksekusinya bertambah secara linear mengikuti ukuran data.

Mengapa struktur data harus ditentukan lebih dulu?

Pilihan struktur data (seperti daftar, map, atau set) langsung memengaruhi efisiensi. Menentukannya sejak awal membantu Anda memastikan memakai alat yang tepat, misalnya map untuk pencarian yang cepat.

Apa itu 'keluarga algoritma'?

Ini adalah kategori umum strategi untuk menyelesaikan masalah, seperti pencarian biner, pengurutan, atau pemrograman dinamis. Dengan mengenali keluarganya, Anda bisa memikirkan solusi yang sudah dikenal dan efisien.

Detail

Deskripsi asli dari pembuat

Algorithm-first discipline: state Big-O, data structure, and algorithm family BEFORE writing loops, queries, or recursion. Catches O(n^2), N+1, and brute-force defaults.

repo: sickn33/agentic-awesome-skills

Popularitas

Bintang GitHub
48k
Peringkat
#5047
Lisensi
MIT
Diperbarui
15/10/2026

Apakah skill ini berguna?

0

Masuk untuk memberi suara.

Komentar

  • …

Skill lain dari repositori ini

Skill serupa