algorithm-first-discipline SKILL.md skillA
algorithm-first-discipline from findscripter/everything-skills is an agent skill: a SKILL.md folder an AI agent loads when a task calls for it.
mdr add findscripter/everything-skills/algorithm-first-discipline@git:20261023.6038cffPins git:20261023.6038cff in mdr.lock. Pin the fingerprint instead.
- Audit grade
- A, 19 of 19 checks passed
- Kind
- SKILL.md skill
- Repository
- findscripter/everything-skills
- Path
00-meta/algorithm-first-discipline/SKILL.md- Versions recorded
- 4
- Latest version
- git:20261023.6038cff, committed Oct 23, 2026
- First version recorded
- Jun 3, 2026
- Size
- 11,570 bytes
- Repository stars
- 11
- License
- a license file GitHub does not identify
当编写/审查含循环、查询、连接、递归或集合遍历(n 超过个位数)的代码时使用;动作:在写代码前先声明时间/空间复杂度、数据结构、算法族,按七步预写协议产出有复杂度论证的实现;不适用于 n<10 的平凡集合、一次性初始化代码、纯性能 profiling/常数因子调优。触发词:嵌套循环、N+1、includes/find 在循环里、await in loop、SELECT *、O(n^2)、Big-O。.
Collected from public GitHub. Every version is saved exactly as it was and never changes. Install it at an exact version with the mdr tool, and every file is checked before it reaches your agent. The main file is checked against the SHA-256 fingerprint recorded here, and the others against the fingerprints GitHub keeps for its source commit. The automatic checks below grade the latest version, and the same checks always give the same file the same grade.
What the file says
## 何时使用 模型本就懂 Big-O、哈希表、分治、动态规划、排序、图算法、摊还分析——它只是不会主动去用。本技能修的是**行为**,不是知识。它是「算法纪律」套件的网关:自身管经典的日常算法纪律,必要时再升级到三个兄弟技能。 **该用的场景:** - 编写、修改或审查涉及循环、集合、查找、搜索、连接、递归、图、查询,或任何对超过个位数个元素做计算的代码。 - 即将写 `for` 套 `for`、在循环里调 `.find`/`.includes`/`.indexOf`、对独立元素在 `for`/`map`/`forEach` 里 `await`、或对集合每项发一次查询。 - 审计代码库/PR 中的已知反模式(await-in-loop、`.includes` 套在 `.filter` 里、循环里字符串拼接、`SELECT *`、N+1 等)。 - 复审「看着很地道」但可能藏着 O(n²) 或 N+1 的 AI 生成代码。 **不该用的边界(明确豁免):** - `n < ~10` 的平凡集合、一次性 setup 代码——别为 `for i in range(3)` 浪费时间写复杂度。 - 常数因子优化、延迟尾部、I/O 瓶颈——这要 profiler,本技能只管渐进复杂度,不是测量工具。 - 自动重写已上线的慢代码——那是 `complexity-cuts` 的活;本技能是「写之前」的推理闸门,不改既有代码。 - 故意的暴力解——只要作者写下一行理由(如「实践中 n≤100,可读性优先」),暴力解可以放行;本技能只要求那行理由存在。 **违反规则的字面,就是违反技能的精神。**「就这一次」正是 O(n²) 上生产的方式。 ## 步骤 **铁律:没有声明复杂度、数据结构、算法族,不写任何非平凡代码。** 在写循环/递归/查询前,消息里必须**按此顺序**出现七步预写协议: 1. **问题形状** —— 一句话。(如「给定 n 个带时间戳的事件,求总权重 ≤ K 的最长连续窗口」。) 2. **输入维度** —— `n = ?`,真实量级(如 `n ~ 10^6 行`),是否热路径。 3. **目标复杂度** —— `time = O(?)`,`space = O(?)`,点名主导输入维度。 4. **数据结构** —— 每个集合形态的值都从 `Array/List/Set/HashMap/TreeMap/Heap/Deque/Trie/Graph/BitSet/Counter/LinkedList` 中刻意选一个,附一句理由(如「Set 用于循环内 O(1) 成员判断」「Heap 用于 top-K 的 O(n log k)」)。循环内查找默认用哈希结构(Set/Map);n 大时默认流式/迭代器而非物化整表。 …
Read the whole file at its exact version.
How to install
claude plugin marketplace add https://markdownregistry.com/mp/a/art_p5mx3n5bhlxlxpoh/4b5cd25c471219926db1d82962f5179e2f562be9cbd60257d5da3b3347fde1d4.json
Then /plugin install algorithm-first-discipline@markdownregistry-p5mx3n5bhlxlxpoh in Claude Code. It installs git:20261023.6038cff, the one graded A here, pinned to the commit it was graded at, and leaves it there.
mdr add findscripter/everything-skills/algorithm-first-discipline@sha256:4b5cd25c47121992The line at the top of this page pins the label git:20261023.6038cff, which is what most people want. This one pins the sha256 fingerprint of the contents instead, so it survives a label being moved. Either way the exact version is written to mdr.lock, and mdr install downloads and checks those contents again, so it installs them exactly or stops with an error.
[](https://markdownregistry.com/a/art_p5mx3n5bhlxlxpoh)
3 badge image fetches in 30 days. What the badge shows.
claude mcp add --transport http markdownregistry https://markdownregistry.com/mcp/registry
Then ask it: what changed in findscripter/everything-skills/algorithm-first-discipline since the version I have? It reads every saved version here, no key and no account. Any agent that speaks MCP can add it.
Got a copy of algorithm-first-discipline from somewhere else? Ask it: where did my algorithm-first-discipline come from, and what was changed? It names the public original, the version yours is closest to and every changed line. The text is not kept.
Versions
The registry has recorded 4 versions of this file, between Jun 3, 2026 and Oct 23, 2026, about one every 47 days.
Watch this file (sign in, one email per new version)
| version | committed | commit | size | audit | |
|---|---|---|---|---|---|
| git:20261023.6038cff latest | 2026-10-23 | 6038cff | 11,570 B | A | view · diff |
| git:20260916.3b600cb | 2026-09-16 | 3b600cb | 11,310 B | A | view · diff |
| git:20260603.d9d2121 | 2026-06-03 | d9d2121 | 11,314 B | A | view · diff |
| git:20260603.7a915e7 | 2026-06-03 | 7a915e7 | 11,314 B | A | view |
Committed this skill to a repository? Install the markdownregistry skill updates app on it, or on all of them. When the registry saves a newer version, a pull request brings your copy to it within minutes, the newest version first, then what changed and any check it newly trips. A copy you edited is never touched, and nothing is deleted.
It asks to read and write contents and pull requests, and to read metadata. No workflow file, no Actions setting, nothing runs on your runners. Uninstall it and everything the registry kept about your repository is deleted.
Committed this skill to a repository? Add one workflow file, and when a newer version is saved, a pull request brings your copy to it, the newest version first, then what changed and any check it newly trips. A copy you edited is never touched, and nothing is deleted.
mkdir -p .github/workflows && curl -fsSL https://markdownregistry.com/ci/skill-updates.yml -o .github/workflows/skill-updates.yml
It runs daily on GitHub Actions, no key and no account. Read the workflow before you add it.
Installed this file, say at .claude/skills/algorithm-first-discipline/SKILL.md? Drop it here to learn which saved version you have and what changed since. Your browser works out its SHA-256 fingerprint and sends only that; the file itself never leaves your computer.
Or paste its contents
Your agent can run this same check on the agent markdown files you have installed, up to 50 in one ask. Add the registry once:
claude mcp add --transport http markdownregistry https://markdownregistry.com/mcp/registry
Then ask it to check the files you have installed. No key and no account.
From the root of your project, one line hashes each installed skill's SKILL.md, your AGENTS.md and your CLAUDE.md, and asks the registry once. Only the fingerprints and paths are sent.
sha256sum .claude/skills/*/SKILL.md AGENTS.md CLAUDE.md | curl -s --data-binary @- https://markdownregistry.com/api/v1/check-copies
In CI, add --fail-with-body: the answer is 409 when any file is behind, so the step fails and still prints which files.
sha256sum .claude/skills/*/SKILL.md AGENTS.md CLAUDE.md | curl -s --fail-with-body --data-binary @- https://markdownregistry.com/api/v1/check-copies
No sha256sum on your machine? shasum -a 256 prints the same lines.
Audit of the latest version
- pass: Frontmatter block present
- pass: Frontmatter declares a name
- pass: Frontmatter declares a description
- pass: Size between 200 bytes and 200 KB (11570 bytes)
- pass: No zero-width or bidi control characters
- pass: No instruction hidden inside an HTML comment
- pass: No link to an exfiltration or paste host
- pass: No credential-shaped string
- pass: No instruction to send local credentials anywhere
- pass: No text hidden with inline styles
- pass: No encoded command decoded and run in a shell
- pass: No prompt-injection phrasing
- pass: No curl or wget piped into a shell
- pass: No decoded text run in a shell
- pass: No recursive delete of root, home or parent
- pass: No instruction to read or print local credentials
- pass: No base64 blob over 200 characters
- pass: No link to a raw IP address
- pass: No script tag
Source
findscripter/everything-skills · 11 stars · license a license file GitHub does not identify · pushed 2026-11-22 · branch main
API
GET https://markdownregistry.com/api/v1/artifacts/art_p5mx3n5bhlxlxpoh GET https://markdownregistry.com/api/v1/resolve?ref=findscripter/everything-skills/algorithm-first-discipline GET https://markdownregistry.com/api/v1/blob/4b5cd25c471219926db1d82962f5179e2f562be9cbd60257d5da3b3347fde1d4 GET https://markdownregistry.com/api/v1/list?kind=skill
Every file of this kind listed here, most starred first, in pages: send each page's next back as cursor. JSON, no key.
Your AI assistant does the legwork. You hear about the deals worth your word. Hand yours the standing instructions at modelranch.com and it joins the network that reads files like this one.
Guides: the SKILL.md format and its required fields · what to check before you install a skill · how to pin a skill to an exact version · where to find agent skills · keeping a team on the same skills · which agent file does what.