Token导航 LogoToken导航TokenDH.com
研究检索敏感数据github未标认证来源可访问许可证需确认审计异常

thinking-occams-razor思考奥卡姆斯剃刀

Agent Skill

thinking-occams-razor 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

494

周安装

21

GitHub Stars

46

下载量

173
CodexClaudeCursorGemini CLI

安装说明

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

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

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

请帮我安装这个 Agent Skill:thinking-occams-razor(思考奥卡姆斯剃刀)
来源仓库:https://github.com/tjboudreaux/cc-thinking-skills
仓库路径:skills/thinking-occams-razor
安装命令:
npx skills add https://github.com/tjboudreaux/cc-thinking-skills --skill thinking-occams-razor
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

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

skills.shnpx skills
npx skills add https://github.com/tjboudreaux/cc-thinking-skills --skill thinking-occams-razor

简介

思考奥卡姆斯剃刀用于查找、检索和筛选相关信息,优先选择假设最少的解释。

  • 适合科学推理、故障诊断与简化系统设计等追求简洁性的场景。
  • 当多个方案并存时,自动比较复杂度并给出简约度评分。
  • 安装命令:npx skills add https://github.com/tjboudreaux/cc-thinking-skills --skill thinking-occams-razor
  • 避免机械套用,需在充分证据基础上结合领域知识综合判断。

SKILL.md

Occam's Razor (Parsimony Principle)

Overview

Occam's Razor, attributed to 14th-century philosopher William of Ockham, states: "Entities should not be multiplied beyond necessity" (entia non sunt multiplicanda praeter necessitatem). When multiple explanations fit the evidence equally well, prefer the simplest one—the one with the fewest assumptions.

Core Principle: Among competing hypotheses that explain the data equally well, select the one with the fewest assumptions.

Einstein's Corollary: "Everything should be made as simple as possible, but no simpler."

When to Use

  • Debugging: Multiple hypotheses could explain a bug
  • Architecture: Choosing between design approaches
  • Root cause analysis: Several causes seem plausible
  • Code review: Evaluating implementation complexity
  • Technical decisions: Selecting between tools or patterns
  • Incident response: Narrowing down failure causes

Decision flow:

Multiple explanations exist? → yes → Do they explain the evidence equally? → yes → APPLY OCCAM'S RAZOR
                                                                          ↘ no → Prefer better explanation
                           ↘ no → Use available explanation

The Process

Step 1: Enumerate Competing Hypotheses

List all plausible explanations for the observed behavior:

Bug: Users intermittently can't log in

Hypotheses:
A. Session token expiration edge case
B. Race condition in auth service
C. Database connection pool exhaustion
D. Cosmic rays flipping bits in memory
E. Complex interaction between CDN cache, load balancer, and session service

Step 2: Count the Assumptions

For each hypothesis, list required assumptions:

HypothesisAssumptions Required
A. Token expiration1. Token validation has edge case
B. Race condition1. Concurrent requests possible, 2. Shared mutable state exists
C. DB pool exhaustion1. Pool is undersized, 2. Connections are leaking
D. Cosmic rays1. Hardware failure, 2. No ECC memory, 3. Perfect timing
E. Complex interaction1. CDN caches auth, 2. LB sticky sessions fail, 3. Session sync delayed

Step 3: Verify Explanatory Power

Ensure simpler hypotheses actually explain the evidence:

Evidence: Failures correlate with high traffic periods

Hypothesis A (token edge case):
  - Doesn't explain traffic correlation ❌

Hypothesis C (DB pool exhaustion):
  - Explains traffic correlation ✓
  - Fewer assumptions than E
  - PREFERRED by Occam's Razor ✓

Step 4: Test Simplest First

Investigate hypotheses in order of simplicity:

1. Check DB connection pool metrics (simplest)
2. Review token validation code (simple)
3. Analyze race condition potential (moderate)
4. Instrument complex service interactions (complex)
5. Check for hardware issues (last resort)

Step 5: Escalate Complexity Only When Needed

If simple explanations are ruled out, move to complex ones with new evidence.

Complexity Assessment Framework

Counting Complexity

FactorComplexity Cost
Each independent assumption+1
Each component involved+1
Each external dependency+2
Timing-dependent behavior+2
Requires rare conditions+3
"Perfect storm" scenarios+5

Example Comparison

Solution A: Add caching layer
- New component (Redis): +1
- Cache invalidation logic: +1
- New failure mode: +1
Total: 3

Solution B: Optimize existing query
- Query modification: +1
Total: 1

→ Prefer Solution B unless evidence shows it's insufficient

When Simplicity Yields to Complexity

Occam's Razor is a heuristic, not an absolute law. Prefer complexity when:

1. Evidence Demands It

Simple hypothesis: Single bug in auth service
Evidence: Failures only occur when Feature X AND Feature Y are both enabled

→ Complex interaction hypothesis now has supporting evidence
→ Accept complexity that explains the evidence

