Preserving Productive Tensions by aaaaqwq/claude-code-skills
npx skills add https://github.com/aaaaqwq/claude-code-skills --skill 'Preserving Productive Tensions'有些张力并非需要解决的问题,而是值得保留的宝贵信息。当多种方法在不同情境下都确实有效时,强行做出选择会破坏灵活性。
核心原则: 保留那些揭示情境依赖性的张力。仅在必要时才强制解决。
当出现以下情况时,张力是富有成效的:
当出现以下情况时,张力需要解决:
将选择设为可配置项,而非固化在架构中:
class Config:
mode: Literal["optimize_cost", "optimize_latency"]
# 每种模式都有简洁、清晰的实现
使用时机: 两种方法在架构上兼容,切换是运行时决策
将两者作为独立的、清晰的模块维护,共享相同的契约:
# processor/batch.py - 为成本优化
# processor/stream.py - 为延迟优化
# 两者都实现:def process(data) -> Result
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
使用时机: 方法差异显著,但共享相同的接口
在文档/决策记录中明确记录这种张力:
## 未解决的张力:身份验证策略
**选项 A: JWT** - 无状态,易于扩展,但令牌撤销困难
**选项 B: Sessions** - 易于撤销,但需要共享状态
**为何未解决:** 不同的部署需要不同的权衡
**决策推迟至:** 部署配置
**审查触发条件:** 如果 80% 的部署选择其中一个选项
使用时机: 无法在代码中保留两者,但需要记录该选择是经过深思熟虑的
所有这些都意味着:停下来。考虑保留这种张力。
在以下情况下,你应该强制解决:
明确提问: “我应该选择一个,还是将两者都保留为选项?”
当保留张力时,清晰地记录:
## 张力:[名称]
**情境:** [此张力存在的原因]
**选项 A:** [方法]
- 优化目标: [优先级]
- 权衡: [成本]
- 最佳适用情境: [情境]
**选项 B:** [方法]
- 优化目标: [不同的优先级]
- 权衡: [不同的成本]
- 最佳适用情境: [不同的情境]
**保留策略:** [配置化/并行/文档化]
**解决触发条件:** [将强制选择其中一种的条件]
“我们应该优化成本还是延迟?”
“我们应该使用 SSE 还是 WebSockets?”
“我们应该支持离线模式吗?”
每周安装量
0
代码仓库
GitHub 星标数
11
首次出现时间
Jan 1, 1970
安全审计
Some tensions aren't problems to solve - they're valuable information to preserve. When multiple approaches are genuinely valid in different contexts, forcing a choice destroys flexibility.
Core principle: Preserve tensions that reveal context-dependence. Force resolution only when necessary.
A tension is productive when:
A tension needs resolution when:
Make the choice configurable rather than baked into architecture:
class Config:
mode: Literal["optimize_cost", "optimize_latency"]
# Each mode gets clean, simple implementation
When to use: Both approaches are architecturally compatible, switching is runtime decision
Maintain both as separate clean modules with shared contract:
# processor/batch.py - optimizes for cost
# processor/stream.py - optimizes for latency
# Both implement: def process(data) -> Result
When to use: Approaches diverge significantly, but share same interface
Capture the tension explicitly in documentation/decision records:
## Unresolved Tension: Authentication Strategy
**Option A: JWT** - Stateless, scales easily, but token revocation is hard
**Option B: Sessions** - Easy revocation, but requires shared state
**Why unresolved:** Different deployments need different trade-offs
**Decision deferred to:** Deployment configuration
**Review trigger:** If 80% of deployments choose one option
When to use: Can't preserve both in code, but need to document the choice was deliberate
All of these mean: STOP. Consider preserving the tension.
You SHOULD force resolution when:
Implementation cost is prohibitive
Fundamental conflict
Clear technical superiority
One-way door
Simplicity requires choice
Ask explicitly: "Should I pick one, or preserve both as options?"
When preserving tensions, document clearly:
## Tension: [Name]
**Context:** [Why this tension exists]
**Option A:** [Approach]
- Optimizes for: [Priority]
- Trade-off: [Cost]
- Best when: [Context]
**Option B:** [Approach]
- Optimizes for: [Different priority]
- Trade-off: [Different cost]
- Best when: [Different context]
**Preservation strategy:** [Configuration/Parallel/Documented]
**Resolution trigger:** [Conditions that would force choosing one]
"Should we optimize for cost or latency?"
"Should we use SSE or WebSockets?"
"Should we support offline mode?"
Weekly Installs
0
Repository
GitHub Stars
11
First Seen
Jan 1, 1970
Security Audits
React 组合模式指南:Vercel 组件架构最佳实践,提升代码可维护性
103,800 周安装