Command Palette

Search for a command to run...

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

lc-site-data

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

Add a topic to the Study Roadmap (data/roadmap.json) or a question to the Complexity Quiz (data/complexity_quiz.json), satisfying the build-time validators in…

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

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

Add a roadmap topic or a quiz question

Edit data/roadmap.json or data/complexity_quiz.json so the build accepts it the first time.

Invocation: /lc-site-data <what> — e.g. /lc-site-data roadmap monotonic-stack, /lc-site-data quiz for LC 239.

Why this one is a skill

Neither file is long, but both are validated hard at build time and both span three or four other files. site/build-roadmap.js and site/build-quiz.js fail the build rather than warn — deliberately, so nothing lands in an unsorted bucket — which turns a five-line edit into a build-break-and-retry loop unless every constraint is satisfied at once.

Never repeat a title, a difficulty, or a link to this repo's solutions in either file. They are read from README.md at build time. A typed copy is a copy that goes stale.

Part A — a roadmap topic

lc-roadmap.html is driven entirely by data/roadmap.json — one entry per topic in its nodes array.

{
  "id": "monotonic-stack",
  "title": "Monotonic Stack",
  "row": 2,
  "prereqs": ["stack"],
  "sheets": ["monotonic_stack", "monotonic_queue"],
  "blurb": "One sentence on what the topic buys you.",
  "problems": [496, 503, 85, 901, 907]
}

What fails the build

Rule Why it exists
every problems id is in a README table a number README does not know has no title, difficulty or solution link to attach
every sheets slug is a file in doc/cheatsheet/ a dead sheet link on a teaching page is worse than no link
row is strictly greater than every prereq's row edges must point downward
no cycle in prereqs —
no edge the graph already implies the roadmap has to stay a transitive reduction, or the drawing turns into spaghetti

That last one is the one that is easy to get wrong: if monotonic-stack needs stack, and stack already needs array, then listing array as a prereq of monotonic-stack is an implied edge and fails. List only the immediate prerequisites.

Placement: within a row, topics are drawn in the order they appear in the file. Put a new topic near the column its prerequisite sits in, to keep the edges short.

The list picker

The page shows one problem set at a time, and all of them are declared in the same file:

  • lists — the picker's entries. from says where membership comes from: curated (the ids on the nodes), list:<flag> (a flag in data/problem_lists.json), or readme:<field> (google / must, read out of README's tag and status columns).
  • topicSources — each source files problems under its own taxonomy (NeetCode's Arrays & Hashing, LeetCode's plan group Hashing, README's ## Array heading). These maps put them on roadmap topics; null means deliberately off the roadmap (SQL, shell, JavaScript-only exercises). A list's topicFrom names which taxonomies to try, in order, so a coarse group falls through to a finer one.

The build fails on a taxonomy key that is missing, pointing at an unknown topic, or mapped but unused — so a renamed upstream category cannot silently drop a whole group of problems. Watch the per-list "shown of" tally the build prints.

Only the curated list has a teaching order, so only it renders locks and prerequisites.

data/problem_lists.json is vendored, not built — refresh it by hand, never from the site build:

python3 script/fetch_problem_lists.py           # rewrite the file
python3 script/fetch_problem_lists.py --check   # exit 1 if it is stale

Part B — a quiz question

lc-complexity-quiz.html draws from data/complexity_quiz.json.

{
  "id": "two-sum-hash",
  "lc": 1,
  "topic": "Arrays & Hashing",
  "vars": "n = len(nums)",
  "code": ["def twoSum(nums, target):", "    ..."],
  "time": "O(n)",
  "space": "O(n)",
  "cost": {
    "time":  { "lines": [3, 4], "why": "`for i, x` makes one pass; each `in seen` is an O(1) hash lookup." },
    "space": { "lines": [6],    "why": "`seen[x] = i` can store all n values before a match." }
  },
  "why": "Optional: the one takeaway the two cost reasons do not already say.",
  "trap": "The wrong answer people actually give, and why it is wrong."
}

Every question also needs its 繁體中文 entry in data/complexity_quiz.zh.json, keyed by id — vars, note / why / trap exactly when the English has them, and cost.time / cost.space as plain strings (the line numbers come from the English). Keep every `code` span and Big-O expression in English. build-quiz.js composes _site/data/complexity-quiz.zh.json for lc-complexity-quiz.zh.html and fails on a missing, stray or partial translation.

What fails the build

Rule Note
no duplicate id —
an lc number is in a README table —
an entry with an lc sets no title/difficulty they come from README
an entry without an lc sets both a pure algorithm or Python d
Полный SKILL.md на GitHub

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

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

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

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

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

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

Read
Glob
Grep
Bash
Write
Edit

FAQ

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

Add a topic to the Study Roadmap (data/roadmap.json) or a question to the Complexity Quiz (data/complexity_quiz.json), satisfying the build-time validators in one pass — a row strictly below every prereq, no cycle and no edge the graph already implies, sheet slugs and LC numbers that exist, no duplicate quiz id, accept always an array, and every answer parseable by site/complexity.js's single-letter identifiers. Use when asked to add a roadmap topic, wire a topic's prerequisites, add a complexity question or drill, or fix a build that a roadmap or quiz entry failed. Triggers - "add monotonic stack to the roadmap", "/lc-site-data quiz for LC 239", "add a complexity question", "the roadmap build is failing".

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

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

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

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

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

Сравнить lc-site-data с