2. Domain Complexity Is Irreducible

Problem: Distributed consensus
Simple solution: Single leader (but single point of failure)
Reality: Distributed systems require complex solutions (Raft, Paxos)

→ Some domains have irreducible complexity
→ Don't oversimplify beyond what's correct

3. Future Requirements Are Known

Current need: Store user preferences
Simple: JSON file
Future need: Multi-device sync, conflict resolution

→ Database is more complex but necessary
→ Known future needs justify upfront complexity

4. Simplicity Introduces Technical Debt

Simple now: Copy-paste code in 5 places
Simpler long-term: Extract shared function

→ Local simplicity vs. systemic simplicity
→ Prefer systemic simplicity

Application Examples

Debugging Example

Bug: API returns 500 errors sporadically

Hypothesis A: Null pointer in rare code path
  Assumptions: 1

Hypothesis B: Memory pressure causes GC pauses that timeout requests
  Assumptions: 3 (memory issues + GC behavior + timeout settings)

Hypothesis C: Race condition between cache refresh and request handling
  Assumptions: 4 (concurrent access + shared state + timing + cache implementation)

Occam's Razor: Start with Hypothesis A
Action: Search logs for null pointer exceptions
Result: Found! NPE in user profile edge case

Architecture Example

Requirement: Service needs to call another service

Option A: Direct HTTP call
  Components: 1 (HTTP client)
  Assumptions: Target available, network reliable

Option B: Message queue with retry
  Components: 3 (queue, producer, consumer)
  Assumptions: Need async, need retry, need decoupling

Option C: Service mesh with circuit breaker, retry, timeout
  Components: 5+ (sidecar, control plane, observability)
  Assumptions: At scale, need observability, need traffic management

Occam's Razor: Start with Option A
Escalate to B/C only when evidence shows need for resilience

Code Implementation Example

# Complex (unnecessary assumptions)
def is_even(n):
    binary = bin(n)
    last_bit = binary[-1]
    return last_bit == '0'

# Simple (minimal assumptions)
def is_even(n):
    return n % 2 == 0

# Occam's Razor: Prefer the modulo approach
# Fewer concepts, fewer operations, same result

Root Cause Analysis Example

Symptom: Deployment failed

Complex hypothesis:
"The CI server's Docker daemon ran out of disk space because
a cron job that cleans old images was disabled when we upgraded
the server OS last month, and nobody noticed because the monitoring
alert was routed to a deprecated Slack channel."

Simple hypothesis:
"The build script has a typo in the new environment variable name."

Occam's Razor: Check the build script first
Result: Typo found. DATABSE_URL instead of DATABASE_URL

Common Anti-Patterns

Anti-PatternDescriptionCorrection
Rube GoldbergComplex solution to simple problemAsk "what's the minimum needed?"
Premature abstractionAbstracting for hypothetical casesWait for evidence of need
Resume-driven developmentUsing complex tech to learn itMatch tool to problem
Cargo cultingCopying complex patterns blindlyUnderstand why patterns exist
Conspiracy thinkingAssuming coordinated complex causesCheck simple causes first

Verification Checklist

  • Listed all plausible hypotheses/solutions
  • Counted assumptions required for each
  • Verified simpler options have equal explanatory power
  • Investigated in order of simplicity
  • Escalated to complexity only with evidence
  • Confirmed solution is "as simple as possible, but no simpler"
  • Checked for domain-irreducible complexity
  • Considered systemic vs. local simplicity

Combining with Other Models

  • First Principles: Reduce to fundamentals, then apply Occam's to solutions
  • Inversion: "What would make this unnecessarily complex?"
  • Debiasing: Watch for complexity bias (assuming complex = sophisticated)
  • Pre-Mortem: Would a simpler approach have fewer failure modes?

Key Questions

  • "What's the simplest explanation that fits all the evidence?"
  • "How many things have to be true for this hypothesis to hold?"
  • "Am I adding complexity to handle cases I haven't seen?"
  • "Would a junior engineer understand this solution?"
  • "If I explained this to a non-technical person, how many steps would it take?"
  • "What's the minimum change that could fix this?"
  • "Am I solving the problem I have, or a problem I might have?"

Ockham's Warning

"Plurality must never be posited without necessity."

The simplest solution isn't always correct, but it should always be tested first. Complexity should be earned through evidence, not assumed through speculation. When you find yourself building elaborate explanations, step back and ask: "What's the minimum hypothesis that explains what I'm seeing?"

适合场景

01

用户想查找某类 Agent Skill 时

02

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

03

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

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

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

能力 4

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

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

平台分布

Codex

35.62%
按下载量换算62

Claude

29.23%
按下载量换算51

Cursor

18.12%
按下载量换算31

Gemini CLI

9.32%
按下载量换算16

安全审计

Gen Agent Trust Hub

通过

Socket

未通过

Snyk

通过

权限和风险

敏感数据

该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

安装前确认

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

来源信息

继续浏览同类 Skills