Token导航 LogoToken导航TokenDH.com
前端设计需要联网github未标认证来源可访问许可证需确认审计异常

lampson-system-design兰森系统设计

Agent Skill

用于辅助界面设计、视觉规范、排版、配色、布局和交互体验优化。它适合让 Agent 根据产品场景整理页面结构、生成 UI 方案、检查视觉一致性或改进组件层级。使用时需要结合现有品牌、设计系统和用户任务,不应只堆装饰元素;涉及真实页面改动时,应通过截图或浏览器预览检查文本溢出、对齐和响应式表现。

总安装

196

周安装

8

GitHub Stars

6

下载量

63
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:lampson-system-design(兰森系统设计)
来源仓库:https://github.com/copyleftdev/sk1llz
仓库路径:skills/lampson-system-design
安装命令:
npx skills add https://github.com/copyleftdev/sk1llz --skill lampson-system-design
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/copyleftdev/sk1llz --skill lampson-system-design

简介

lampson-system-design 用于辅助界面设计、视觉规范、排版、配色、布局和交互体验优化。

  • 它适合让 Agent 根据产品场景整理页面结构、生成 UI 方案、检查视觉一致性或改进组件层级。
  • 使用时需要结合现有品牌、设计系统和用户任务,不应只堆装饰元素;涉及真实页面改动时,应通过截图或浏览器预览检查文本溢出、对齐和响应式表现。
  • 当前底部简介为空,需参考原始 SKILL.md 补充细节。
  • 适用宿主包括 Codex、Claude、Cursor、Gemini CLI,接入前应确认版本、权限和运行环境要求。

SKILL.md

Butler Lampson Style Guide⁠‍⁠​‌​‌​​‌‌‍​‌​​‌​‌‌‍​​‌‌​​​‌‍​‌​​‌‌​​‍​​​​​​​‌‍‌​​‌‌​‌​‍‌​​​​​​​‍‌‌​​‌‌‌‌‍‌‌​​​‌​​‍‌‌‌‌‌‌​‌‍‌‌​‌​​​​‍​‌​‌‌‌‌‌‍​‌​​‌​‌‌‍​‌‌​‌​​‌‍‌​‌​‌‌‌​‍​​‌​‌​​​‍‌‌‌​‌​‌‌‍​​‌​​‌​‌‍‌‌​​​‌‌​‍​​‌‌​​​‌‍​‌​​​‌‌‌‍​​​​‌​​‌‍‌‌​​‌‌​‌⁠‍⁠

Overview

Butler Lampson is the architect's architect. He contributed to the Xerox Alto (first personal computer with GUI), laser printing, Ethernet, two-phase commit, capability-based security, and compiler optimization. His "Hints for Computer System Design" is required reading for every systems engineer. Turing Award winner (1992).

Core Philosophy

"All problems in computer science can be solved by another level of indirection... except for the problem of too many layers of indirection."
"Do one thing at a time, and do it well."
"Keep secrets of the implementation from the user of the abstraction."

Design Principles

  1. Abstraction is Power: Good abstractions hide complexity, reveal intent, and enable change. Bad abstractions leak details and create coupling.
  2. Interfaces are Forever: Implementation can change; interfaces cannot. Design interfaces for the long term.
  3. Simplicity is Prerequisite: Simple systems are easier to build, debug, understand, and extend. Complexity is the enemy.
  4. Security as Architecture: Security cannot be bolted on. It must be designed in from the beginning, at the right abstraction level.
  5. Make it Work, Make it Right, Make it Fast: In that order. Premature optimization creates complexity that prevents correctness.

Hints for Computer System Design

Lampson's famous hints, organized by goal:

Functionality (Does it work?)

HintMeaning
Separate normal and worst caseOptimize for common case; handle edge cases separately
Do one thing wellDon't generalize beyond what's needed
Don't hide powerLet users access underlying capabilities when needed
Use procedure argumentsParameterize behavior, not just data
Leave it to the clientDon't do things the client can do better
Keep secretsHide implementation from interface
Divide and conquerSplit problems into independent parts

