agentleFS
smileynetsmileynet/code-spice/skills/software-tradeoffs/SKILL.md

software-tradeoffs

Skill0 starsChanged 9 months agoMITView on GitHub

Software tradeoff analysis, decision frameworks, and common tradeoff patterns. Use when evaluating design alternatives, choosing between competing approaches, analyzing costs vs. benefits of technical decisions, or when a decision involves tension between two desirable properties. Covers duplication vs. coupling, flexibility vs. complexity, performance optimization, API design, dependency management, error handling strategies, and distributed system tradeoffs.

The file

Files
SKILL.md

Software Tradeoffs

The Tradeoff Analysis Framework

  1. Identify the tension — What two (or more) desirable properties are in conflict?
  2. List alternatives — At least two concrete approaches
  3. Evaluate in context — Pros and cons depend on your specific situation (team size, SLAs, traffic, timeline)
  4. Choose and accept — Pick one, accepting its cons alongside its pros
  5. Document the decision — Future you (and teammates) need to know why

The cardinal rule: Context changes everything. A pattern that's optimal in one situation may be harmful in another. Validate assumptions with measurement, not intuition.

The Tradeoff Decision Matrix

TradeoffOption AOption BChoose A WhenChoose B When
DRY vs. CouplingExtract shared codeDuplicate codeLogic is truly identical and owned by one teamServices evolve independently or teams need autonomy
Flexibility vs. ComplexityAdd extension pointsKeep it simpleMultiple consumers with different needsOne consumer or needs are well-known
Optimize vs. ShipOptimize hot pathShip and measureProfiling shows a bottleneck on a hot pathNo measured performance problem exists
Abstract vs. DirectWrap dependenciesUse directlyDependency may change or needs testing isolationDependency is stable and abstraction adds no value
Checked vs. Unchecked errorsForce caller to handleLet errors propagateCaller can meaningfully recoverError is unrecoverable or caller can't act on it
Library vs. CustomUse third-party libraryBuild your ownProblem is well-solved and library is maintainedCore differentiator or library is a poor fit
Monolith vs. ServicesSingle deployableDistributed servicesSmall team, early product, simple scaling needsIndependent team scaling, polyglot requirements
Consistency vs. AvailabilityStrong consistencyEventual consistencyFinancial transactions, inventory countsSocial feeds, analytics, caching layers

Tradeoff Analysis Checklist

  • Named the tension: What two desirable properties are in conflict?
  • Listed alternatives: At least two concrete approaches identified
  • Considered context: Team size, traffic, SLAs, timeline factored in
  • Evaluated reversibility: How hard is it to change this decision later?
  • Identified the hot path: If performance-related, measured with data
  • Checked assumptions: Are you optimizing based on intuition or measurement?
  • Considered second-order effects: Does the choice affect other teams, APIs, or systems?
  • Documented the decision: Written down why, not just what

"Which tradeoff am I actually making?"

You're tempted to...The real tradeoff is...Ask yourself...
Remove duplicated codeCoupling vs. independenceWill these paths diverge? Do different teams own them?
Add an extension pointFlexibility vs. complexityDo you have >1 consumer? Is the use case concrete?
Optimize a code pathPerformance vs. readabilityIs this on the hot path? Do you have profiling data?
Add a third-party libraryDevelopment speed vs. long-term maintenanceIs this a core differentiator? Is the library well-maintained?
Extract a microserviceTeam autonomy vs. operational complexityIs the monolith actually blocking you?
Use strong consistencyCorrectness vs. availability and latencyWhat's the business cost of stale or incorrect data?
Wrap a dependencyFuture flexibility vs. current complexityHow likely is replacement? How deep is the integration?

"How do I know if I chose wrong?"

SymptomLikely Wrong ChoiceCourse Correction
Changing one service breaks anotherOver-extracted shared code (too DRY)Duplicate and decouple
Simple features take weeksOver-engineered flexibilityRemove unused extension points
Performance issues in productionDidn't optimize the hot pathProfile, identify bottleneck, targeted fix
Library upgrade breaks everythingToo-deep dependency without wrappingExtract interface, wrap the dependency
Teams blocked waiting on each otherMonolith coordination overheadExtract contested components into services
Debugging takes daysToo many microservices for the team sizeConsolidate related services

Common Mistakes

  • Applying rules without context — DRY doesn't apply when duplication is coincidental. "Premature optimization is evil" doesn't apply when you have SLA data and profiling.
  • Optimizing what you haven't measured — A synchronized singleton is 120x slower than double-checked locking in multithreaded benchmarks, but if accessed once at startup, the difference is meaningless.
  • Ignoring coordination cost — Amdahl's law applies to teams. Shared libraries, databases, and APIs introduce synchronization points. Sometimes duplication is the price of parallel progress.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.