Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

lc-cheatsheet

БесплатноБез исполняемых скриптовНе проверен

File a LeetCode problem into the cheatsheets under doc/cheatsheet/ the way the existing sections are written — find the sheet whose Scope line owns the topic…

yennanliuот yennanliu★ 141 звезда на GitHub

Об этом скилле

Add a LeetCode problem to a cheatsheet

Turn a problem (or a pattern just learned) into a cheatsheet section in the card shape doc/cheatsheet/00_template.md defines — a pattern card or a problem card, filed in the sheet whose role and Scope line own it, with every snippet run, every moved anchor followed, and the 繁體中文 overlay kept level. Most existing sections predate the cards; this skill never copies their shape.

Invocation: /lc-cheatsheet <LC number> [into <sheet-slug>] [as <mode>]

/lc-cheatsheet 1650 into binary_tree as variation
/lc-cheatsheet 239 into sliding_window          # mode inferred -> example
/lc-cheatsheet 496 as pattern                   # sheet inferred from the technique
/lc-cheatsheet monotonic_queue as sheet         # a whole new file
add LC 1650 to the LCA part of binary_tree.md   # the plain-English form works too
as <mode> Use when Lands as
example (default) the sheet has the template; this problem is another instance of it a problem card under that template's section: in the topic's X_examples.md when it has one (Skeleton C), else in the core sheet
variation the sheet's template does not quite solve it — one precondition differs a #### <X> Variant — <what changed> (LC n) under the template it varies
pattern the sheet has no template for this technique at all a new pattern/template section, plus its row in the sheet's category table
sheet no sheet owns the topic, or a core sheet needs its _examples / _advanced satellite a new doc/cheatsheet/<slug>.md and its data/cheatsheet_meta.json entry

Missing arguments are inferred, not asked about: the sheet from the technique the solution uses and from README.md's topic heading for that LC number, the mode from what the sheet already contains (step 2). Ask only when two sheets both plausibly own it and their Scope lines do not settle it.

Precedence, when into <slug> and the Scope lines disagree. Both are honoured, and they are honoured differently — the named sheet is never ignored, and the Scope line still decides where the depth lives:

into <slug> always edited. It is where you said you were working, so it gets the entry point: the row in its own table and the link onward to the owner's section. A pointer, not a second copy of the code: one home per problem (CLAUDE.md § What goes inside a section)
the Scope owner gets the full section, if it is a different sheet. Depth belongs to the file whose Scope line claims the topic, or the two sheets grow into one document

So /lc-cheatsheet 1650 into binary_tree edits binary_tree.md and tree_lca_distance.md, and says so in the report. Nothing is silently redirected; a sheet you named is never left untouched. When the named sheet is the Scope owner — the common case — the two collapse into one edit.

Prime directives

  1. The Scope line decides which sheet, not the topic name. Every sheet opens with > **Scope** — <what this file owns, and what it deliberately does not>. Read the candidates' Scope lines before writing a line. That block exists precisely to stop two files growing into the same document.
  2. File it under the pattern it belongs to. Never append an LC Examples section to the end that re-solves what a template above already solves, and never open a catch-all (Missing Google Patterns). Both are the Aug 2026 cleanup this repo already paid for — see doc/cheatsheet-review-2026-08.md.
  3. Untested code is not a cheatsheet entry. Run every snippet added against the problem's own examples (step 6). A sheet is read as authoritative; a wrong snippet in one is worse than no snippet.
  4. A moved anchor is a broken site. Changing a heading's text — including adding or changing its ⭐ run — moves its id. Every link aimed at it moves in the same commit (step 5).
  5. An English edit parks its Chinese translation. The 中文 overlay is keyed per section, so an edited section silently falls back to English. Re-key it (step 7); do not leave the gap.
  6. Write the card, not the neighbour's shape. Every section this skill writes or rewrites is a pattern card or a problem card (step 4), even when every section around it is older and shaped differently. Most sheets predate the cards, so copying the section next door copies exactly the shape the Nov 2026 review retired. script/check_cheatsheet_cards.py fails CI on a new or rewritten section that is not card-shaped (step 8).

The steps

1. Find the sheet that owns it

grep -rn "LC 1650\|1650\b" doc/cheatsheet/ | head -20        # who already mentions it
grep -n "^> \*\*Scope\*\*" doc/cheatsheet/{binary_tree,tree_lca_distance}.md
grep -n "^## \|1650" README.md | grep -B 2 1650               # README's topic heading

Read out of that:

  • Which sheet's Scope line claims the topic.
Полный SKILL.md на GitHub

Установить lc-cheatsheet в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Read
Glob
Grep
Bash
Write
Edit

FAQ

Что делает скилл lc-cheatsheet?

File a LeetCode problem into the cheatsheets under doc/cheatsheet/ the way the existing sections are written — find the sheet whose Scope line owns the topic, file it under the pattern it belongs to (a worked example, a variation on an existing template, a new pattern section, or a new sheet), smoke-test every snippet, fix the heading anchors the edit moved, and re-translate the 中文 sections it invalidated. Use when asked to add or update a cheatsheet, to document a pattern just learned, to add an LC example or a template variation to a sheet, or to start a new cheatsheet. Triggers - "add LC 1650 to binary_tree as a variation", "/lc-cheatsheet 239 into sliding_window", "document the monotonic stack pattern", "update the LCA part of the binary tree cheatsheet".

Как установить скилл lc-cheatsheet?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл lc-cheatsheet запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить lc-cheatsheet с