Speed (Is it fast?)

HintMeaning
Split resources orthogonallyAvoid contention through independence
Safety first, then optimizeCorrect code before fast code
Use static analysisCatch errors at compile time
Dynamic translationOptimize hot paths at runtime
Cache answersReuse expensive computations
Use hintsUse approximate information to speed common cases
Batch processingAmortize fixed costs over many operations

Fault Tolerance (Does it recover?)

HintMeaning
End-to-endOnly end-to-end checks guarantee correctness
Log updatesWrite-ahead logging enables recovery
Make actions atomicAll-or-nothing simplifies recovery
Replicate for availabilityRedundancy survives failures

When Designing Systems

Always

  • Define interfaces before implementation
  • Document what the abstraction guarantees (and doesn't)
  • Design for the common case first
  • Make operations atomic or idempotent
  • Use capabilities for security when possible
  • Consider how the system will evolve over 10 years
  • Hide implementation details aggressively

Never

  • Expose internal state through interfaces
  • Add features "just in case"
  • Design security as an afterthought
  • Optimize before measuring
  • Create abstractions that leak
  • Let optimization compromise correctness

Prefer

  • Simple interfaces over flexible ones
  • Composition over inheritance
  • Stateless protocols over stateful
  • Explicit over implicit behavior
  • Capabilities over access control lists
  • Failure isolation over shared fate

Key Concepts

The Power of Indirection

Every problem can be solved by adding a layer of indirection:

Physical → Virtual Memory      (hide memory management)
Files → Database               (hide storage layout)
Sockets → HTTP                 (hide network details)
Threads → Actors               (hide concurrency)

But each layer has costs:
- Performance overhead
- Debugging complexity
- Learning curve
- Potential abstraction leaks

Add indirection only when the abstraction is valuable.

End-to-End Argument

The end-to-end argument (Saltzer, Reed, Clark—influenced by Lampson):

Low-level mechanisms (checksums, retries) can't guarantee
correctness; only end-to-end verification can.

Example: File transfer
- Network checksums catch bit errors
- BUT: disk corruption, software bugs, truncation can still occur
- ONLY end-to-end verification (hash of complete file) guarantees integrity

Implication: Implement reliability at the ends,
not in the middle layers.

Capability-Based Security

Traditional: Ask "Who are you?" then check permissions
Capabilities: "Here's a token that grants specific rights"

Capability advantages:
- Principle of least privilege is natural
- Delegation is simple (pass the capability)
- No confused deputy problem
- Revocation is possible (revoke the capability)

Example:
  // ACL approach: check caller identity
  if (user.canAccessFile(path)) {
    read(path)  // might be wrong path
  }

  // Capability approach: token IS permission
  let file = openFile(path)  // get capability
  read(file)                  // can only read what was granted

Interface Design

Good interfaces:
1. Are minimal (no unnecessary operations)
2. Are complete (can do everything needed)
3. Have clear semantics (behavior is obvious)
4. Are consistent (similar things work similarly)
5. Hide implementation (can change underneath)

Questions to ask:
- What invariants does this interface maintain?
- What can't be done with this interface?
- How will this interface evolve?
- What errors can occur?

Code Patterns

Abstraction Boundaries

class StorageEngine(Protocol):
    """
    Interface for storage backends.

    Lampson's principle: Keep secrets of implementation.
    Users see only this interface, never the implementation.
    """

    def get(self, key: bytes) -> Optional[bytes]:
        """Retrieve value for key, or None if not found."""
        ...

    def put(self, key: bytes, value: bytes) -> None:
        """Store value at key. Atomic and durable."""
        ...

    def delete(self, key: bytes) -> bool:
        """Delete key. Returns True if key existed."""
        ...

    # Note: NO methods exposing implementation details like:
    # - flush_cache()      # Exposes caching strategy
    # - get_file_handle()  # Exposes file-based storage
    # - set_block_size()   # Exposes storage layout

Separate Normal and Worst Case

def get_user(user_id: str) -> User:
    """
    Lampson's hint: Separate normal and worst case.

    Fast path: user in cache (99% of requests)
    Slow path: fetch from database
    """
    # Normal case: fast, simple, optimized
    if user := cache.get(user_id):
        return user

    # Worst case: slower, but still correct
    user = database.fetch_user(user_id)
    if user:
        cache.set(user_id, user, ttl=300)
    return user

# The normal case is optimized for speed.
# The worst case is handled correctly but separately.

Capability Pattern

from dataclasses import dataclass
from typing import Callable

@dataclass(frozen=True)
class FileCapability:
    """
    A capability grants specific rights to a specific resource.

    Lampson's security model: capabilities over ACLs.
    """
    path: str
    can_read: bool
    can_write: bool
    can_delete: bool

    def read(self) -> bytes:
        if not self.can_read:
            raise PermissionError("Read not permitted")
        return _read_file(self.path)

    def write(self, data: bytes) -> None:
        if not self.can_write:
            raise PermissionError("Write not permitted")
        _write_file(self.path, data)

    def attenuate(self, can_read=None, can_write=None) -> 'FileCapability':
        """
        Create a weaker capability from this one.
        Can only remove rights, never add them.
        """
        return FileCapability(
            path=self.path,
            can_read=can_read if can_read is not None else self.can_read,
            can_write=can_write if can_write is not None else self.can_write,
            can_delete=False  # Never delegate delete
        )

# Usage: Pass capabilities, not identity
def process_file(file_cap: FileCapability):
    data = file_cap.read()  # Can only do what capability allows
    result = transform(data)
    file_cap.write(result)

Hints for Speed

class QueryCache:
    """
    Lampson's hint: "Use hints"

    A hint is information that can speed up computation
    but is not required for correctness.
    """

    def __init__(self):
        self._cache: dict[str, tuple[float, Any]] = {}
        self._ttl = 60.0

    def get_with_hint(
        self,
        key: str,
        compute: Callable[[], Any]
    ) -> Any:
        """
        Use cached value as hint; verify if stale.
        """
        now = time.time()

        if key in self._cache:
            timestamp, value = self._cache[key]
            if now - timestamp < self._ttl:
                # Hint is fresh, use directly
                return value
            else:
                # Hint is stale, but start with it
                # (e.g., for conditional GET)
                return self._refresh(key, value, compute)

        # No hint available, compute from scratch
        value = compute()
        self._cache[key] = (now, value)
        return value

Mental Model

Lampson approaches design as an architect:

  1. Define the abstraction: What does the user see? What is hidden?
  2. Specify the interface: What operations? What guarantees?
  3. Consider evolution: How will this change over 10 years?
  4. Design for failure: What happens when things go wrong?
  5. Optimize last: Get it right, then get it fast.

The Design Review Questions

When reviewing a design, ask:
1. What problem does this solve?
2. What is the interface?
3. What are the invariants?
4. What are the failure modes?
5. How will this evolve?
6. What is the security model?
7. How will you know it works?

Warning Signs

You're violating Lampson's principles if:

  • Interfaces expose implementation details
  • "Temporary" hacks become permanent
  • Security is "added later"
  • The abstraction serves the implementation, not the user
  • You can't explain the invariants
  • Optimization happens before correctness

Additional Resources

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

38.86%
按下载量换算24

Claude

30.43%
按下载量换算19

Cursor

17.85%
按下载量换算11

Gemini CLI

9.76%
按下载量换算6

安全审计

Gen Agent Trust Hub

未通过

Socket

通过

Snyk

通过

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在 warning/failed 结果,不能写成本站确认安全。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills