system-design-from-scratch
安装方式
先用 Prompt 核对来源与依赖。也可下载安装包。
用 AI 助手安装
复制提示词,让助手先核对固定版本和依赖。
查看 Prompt收起 Prompt
先检查当前 Agent 是否已安装 SkillPI Skill Finder。如果尚未安装,请按官方仓库的说明安装并启用:https://github.com/Findskills/skillpi。然后使用 Skill Finder 打开此 SkillPI 详情页并定位 "system-design-from-scratch":https://skillpi.com/zh/skills/deepskill-110c057be1e724c629baaf94a7c783610b707c9b8788ce1d81b5813b588658c8。安装前核对上游来源和版本:https://github.com/dotslashsimran/simcraft。来源不一致时停止并说明差异。核对通过后,用 Skill Finder 安装目标 Skill,并报告安装路径和来源版本。
来源与配置
github.com
配置方式待核实
请查看原始来源中的适用工具、依赖和权限要求。
安装实测待补充
设计并实现一个后端或分布式系统的微小但真实可运行版本:通过不变性测试验证属性,进行负载测试(含吞吐量及 p50/p95/p99 延迟),并注入故障(节点崩溃、消息丢失或延迟、网络分区、时钟偏移、磁盘满等)。完成后撰写设计文档,包含性能指标、替代方案、失效边界、以及对 Redis/Kafka/Cassandra/etcd 等实现方式的对比,并提供可用于面试的总结。适用于限流器、带重试和可见性超时的任务队列、一致性哈希、LSM 树键值存储、预写日志、Raft 领导者选举、带淘汰策略的缓存、发布/订阅系统、URL 短链服务等场景,以及需要超越简单框图的系统设计练习。
介绍来源: third_party · dotslashsimran · 0.0.1 参考来源
SkillPi 解读
- 能完成的任务
- 翻译待完成,请参阅来源文档。
- 实测状态
- 未测试
文件浏览
Frontmatter
name: system-design-from-scratch
description: Design a backend or distributed system by building a tiny but real working version of it, proving its properties with invariant tests, a load test (throughput and p50/p95/p99 latency) and fault injection (crashed nodes, dropped or delayed messages, partitions, clock skew, full disks), then writing a design doc with the numbers, alternatives, where it breaks, how Redis, Kafka, Cassandra or etcd do it, and an interview-ready summary. Works for rate limiters, job queues with retries and visibility timeouts, consistent hashing, LSM-tree key-value stores, write-ahead logs, Raft leader election, caches with eviction policies, pub/sub, URL shorteners and similar. Use when the user says "build a rate limiter from scratch", "system design practice", "how does Raft work, let's build it", "design X and prove it", "load test my design", "what happens to X when a node dies", or is preparing for a system design interview and wants more than boxes and arrows.System design from scratch
A whiteboard design is a guess. This skill turns it into evidence: a small system that actually runs, tests that state what must always be true, a load test that measures it, and faults that try to break it. The design doc at the end only contains claims that something in the folder proved.
The sibling skill from-scratch teaches one concept step by step. This skill is for systems with load, failure and trade-offs. Use from-scratch first if the user has never seen the core idea.
Tools in this skill
scripts/loadgen.py: async load generator for a Python function or an HTTP endpoint. Open loop (--rate, fixed schedule, latency counted from the scheduled time) or closed loop (--concurrency). Reports throughput, outcome counts and p50/p90/p95/p99/p99.9 from HdrHistogram-style buckets, plus the generator's own lag.--rates 200,400,800sweeps load to find the knee. Text chart always, PNG with--plotif matplotlib is installed.scripts/faultsim.py: deterministic discrete event simulator for message passing nodes. Delay, drop, duplicate, partition, one-way block, crash and restart (disk survives), clock offset and drift, disk full, a random fault schedule (random_faults), and invariants checked after every event. Same seed, same run.python3 scripts/faultsim.py --demoshows the basics.examples/rate-limiter/andexamples/raft-election/: two complete runs of this workflow, each with aDESIGN.mdof real results. Read the matching one before starting a similar system.
Check what is installed first: python3 --version, go version, python3 -c "import matplotlib". Default to Python 3.9+ standard library. Use Go only if it is installed and the user wants it (the scripts still work against a Go server over HTTP).
Workflow
Do the steps in order. Show the user each step's output before moving on, and ask one question at a time when something is unclear.
-
Requirements and numbers. Write a short table: what the system does, scale (QPS, keys, data size), latency budget, durability and consistency needs, and what happens on failure. Then do the back-of-envelope math out loud: memory per item times items, requests per second per node, round trips per request, disk bytes per day. Note which numbers already rule a design out. Patterns and reference figures are in reference.md.
-
Smallest correct version. One file per component, plain Python. Make time injectable (a
clockparameter or a faultsim node) so tests can control it. For anything with more than one node, build it asfaultsim.Nodesubclasses first; only add real sockets for the load test. Leave out everything not needed to show the core trade-off, and list what was left out. -
Invariants and property tests. Write down what must always be true (for example "never more than burst + rate x T admitted", "at most one leader per term", "a read after an acknowledged write returns it"). Test each over hundreds of seeded random inputs, compare against a brute force oracle where one exists, and keep one test per known weakness that shows it on purpose. reference.md lists invariants for each common system.
-
Load test. Use
loadgen.py. Prefer open loop for latency claims; closed loop hides queueing (coordinated omission). Sweep offered load to find where latency bends. Always look at the generator lag line: if it is high, the numbers describe the laptop, not the system. Say so in the doc. -
Fault injection. In faultsim: crash the leader or a replica, partition minority from majority, drop 10 to 30% of messages, slow one link, skew or speed up one clock, fill one disk. Then run
random_faultsacross 100+ seeds with invariants on. Plant one realistic bug (skip an fsync, forget a check) and confirm the tests catch it; if they do not, the nemesis or the invariant is too weak. Keep every failing seed as a regression test. -
Design doc. Write
DESIGN.mdnext to the code with these sections: requirements and numbers; what was built; invariants and test results; load results; fault results; the decision; where it breaks; what production systems do differently (cite their public docs, see reference.md); a five sentence interview summary that uses the measured numbers; and the commands to reproduce. Every number in it must come from a run in this session. Mark machine-dependent numbers with the machine's load.
Rules
- Never write a result you did not get. Never round a bad number into a good one.
- Simulated time for correctness and distributed behaviour; real time only for cost and throughput, and report how busy the machine was.
- A test that has never failed proves little. Show each invariant failing at least once (a planted bug or a removed check).
- "0 failures in N seeds" means the failure rate is probably below about 3/N, not zero. Say that.
- Compare at least two designs on the same workload. The trade-off is the point.
- When citing a production system, describe only what its public docs or papers say.
当前收录版本
0.0.1
质量评测
满分100 · 来自 SkillPi LAB 实验室的评测报告。
亮点
- 提供从设计到验证的完整系统工程实践流程,显著提升系统设计能力
- 覆盖限流器、Raft、任务队列等高频面试场景,实用价值高
亮点
- 触发词覆盖全面,精准匹配系统设计练习和面试准备需求
亮点
- 六步工作流程清晰,包含端到端示例和参考文档链接
- 强调证据驱动设计,避免空泛理论
待提升项
-
依赖说明不完整 原报告严重程度:轻微
未明确说明 matplotlib 等可选依赖的安装方式,可能影响部分功能使用
改进建议:在文档开头添加依赖检查与安装说明,明确可选依赖的作用
亮点
- 提供确定性故障模拟和不变性测试,确保系统行为可验证
- 强调回归测试和失败种子保存,提升长期可靠性
取前四项原始分值的算术平均,四舍五入取整。可通过收录报告核对各项评分与说明,运行记录需单独查证。
正文静态检测
100 / 100 · skillpi-20261123-no-r3-v1
正文未命中当前规则。
分数仅反映正文中的规则命中,供使用前参考。附件与运行行为不在此评分范围内。
权限与使用前检查
根据当前主文档自动整理,命中内容可能是示例或防护说明;不是实际权限声明,也未覆盖附件、外部依赖或运行行为。
未从主文档识别到上述常见操作,不能据此判断无需权限或没有风险。
安全评级与访问范围
safe · 静态证据核验,不代表运行安全保证。
使用前请由宿主核对并授权实际文件读写、外部服务和联网目的地;本站的核验不会授予任何运行权限。
用户讨论
还没有已核实的点评。