来源信息
- 仓库
- brycewang-stanford/Auto-Empirical-Research-Skills
- 最近来源活动
- 2026年4月3日 02:07
- 检测到的 SKILL.md 语言
- 英语
- 星标
- 3,291
- 分支
- 432
安装方式
默认使用会先检查来源的 Prompt;你也可以切换为直接命令,或下载本地副本。
检查来源文件
决定是否安装前,请先阅读 SKILL.md,以及 SkillsMP 当前展示的配套文件。
菜单
默认使用会先检查来源的 Prompt;你也可以切换为直接命令,或下载本地副本。
决定是否安装前,请先阅读 SKILL.md,以及 SkillsMP 当前展示的配套文件。
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/brycewang-stanford/Auto-Empirical-Research-Skills --skill distributed-systems-guide命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
Route empirical-research requests through the Auto-Empirical Research Skills catalog when this whole repository is installed as one skill in Codex, CodeBuddy, Claude Code, or another IDE. Use to choose and load the right vendored AERS skill for causal inference, econometrics, replication, data acquisition, manuscript writing, peer review and referee responses, citation checking, de-AIGC editing, or full empirical-paper workflows without reading the entire repository at once.
中英双语学术降 AIGC / bilingual academic de-AIGC skill. Removes AI-generated writing signatures from empirical papers in economics, management, and the social sciences — in both English and Chinese. Covers Turnitin AI, GPTZero, Originality.ai on the English side and 知网 AMLC, 万方, 维普 on the Chinese side. Uses a six-step loop (intake → audit → claim-evidence check → differentiated rewrite → five-dimension self-score → cold-reader recheck) with two pattern libraries (22 English + 17 Chinese patterns), section-by-section strategies for empirical papers, and hard protections that keep every number, coefficient, and citation intact.
Use when a research task needs reproducible Kaggle discovery, metadata inspection, bounded public-data downloads, competition or kernel discovery, model discovery, or an explicitly approved Kaggle write/delete operation through the official CLI.
基于 SOC 职业分类
正在显示 SKILL.md
| name | distributed-systems-guide |
| description | Distributed systems design patterns and analysis for CS research |
| metadata | {"openclaw":{"emoji":"🌐","category":"domains","subcategory":"cs","keywords":["distributed-systems","consensus","replication","fault-tolerance","scalability","cap-theorem"],"source":"wentor"}} |
A skill for researching and designing distributed systems, covering consensus algorithms, replication strategies, consistency models, fault tolerance, and performance analysis. Provides theoretical foundations and practical implementations relevant to systems research.
Strongest
| Linearizability (atomic, real-time ordering)
| Sequential consistency (program order respected)
| Causal consistency (causally related ops ordered)
| PRAM / FIFO consistency (per-process order)
| Eventual consistency (converges if updates stop)
Weakest
The CAP theorem states that during a network partition, a distributed system must choose between consistency and availability:
| System | Partition Behavior | Normal Behavior | Classification |
|---|---|---|---|
| ZooKeeper | Consistent (sacrifice A) | Low latency, consistent | CP / PC/EC |
| Cassandra | Available (sacrifice C) | Low latency, eventual | AP / PA/EL |
| Spanner | Consistent (sacrifice A) | Higher latency, consistent | CP / PC/EC |
| DynamoDB | Configurable per-read | Tunable consistency | AP or CP |
| CockroachDB | Consistent (sacrifice A) | Serializable | CP / PC/EC |
from enum import Enum
from dataclasses import dataclass, field
import random
class NodeState(Enum):
FOLLOWER = "follower"
CANDIDATE = "candidate"
LEADER = "leader"
@dataclass
class LogEntry:
term: int
index: int
command: str
@dataclass
class RaftNode:
"""
Simplified Raft consensus node for educational purposes.
Implements leader election and log replication state machine.
"""
node_id: str
state: NodeState = NodeState.FOLLOWER
current_term: int = 0
voted_for: str = None
log: list = field(default_factory=list)
commit_index: int = 0
last_applied: int = 0
# Leader state
next_index: dict = field(default_factory=dict)
match_index: dict = field(default_factory=dict)
def start_election(self, peers: list[str]) -> dict:
"""Transition to candidate and request votes."""
self.state = NodeState.CANDIDATE
self.current_term +=
.voted_for = .node_id
last_log_index = (.log) - .log -
last_log_term = .log[-].term .log
{
: ,
: .current_term,
: .node_id,
: last_log_index,
: last_log_term,
}
() -> :
term < .current_term:
{: .current_term, : }
term > .current_term:
.current_term = term
.state = NodeState.FOLLOWER
.voted_for =
my_last_term = .log[-].term .log
my_last_index = (.log) - .log -
log_ok = (last_log_term > my_last_term
(last_log_term == my_last_term
last_log_index >= my_last_index))
vote_granted = (
(.voted_for .voted_for == candidate_id)
log_ok
)
vote_granted:
.voted_for = candidate_id
{: .current_term, : vote_granted}
() -> LogEntry:
entry = LogEntry(
term=.current_term,
index=(.log),
command=command,
)
.log.append(entry)
entry
| Algorithm | Fault Model | Tolerance | Rounds | Complexity |
|---|---|---|---|---|
| Paxos | Crash faults | f < n/2 | 2 (normal) | Difficult to implement correctly |
| Raft | Crash faults | f < n/2 | 2 (normal) | Designed for understandability |
| PBFT | Byzantine faults | f < n/3 | 3 | O(n^2) message complexity |
| HotStuff | Byzantine faults | f < n/3 | 3 | O(n) with pipelining |
class ReplicatedStateMachine:
"""
State machine replication with configurable consistency.
Demonstrates read/write quorum intersection for correctness.
"""
def __init__(self, n_replicas: int, read_quorum: int = None,
write_quorum: int = None):
self.n = n_replicas
self.R = read_quorum or (n_replicas // 2 + 1)
self.W = write_quorum or (n_replicas // 2 + 1)
# Quorum intersection guarantees: R + W > N
assert self.R + self.W > self.n, (
f"Quorum intersection violated: R({self.R}) + W({self.W}) "
f"must be > N({self.n})"
)
self.replicas = [{} for _ in range(n_replicas)]
self.version_clock = 0
def write(self, key: str, value: str) -> dict:
"""Write to W replicas."""
self.version_clock += 1
# Select W replicas (in practice, based on availability)
targets = random.sample((.n), .W)
i targets:
.replicas[i][key] = (value, .version_clock)
{
: key,
: .version_clock,
: (targets),
: ,
}
() -> :
targets = random.sample((.n), .R)
responses = []
i targets:
key .replicas[i]:
responses.append(.replicas[i][key])
responses:
{: key, : , : }
latest = (responses, key= x: x[])
{
: key,
: latest[],
: latest[],
: ,
}
class VectorClock:
"""Vector clock for tracking causality in distributed systems."""
def __init__(self, process_id: str, processes: list[str]):
self.pid = process_id
self.clock = {p: 0 for p in processes}
def increment(self):
"""Local event: increment own counter."""
self.clock[self.pid] += 1
def send(self) -> dict:
"""Prepare clock for sending with a message."""
self.increment()
return dict(self.clock)
def receive(self, other_clock: dict):
"""Merge received clock: element-wise max, then increment."""
for p in self.clock:
self.clock[p] = max(self.clock[p], other_clock.get(p, 0))
self.increment()
def happened_before(self, other: dict) -> :
((.clock[p] <= other.get(p, ) p .clock)
(.clock[p] < other.get(p, ) p .clock))
Key metrics for evaluating distributed systems: