当前位置: 首页 > Skill >

Decision Frameworks

Decision Frameworks

Decision Frameworks

针对常见工程选择(如库选型、架构设计、自建与采购权衡、优先级排序、可逆性分析及ADR)的结构化决策模式。适用于工具、架构或方案的抉择,以及技术决策文档的记录。

1.0.0 2026.11.25 491
获取Skill文件查看使用说明
作 者:江舟 许可证: 更新时间:2026.11.25
本文目录展开

Decision Frameworks (Meta-Skill)

Structured approaches for making engineering decisions with confidence and traceability.

Installation

OpenClaw / Moltbot / Clawbot

npx clawhub@latest install decision-frameworks

When to Use

  • Choosing between libraries, frameworks, or tools
  • Facing a build-vs-buy decision
  • Selecting an architecture pattern (monolith vs microservices, SQL vs NoSQL, etc.)
  • Multiple valid options exist and the team needs alignment
  • Prioritizing a backlog or technical roadmap
  • Documenting a significant technical decision for future reference

Decision Matrix Template

Use a weighted scoring matrix when comparing 3+ options across measurable criteria.

Criteria Weight Option A Option B Option C
Performance 5 4 (20) 3 (15) 5 (25)
Developer Experience 4 5 (20) 4 (16) 3 (12)
Community Support 3 5 (15) 3 (9) 2 (6)
Learning Curve 3 3 (9) 4 (12) 2 (6)
Cost 2 5 (10) 3 (6) 4 (8)
Total 74 58 57

How to use:

  1. List criteria relevant to the decision
  2. Assign weights (1-5) based on project priorities
  3. Score each option per criterion (1-5)
  4. Multiply score x weight, sum per option
  5. Highest total wins — but sanity-check the result against gut feel

Build vs Buy Framework

Follow this decision tree:

Is it a core differentiator for your product?
├── YES → Build it (own the competitive advantage)
└── NO
    ├── Does a mature, well-maintained solution exist?
    │   ├── YES → Buy / adopt it
    │   └── NO → Build, but keep it minimal
    └── Is the integration cost higher than building?
        ├── YES → Build
        └── NO → Buy / adopt

Factor comparison:

Factor Build Buy / Adopt
Maintenance cost Ongoing — your team owns it Vendor/community maintains it
Customization Unlimited flexibility Limited to extension points
Time to market Slower — development required Faster — ready-made
Team expertise Must have or acquire skills Abstracted away
Long-term cost Scales with internal capacity License/subscription fees
Vendor lock-in risk None Medium to high
Security control Full audit capability Dependent on vendor transparency

Library / Framework Selection

Evaluate candidate libraries against these criteria before adopting:

Criterion What to Check Red Flag
Maintenance activity Commits in last 90 days, open issues trend No commits in 6+ months
Community size GitHub stars, npm weekly downloads, Discord/forum < 1k weekly downloads for critical lib
Bundle size Bundlephobia, tree-shaking support > 50 KB gzipped for a utility lib
TypeScript support Built-in types vs DefinitelyTyped, type quality No types or outdated @types
Breaking change history Changelog, semver adherence, migration guides Frequent majors without guides
License OSI-approved, compatible with your project AGPL in a SaaS product, no license
Security audit Snyk/Socket score, CVE history, dependency depth Known unpatched CVEs
Documentation quality Getting started guide, API reference, examples README-only, no examples

Quick heuristic: If you cannot replace the library within one sprint, treat the decision as a one-way door (see Reversibility Check below).

Architecture Decision Framework

Use these tradeoff tables when choosing between architectural approaches.

Monolith vs Microservices

Factor Monolith Microservices
Complexity Low at start, grows over time High from day one
Deployment Single artifact Independent per service
Team scaling Harder beyond 10-15 engineers Enables autonomous teams
Data consistency ACID transactions Eventual consistency, sagas
Debugging Single process, easy tracing Distributed tracing required
Best when Early-stage, small team, MVP Proven domain boundaries, scale needs

SQL vs NoSQL

Factor SQL (Relational) NoSQL (Document/Key-Value)
Schema Strict, enforced Flexible, schema-on-read
Relationships Native joins, foreign keys Denormalized, application-level joins
Scaling Vertical (read replicas help) Horizontal by design
Consistency Strong (ACID) Tunable (eventual to strong)
Query flexibility Ad-hoc queries, aggregations Limited to access patterns
Best when Complex relations, reporting High write volume, flexible schema

REST vs GraphQL

Factor REST GraphQL
Simplicity Simple, well-understood Schema definition required
Over/under-fetching Common — multiple endpoints Clients request exact fields
Caching HTTP caching built-in Requires custom caching layer
Tooling Mature ecosystem Growing — Apollo, Relay, urql
Versioning URL or header versioning Schema evolution, deprecation
Best when CRUD APIs, public APIs Complex UIs, mobile + web clients

SSR vs CSR vs SSG

Factor SSR CSR SSG
Initial load Fast (HTML from server) Slow (JS bundle parse) Fastest (pre-built HTML)
SEO Excellent Poor without hydration Excellent
Best when Personalized pages Dashboards, SPAs Blogs, docs, marketing

Monorepo vs Polyrepo

Factor Monorepo Polyrepo
Code sharing Trivial — same repo Requires published packages
CI/CD complexity Needs smart filtering (Turborepo) Simple per-repo pipelines
Best when Shared libs, aligned releases Independent teams, different stacks

Priority Matrices — RICE Scoring

Score and rank features/tasks:

RICE Score = (Reach x Impact x Confidence) / Effort
Factor Scale
Reach Number of users/events affected per quarter
Impact 3 = massive, 2 = high, 1 = medium, 0.5 = low, 0.25 = minimal
Confidence 100% = high, 80% = medium, 50% = low
Effort Person-weeks (or person-sprints)

MoSCoW Method

Category Meaning Budget Target
Must Non-negotiable for this release ~60% of effort
Should Important but not critical ~20% of effort
Could Desirable if time permits ~15% of effort
Won't Explicitly out of scope (this time) ~5% (planning)

Reversibility Check

Classify every significant decision as a one-way or two-way door.

Aspect One-Way Door (Type 1) Two-Way Door (Type 2)
Definition Irreversible or very costly to undo Easily reversed with low cost
Examples Database engine migration, public API contract, language rewrite UI framework for internal tool, feature flag experiment, library swap behind interface
How to identify Would reverting require > 1 sprint of rework? Data migration? Customer communication? Can you revert with a config change, flag toggle, or single PR?
Approach Invest in analysis, prototype, get stakeholder sign-off Decide fast, ship, measure, iterate
Time to decide Days to weeks — thorough evaluation Hours — bias toward action

Rule of thumb: Wrap risky choices behind interfaces/abstractions. This converts many one-way doors into two-way doors by isolating the implementation from consumers.

ADR Template

Document significant decisions using a lightweight Architecture Decision Record.

# ADR-NNNN: [Short Title]

## Status
[Proposed | Accepted | Deprecated | Superseded by ADR-XXXX]

## Context
What is the problem or situation that motivates this decision?
Include constraints, requirements, and forces at play.

## Decision
What is the change being proposed or adopted?
State the decision clearly and concisely.

## Consequences

### Positive
- [Benefit 1]
- [Benefit 2]

### Negative
- [Tradeoff 1]
- [Tradeoff 2]

### Risks
- [Risk and mitigation]

Store in docs/adr/ or decisions/. Number sequentially. Never delete — mark superseded. Review during onboarding and quarterly audits.

Anti-Patterns

Anti-Pattern Description Counter
Analysis Paralysis Endless evaluation, no decision made Set a decision deadline; use the matrix
HiPPO Highest Paid Person's Opinion overrides data Require data or a scored matrix for all options
Sunk Cost Fallacy Continuing because of past investment, not future value Evaluate options as if starting fresh today
Bandwagon Effect Choosing because "everyone uses it" Score against your actual criteria
Premature Optimization Optimizing before measuring or validating need Profile first; optimize only proven bottlenecks
Resume-Driven Development Picking tech to pad a resume, not to solve the problem Align choices with team skills and project goals
Not Invented Here Rejecting external solutions out of pride Run the Build vs Buy framework honestly

NEVER Do

  1. NEVER skip writing down the decision — undocumented decisions get relitigated endlessly
  2. NEVER decide by committee without a single owner — assign a DRI (Directly Responsible Individual)
  3. NEVER treat all decisions as equal weight — classify by reversibility and impact first
  4. NEVER ignore second-order effects — ask "and then what?" at least twice
  5. NEVER lock in without an exit plan — define how you would migrate away before committing
  6. NEVER conflate familiarity with superiority — evaluate on criteria, not comfort
  7. NEVER defer a one-way door decision indefinitely — the cost of delay often exceeds the cost of a wrong choice

推荐文章

更多
PHP时间戳与日期字符串相互转换方法详解

本文介绍PHP中时间数值(Unix时间戳)与日期字符串之间的相互转换方法。通过strtotime和date函数,实现将当前时间、指定日期转换为时间戳,以及将时间戳格式化为可读的日期时间字符串,并提供相关在线计算工具推荐。

2025.11.30 1,034
PHP日期转时间戳时区偏差怎么解决

在 PHP 中将日期字符串转换为时间戳时,若未显式指定时区,默认使用脚本配置的 date.timezone 或系统时区。当服务器时区与业务逻辑预期(如 UTC )不一致时,会产生偏差。解决核心是确保输入字符串携带明确时区信息,或在转换前统一设置时区上下文。

2026.10.24 1,031
PHP跨域配置:怎么安全地允许指定域名而非使用通配符

在 PHP 中安全地允许指定域名跨域,核心是解析请求头中的 Origin ,验证其是否在白名单内,然后动态设置 Access-Control-Allow-Origin 响应头。不要使用通配符 * ,也不要硬编码单一域名。

2025.03.29 1,019
JavaScript中利用replace结合正则实现replaceAll效果

JavaScript原生仅支持replace()进行单次或全局替换,缺乏类似Java的replaceAll()便捷方法。本文总结四种在JS中实现全量替换的方案:使用带g标志的正则、带gm标志的正则、扩展String原型以及split后join。通过对比代码示例,展示各方法的实现细节与适用场景,帮助开发者根据需求选择最优解。

2025.04.29 1,017
OpenAI的Jalapeno芯片未落地,教你分辨300兆瓦算力消息

OpenAI计划在SB Energy租赁的数据中心部署约300兆瓦自研Jalapeno推理芯片,但目前双方仍处于洽谈阶段,交易细节与上线时间表均未公布。本文带你按报道原文核实项目所处阶段,厘清芯片发布、电力功率与实际推理算力的边界,并将融资意向与签约、开工、投运节点分开追踪,避免误将规划容量计入现有算力。

2026.12.02 1,014
PHP实现基础文件上传:HTML表单与$_FILES处理流程

在 HTML 表单中设置 enctype="multipart/form-data" ,并在 PHP 后端通过 $_FILES 数组接收文件,调用 move_uploaded_file() 将临时文件移动到目标目录即可完成上传。

2026.09.07 1,014
Skill 文件
  • SKILL.md
    • Decision Frameworks (Meta-Skill)
    • Installation
      • OpenClaw / Moltbot / Clawbot
    • When to Use
    • Decision Matrix Template
    • Build vs Buy Framework
    • Library / Framework Selection
    • Architecture Decision Framework
      • Monolith vs Microservices
      • SQL vs NoSQL
      • REST vs GraphQL
      • SSR vs CSR vs SSG
      • Monorepo vs Polyrepo
    • Priority Matrices — RICE Scoring
      • MoSCoW Method
    • Reversibility Check
    • ADR Template
    • Anti-Patterns
    • NEVER Do
  • 项目或源文件

相关 Skill

更多
Decision Maker Decision Maker 决策分析工具。利弊对比、加权决策矩阵、盲选消除偏见、决策框架推荐、风险评估。Decision maker with pros-cons analysis, weighted matrix, blind choice, decision frameworks.
decision-expert decision-expert A decision support skill for OpenClaw that helps users analyze options, weigh trade-offs, and apply decision frameworks
service-qa-coach service-qa-coach Review support quality for chat, email, phone, social DM, or marketplace service teams. Use when a team needs a QA scorecard, failure-mode analysis, coaching plan, calibration checklist, or service-improvement brief without live ticketing, CRM, or contact-center system access.
高中数学作业批改助手 高中数学作业批改助手 >图片识别 直接读取学生手写作答照片,识别公式、符号、步骤 🧮 自动推导 根据题目自动生成参考答案和评分细则,无需教师预设 📊 逐步给分 每个关键步骤独立评分,体现过程分 📝 结构化报告 输出含识别内容、参考答案、逐步评分、改进建议的完整报告 🗂 批量批改 支持一次性批改多道题,最终汇总得分表
Vibration Analysis Vibration Analysis 分析来自CMS趋势、RMS/峰值、频谱及SCADA报警的风机传动链(主轴、齿轮箱、发电机)振动数据。