28 eval-informed mental models and critical-thinking skills for Claude Code, GitHub Copilot, Codex, Cursor, and other Agent Skills-compatible tools
JavaScript agent-skillsai-toolsanthropicclaudeclaude-codecritical-thinkingdecision-makingfirst-principlesmental-modelsproblem-solvingsystems-thinking
Add 20 new thinking skills and quality improvement scripts
Travis Boudreaux7e606b31d187
diff --git a/.claude/skills/thinking-cynefin/SKILL.md b/.claude/skills/thinking-cynefin/SKILL.mdnew file mode 100644index 0000000..a60d877--- /dev/null+++ b/.claude/skills/thinking-cynefin/SKILL.md@@ -0,0 +1,370 @@+---+name: thinking-cynefin+description: Classify problems by complexity domain (clear, complicated, complex, chaotic) and match approach to domain. Use for choosing methodologies, problem framing, and process design.+---++# Cynefin Framework++## Overview++The Cynefin framework, developed by Dave Snowden, classifies problems into domains based on the relationship between cause and effect. Different domains require fundamentally different approaches. Using the wrong approach for the domain leads to failure—agile doesn't fix truly complex problems, and detailed planning doesn't help in chaos.++**Core Principle:** The nature of the problem determines the nature of the solution. Match your approach to the domain.++## When to Use++- Choosing the right methodology for a project+- Understanding why an approach isn't working+- Designing processes for different problem types+- Deciding how much to plan vs. experiment+- Understanding organizational challenges+- Incident response and crisis management++Decision flow:++```+Facing a problem?+ → What's the relationship between cause and effect?+ → Obvious? → CLEAR DOMAIN+ → Requires analysis? → COMPLICATED DOMAIN+ → Only visible in retrospect? → COMPLEX DOMAIN+ → Cannot perceive? → CHAOTIC DOMAIN+```++## The Five Domains++### 1. Clear (formerly Simple/Obvious)++**Characteristics:**+- Cause and effect are obvious to everyone+- Best practices exist and work+- Repeatable processes++**Approach: Sense → Categorize → Respond**++```+Problem: Server disk is full+Sense: Alert shows disk at 100%+Categorize: Known issue with known fix+Respond: Clear old logs, add monitoring++Appropriate method:+- Standard operating procedures+- Checklists+- Best practices+- Automation+```++**Failure mode:** Complacency. Treating complex problems as clear leads to oversimplification.++### 2. Complicated++**Characteristics:**+- Cause and effect require expertise to see+- Multiple right answers exist+- Good practices (not "best" practices)+- Expert analysis needed++**Approach: Sense → Analyze → Respond**++```+Problem: Application performance degradation+Sense: Response times increased 3x+Analyze: Profile, trace, identify bottleneck (requires expertise)+Respond: Apply appropriate fix based on analysis++Appropriate method:+- Expert analysis+- Waterfall/planning+- Detailed specifications+- Engineering analysis+- Multiple valid solutions+```++**Failure mode:** Analysis paralysis. Over-analyzing when action is needed, or treating complicated problems as if they're clear.++### 3. Complex++**Characteristics:**+- Cause and effect only visible in retrospect+- Emergent behavior+- Cannot predict outcomes+- Patterns emerge from interactions++**Approach: Probe → Sense → Respond**++```+Problem: User engagement is declining+Probe: Run experiments, try interventions+Sense: See what patterns emerge+Respond: Amplify what works, dampen what doesn't++Appropriate method:+- Safe-to-fail experiments+- Agile/iterative+- Prototyping+- A/B testing+- Emergent strategy+```++**Failure mode:** Trying to analyze/plan your way through complexity. The system is too interconnected for analysis; you must probe and learn.++### 4. Chaotic++**Characteristics:**+- No perceivable cause and effect+- High turbulence+- Need to act first to create stability+- No time for analysis++**Approach: Act → Sense → Respond**++```+Problem: Production is down, cause unknown+Act: Take immediate action to stabilize (rollback, failover)+Sense: Once stable, assess what happened+Respond: Move to complex/complicated domain for investigation++Appropriate method:+- Command and control+- Decisive action+- Rapid response+- Crisis management+```++**Failure mode:** Trying to analyze during chaos. The priority is stability, not understanding.++### 5. Disorder (Center)++**Characteristics:**+- Don't know which domain you're in+- Multiple stakeholders perceive different domains+- Confusion and disagreement about approach++**Approach:** Break the problem into parts, classify each part++```+Problem: "We need to fix our development process"+Reality: Some parts are clear (coding standards)+ Some parts are complicated (architecture decisions)+ Some parts are complex (team dynamics)++Solution: Break apart, apply appropriate approach to each+```++## Domain Assessment++### Step 1: Assess Cause-Effect Relationship++```markdown+## Domain Assessment: [Problem]++Can you see clear cause-effect?+- [ ] Yes, obvious to everyone → CLEAR+- [ ] Yes, but requires expertise → COMPLICATED+- [ ] No, only visible after the fact → COMPLEX+- [ ] No, completely turbulent → CHAOTIC+- [ ] Unsure, mixed signals → DISORDER+```++### Step 2: Test Your Assessment++| Domain | Test | If yes, stay | If no, reconsider |+|--------|------|--------------|-------------------|+| Clear | Do best practices exist and work reliably? | Clear | Maybe Complicated |+| Complicated | Can experts predict outcomes? | Complicated | Maybe Complex |+| Complex | Can you run safe-to-fail experiments? | Complex | Maybe Chaotic |+| Chaotic | Is the situation too turbulent to experiment? | Chaotic | Maybe Complex |++### Step 3: Match Approach++```markdown+## Approach Selection++Domain: [Assessment result]++Appropriate approach:+- Decision-making style: [Best practice / Expert analysis / Experimentation / Crisis response]+- Planning depth: [Detailed / Moderate / Minimal / None]+- Methodology: [Process / Analysis / Agile / Command]+- Success measure: [Efficiency / Quality / Learning / Stability]+```++## Common Mismatches++### Treating Complex as Complicated++```+Symptom: Extensive planning, but outcomes keep surprising+Example: Detailed user research, perfect spec, but users don't engage+Why it fails: You can't analyze your way to understanding emergent behavior+Fix: Probe with experiments, sense patterns, iterate+```++### Treating Complicated as Clear++```+Symptom: "Just do it" approach to expert problems+Example: "Build it like they did at [Company]" without understanding why+Why it fails: Context matters; expertise reveals nuances+Fix: Engage experts, analyze the specific situation+```++### Treating Chaotic as Complex++```+Symptom: Running experiments during a crisis+Example: "Let's A/B test during the outage"+Why it fails: Chaos requires immediate stability, not learning+Fix: Act decisively first, learn later+```++### Treating Clear as Complicated++```+Symptom: Over-engineering simple problems+Example: Designing an architecture for "Hello World"+Why it fails: Wasted effort, delayed delivery+Fix: Apply best practice, don't over-analyze+```++## Domain-Appropriate Practices++### For Clear Domain++```markdown+## Clear Domain Practices++- Standard operating procedures+- Checklists (like the surgical checklist)+- Automation and scripting+- Documentation+- Training and certification+- Process compliance++Example applications:+- Deployment procedures+- Coding standards+- Basic incident response+- Onboarding checklists+```++### For Complicated Domain++```markdown+## Complicated Domain Practices++- Expert analysis and consultation+- Structured problem-solving+- Architecture reviews+- Root cause analysis+- Design specifications+- Scenario planning++Example applications:+- System architecture+- Performance optimization+- Security review+- Technology selection+```++### For Complex Domain++```markdown+## Complex Domain Practices++- Safe-to-fail experiments+- Iterative development+- Retrospectives+- Emergent design+- Short feedback loops+- Feature flags++Example applications:+- Product development+- Team process improvement+- User experience design+- Organizational change+```++### For Chaotic Domain++```markdown+## Chaotic Domain Practices++- Decisive leadership+- Clear command+- Rapid triage+- Communication of actions+- Post-incident review (later)++Example applications:+- Major outages+- Security incidents+- Crisis response+- Emergency triage+```++## Cynefin Template++```markdown+# Cynefin Analysis: [Problem/Situation]++## Problem Statement+[Describe the problem]++## Domain Assessment++### Cause-Effect Analysis+Relationship: [Clear / Requires expertise / Retrospective / Turbulent]+Evidence: [What makes you believe this]++### Domain Classification+Domain: [Clear / Complicated / Complex / Chaotic / Disorder]++### Confidence Check+Could this be a different domain? [Assessment]++## Approach++Based on [domain], the appropriate approach is:++| Aspect | Approach |+|--------|----------|+| Decision style | [Best practice / Analysis / Experimentation / Crisis response] |+| Planning | [Detailed / Moderate / Minimal / None] |+| Methodology | [Process / Waterfall / Agile / Command] |+| Success metric | [Efficiency / Quality / Learning / Stability] |++## Specific Actions+Given the domain, I will:+1. [Action]+2. [Action]+```++## Verification Checklist++- [ ] Assessed cause-effect relationship honestly+- [ ] Considered if domain assessment might be wrong+- [ ] Matched approach to domain+- [ ] Not applying complicated solutions to clear problems+- [ ] Not planning detailed solutions for complex problems+- [ ] Not experimenting during chaos+- [ ] Ready to reassess as situation evolves++## Key Questions++- "What's the relationship between cause and effect here?"+- "Can experts reliably predict the outcome?"+- "Am I applying the right approach for this domain?"+- "Is this actually complex, or am I avoiding the analysis?"+- "Is this actually complicated, or am I over-planning?"+- "Has the situation moved to a different domain?"++## Snowden's Wisdom++"Complex systems are not causal—they're dispositional. You can't predict what will happen; you can only influence what might happen."++"The only way to understand a complex system is to probe it and see how it responds."++Different problems require different thinking. The failure isn't in your methodology—it's in applying the wrong methodology to the wrong domain. Match the approach to the problem, not the other way around.diff --git a/.claude/skills/thinking-effectuation/SKILL.md b/.claude/skills/thinking-effectuation/SKILL.mdnew file mode 100644index 0000000..2472697--- /dev/null+++ b/.claude/skills/thinking-effectuation/SKILL.md@@ -0,0 +1,350 @@+---+name: thinking-effectuation+description: Start with means, not goals; co-create with partners; leverage contingencies. Use for startup strategy, innovation projects, and uncertain/novel domains where planning is unreliable.+---++# Effectuation++## Overview++Effectuation, developed by Saras Sarasvathy from studying expert entrepreneurs, inverts traditional causal reasoning. Instead of starting with a goal and finding resources, effectuators start with available means and discover goals through action. This approach is more robust in highly uncertain environments where prediction is unreliable.++**Core Principle:** When you can't predict the future, don't try. Instead, focus on what you can control and let the future emerge from your actions.++## When to Use++- Startup and new product development+- Innovation in uncertain domains+- When prediction is unreliable+- Entering new markets+- When resources are constrained+- Side projects and experiments+- Career pivots++Decision flow:++```+Facing uncertainty about outcomes?+ → Can you predict the future reliably? → no → USE EFFECTUATION+ → Do you have fixed goals but uncertain resources? → yes → Traditional planning+ → Do you have available means but uncertain goals? → yes → USE EFFECTUATION+```++## Causal vs Effectual Reasoning++### Causal (Traditional)++```+1. Set a goal+2. Plan to achieve the goal+3. Gather necessary resources+4. Execute the plan+5. Measure against the goal++Example:+Goal: Build a $10M company+Plan: Build product X for market Y+Resources: Raise $2M, hire 10 people+Execute: 18-month development plan+Measure: Revenue against projections+```++### Effectual (Entrepreneurial)++```+1. Start with your means+2. Take action with acceptable loss+3. Build partnerships+4. Leverage contingencies+5. Goals emerge from action++Example:+Means: I know databases, have some savings, know other engineers+Action: Build a small tool, see who's interested+Partners: Three early users want to co-create+Contingency: One user has a different problem that's bigger+Emerging goal: Pivot to new problem, user becomes co-founder+```++## The Five Principles of Effectuation++### 1. Bird in Hand (Start with Means)++Begin with what you have:++```markdown+## My Means Inventory++Who I am:+- Skills: [List skills]+- Preferences: [What I enjoy]+- Values: [What matters to me]++What I know:+- Domain expertise: [Areas of knowledge]+- Unique insights: [What I see that others don't]+- Technical skills: [What I can build]++Who I know:+- Potential partners: [People who might join]+- Potential customers: [People who might buy]+- Resources: [People who can help]++What can I do with THESE means?+(Don't start with "what's needed"—start with "what I have")+```++### 2. Affordable Loss (Acceptable Downside)++Focus on what you can afford to lose, not expected return:++```markdown+## Affordable Loss Analysis++I can afford to lose:+- Time: 6 months of evenings/weekends+- Money: $5K of savings+- Opportunity: Delay of other projects+- Reputation: Minor if it fails quietly++I cannot afford to lose:+- Day job income+- Family time beyond X hours+- More than $5K++Action: Design the experiment to fit within affordable loss+ Don't calculate expected return—calculate maximum loss+ Can I live with maximum loss? If yes, proceed.+```++### 3. Crazy Quilt (Partnerships)++Co-create with anyone who commits:++```markdown+## Partnership Building++Instead of: Finding resources for my predetermined plan+Do: Let partners shape the venture++Approach:+1. Share what I'm working on+2. Anyone who commits becomes a partner+3. They bring their means and constraints+4. The venture adapts to include them++Example:+- I start with: Database tool idea+- Partner 1 commits: Brings sales experience, shifts to B2B+- Partner 2 commits: Brings design, shifts to user-facing product+- Customer 1 commits: Brings specific use case, shapes roadmap++The venture becomes what committed partners make it.+```++### 4. Lemonade (Leverage Contingencies)++Treat surprises as opportunities:++```markdown+## Contingency Response++Causal mindset: "That wasn't in the plan—it's a problem"+Effectual mindset: "That's unexpected—how can we use it?"++Examples:+- Competitor launches similar product+ Causal: "Our plan is threatened"+ Effectual: "They validated market, potential acquirer, potential partner"++- Key hire falls through+ Causal: "We're behind plan"+ Effectual: "Maybe we don't need that role; what can we do with who we have?"++- Customer wants something different+ Causal: "That's not our product"+ Effectual: "Maybe that IS our product"+```++### 5. Pilot in the Plane (Control, Don't Predict)++Focus on what you can control:++```markdown+## Control vs Predict++Can't control/predict:+- Market movements+- Competitor actions+- Customer adoption rate+- Economic conditions+- Technology shifts++Can control:+- Who I work with+- What I build this week+- How I respond to feedback+- What partnerships I form+- How much I risk++Strategy: Maximize actions on controllable factors+ Don't waste energy predicting uncontrollable factors+ Create the future through action, not prediction+```++## Effectuation Process++### Step 1: Inventory Your Means++```markdown+## Means Inventory++### Who I Am+- Background: [Experience, skills, identity]+- Passions: [What energizes me]+- Values: [What I won't compromise]++### What I Know+- Professional knowledge: [Domains]+- Technical skills: [Abilities]+- Market insights: [What I understand that others might not]++### Who I Know+- Close network: [People who would take my call]+- Extended network: [People who know people]+- Communities: [Groups I'm part of]+```++### Step 2: Define Affordable Loss++```markdown+## Affordable Loss++Time I can invest: [Hours/week, months]+Money I can lose: [$X]+Reputation at stake: [What's the downside?]+Opportunity cost: [What else am I not doing?]++Maximum I'm willing to lose: [Clear boundary]+```++### Step 3: Take Action++```markdown+## Next Action++Given my means and affordable loss:+What's the smallest action that could create information?++Options:+1. [Action] - Teaches me [what]+2. [Action] - Teaches me [what]+3. [Action] - Teaches me [what]++Selected action: [Action with best learning/risk ratio]+```++### Step 4: Seek Commitments++```markdown+## Partnership Outreach++Who might be interested in co-creating?++| Person | Their Means | Ask | Commitment |+|--------|-------------|-----|------------|+| [Name] | [Skills/resources] | [What to ask] | [What they commit] |++Each commitment expands my means and shapes the direction.+```++### Step 5: Adapt and Iterate++```markdown+## Iteration Log++| Action | Outcome | Surprise | How to leverage |+|--------|---------|----------|-----------------|+| | | | |++After each action:+- What did I learn?+- What commitments emerged?+- What contingencies can I leverage?+- What's the next action?+```++## Effectuation Template++```markdown+# Effectuation Analysis: [Venture/Project]++## Means Inventory+Who I am: [Identity, skills, values]+What I know: [Knowledge, expertise]+Who I know: [Network, relationships]++## Affordable Loss+Can afford: [Time, money, reputation]+Cannot afford: [Boundaries]+Maximum loss I'm willing to accept: [Clear number]++## Current Commitments+| Partner | Their Means | Commitment |+|---------|-------------|------------|+| | | |++## Contingencies Available+| Surprise | Potential Leverage |+|----------|-------------------|+| | |++## Next Action+Action: [Specific, small action]+Affordable loss: [What's at stake]+Learning goal: [What I'll know after]++## Emerging Direction+Where seems to be going: [Current trajectory]+How it differs from start: [Evolution]+```++## When to Use Causal vs Effectual++| Context | Approach | Why |+|---------|----------|-----|+| Existing market, proven model | Causal | Prediction is reliable |+| New market, unproven model | Effectual | Prediction is unreliable |+| Abundant resources | Causal | Can afford to plan extensively |+| Constrained resources | Effectual | Must work with what you have |+| Clear goal | Causal | Plan toward the goal |+| Exploring opportunities | Effectual | Goals emerge from action |+| Risk can be calculated | Causal | Expected return is meaningful |+| Risk is uncertain | Effectual | Affordable loss is meaningful |++## Verification Checklist++- [ ] Inventoried available means+- [ ] Defined affordable loss (not expected return)+- [ ] Sought commitments, not just resources+- [ ] Treating surprises as opportunities+- [ ] Focusing on what I can control+- [ ] Taking action to learn, not to execute plan+- [ ] Letting goals emerge from action++## Key Questions++- "What can I do with what I have?"+- "What am I willing to lose?"+- "Who might want to co-create this?"+- "How can I leverage this surprise?"+- "What can I control right now?"+- "What's the smallest action that teaches me something?"++## Sarasvathy's Wisdom++"Effectual reasoning does not begin with a specific goal. Instead, it begins with a given set of means and allows goals to emerge contingently over time from the varied imaginations and diverse aspirations of the founders and the people they interact with."++"In the face of an uncertain future, entrepreneurs use effectual logic to fabricate—make—the future, rather than try to find or predict it."++You can't predict the future. But you can create it through action. Start with your means, take affordable risks, build with partners, leverage surprises, and control what you can. The goal will find you.diff --git a/.claude/skills/thinking-fermi-estimation/SKILL.md b/.claude/skills/thinking-fermi-estimation/SKILL.mdnew file mode 100644index 0000000..c2e9e0a--- /dev/null+++ b/.claude/skills/thinking-fermi-estimation/SKILL.md@@ -0,0 +1,395 @@+---+name: thinking-fermi-estimation+description: Make order-of-magnitude estimates for unknown quantities by decomposing into known or estimable factors. Use for capacity planning, cost estimation, market sizing, and technical feasibility assessment.+---++# Fermi Estimation++## Overview++Fermi estimation, named after physicist Enrico Fermi, is the art of making reasonable estimates for quantities that seem impossible to know without direct measurement. By decomposing a question into factors you can estimate, then multiplying, you often get surprisingly accurate order-of-magnitude results.++**Core Principle:** Break the unknown into known (or estimable) pieces. Even rough estimates combine to reasonable accuracy due to errors canceling out.++## When to Use++- Capacity planning ("How much storage will we need?")+- Cost estimation ("What will this infrastructure cost?")+- Market sizing ("How many potential users exist?")+- Feasibility assessment ("Is this even plausible?")+- Sanity checking ("Does this number make sense?")+- Interview questions ("How many piano tuners in Chicago?")+- Quick prioritization ("Is this worth pursuing?")++Decision flow:++```+Need a number you don't have? → yes → Can you measure it directly? → no → FERMI ESTIMATE+ ↘ yes → Measure+ ↘ no → You might not need it+```++## The Fermi Process++### Step 1: Clarify What You're Estimating++Be precise about the quantity:++```+Vague: "How big is the market?"+Precise: "How many SaaS companies with 50-500 employees in the US+ would pay $1000/month for our product?"+```++### Step 2: Decompose into Estimable Factors++Break into pieces you can estimate:++```+Storage needs for user data:+= (Number of users)+ × (Data per user per day)+ × (Days of retention)+ × (Overhead factor)+```++**Decomposition strategies:**++| Strategy | Example |+|----------|---------|+| By component | Total = Sum of parts |+| By rate × time | Total = Rate × Duration |+| By population × fraction | Target = Base × Percentage |+| By analogy × adjustment | New ≈ Similar × Ratio |++### Step 3: Estimate Each Factor++For each factor, estimate based on:++| Source | Example |+|--------|---------|+| Known data | "We have 10,000 DAU" |+| Industry benchmarks | "Average SaaS churn is 5%" |+| Physical constraints | "A human can make ~50 decisions/day" |+| Logical bounds | "At least 1, at most 1 million" |+| Personal experience | "I've seen systems handle 1000 req/s" |++**When estimating:**+- Use ranges, not point estimates: "10,000 to 50,000"+- Prefer geometric mean for order-of-magnitude: √(10,000 × 50,000) = 22,360+- Round to one significant figure: ~20,000++### Step 4: Combine Factors++Multiply (or add) factors together:++```+Storage = 50,000 users × 10 KB/user/day × 365 days × 1.5 overhead+ = 50,000 × 10,000 × 365 × 1.5 bytes+ = 274 billion bytes+ ≈ 270 GB/year+```++### Step 5: Sanity Check++Verify reasonableness:+- Does the order of magnitude make sense?+- Is it physically possible?+- Does it match any known data points?+- Would a 10x error change the decision?++### Step 6: State Confidence and Implications++```+Estimate: ~270 GB/year+Confidence: Within 3-5x (80-1,500 GB)+Implication: Standard database tier sufficient; no special infrastructure needed+```++## Fermi Estimation Template++```markdown+# Fermi Estimate: [Question]++## Question (Precise)+[Exactly what we're estimating]++## Decomposition+[Quantity] = [Factor 1] × [Factor 2] × ... × [Factor N]++## Factor Estimates++### Factor 1: [Name]+- Estimate: [Value]+- Source/Reasoning: [Why this number]+- Confidence: High / Medium / Low++### Factor 2: [Name]+- Estimate: [Value]+- Source/Reasoning: [Why this number]+- Confidence: High / Medium / Low++[Continue for all factors...]++## Calculation+[Show the math]++## Result+- Point estimate: [Value]+- Range: [Low] to [High] (representing Xx uncertainty)++## Sanity Check+- Physical plausibility: [Check]+- Comparison to known data: [Check]+- Order of magnitude reasonable: [Check]++## Implications+[What does this estimate mean for the decision?]+```++## Example 1: Data Storage Needs++**Question:** How much storage will our new feature need in Year 1?++```markdown+## Decomposition+Storage = Users × Events/User/Day × Event Size × Days × Replication++## Factor Estimates++### Users (DAU)+- Estimate: 100,000 (current) growing to 200,000 (end of year)+- Average over year: ~150,000+- Confidence: High (we have current data)++### Events per User per Day+- Estimate: 50 events (based on current feature usage patterns)+- Confidence: Medium (new feature might differ)++### Event Size+- Estimate: 500 bytes (JSON with typical payload)+- Confidence: High (we can measure similar events)++### Days in Year+- Estimate: 365+- Confidence: Certain++### Replication Factor+- Estimate: 3x (standard for durability)+- Confidence: High (architectural requirement)++## Calculation+Storage = 150,000 × 50 × 500 × 365 × 3+ = 150,000 × 50 × 500 × 365 × 3+ = 4.1 × 10^12 bytes+ = 4.1 TB++## Result+- Point estimate: ~4 TB+- Range: 1 TB (pessimistic assumptions) to 15 TB (growth beats expectations)++## Sanity Check+- 4 TB for 150K users = ~27 MB/user/year = reasonable+- Similar feature at other company uses "several TB" = consistent+- Standard database can handle 4 TB = feasible++## Implications+- Standard managed database tier sufficient+- No need for sharding or special storage architecture in Year 1+- Budget ~$500/month for storage costs+```++## Example 2: API Rate Capacity++**Question:** Can our API handle Black Friday traffic?++```markdown+## Decomposition+Required RPS = Peak Daily Users × Requests/User/Session × Sessions/Day × Peak Multiplier / Seconds in Peak Hour++## Factor Estimates++### Peak Daily Users+- Estimate: 500,000 (3x normal 170K)+- Source: Last year's Black Friday+- Confidence: Medium++### Requests per Session+- Estimate: 30 API calls (measured)+- Confidence: High++### Sessions per Day+- Estimate: 2 (mobile + desktop)+- Confidence: Medium++### Peak Multiplier+- Estimate: 5x (traffic concentrated in 4-hour window, spiky within that)+- Confidence: Medium++### Seconds in Peak Hour+- Estimate: 3,600+- Confidence: Certain++## Calculation+Required RPS = (500,000 × 30 × 2 × 5) / 3,600+ = 150,000,000 / 3,600+ = 41,667 RPS+ ≈ 40,000 RPS peak++## Result+- Point estimate: 40,000 RPS+- Range: 15,000 to 100,000 RPS++## Sanity Check+- Current capacity: 10,000 RPS+- Gap: 4x capacity needed+- Similar scale companies report 20-50K RPS on peak days = consistent++## Implications+- Need 4x capacity increase+- Auto-scaling must handle 40K+ RPS+- Load test to 60K RPS (1.5x safety margin)+```++## Example 3: Market Size++**Question:** How many potential customers for our developer tool?++```markdown+## Decomposition+TAM = Software Companies × Avg Developers × Adoption Rate × Price Tolerance++## Factor Estimates++### Software Companies (US)+- Estimate: ~500,000 (SBA data: tech companies)+- Confidence: Medium++### With 10+ Developers (our target)+- Estimate: 10% = 50,000 companies+- Confidence: Low (rough estimate)++### Developers per Target Company+- Estimate: 30 average+- Confidence: Medium++### Adoption Rate (would consider)+- Estimate: 20% (dev tools are crowded)+- Confidence: Low++### Price Point+- Estimate: $50/developer/month+- Confidence: Medium (based on similar tools)++## Calculation+Addressable Users = 50,000 × 30 × 20% = 300,000 developers+Revenue = 300,000 × $50 × 12 = $180M/year TAM++## Result+- TAM: ~$180M/year+- Realistic serviceable market: 5-10% = $10-20M/year++## Sanity Check+- Similar dev tools (Datadog, etc.) have $100M+ revenue = plausible ceiling+- 300K potential users in a niche = reasonable++## Implications+- Market size justifies investment if we can capture 5%++- Need differentiation in crowded space+```++## Common Decomposition Patterns++### Capacity Planning+```+Needed = Users × Usage/User × Factor/Usage × Growth × Safety+```++### Cost Estimation+```+Cost = Resources × Unit Cost × Duration × Overhead+```++### Time Estimation+```+Time = Tasks × Time/Task × (1 + Risk Factor)+```++### Market Sizing+```+Market = Population × Segment% × Adoption% × Price × Frequency+```++## Tips for Better Estimates++### Use Multiple Approaches++Estimate the same thing different ways:++```+Website traffic estimate:+Method 1: Bottom-up from user base+Method 2: Top-down from market share+Method 3: Analogy to similar company++If methods agree within 3x, confidence increases+If they diverge wildly, investigate assumptions+```++### Bound First++Start with upper and lower bounds:++```+"Definitely more than 1,000, definitely less than 10 million"+"So somewhere in 10,000-1,000,000 range"+"Let me narrow from there..."+```++### Watch for Correlated Errors++If factors are correlated, errors don't cancel:++```+BAD: Users × Revenue/User (both depend on same growth assumption)+BETTER: Estimate revenue directly, or use independent factors+```++### One Significant Figure++Don't false precision:++```+Calculation: 47,832,519 bytes+Report: ~50 MB (not "47.8 MB")+```++## Verification Checklist++- [ ] Question stated precisely+- [ ] Decomposed into 3-6 estimable factors+- [ ] Each factor has reasoning/source+- [ ] Factors are relatively independent+- [ ] Calculation shown and checked+- [ ] Result sanity-checked against reality+- [ ] Uncertainty range stated+- [ ] Implications for decision clarified++## Key Questions++- "Can I break this into smaller, estimable pieces?"+- "What do I already know that constrains this?"+- "What's the upper bound? Lower bound?"+- "Does this number pass the smell test?"+- "Would being off by 10x change my decision?"+- "Can I estimate this a different way to cross-check?"++## Fermi's Wisdom++When asked how many piano tuners were in Chicago, Fermi didn't look it up—he estimated from population, households, pianos, tuning frequency, and tuner capacity. His estimate was reportedly within 20% of the actual number.++The lesson: You know more than you think. Decompose, estimate, combine. The errors often cancel, and you get surprisingly close to truth.++"Never make a calculation until you know the answer." — John Wheeler (Fermi's colleague)++Meaning: Estimate first to know what answer to expect, then calculate to verify.diff --git a/.claude/skills/thinking-five-whys-plus/SKILL.md b/.claude/skills/thinking-five-whys-plus/SKILL.mdnew file mode 100644index 0000000..b127897--- /dev/null+++ b/.claude/skills/thinking-five-whys-plus/SKILL.md@@ -0,0 +1,346 @@+---+name: thinking-five-whys-plus+description: Enhanced root cause analysis with explicit bias guards and stopping criteria. Use for incident post-mortems, bug investigations, and process failures where standard 5 Whys might mislead.+---++# Five Whys Plus++## Overview++The Five Whys technique from Toyota Production System is powerful but often misapplied. This enhanced version adds explicit guards against common failures: premature stopping, single-cause bias, blame-oriented thinking, and confirmation bias. It transforms a simple technique into a rigorous root cause methodology.++**Core Principle:** Keep asking "why" until you reach actionable root causes, but guard against the technique's known failure modes.++## When to Use++- Incident post-mortems+- Bug investigations+- Process failures+- Customer complaints+- Recurring problems+- Any situation where you need root cause, not just proximate cause++Decision flow:++```+Problem occurred?+ → Is the cause obvious and verified? → yes → Fix directly+ → Need to find root cause? → yes → APPLY FIVE WHYS PLUS+ → Is this a complex multi-factor problem? → yes → Consider Kepner-Tregoe PA+```++## Standard Five Whys Failure Modes++| Failure Mode | Description | Guard |+|--------------|-------------|-------|+| Premature stopping | Accepting first plausible cause | Minimum depth + actionability test |+| Single-cause bias | Assuming one root cause | Branch on "what else?" |+| Blame orientation | Stopping at human error | "Why was error possible?" |+| Confirmation bias | Finding expected cause | Devil's advocate review |+| Circular reasoning | Why loops back on itself | Detect and break cycles |+| Speculation depth | Going beyond evidence | Evidence requirement |++## The Five Whys Plus Process++### Step 1: State the Problem Precisely++Bad: "The system was slow"+Good: "API response times exceeded 2 seconds for 30% of requests between 14:00-14:45 UTC on January 15"++```markdown+Problem Statement:+- What happened: [Specific observable symptom]+- When: [Time range]+- Where: [Affected systems/users]+- Extent: [Scope and severity]+- Impact: [Business/user impact]+```++### Step 2: Apply "Why" with Evidence Requirement++For each "why," require evidence:++```markdown+Why #1: Why did [problem] occur?+Answer: [Hypothesis]+Evidence: [Data, logs, metrics that support this]+Confidence: [High/Medium/Low]+```++**Evidence types:**+- Logs showing the event+- Metrics correlating with timeline+- Code showing the behavior+- Configuration proving the state+- Testimony from multiple sources++### Step 3: Branch on "What Else?"++After each "why," explicitly ask "what else could cause this?"++```markdown+Why #1: Why did API response times spike?+Primary answer: Database queries were slow+Evidence: DB query times increased from 50ms to 1.5s++What else could cause this?+- [ ] Network latency (checked: normal)+- [ ] Application code changes (checked: none deployed)+- [ ] Memory pressure (checked: normal)+- [ ] External API dependencies (checked: normal)++→ Proceeding with database queries as verified cause+```++### Step 4: Apply "Why Was This Possible?" for Human Error++Never stop at "human error" or "someone made a mistake."++```+BAD chain:+Why did the outage occur? → Config was wrong+Why was config wrong? → Engineer made a typo+→ STOP (blames human)++GOOD chain:+Why did the outage occur? → Config was wrong+Why was config wrong? → Engineer made a typo+Why was a typo possible? → No validation on config changes+Why was there no validation? → Config system doesn't support schemas+Why doesn't it support schemas? → Tech debt, never prioritized+→ ROOT CAUSE: Config validation infrastructure gap+```++### Step 5: Check Stopping Criteria++Only stop when ALL are true:++| Criterion | Question | ✓ |+|-----------|----------|---|+| Actionable | Can we take concrete action on this cause? | |+| Controllable | Is this within our control to fix? | |+| Fundamental | Would fixing this prevent recurrence? | |+| Evidenced | Do we have evidence, not just speculation? | |+| Not-blame | Is this a system issue, not just "someone messed up"? | |++### Step 6: Verify with Counter-Analysis++Before finalizing, apply devil's advocate:++```markdown+Proposed root cause: [X]++Counter-analysis:+1. What evidence contradicts this conclusion?+2. What other explanation fits the evidence?+3. Would someone with a different perspective agree?+4. If we fix X, are we confident the problem won't recur?+5. Are we finding what we expected to find? (confirmation bias check)+```++## Enhanced Template++```markdown+# Five Whys Plus Analysis++## Problem Statement+- **What:** [Specific symptom]+- **When:** [Time range]+- **Where:** [Affected scope]+- **Impact:** [Severity and consequences]++## Why Chain++### Why #1: Why did [problem] occur?+**Answer:**+**Evidence:**+**Confidence:** High / Medium / Low+**What else considered:**+**Ruled out because:**++### Why #2: Why did [answer #1] occur?+**Answer:**+**Evidence:**+**Confidence:**+**What else considered:**+**Ruled out because:**++### Why #3: Why did [answer #2] occur?+**Answer:**+**Evidence:**+**Confidence:**+**What else considered:**+**Ruled out because:**++[Continue as needed...]++## Stopping Criteria Check+- [ ] Actionable: We can take concrete action+- [ ] Controllable: Within our control+- [ ] Fundamental: Prevents recurrence+- [ ] Evidenced: Supported by data+- [ ] System-focused: Not blaming individuals++## Counter-Analysis+**Contradicting evidence:**+**Alternative explanations:**+**Confirmation bias check:**+**Confidence in conclusion:**++## Root Causes Identified+1. [Primary root cause]+2. [Contributing factor if applicable]++## Recommended Actions+| Action | Addresses | Owner | Timeline |+|--------|-----------|-------|----------|+| | | | |++## Verification Plan+How will we know the fix worked?+```++## Example: Production Outage++```markdown+# Five Whys Plus: Payment Service Outage++## Problem Statement+- What: Payment service returned 500 errors+- When: 2024-01-15 14:00-14:45 UTC+- Where: Production, US-East region+- Impact: 2,400 failed transactions, ~$180K revenue impact++## Why Chain++### Why #1: Why did payment service return 500 errors?+**Answer:** Database connection pool exhausted+**Evidence:** Connection pool metrics showed 100/100 in use, logs show "connection wait timeout"+**Confidence:** High+**What else considered:**+- Application bugs (no recent deploys)+- Memory issues (heap normal)+- Network problems (latency normal)++### Why #2: Why was connection pool exhausted?+**Answer:** Queries taking 10x longer than normal+**Evidence:** P99 query time went from 50ms to 500ms at 14:00+**Confidence:** High+**What else considered:**+- Connection leak (connection count stable before incident)+- Sudden traffic spike (traffic was normal)++### Why #3: Why were queries taking 10x longer?+**Answer:** Missing index on payment_status table+**Evidence:** EXPLAIN shows sequential scan on 10M row table+**Confidence:** High+**What else considered:**+- Lock contention (no blocking locks)+- DB resource exhaustion (CPU/memory normal)++### Why #4: Why was the index missing?+**Answer:** Migration to add index was rolled back 2 weeks ago+**Evidence:** Deployment logs show rollback on 2024-01-01+**Confidence:** High++### Why #5: Why was the migration rolled back?+**Answer:** Migration timed out during deploy window+**Evidence:** Deploy log shows "migration timeout after 30 minutes"++### Why #6: Why did migration timeout?+**Answer:** Table too large for online migration in current window+**Evidence:** Table has 10M rows, online migration takes ~2 hours+**Confidence:** High++### Why #7 (System-level): Why wasn't this caught before impact?+**Answer:** No alerting on query performance degradation+**Evidence:** No alerts fired until connection pool exhausted++## Stopping Criteria Check+- [x] Actionable: Can add index, fix alerting+- [x] Controllable: Within our control+- [x] Fundamental: Index prevents query issue, alerting prevents impact+- [x] Evidenced: All steps have supporting data+- [x] System-focused: Process and tooling issues, not blame++## Root Causes Identified+1. **Primary:** Index migration process doesn't handle large tables+2. **Contributing:** No alerting on query latency before connection exhaustion++## Recommended Actions+| Action | Addresses | Owner | Timeline |+|--------|-----------|-------|----------|+| Implement online index creation tool | Root cause 1 | Platform | 2 weeks |+| Add query latency alerting | Root cause 2 | SRE | 1 week |+| Create index during maintenance window | Immediate fix | DBA | Tonight |+```++## Common Patterns to Catch++### The Blame Stop++```+BAD: "Why did it fail?" → "Engineer didn't test properly" → STOP++BETTER: → "Why was it possible to deploy without proper testing?"+ → "Why doesn't the pipeline enforce testing?"+ → System/process root cause+```++### The Premature Technical Stop++```+BAD: "Why was it slow?" → "Query was inefficient" → STOP++BETTER: → "Why was an inefficient query in production?"+ → "Why didn't code review catch it?"+ → "Why don't we have query performance testing?"+```++### The Circular Why++```+DETECT: "Why A?" → "Because B" → "Why B?" → "Because A"++BREAK: Introduce external evidence or third factor+```++### The Speculation Dive++```+DETECT: Answers become increasingly speculative without evidence++BREAK: "What evidence do we have for this?"+ If none, mark as hypothesis and seek evidence+```++## Verification Checklist++- [ ] Problem stated with specific details (what, when, where, extent)+- [ ] Each "why" has supporting evidence+- [ ] "What else?" asked at each branch point+- [ ] Didn't stop at human error—asked "why was error possible?"+- [ ] Stopping criteria all satisfied+- [ ] Counter-analysis performed+- [ ] Root cause is actionable and controllable+- [ ] Actions address root cause, not just symptoms++## Key Questions++- "What evidence supports this answer?"+- "What else could explain this?"+- "Why was this mistake/error/failure possible?"+- "If we stop here, will the problem actually be prevented?"+- "Are we finding what we expected, or what the evidence shows?"+- "Would someone outside our team reach the same conclusion?"++## Ohno's Wisdom (Extended)++Taiichi Ohno said: "By asking 'why' five times and answering each time, we can get to the real cause of the problem."++The extension: Five is not magic. The real guidance is:+1. Keep asking until you reach something actionable+2. But don't speculate past your evidence+3. And never stop at human blame++The technique is simple. Applying it well requires discipline.diff --git a/.claude/skills/thinking-jobs-to-be-done/SKILL.md b/.claude/skills/thinking-jobs-to-be-done/SKILL.mdnew file mode 100644index 0000000..39e4db5--- /dev/null+++ b/.claude/skills/thinking-jobs-to-be-done/SKILL.md@@ -0,0 +1,338 @@+---+name: thinking-jobs-to-be-done+description: Understand what "job" users hire your product to do, focusing on progress users seek rather than features. Use for product development, feature prioritization, user research, and market positioning.+---++# Jobs to Be Done++## Overview++Jobs to Be Done (JTBD), developed by Clayton Christensen, reframes product thinking around the progress customers are trying to make in their lives. People don't buy products; they "hire" products to do a job. Understanding the job reveals what you're really competing against and what success looks like.++**Core Principle:** People don't want a quarter-inch drill. They don't even want a quarter-inch hole. They want to hang a picture of their family.++## When to Use++- Product development and roadmapping+- Feature prioritization+- User research and interviews+- Competitive analysis+- Market positioning+- Understanding "surprising" competitors+- Debugging low adoption of features++Decision flow:++```+Building/improving a product?+ → Do you understand the job users hire it for? → no → DISCOVER THE JOB+ → Are features not being adopted? → yes → CHECK JOB ALIGNMENT+ → Surprising competitors winning? → yes → IDENTIFY THEIR JOB+```++## Understanding Jobs++### The Job Formula++```+When I [situation/trigger]+I want to [motivation/progress]+So I can [desired outcome/better state]+```++**Example:**+```+When I [finish a project milestone]+I want to [notify my team without disrupting their focus]+So I can [maintain team awareness while respecting their time]++Job: "Keep team informed asynchronously"+Not: "Use Slack" (that's a solution, not the job)+```++### Job Dimensions++Every job has multiple dimensions:++| Dimension | Question | Example (Project Management Tool) |+|-----------|----------|-----------------------------------|+| Functional | What task needs doing? | Track tasks, assign work, see progress |+| Emotional | How do I want to feel? | In control, not overwhelmed, confident |+| Social | How do I want to appear? | Organized, reliable, professional |++### Job Context++Jobs are situation-specific:++```+Same person, different jobs:++Morning: "Help me triage what needs attention today"+ → Simple dashboard, prioritized list++Deep work: "Get out of my way, let me focus"+ → Minimal notifications, distraction-free++End of day: "Help me hand off cleanly so I can disconnect"+ → Status summary, async update capabilities+```++## The JTBD Discovery Process++### Step 1: Identify Job Performers++Who is "hiring" your product?++```markdown+## Job Performers++Primary: Engineering managers+- Hire product for: tracking team delivery+- Frequency: daily+- Stakes: team performance visible to leadership++Secondary: Individual engineers+- Hire product for: knowing what to work on next+- Frequency: multiple times daily+- Stakes: personal productivity and recognition+```++### Step 2: Discover Jobs Through Interviews++Ask about behavior, not hypotheticals:++```markdown+## JTBD Interview Questions++About recent usage:+- "Walk me through the last time you used [product]"+- "What triggered you to open it?"+- "What were you trying to accomplish?"+- "How did you know when you were done?"++About the switch:+- "What were you using before?"+- "What wasn't working about the old solution?"+- "What finally made you switch?"+- "What did you give up by switching?"++About progress:+- "What does success look like for this task?"+- "How do you know when things are going well?"+- "What frustrates you most about this process?"+```++### Step 3: Analyze Competing Solutions++What else could do this job?++```markdown+## Competition for "Keep team informed on project status"++Direct competitors:+- Other project management tools (Asana, Monday.com)++Indirect competitors (same job, different solution):+- Email updates+- Slack messages+- Weekly standup meetings+- Walking over to someone's desk+- Spreadsheets++Non-consumption:+- Just hope everyone knows+- Let things fall through cracks++Insight: We're not competing with other tools—we're competing+ with "just send an email" and "bring it up in standup"+```++### Step 4: Map Job Steps++Break the job into stages:++```markdown+## Job Map: "Deliver working software on time"++1. Define: Understand what needs to be built+ - Sub-jobs: Clarify requirements, estimate scope, identify risks++2. Plan: Organize how to build it+ - Sub-jobs: Break into tasks, sequence work, allocate resources++3. Execute: Build the thing+ - Sub-jobs: Track progress, remove blockers, adjust course++4. Validate: Confirm it works+ - Sub-jobs: Test, get feedback, verify acceptance criteria++5. Deliver: Get it to users+ - Sub-jobs: Deploy, communicate, monitor++Pain points cluster around: #2 (scope conflicts) and #3 (blocker visibility)+```++### Step 5: Identify Outcome Metrics++What does success look like for the job?++```markdown+## Desired Outcomes: "Deliver working software on time"++Minimize:+- Time spent on status reporting+- Surprises in sprint reviews+- Blocked time waiting for others+- Rework from misunderstood requirements++Maximize:+- Confidence in delivery timeline+- Clarity on priorities+- Team awareness of blockers+- Early warning of issues+```++## JTBD Application Patterns++### Feature Prioritization++```markdown+## Feature Evaluation: Job Lens++Feature: Advanced reporting dashboard++Job it serves: "Demonstrate team value to leadership"+Job performers: ~10% of users (managers reporting up)+Job frequency: Monthly+Alternative solutions: Screenshots + slides (works fine)++Verdict: Low priority - job is infrequent, alternatives adequate++---++Feature: Blocker visibility alerts++Job it serves: "Remove obstacles before they delay delivery"+Job performers: ~60% of users (anyone managing work)+Job frequency: Daily+Alternative solutions: Manual check-ins (time-consuming, often missed)++Verdict: High priority - frequent job, poor alternatives+```++### Competitive Analysis++```markdown+## Competitive Analysis via JTBD++Our product: Developer documentation tool++Traditional competitive frame:+- Competitors: ReadMe, GitBook, Docusaurus+- Differentiation: Features, pricing, integrations++JTBD competitive frame:+Job: "Help developers integrate our API successfully"++Competitors for this job:+- Our own code examples (strongest competitor!)+- Stack Overflow answers+- Competitor's documentation+- Direct support from our team+- Just trying stuff until it works++Insight: Improving code examples in docs might beat any feature work+```++### Low Adoption Debugging++```markdown+## Why isn't Feature X being used?++Feature: Automated weekly report generation+Usage: 3% of target users++JTBD analysis:+Expected job: "Create status reports efficiently"+Actual job: "Demonstrate my judgment and insight to leadership"++Problem: Automated reports don't show judgment+ The PROCESS of creating reports is part of the job+ They want to curate, not automate++Solution: Change from "generate report" to "draft report for review"+ Support the curation job, don't replace it+```++## JTBD Template++```markdown+# Jobs to Be Done Analysis: [Product/Feature]++## Job Performers+| Performer | Hire For | Frequency | Stakes |+|-----------|----------|-----------|--------|+| | | | |++## Primary Job++When I [situation/trigger]+I want to [motivation/progress]+So I can [desired outcome]++### Job Dimensions+- Functional: [What task]+- Emotional: [How feel]+- Social: [How appear]++## Job Map+1. [Stage]: [Sub-jobs]+2. [Stage]: [Sub-jobs]+...++## Competing Solutions+| Competitor | How it does the job | Where it falls short |+|------------|---------------------|---------------------|+| | | |++## Desired Outcomes+Minimize:+- [Negative outcome]++Maximize:+- [Positive outcome]++## Implications+- Feature should: [Insight]+- Feature shouldn't: [Insight]+- Position against: [True competitor]+```++## Verification Checklist++- [ ] Identified job performers (who hires the product)+- [ ] Articulated job in When/Want/So format+- [ ] Considered functional, emotional, and social dimensions+- [ ] Mapped job steps+- [ ] Identified all competing solutions (including non-consumption)+- [ ] Defined measurable desired outcomes+- [ ] Features traced to specific jobs++## Key Questions++- "What job is the user hiring this product to do?"+- "What progress are they trying to make?"+- "What are they switching from? (Including 'nothing')"+- "What are they giving up by using this?"+- "What does success look like for this job?"+- "What surprising competitors exist for this job?"++## Christensen's Wisdom++"People don't want a quarter-inch drill bit. They want a quarter-inch hole."++Actually: They want to hang a picture. Actually: They want to enjoy their family photos. The deeper you go, the more insight you get into what "better" really means.++"The jobs that arise in people's lives are the fundamental causal driver behind everything."++Products don't fail because of features. They fail because they don't help people make progress on jobs they care about. Understand the job, and the features become obvious.diff --git a/.claude/skills/thinking-leverage-points/SKILL.md b/.claude/skills/thinking-leverage-points/SKILL.mdnew file mode 100644index 0000000..70d429f--- /dev/null+++ b/.claude/skills/thinking-leverage-points/SKILL.md@@ -0,0 +1,386 @@+---+name: thinking-leverage-points+description: Identify where small changes can have large effects using Donella Meadows' hierarchy of system intervention points. Use for strategic decisions, system optimization, and choosing where to focus engineering effort.+---++# Leverage Points++## Overview++Donella Meadows' "Places to Intervene in a System" provides a hierarchy of intervention points ranked by their power to change system behavior. Most effort goes into low-leverage interventions (parameters, buffers) when high-leverage points (goals, paradigms) offer transformational change with less force.++**Core Principle:** The higher in the hierarchy, the more leverage—but also the more resistance. Find the highest leverage point you can actually move.++## When to Use++- Choosing where to focus engineering effort+- Prioritizing system improvements+- Organizational change initiatives+- Architecture evolution decisions+- Process optimization+- Resource allocation+- When incremental changes aren't working++Decision flow:++```+Want to change system behavior?+ → Have you tried high-leverage interventions? → no → START HIGHER+ → Are you stuck at low leverage? → yes → MOVE UP THE HIERARCHY+ → Is change not sticking? → yes → LOOK FOR BALANCING LOOPS+```++## The 12 Leverage Points (Low to High)++### Level 12: Constants and Parameters (LOWEST LEVERAGE)++**What:** Numbers—budgets, rates, thresholds, timeouts++**Examples:**+- Adjusting cache TTL+- Changing retry counts+- Modifying timeout values+- Tweaking rate limits++**Why low leverage:** Parameters rarely change behavior fundamentally. The system absorbs parameter changes and continues its pattern.++```+Intervention: Increase server timeout from 30s to 60s+Result: Slow requests succeed, but root cause remains+Leverage: Very low—masks symptom, doesn't fix system+```++### Level 11: Buffer Sizes++**What:** Stabilizing stocks—queues, caches, inventories++**Examples:**+- Queue depth limits+- Connection pool sizes+- Memory allocations+- Batch sizes++**Why low leverage:** Buffers absorb fluctuations but don't change system dynamics. Bigger buffer = slower response to change.++```+Intervention: Increase message queue size+Result: Handles traffic spikes, but processing lag grows+Leverage: Low—buys time but doesn't address throughput+```++### Level 10: Stock-and-Flow Structures++**What:** Physical architecture—how things are connected++**Examples:**+- Database schema+- Service topology+- Network architecture+- Team structure++**Why medium leverage:** Hard to change once built; design matters but is often locked in.++```+Intervention: Add read replica to reduce DB load+Result: Significant improvement in read performance+Leverage: Medium—structural change, but within existing paradigm+```++### Level 9: Delays++**What:** Time lags in feedback loops++**Examples:**+- Deployment pipeline duration+- Feedback cycle time+- Onboarding time+- Release frequency++**Why medium leverage:** Shortening delays makes systems more responsive and stable. Many oscillation problems are actually delay problems.++```+Intervention: Reduce deployment time from 2 hours to 10 minutes+Result: Faster feedback, fewer bugs reaching production+Leverage: Medium-high—changes system responsiveness fundamentally+```++### Level 8: Balancing Feedback Loops++**What:** Negative feedback that counteracts change++**Examples:**+- Auto-scaling rules+- Circuit breakers+- Quality gates+- Alerting thresholds++**Why medium-high leverage:** Strengthening balancing loops increases stability; weakening them enables change.++```+Intervention: Implement circuit breaker with automatic recovery+Result: Failures isolated, cascade prevention+Leverage: Medium-high—changes failure dynamics+```++### Level 7: Reinforcing Feedback Loops++**What:** Positive feedback that amplifies change++**Examples:**+- Growth loops (viral, network effects)+- Technical debt spirals+- Talent attraction/attrition cycles+- Performance improvement loops++**Why high leverage:** Reinforcing loops drive exponential growth or collapse. Controlling gain = controlling trajectory.++```+Intervention: Create "fix broken windows" culture that reinforces quality+Result: Quality begets quality, technical debt decreases+Leverage: High—self-sustaining improvement+```++### Level 6: Information Flows++**What:** Who has access to what information++**Examples:**+- Metrics dashboards+- Error visibility+- Cost attribution+- Performance feedback to developers++**Why high leverage:** Adding information where it was missing changes behavior dramatically. People respond to what they can see.++```+Intervention: Show cloud costs per team in real-time dashboard+Result: Teams optimize without mandates+Leverage: High—behavior change through visibility+```++### Level 5: System Rules++**What:** Incentives, constraints, permissions++**Examples:**+- Code review requirements+- Definition of done+- SLA agreements+- Approval processes+- Deployment policies++**Why high leverage:** Rules define what's allowed and rewarded. Change rules, change behavior.++```+Intervention: Require automated tests for all production code+Result: Test coverage increases, bug rate decreases+Leverage: High—changes what's acceptable+```++### Level 4: Self-Organization++**What:** Ability of the system to change its own structure++**Examples:**+- Team autonomy to change processes+- Ability to add/remove services+- Permission to experiment+- Organizational learning capacity++**Why very high leverage:** Systems that can evolve survive; rigid systems eventually fail.++```+Intervention: Give teams authority to choose their own tools/practices+Result: Innovation increases, best practices emerge and spread+Leverage: Very high—enables adaptation+```++### Level 3: System Goals++**What:** The purpose or function of the system++**Examples:**+- Success metrics+- OKRs and KPIs+- Definition of "winning"+- What's optimized for++**Why very high leverage:** Everything else serves the goal. Change the goal, change everything downstream.++```+Intervention: Change metric from "features shipped" to "user outcomes achieved"+Result: Teams focus on impact, not output+Leverage: Very high—redirects all effort+```++### Level 2: Paradigm (Mindset)++**What:** The shared assumptions from which goals arise++**Examples:**+- "Move fast and break things" vs "Boring technology"+- "Monolith is bad" vs "Right tool for context"+- "Engineering is a cost center" vs "Engineering creates value"++**Why transformational:** Paradigms are upstream of goals, rules, and structure. Shift the paradigm, transform the system.++```+Intervention: Shift from "avoid failure" to "learn from failure"+Result: Experimentation increases, innovation accelerates+Leverage: Transformational—changes what's thinkable+```++### Level 1: Transcending Paradigms (HIGHEST LEVERAGE)++**What:** The ability to change paradigms, recognizing no paradigm is "true"++**Examples:**+- Recognizing that current best practices are temporary+- Ability to hold multiple paradigms simultaneously+- Knowing when to abandon a paradigm++**Why highest leverage:** Freedom from paradigm lock-in enables choosing the right paradigm for each context.++```+Mastery: Recognize when "microservices always" became dogma+ Choose monolith when it's right+Result: Optimal architecture for each situation+Leverage: Highest—freedom from ideological constraints+```++## Applying Leverage Points++### Step 1: Identify Current Interventions++Where are you currently trying to create change?++```markdown+Current interventions:+- Increasing server count (Level 11 - buffers)+- Adjusting timeout parameters (Level 12 - parameters)+- Adding monitoring (Level 6 - information flows)+```++### Step 2: Map to Hierarchy++Plot on the hierarchy to see leverage distribution:++```+High Leverage [3] Goals+ [5] Rules+ [6] Information ← Monitoring+ [7] Reinforcing loops+Medium [8] Balancing loops+ [9] Delays+ [10] Structure+Low Leverage [11] Buffers ← Server count+ [12] Parameters ← Timeouts+```++### Step 3: Look Higher++For each low-leverage intervention, ask: "What's the higher-leverage version?"++| Low Leverage | Ask | Higher Leverage |+|--------------|-----|-----------------|+| More servers | Why do we need more capacity? | Fix inefficient algorithm (structure) |+| Longer timeouts | Why are things slow? | Reduce delays in pipeline |+| More QA staff | Why so many bugs? | Change quality rules (Level 5) |++### Step 4: Assess Feasibility++Higher leverage often means more resistance. Evaluate:++```markdown+Intervention: Change success metric from velocity to outcomes+Leverage: Level 3 (Goals) - Very High+Resistance: High - threatens existing measurement systems+Feasibility: Medium - needs executive buy-in+Strategy: Pilot with one team, demonstrate results, expand+```++### Step 5: Choose Highest Feasible Leverage++Select the highest-leverage intervention you can actually execute.++## Common Patterns++### The Parameter Trap++Teams endlessly tune parameters when the real issue is structural:++```+Symptom: Constantly adjusting cache TTLs, retry counts, timeouts+Reality: Architecture doesn't match access patterns+Solution: Redesign data flow (Level 10) instead of tuning parameters+```++### The Information Unlock++Missing information often explains dysfunction:++```+Symptom: Teams make poor resource decisions+Reality: They can't see the cost of their decisions+Solution: Make costs visible (Level 6)+Result: Behavior changes without mandates+```++### The Goal Inversion++Metrics become goals, then become gamed:++```+Symptom: High velocity, low impact+Reality: Measuring output, not outcomes+Solution: Change the goal to user value delivered (Level 3)+```++### The Paradigm Shift++Sometimes the whole frame is wrong:++```+Symptom: Constant firefighting despite process improvements+Reality: "Heroism" paradigm rewards firefighting over prevention+Solution: Shift to "boring is good" paradigm (Level 2)+```++## Leverage Points for Common Problems++| Problem | Low-Leverage Response | High-Leverage Alternative |+|---------|----------------------|---------------------------|+| System too slow | Add caching (11) | Fix algorithm, add feedback on perf (6, 10) |+| Too many bugs | More testing (12) | Quality in definition of done (5) |+| Team conflicts | More meetings (12) | Clear goals and incentives (3, 5) |+| Innovation stalled | Hackathons (12) | Permission to experiment (4) |+| Costs too high | Cut budgets (12) | Visibility + ownership (6, 5) |+| Knowledge silos | Documentation (11) | Information flow changes (6) |++## Verification Checklist++- [ ] Identified current intervention points+- [ ] Mapped interventions to leverage hierarchy+- [ ] Asked "what's the higher-leverage version?" for each+- [ ] Assessed feasibility vs. leverage tradeoff+- [ ] Selected highest feasible leverage point+- [ ] Considered resistance and how to address it+- [ ] Have strategy for paradigm-level resistance if applicable++## Key Questions++- "What level of leverage am I operating at?"+- "What's one level higher I could try?"+- "Why hasn't this parameter tuning fixed the problem?"+- "What information is missing that would change behavior?"+- "What rule change would make this unnecessary?"+- "What goal are we actually optimizing for?"+- "What paradigm is constraining our thinking?"++## Meadows' Wisdom++"People who manage to intervene in systems at the level of paradigm hit a leverage point that totally transforms systems."++"Magical leverage points are not easily accessible, even if we know where they are. There are no cheap tickets to mastery."++The highest leverage requires the most skill and often the most patience. But knowing where leverage exists helps you stop wasting effort at the bottom of the hierarchy.diff --git a/.claude/skills/thinking-lindy-effect/SKILL.md b/.claude/skills/thinking-lindy-effect/SKILL.mdnew file mode 100644index 0000000..3cfb682--- /dev/null+++ b/.claude/skills/thinking-lindy-effect/SKILL.md@@ -0,0 +1,314 @@+---+name: thinking-lindy-effect+description: For non-perishable things, future life expectancy is proportional to current age. Use for technology selection, evaluating frameworks/libraries, and predicting tool longevity.+---++# The Lindy Effect++## Overview++The Lindy Effect, named after a New York deli where comedians discussed career longevity, states that for non-perishable things (ideas, technologies, books, practices), future life expectancy is proportional to current age. If a technology has survived 20 years, it's likely to survive another 20. If it's survived 2 years, expect another 2.++**Core Principle:** Time is the ultimate test. Old things that still exist have proven their value; new things are still being tested.++## When to Use++- Technology selection (languages, frameworks, databases)+- Evaluating libraries and dependencies+- Predicting tool longevity+- Career skill investment+- Methodology and practice adoption+- Architectural patterns+- Vendor/product selection++Decision flow:++```+Choosing between options?+ → Are some options significantly older? → yes → APPLY LINDY HEURISTIC+ → Is longevity important for this choice? → yes → FAVOR OLDER, PROVEN OPTIONS+ → Is the new thing solving a new problem? → yes → NEW MIGHT BE APPROPRIATE+```++## Understanding Lindy++### What Lindy Applies To (Non-Perishable)++- **Technologies:** Languages, databases, protocols+- **Ideas:** Mathematical concepts, design patterns, algorithms+- **Practices:** Testing, version control, code review+- **Books:** Technical references, foundational texts+- **Institutions:** Standards bodies, open source foundations++### What Lindy Doesn't Apply To (Perishable)++- **Hardware:** Physical degradation limits life+- **Individual careers:** Humans have biological limits+- **Specific products:** Companies can fail, be acquired+- **Fashion-driven choices:** Popularity cycles aren't Lindy++### The Math++```+Expected remaining life ≈ Current age++If survived 10 years → Expected to survive another ~10+If survived 50 years → Expected to survive another ~50+If survived 2 years → Expected to survive another ~2+```++## Applying Lindy to Technology++### Programming Languages++| Language | Age | Lindy Expectation | Evidence |+|----------|-----|-------------------|----------|+| C | 50+ years | 50+ more years | Powers OS, embedded, will outlive us |+| Java | 30 years | 30+ more years | Enterprise backbone, not going away |+| Python | 30 years | 30+ more years | Scientific computing, ML, scripting |+| Go | 15 years | 15+ more years | Proven for infra, backed by Google |+| Rust | 10 years | 10+ more years | Growing, solving real problems |+| New hotness | 2 years | 2-5 years | Unproven, might disappear |++### Databases++| Database | Age | Lindy Expectation | Notes |+|----------|-----|-------------------|-------|+| PostgreSQL | 35+ years | 35+ more years | SQL is 50+ years old |+| MySQL | 30 years | 30+ more years | LAMP stack foundation |+| MongoDB | 15 years | 15+ more years | Survived NoSQL hype cycle |+| CockroachDB | 10 years | 10+ more years | NewSQL, still proving itself |+| Latest DB | 2 years | Unknown | High risk for production use |++### Frameworks++| Framework | Age | Lindy Expectation | Notes |+|-----------|-----|-------------------|-------|+| React | 10+ years | 10+ more years | Dominant, ecosystem mature |+| Rails | 20 years | 20+ more years | Productive, battle-tested |+| Django | 18 years | 18+ more years | Python's Rails, stable |+| Express | 14 years | 14+ more years | Node.js standard |+| Newest framework | 1 year | 1-3 years | Likely to be replaced |++### Patterns and Practices++| Practice | Age | Lindy Expectation |+|----------|-----|-------------------|+| Version control | 50+ years | Permanent |+| Automated testing | 40+ years | Permanent |+| Code review | 40+ years | Permanent |+| Agile (core ideas) | 30+ years | Very long |+| CI/CD | 20+ years | Very long |+| Microservices | 10 years | Moderate |+| Latest methodology | 2 years | Unknown |++## The Lindy Decision Process++### Step 1: Assess Age of Options++For each option, determine how long it's been in significant use:++```markdown+Options for message queue:+- RabbitMQ: 17 years (2007)+- Kafka: 13 years (2011)+- NATS: 11 years (2013)+- NewQueue: 2 years (2022)+```++### Step 2: Apply Lindy Heuristic++```markdown+Lindy expectation:+- RabbitMQ: 17+ more years+- Kafka: 13+ more years+- NATS: 11+ more years+- NewQueue: 2-5 more years (high uncertainty)+```++### Step 3: Consider Context++Lindy is a heuristic, not a law. Consider:++```markdown+When older is better:+- Long-term production systems+- Core infrastructure+- Skills investment+- Dependencies with many consumers++When newer might be appropriate:+- Solving genuinely new problems+- Performance-critical new workloads+- Specific capability older tools lack+- Temporary/experimental projects+```++### Step 4: Calibrate by Ecosystem Age++A 5-year-old tool in a 5-year-old ecosystem is "old" for that ecosystem:++```markdown+Kubernetes ecosystem: ~10 years old+- Helm: 8 years → "Lindy" for K8s+- ArgoCD: 7 years → "Lindy" for K8s+- New tool: 1 year → Not Lindy yet++Node.js ecosystem: 14 years old+- Express: 14 years → Maximally Lindy for Node+- Fastify: 8 years → Moderately Lindy+- New framework: 1 year → Unproven+```++## Lindy Failure Modes++### Survivor Bias Confusion++Lindy predicts future survival given current survival. It doesn't say all old things are good:++```+Correct: "COBOL has survived 60 years, will survive 60 more"+Incorrect: "COBOL is the best choice for new projects"+(Survival ≠ Optimal for new use cases)+```++### Ignoring Paradigm Shifts++Lindy works within stable paradigms. Paradigm shifts create discontinuities:++```+- Pre-cloud: On-premise databases were Lindy+- Post-cloud: Managed databases emerged+- But: Core database concepts (SQL, ACID) remained Lindy+```++### Confusing Perishable and Non-Perishable++```+Perishable: Specific SaaS vendor → Can be acquired, pivoted, shut down+Non-perishable: The practice the vendor enables → Likely Lindy++E.g., Heroku might change, but "platform-as-a-service" concept is Lindy+```++## Lindy in Practice++### Technology Selection++```markdown+## Lindy Analysis: Database for New Product++Requirements: ACID transactions, relational data, long-term stability++Options:+| Option | Age | Lindy Score | Fit for Requirements |+|--------|-----|-------------|---------------------|+| PostgreSQL | 35 years | Excellent | Excellent |+| MySQL | 30 years | Excellent | Good |+| CockroachDB | 10 years | Good | Excellent |+| PlanetScale | 5 years | Moderate | Good |++Decision: PostgreSQL (Lindy + excellent fit)+ Consider CockroachDB for scale needs (worth the Lindy tax)+```++### Skill Investment++```markdown+## Lindy Career Analysis++Which skills to invest in?++Lindy skills (high confidence in future value):+- SQL (50+ years)+- Unix/Linux (50+ years)+- Git/version control (40+ years)+- Testing fundamentals (40+ years)++Moderate Lindy (good bet):+- Python (30+ years)+- JavaScript (28 years)+- Docker/containers (12 years)+- Kubernetes (10 years)++Low Lindy (speculative):+- Latest framework (1-3 years)+- Trending language (variable)++Investment strategy: Core in Lindy skills, experiments in new+```++### Dependency Selection++```markdown+## Lindy Dependency Audit++For each critical dependency:+| Dependency | Age | Last Update | Contributors | Lindy Risk |+|------------|-----|-------------|--------------|------------|+| lodash | 12 years | Active | Many | Low |+| express | 14 years | Active | Many | Low |+| new-lib | 1 year | Active | 3 | High |++Policy: Critical path requires 5+ year Lindy+ Experimental features can use newer dependencies+```++## Lindy Template++```markdown+# Lindy Analysis: [Decision]++## Options with Age+| Option | First Stable | Age | Category |+|--------|--------------|-----|----------|+| | | | Proven/Moderate/New |++## Lindy Expectations+| Option | Expected Longevity | Confidence |+|--------|-------------------|------------|+| | | High/Medium/Low |++## Context Adjustments+- Is this a new problem domain? [Yes/No]+- Is the ecosystem mature? [Yes/No]+- Do newer options solve critical gaps? [Yes/No]++## Lindy-Adjusted Decision+Primary choice: [Option with best Lindy + fit]+Rationale: [Why this balances Lindy with requirements]++## Risk if Lindy is Wrong+[What happens if the non-Lindy option outlasts expectations?]+```++## Verification Checklist++- [ ] Identified age of all options+- [ ] Applied Lindy heuristic to estimate longevity+- [ ] Distinguished perishable from non-perishable+- [ ] Considered paradigm shift possibilities+- [ ] Checked if newer options solve genuinely new problems+- [ ] Balanced Lindy with specific requirements+- [ ] Documented reasoning++## Key Questions++- "How long has this technology/practice existed?"+- "Is this Lindy (non-perishable) or perishable?"+- "What's the Lindy expectation for each option?"+- "Is the newer option solving a problem that didn't exist before?"+- "Am I betting against Lindy? If so, why?"+- "What's proven vs. what's hyped?"++## Taleb's Wisdom++"If a book has been in print for forty years, I can expect it to be in print for another forty years. But, and that is the main difference, if it survives another decade, then it will be expected to be in print another fifty years."++"Technology is at its best when it is invisible."++The technologies you don't think about—TCP/IP, Unix, SQL—are the most Lindy. The technologies that demand constant attention are still being tested.++"The old is to be respected; the new is to be examined."++Lindy doesn't mean reject the new. It means: the burden of proof is on the new. New must demonstrate value; old has already demonstrated survival.diff --git a/.claude/skills/thinking-margin-of-safety/SKILL.md b/.claude/skills/thinking-margin-of-safety/SKILL.mdnew file mode 100644index 0000000..07a635f--- /dev/null+++ b/.claude/skills/thinking-margin-of-safety/SKILL.md@@ -0,0 +1,313 @@+---+name: thinking-margin-of-safety+description: Build in buffers for unknown unknowns and don't optimize to the edge. Use for capacity planning, deadline estimation, architecture design, and risk management.+---++# Margin of Safety++## Overview++Margin of Safety, borrowed from Benjamin Graham's investment philosophy and structural engineering, is the practice of building in buffers to account for unknown unknowns. In a world of uncertainty, systems optimized to the edge are brittle. Robust systems have slack, reserves, and room for error.++**Core Principle:** Build in buffers. The world is uncertain. Systems without margin fail when stressed.++## When to Use++- Capacity planning+- Deadline and timeline estimation+- Architecture design+- Resource allocation+- Risk management+- SLA commitments+- Infrastructure provisioning+- Any commitment under uncertainty++Decision flow:++```+Making a commitment or design?+ → Is there uncertainty? → yes → BUILD IN MARGIN+ → Are you optimizing tightly? → yes → ADD SLACK+ → What if your estimates are wrong? → Consider margin+```++## The Margin of Safety Framework++### Step 1: Identify Your Estimate++What's your best guess for the requirement?++```+Estimate: Need 100 requests/second capacity+Estimate: Project will take 6 weeks+Estimate: Need 500GB storage for year 1+```++### Step 2: Quantify Your Uncertainty++How confident are you, and what could you be missing?++```markdown+## Uncertainty Analysis++| Factor | Your Estimate | Uncertainty | Possible Range |+|--------|---------------|-------------|----------------|+| Traffic | 100 RPS | ±50% | 50-150 RPS |+| Spike multiplier | 3x | ±100% | 1.5x-6x |+| Growth rate | 20%/year | ±50% | 10-30%/year |+| Unknown unknowns | - | +50-100% | - |+```++### Step 3: Calculate Required Margin++Different contexts need different margins:++| Context | Typical Margin | Rationale |+|---------|---------------|-----------|+| Capacity planning | 2-3x | Traffic spikes unpredictable |+| Time estimation | 1.5-2x | Everything takes longer |+| Infrastructure | 2x headroom | Scaling takes time |+| SLA commitment | 1.5x buffer | Reputation at stake |+| New/unknown domain | 2-3x | High uncertainty |+| Well-understood domain | 1.3-1.5x | Lower uncertainty |++### Step 4: Apply Margin++```+Base estimate: 100 RPS+Margin: 2x (moderate uncertainty, spikes possible)+Provision: 200 RPS capacity++Base estimate: 6 weeks+Margin: 1.5x (experienced team, some unknowns)+Commit: 9 weeks+```++### Step 5: Monitor and Adjust++Track actuals against estimates to calibrate future margins:++```markdown+## Calibration Log++| Estimate | Margin Applied | Actual | Margin Accuracy |+|----------|----------------|--------|-----------------|+| 100 RPS | 2x (200) | 180 | Adequate |+| 6 weeks | 1.5x (9) | 10 weeks | Insufficient |+| 500 GB | 2x (1TB) | 400 GB | Excessive |++Insight: Time estimates need higher margin; storage was overprovisioned+```++## Margin Patterns++### Capacity Margin++```markdown+## Capacity Planning with Margin++Base load: 1,000 RPS+Peak multiplier: 3x (historical)+Margin for unknowns: 1.5x+Margin for growth: 1.3x (6 months runway)++Required capacity: 1,000 × 3 × 1.5 × 1.3 = 5,850 RPS+Round up: 6,000 RPS++Rationale: Can handle 6x normal load, or 4x peak, or growth + peak+```++### Time Margin++```markdown+## Project Estimation with Margin++Task estimates:+- Feature A: 2 weeks+- Feature B: 3 weeks+- Integration: 1 week+- Testing: 1 week+Base total: 7 weeks++Adjustments:+- Optimistic bias: +30%+- Unknowns: +20%+- Dependencies: +15%+Margin total: 1.65x++Commitment: 7 × 1.65 = 11.5 → 12 weeks++Rule of thumb: Hofstadter's Law - "It always takes longer than you expect,+ even when you take into account Hofstadter's Law."+```++### Financial Margin++```markdown+## Budget with Margin++Infrastructure estimate:+- Compute: $5,000/month+- Storage: $2,000/month+- Network: $1,000/month+Base: $8,000/month++Margin considerations:+- Traffic growth: +25%+- Unplanned incidents: +15%+- New features: +20%++Budget request: $8,000 × 1.6 = $12,800/month+Actual budget: $13,000/month (round up)+```++### Design Margin++```markdown+## Architectural Margin++Connection pool:+- Normal usage: 50 connections+- Peak: 100 connections+- Margin: 2x peak+- Configure: 200 connections++Queue depth:+- Normal processing: 1,000 messages+- Burst: 10,000 messages+- Margin: 2x burst+- Configure: 20,000 max depth++Timeout:+- P99 latency: 500ms+- Margin: 2x+- Set timeout: 1000ms+```++## When to Use Different Margins++### High Margin (2-3x)++- New domain or technology+- Critical system (failure is very costly)+- External dependencies (unpredictable)+- Customer-facing SLAs+- Irreversible commitments++### Moderate Margin (1.5-2x)++- Familiar domain with some unknowns+- Internal systems (can recover from issues)+- Controlled dependencies+- Reversible decisions++### Low Margin (1.2-1.5x)++- Well-understood domain+- Historical data available+- Low consequence of being wrong+- Short time horizons+- Easy to adjust++### No Margin (Optimize to Edge)++Almost never appropriate for:+- Public commitments+- Production systems+- External dependencies++Acceptable for:+- Internal experiments+- Temporary systems+- Cost optimization after proving stable++## The Cost of Margin++Margin isn't free. Balance:++```markdown+## Margin Cost-Benefit++High margin:++ Handles unexpected loads++ Reduces stress/heroics++ Enables growth without emergency scaling+- Higher infrastructure cost+- Potentially wasted resources++Low margin:++ Lower cost++ Efficient resource use+- Risk of outages+- Constant firefighting+- Technical debt from quick fixes++Sweet spot: Margin where cost of buffer < expected cost of margin-breach × probability+```++## Margin of Safety Template++```markdown+# Margin of Safety Analysis: [Context]++## Base Estimate+What: [What you're estimating]+Estimate: [Your point estimate]+Confidence: [How confident you are]++## Uncertainty Factors+| Factor | Impact | Probability | Adjustment |+|--------|--------|-------------|------------|+| [Factor 1] | +X% | Medium | |+| [Factor 2] | +Y% | Low | |+| Unknown unknowns | +Z% | - | |++## Margin Calculation+Base: [X]+Uncertainty multiplier: [1.X]+Context multiplier: [1.Y] (high/medium/low stakes)+Total margin: [X × all multipliers]++## Final Commitment/Design+With margin: [Final number]+Rationale: [Why this margin]++## Monitoring Plan+How will you know if margin is adequate/excessive?+- [Metric to track]+- [Threshold for concern]+- [Review cadence]+```++## Verification Checklist++- [ ] Identified base estimate+- [ ] Quantified uncertainty factors+- [ ] Selected appropriate margin for context+- [ ] Applied margin to commitment/design+- [ ] Considered cost of margin vs. cost of breach+- [ ] Have monitoring to validate margin adequacy+- [ ] Calibrating based on actual outcomes++## Key Questions++- "What happens if my estimate is wrong by 2x?"+- "How much margin does this uncertainty warrant?"+- "Am I building for best case or realistic case?"+- "What's the cost of being wrong vs. cost of margin?"+- "Have I accounted for unknown unknowns?"+- "Am I optimizing to the edge when I shouldn't be?"++## Graham's Wisdom++"The margin of safety is always dependent on the price paid."++In engineering: The margin needed depends on the cost of failure. Critical systems need more margin. Experiments can run leaner.++"Confronted with the challenge to distill the secret of sound investment into three words, we venture the motto, Margin of Safety."++In systems: When in doubt, build in margin. The cost of over-provisioning is usually much less than the cost of under-provisioning when things go wrong.++"The function of the margin of safety is, in essence, that of rendering unnecessary an accurate estimate of the future."++You don't need to predict perfectly if you have adequate margin. Margin is insurance against your own estimation errors.diff --git a/.claude/skills/thinking-model-combination/SKILL.md b/.claude/skills/thinking-model-combination/SKILL.mdnew file mode 100644index 0000000..e2b84d8--- /dev/null+++ b/.claude/skills/thinking-model-combination/SKILL.md@@ -0,0 +1,395 @@+---+name: thinking-model-combination+description: Combine multiple mental models for richer analysis. Use for complex problems requiring multiple lenses, high-stakes decisions, or when single models leave blind spots.+---++# Model Combination++## Overview++Real-world problems rarely fit neatly into a single mental model. Model combination uses multiple frameworks together—sequentially, in parallel, or nested—to achieve deeper understanding than any single model provides. The skill is knowing how to combine models productively without creating confusion or analysis paralysis.++**Core Principle:** Multiple lenses reveal what single lenses miss. But combination requires discipline, not just accumulation.++## When to Use++- Complex problems spanning multiple domains+- High-stakes decisions where blind spots are costly+- When single models leave important questions unanswered+- Validating conclusions through different frameworks+- Teaching comprehensive analysis+- Building robust decision processes++Decision flow:++```+Analyzing a problem?+ → Does one model fully address it? → yes → Use single model+ → Are there important blind spots? → yes → ADD COMPLEMENTARY MODEL+ → Are stakes high enough to justify deeper analysis? → yes → USE MULTIPLE MODELS+```++## Combination Patterns++### Pattern 1: Sequential (Pipeline)++Use one model's output as another's input:++```markdown+## Sequential Combination++Model A → Model B → Model C++Example: Product Decision+1. Jobs to be Done → Identify the real user need+2. First Principles → Design solution from fundamentals+3. Pre-mortem → Identify what could go wrong+4. Reversibility → Assess if we can course-correct++Flow:+[JTBD identifies need] → [First Principles designs solution] →+[Pre-mortem finds risks] → [Reversibility determines commitment level]++Each model builds on previous insights.+```++### Pattern 2: Parallel (Multiple Lenses)++Apply models independently, compare results:++```markdown+## Parallel Combination++ ┌→ Model A → Result A ─┐+Problem → Model B → Result B → Synthesis+ └→ Model C → Result C ─┘++Example: Strategic Decision+Apply independently:+- Red Team: "How could this fail?"+- Opportunity Cost: "What are we giving up?"+- Second-Order Thinking: "What happens next?"++Synthesis:+| Model | Conclusion | Unique Insight |+|-------|------------|----------------|+| Red Team | [Finding] | [What only this revealed] |+| Opportunity Cost | [Finding] | [What only this revealed] |+| Second-Order | [Finding] | [What only this revealed] |++Combined conclusion: [Synthesis of all three]+```++### Pattern 3: Nested (Zoom Levels)++Use different models at different scales:++```markdown+## Nested Combination++Macro level: Model A+ └→ Meso level: Model B+ └→ Micro level: Model C++Example: System Optimization+- Macro (System): Theory of Constraints → Find the bottleneck+- Meso (Process): Scientific Method → Diagnose bottleneck cause+- Micro (Action): OODA Loop → Rapid iteration on fixes++The macro model identifies WHERE to focus.+The meso model identifies WHAT is happening.+The micro model guides HOW to respond.+```++### Pattern 4: Adversarial (Thesis-Antithesis)++Use models that challenge each other:++```markdown+## Adversarial Combination++Model A argues FOR → ← Model B argues AGAINST++Example: Investment Decision+- Optimistic lens (First Principles): "Here's why this could work"+- Pessimistic lens (Pre-mortem): "Here's why this will fail"+- Neutral lens (Bayesian): "Here's the actual probability"++Structure:+| Aspect | First Principles | Pre-mortem | Bayesian Estimate |+|--------|------------------|------------|-------------------|+| Market | [Optimistic case] | [Failure mode] | [P(success)] |+| Technology | [Optimistic case] | [Failure mode] | [P(success)] |+| Team | [Optimistic case] | [Failure mode] | [P(success)] |++Resolution: Adjust probabilities based on adversarial insights+```++### Pattern 5: Temporal (Time-Based)++Different models for different time horizons:++```markdown+## Temporal Combination++Past: Model A (understand history)+Present: Model B (assess current state)+Future: Model C (project outcomes)++Example: Career Decision+- Past (5 Whys): "Why am I in this situation?"+- Present (Circle of Competence): "What are my current advantages?"+- Future (Regret Minimization): "What will 80-year-old me think?"++Timeline:+Past analysis → Present assessment → Future projection → Decision+```++## Combination Recipes++### Recipe 1: High-Stakes Decision++```markdown+## High-Stakes Decision Recipe++Combine: Reversibility + Pre-mortem + Opportunity Cost + Second-Order++Step 1 - Reversibility Check:+Is this Type 1 or Type 2?+[Assessment]++Step 2 - Pre-mortem:+Assume failure, explain why+[Failure modes]++Step 3 - Opportunity Cost:+What's the best alternative?+[Alternatives foregone]++Step 4 - Second-Order:+What happens after the immediate effect?+[Cascading consequences]++Synthesis:+Given [reversibility], with risks of [pre-mortem findings],+giving up [opportunity cost], leading to [second-order effects],+the decision is: [Conclusion]+```++### Recipe 2: System Diagnosis++```markdown+## System Diagnosis Recipe++Combine: Cynefin + Theory of Constraints + Feedback Loops + Leverage Points++Step 1 - Cynefin:+What domain is this? [Clear/Complicated/Complex/Chaotic]+Appropriate approach: [Sense-Categorize-Respond / Sense-Analyze-Respond / etc.]++Step 2 - Theory of Constraints:+Where's the bottleneck?+[Constraint identification]++Step 3 - Feedback Loops:+What reinforcing/balancing loops exist?+[Loop mapping]++Step 4 - Leverage Points:+Where can small changes have big effects?+[Intervention points]++Synthesis:+This is a [domain] problem. The constraint is [X].+The key feedback loop is [Y]. The highest leverage point is [Z].+```++### Recipe 3: Innovation Challenge++```markdown+## Innovation Recipe++Combine: First Principles + TRIZ + Effectuation + Via Negativa++Step 1 - First Principles:+What are the fundamental truths?+[Core elements]++Step 2 - TRIZ:+What contradictions exist? What inventive principles apply?+[Contradiction resolution]++Step 3 - Effectuation:+What means do we have? What's affordable loss?+[Means inventory and constraints]++Step 4 - Via Negativa:+What should we remove or avoid?+[Subtractions]++Synthesis:+Starting from [first principles], resolving [contradiction] via [TRIZ principle],+using [available means], and removing [via negativa items],+the innovation path is: [Approach]+```++### Recipe 4: Argument Evaluation++```markdown+## Argument Evaluation Recipe++Combine: Steel-manning + Bayesian + Debiasing++Step 1 - Steel-manning:+What's the strongest version of this argument?+[Strengthened argument]++Step 2 - Bayesian:+What's my prior? What evidence would update it?+Prior: [X%]+Evidence that would increase: [List]+Evidence that would decrease: [List]++Step 3 - Debiasing:+What biases might affect my evaluation?+[Bias checklist]++Synthesis:+The steel-manned argument is [X]. Given [evidence] and controlling for [biases],+my updated probability is [Y%]. Conclusion: [Assessment]+```++## Combination Anti-Patterns++### Too Many Models++```markdown+## Anti-Pattern: Model Soup++Problem: Using 5+ models without clear purpose+Result: Confusion, analysis paralysis, contradictory conclusions++Symptoms:+- Can't synthesize findings+- Each model says something different+- Analysis takes forever+- No clear recommendation emerges++Fix: Maximum 3-4 models with clear roles+ Define how models relate BEFORE applying+ Designate a "tiebreaker" model for conflicts+```++### Incompatible Models++```markdown+## Anti-Pattern: Forced Marriage++Problem: Combining models with conflicting assumptions+Example: Effectuation (embrace uncertainty) + Detailed planning (predict future)++Symptoms:+- Models contradict each other fundamentally+- Can't reconcile conclusions+- Feels like arguing with yourself++Fix: Use models in sequence for different phases+ Or use as adversarial pair intentionally+ Don't try to blend incompatible worldviews+```++### Model Without Purpose++```markdown+## Anti-Pattern: Checkbox Combination++Problem: Adding models to seem thorough, not for insight+Result: Wasted effort, no additional value++Symptoms:+- Model confirms what you already knew+- No new insights from additional model+- Adding models "just in case"++Fix: Add model only if it addresses a specific blind spot+ Ask: "What question does this model answer that others don't?"+```++## Model Combination Template++```markdown+# Model Combination Analysis: [Problem]++## Problem Characterization+[Describe the problem and why combination is needed]++## Combination Pattern+Pattern: [Sequential/Parallel/Nested/Adversarial/Temporal]+Rationale: [Why this pattern]++## Models Selected+| Model | Role | What It Addresses |+|-------|------|-------------------|+| | | |++## Analysis++### Model 1: [Name]+[Analysis using this model]+Key insight: [What this uniquely revealed]++### Model 2: [Name]+[Analysis using this model]+Key insight: [What this uniquely revealed]++### Model 3: [Name]+[Analysis using this model]+Key insight: [What this uniquely revealed]++## Synthesis++### Convergence+Where models agree: [Common conclusions]++### Divergence+Where models differ: [Conflicting conclusions]+Resolution: [How to resolve conflicts]++### Unique Contributions+| Model | Unique Insight |+|-------|----------------|+| | |++## Combined Conclusion+[Synthesis that incorporates all models]++## Confidence Assessment+Confidence in conclusion: [High/Medium/Low]+What would change my mind: [Key uncertainties]+```++## Verification Checklist++- [ ] Each model has a clear, distinct role+- [ ] Combination pattern is explicit+- [ ] Models are compatible or deliberately adversarial+- [ ] Synthesis addresses convergence and divergence+- [ ] Not using more models than necessary+- [ ] Clear combined conclusion emerges++## Key Questions++- "What does each model contribute that others don't?"+- "How do these models relate to each other?"+- "Where do the models agree? Disagree?"+- "Am I adding models for insight or just thoroughness?"+- "What's the simplest combination that addresses the problem?"+- "How do I synthesize if models conflict?"++## Munger's Wisdom (Extended)++"I've long believed that a certain system—which almost any intelligent person can learn—works way better than the systems most people use. What you need is a latticework of mental models in your head."++"You may have noticed students who just try to remember and pound back what is remembered. Well, they fail in school and in life. You've got to hang experience on a latticework of models in your head."++The latticework isn't just having models—it's the connections between them. Combination is how you weave the lattice. Individual models are threads; combination creates the fabric that catches reality's complexity.diff --git a/.claude/skills/thinking-model-selection/SKILL.md b/.claude/skills/thinking-model-selection/SKILL.mdnew file mode 100644index 0000000..a2bcec5--- /dev/null+++ b/.claude/skills/thinking-model-selection/SKILL.md@@ -0,0 +1,319 @@+---+name: thinking-model-selection+description: Choose the right mental model for the problem at hand. Use when facing new problems, when current approaches fail, or when you need to match tool to context.+---++# Model Selection++## Overview++Every mental model has a domain where it excels and domains where it fails. Model selection is the meta-skill of recognizing which model fits which problem. The expert doesn't just know many models—they know when to apply each one. Using the wrong model is often worse than using no model at all.++**Core Principle:** The map is not the territory. Choose the map that best serves your journey.++## When to Use++- Facing a new problem type+- Current approach isn't working+- Multiple stakeholders suggest different frameworks+- Deciding how to structure analysis+- Teaching others which tools to use+- Building decision-making processes++Decision flow:++```+Facing a problem?+ → Have you identified the problem type? → no → CLASSIFY THE PROBLEM FIRST+ → Does your usual model fit? → no → CONSIDER ALTERNATIVES+ → Are you using a model by habit? → yes → QUESTION THE FIT+```++## Problem-Model Matching++### Step 1: Classify the Problem++```markdown+## Problem Classification++Problem: [Describe the problem]++Problem dimensions:+| Dimension | Assessment |+|-----------|------------|+| Predictability | Can outcomes be predicted? [High/Medium/Low] |+| Complexity | How many interacting parts? [Simple/Complicated/Complex] |+| Time horizon | When do consequences matter? [Immediate/Short/Long] |+| Reversibility | Can decisions be undone? [Easily/With difficulty/Not at all] |+| Information | How much do you know? [Complete/Partial/Minimal] |+| Stakeholders | Who's affected? [Individual/Team/Organization/Society] |+```++### Step 2: Match to Model Categories++```markdown+## Model Category Matching++Based on classification, which category fits?++| Problem Type | Model Category | Examples |+|--------------|----------------|----------|+| Root cause unknown | Diagnostic models | 5 Whys, Scientific Method, Kepner-Tregoe |+| Decision under uncertainty | Probabilistic models | Bayesian, Expected Value, Regret Minimization |+| System behavior | Systems models | Feedback Loops, Leverage Points, Archetypes |+| Cognitive bias risk | Debiasing models | Pre-mortem, Red Team, Steel-manning |+| Resource allocation | Constraint models | Theory of Constraints, Opportunity Cost |+| Innovation/exploration | Generative models | First Principles, TRIZ, Effectuation |+| Domain classification | Meta models | Cynefin, Circle of Competence |+```++### Step 3: Select Specific Model++```markdown+## Model Selection++Category: [From Step 2]++Candidate models:+| Model | Fit Score | Strengths for This Problem | Weaknesses |+|-------|-----------|---------------------------|------------|+| [Model 1] | [1-5] | [Why it fits] | [Limitations] |+| [Model 2] | [1-5] | [Why it fits] | [Limitations] |+| [Model 3] | [1-5] | [Why it fits] | [Limitations] |++Selected model: [Choice]+Rationale: [Why this model for this problem]+```++## Model Selection Matrix++### By Problem Type++```+DIAGNOSTIC PROBLEMS (What's causing this?)+├── Known categories exist → Kepner-Tregoe (systematic analysis)+├── Need quick root cause → 5 Whys Plus (iterative drilling)+├── Hypothesis-driven → Scientific Method (test and falsify)+└── System-wide issue → Feedback Loops (find reinforcing patterns)++DECISION PROBLEMS (What should we do?)+├── High stakes, irreversible → Regret Minimization, Pre-mortem+├── Under uncertainty → Bayesian, Probabilistic Thinking+├── Resource constrained → Opportunity Cost, Theory of Constraints+├── Multiple options → Kepner-Tregoe (decision analysis)+└── Type 1 vs Type 2 → Reversibility Framework++UNDERSTANDING PROBLEMS (How does this work?)+├── Complex system → Systems Thinking, Feedback Loops+├── Human behavior → Jobs to be Done, Incentive Analysis+├── Organizational → Archetypes, Leverage Points+└── Competitive → Red Team, Game Theory++CREATIVE PROBLEMS (How might we...?)+├── Break assumptions → First Principles, TRIZ+├── Limited resources → Effectuation, Via Negativa+├── Technical contradiction → TRIZ+└── Unknown territory → Thought Experiments, Cynefin (probe)++EVALUATION PROBLEMS (Is this good?)+├── Arguments/proposals → Steel-manning, Red Team+├── Predictions → Probabilistic, Calibration+├── Longevity → Lindy Effect+├── Safety → Margin of Safety, Pre-mortem+└── Expertise fit → Circle of Competence+```++### By Domain++```markdown+## Domain-Model Mapping++| Domain | Primary Models | Why |+|--------|---------------|-----|+| Debugging | Scientific Method, 5 Whys | Hypothesis testing, root cause |+| Architecture | Systems Thinking, Leverage Points | Interconnections, intervention |+| Product | Jobs to be Done, Cynefin | User needs, complexity |+| Strategy | Red Team, Pre-mortem | Adversarial, risk |+| Performance | Theory of Constraints, Fermi | Bottlenecks, estimation |+| Decisions | Reversibility, Regret Minimization | Stakes assessment |+| Innovation | First Principles, TRIZ | Breakthrough thinking |+| Risk | Margin of Safety, Probabilistic | Uncertainty handling |+```++## Model Failure Modes++### Using the Wrong Model++```markdown+## Model Mismatch Indicators++Signs you're using the wrong model:+- Analysis feels forced or awkward+- Key aspects don't fit the framework+- You're ignoring important factors+- Results don't match intuition consistently+- Stakeholders don't recognize the framing++Common mismatches:+| Situation | Wrong Model | Right Model |+|-----------|-------------|-------------|+| Complex adaptive system | Root cause analysis | Systems thinking |+| Simple process problem | Systems thinking | Checklist/SOP |+| Uncertain future | Detailed planning | Effectuation |+| Known domain | First principles | Best practices |+| Political problem | Technical analysis | Stakeholder mapping |+```++### Model Overuse++```markdown+## Model Overuse Patterns++"When you have a hammer, everything looks like a nail"++Signs of overuse:+- You use the same model for every problem+- You haven't learned new models recently+- Problems that don't fit are "forced" into the model+- You dismiss problems that don't fit your model++Fix: Deliberately practice with unfamiliar models+ Ask: "What model would someone else use?"+ Rotate models intentionally+```++## Model Selection Process++### Quick Selection (< 2 minutes)++```markdown+## Quick Model Selection++1. What type of problem? [Diagnostic/Decision/Understanding/Creative/Evaluation]+2. What's the constraint? [Time/Information/Stakes/Complexity]+3. What's the default model for this type?+4. Any reason NOT to use the default?+5. Proceed or reconsider++Default models by type:+- Diagnostic → 5 Whys Plus+- Decision → Reversibility check first+- Understanding → Systems Thinking+- Creative → First Principles+- Evaluation → Steel-manning+```++### Deliberate Selection (> 5 minutes)++```markdown+## Deliberate Model Selection++1. Characterize the problem fully+2. Identify 3-5 candidate models+3. Score each on fit+4. Consider combining models+5. Select and document rationale+6. Plan to reassess if model doesn't illuminate++Selection criteria:+| Criterion | Weight | Model A | Model B | Model C |+|-----------|--------|---------|---------|---------|+| Problem fit | 30% | | | |+| Available info | 20% | | | |+| Time to apply | 15% | | | |+| Stakeholder acceptance | 15% | | | |+| My competence with model | 20% | | | |+```++## Model Selection Template++```markdown+# Model Selection: [Problem]++## Problem Characterization+Type: [Diagnostic/Decision/Understanding/Creative/Evaluation]+Complexity: [Simple/Complicated/Complex/Chaotic]+Stakes: [Low/Medium/High]+Reversibility: [High/Medium/Low]+Information: [Complete/Partial/Minimal]++## Candidate Models+| Model | Fit | Strengths | Weaknesses |+|-------|-----|-----------|------------|+| | | | |++## Selected Model+Model: [Choice]+Rationale: [Why this model]++## Fallback+If selected model doesn't work: [Alternative]+Signs to switch: [Indicators]++## Application Plan+How I'll use this model:+1. [Step]+2. [Step]+```++## Meta-Model Guidelines++### When to Use Multiple Models++```markdown+## Model Combination Triggers++Use multiple models when:+- Problem spans multiple types+- Single model leaves blind spots+- Stakes are very high+- Time allows deeper analysis++Combination patterns:+- Sequential: Use A to narrow, then B to decide+- Parallel: Use A and B independently, compare results+- Nested: Use A at macro level, B at micro level+```++### When to Abandon a Model++```markdown+## Model Exit Criteria++Stop using a model when:+- 15+ minutes with no insight+- Key facts don't fit the framework+- You're forcing the analysis+- Someone suggests a better fit++Don't stop just because:+- The answer is uncomfortable+- It requires more work+- Results disagree with intuition (investigate why)+```++## Verification Checklist++- [ ] Classified the problem type+- [ ] Considered multiple candidate models+- [ ] Checked for model-problem fit+- [ ] Avoided using model out of habit+- [ ] Have a fallback if model doesn't work+- [ ] Can articulate why this model fits++## Key Questions++- "What type of problem is this really?"+- "What model would an expert in this domain use?"+- "Am I using this model because it fits, or because I know it?"+- "What aspects of the problem does this model ignore?"+- "What model would give a different answer?"+- "When should I switch to a different model?"++## Munger's Wisdom++"You've got to have models in your head. And you've got to array your experience—both vicarious and direct—on this latticework of models."++"You must know the big ideas in the big disciplines, and use them routinely—all of them, not just a few."++The power isn't in any single model—it's in having many models and knowing when each applies. A tool is only useful when matched to the task. The meta-skill of model selection multiplies the value of every model you know.diff --git a/.claude/skills/thinking-opportunity-cost/SKILL.md b/.claude/skills/thinking-opportunity-cost/SKILL.mdnew file mode 100644index 0000000..1f86c8a--- /dev/null+++ b/.claude/skills/thinking-opportunity-cost/SKILL.md@@ -0,0 +1,338 @@+---+name: thinking-opportunity-cost+description: Evaluate decisions by what you give up, not just what you gain. Use for resource allocation, prioritization, build vs. buy choices, and technical debt evaluation.+---++# Opportunity Cost Thinking++## Overview++Opportunity cost is the value of the next-best alternative foregone when making a choice. Every decision to do X is simultaneously a decision not to do Y, Z, and everything else. Engineers often focus on the value of their chosen path while underweighting what they're giving up.++**Core Principle:** The true cost of anything is what you give up to get it. A "free" option that consumes time has massive opportunity cost.++## When to Use++- Resource allocation (time, money, people)+- Feature prioritization+- Build vs. buy decisions+- Technical debt evaluation+- Career decisions+- Architecture choices+- Saying "yes" to any commitment++Decision flow:++```+Making a commitment?+ → Have you considered what you're NOT doing? → no → APPLY OPPORTUNITY COST+ → Is the foregone value significant? → yes → Factor into decision+ ↘ no → Proceed+```++## The Opportunity Cost Framework++### Step 1: Identify the Choice++State the decision explicitly:++```+Choice: Build custom authentication system+Commitment: 3 engineers for 4 months+```++### Step 2: List the Alternatives++What else could you do with those resources?++```+Alternatives for 3 engineers × 4 months:+A. Build custom auth (the choice)+B. Use Auth0 ($500/mo) + build 3 features+C. Improve performance of existing system+D. Reduce technical debt backlog by 40%+E. Build new product line MVP+```++### Step 3: Value Each Alternative++Estimate the value of each path:++```markdown+| Alternative | Direct Value | Strategic Value | Risk | Total Value |+|-------------|--------------|-----------------|------|-------------|+| Custom auth | Full control, no vendor cost | IP ownership | High (security) | Medium |+| Auth0 + features | Features faster | Time to market | Low | High |+| Performance work | 2x throughput | Customer satisfaction | Low | Medium-High |+| Tech debt | Faster future dev | Developer retention | Low | Medium |+| New product MVP | Revenue diversification | Growth potential | High | High |+```++### Step 4: Calculate Opportunity Cost++Opportunity cost = Value of best foregone alternative++```+If we choose Custom Auth:+ Best alternative foregone: Auth0 + features (rated "High")+ Opportunity cost: The features we won't build + faster time to market+```++### Step 5: Make Decision with Full Accounting++Total cost of choice = Direct cost + Opportunity cost++```+Custom Auth True Cost:+ Direct: 3 engineers × 4 months = 12 engineer-months+ Opportunity: 3 features delayed by 4 months+ + Market share lost to faster competitors+ + Developer time not on revenue features++Question: Is custom auth worth all of that?+```++## Opportunity Cost Patterns++### The "Free" Trap++Nothing is free if it consumes time:++```+Scenario: "We can build this ourselves instead of paying $10K for the tool"++Analysis:+- Tool cost: $10,000+- Build time: 2 engineers × 2 weeks = 4 engineer-weeks+- Engineer cost: ~$4,000/week fully loaded = $16,000+- Maintenance: 1 week/quarter = $16,000/year ongoing++True cost: $16K + ongoing maintenance > $10K + $0 maintenance+Plus: What else could those engineers have built?+```++### The Sunk Cost Interaction++Don't let sunk costs distort opportunity cost analysis:++```+BAD thinking:+"We've already spent 6 months on this, we can't abandon it"+(Sunk cost fallacy ignores opportunity cost of continuing)++GOOD thinking:+"Given where we are now, what's the best use of the NEXT 6 months?"+(Fresh opportunity cost analysis from current state)+```++### The Hidden Alternative++The status quo is always an alternative:++```+Proposal: Migrate to Kubernetes+Alternatives considered: ECS, Nomad, K8s+Missing alternative: Don't migrate, improve current system++Full analysis should include:+- Cost of migration (all options)+- Cost of staying put (often undervalued)+- Opportunity cost of engineers doing migration vs. features+```++### Time as the Scarcest Resource++Time opportunity cost is often highest:++```+"Quick meeting, only 30 minutes"++For 8-person meeting:+- Direct cost: 30 min × 8 = 4 person-hours+- Opportunity cost: 4 hours not spent on focused work+- Context switching cost: 15 min recovery × 8 = 2 more hours+- True cost: ~6 person-hours of productivity++Question: Is this meeting worth 6 hours of productivity?+```++## Application Areas++### Feature Prioritization++```markdown+## Opportunity Cost Analysis: Feature A vs. B++| Factor | Feature A | Feature B |+|--------|-----------|-----------|+| Dev time | 4 weeks | 2 weeks |+| Revenue impact | $50K/month | $30K/month |+| Time to value | 4 weeks | 2 weeks |++If we build A first:+- We get A in 4 weeks+- We get B in 6 weeks+- 2 extra weeks without B = $60K foregone++If we build B first:+- We get B in 2 weeks+- We get A in 6 weeks+- 2 extra weeks without A = $100K foregone++Decision: Build A first despite higher dev cost (higher opportunity cost of delay)+```++### Build vs. Buy++```markdown+## Build vs. Buy: Monitoring System++Build:+- Development: $200K (4 engineers × 6 months)+- Maintenance: $80K/year+- Time to production: 6 months+- Opportunity cost: Features those engineers would have built++Buy (Datadog):+- License: $50K/year+- Integration: $30K (2 engineers × 1 month)+- Time to production: 1 month+- Opportunity cost: None significant++5-year TCO:+- Build: $200K + ($80K × 5) + opportunity cost = $600K + opportunity+- Buy: ($50K × 5) + $30K = $280K++Decision: Buy unless unique requirements justify 2x+ cost+```++### Technical Debt++```markdown+## Technical Debt Opportunity Cost++Current state: 20% of engineering time on maintenance+Proposed: 3-month refactoring project++Analysis:+- 3 months of refactoring = no features for 3 months+- After refactoring: 10% time on maintenance (saves 10%)+- Break-even: When does saved maintenance = investment?++If team = 10 engineers:+- Investment: 10 × 3 = 30 engineer-months+- Monthly savings: 10 × 10% = 1 engineer-month+- Break-even: 30 months++Opportunity cost: Features not built during 3-month refactoring+Real question: Are those features worth more than 30+ months of 10% overhead?+```++### Hiring Decisions++```markdown+## Hiring Opportunity Cost++Choice: Hire senior engineer at $250K+Alternative: Two mid-level at $300K total++Analysis:+- Senior: Higher immediate productivity, mentorship+- Two mid: More throughput long-term, redundancy++Opportunity cost of senior:+- Fewer total engineers+- Less coverage/redundancy+- Longer ramp-up if they leave++Opportunity cost of two mid:+- More management overhead+- Longer to complex projects+- Training investment++Decision depends on: Current team composition, project complexity, growth stage+```++## Opportunity Cost Template++```markdown+# Opportunity Cost Analysis: [Decision]++## The Choice+What we're considering: [Primary option]+Resource commitment: [Time, money, people]++## Alternatives+What else could we do with these resources?++| # | Alternative | Resource Use | Direct Value | Strategic Value |+|---|-------------|--------------|--------------|-----------------|+| 1 | [Primary choice] | [X] | [Value] | [Strategic] |+| 2 | [Alternative 1] | [X] | [Value] | [Strategic] |+| 3 | [Alternative 2] | [X] | [Value] | [Strategic] |+| 4 | Do nothing | [X] | [Value] | [Strategic] |++## Opportunity Cost Calculation++Best foregone alternative: [Which one]+Value of that alternative: [Quantified if possible]++## True Cost of Primary Choice+- Direct cost: [Resources consumed]+- Opportunity cost: [Value of foregone alternative]+- Total: [Sum]++## Decision+Is [primary choice] worth [total cost]?+[Reasoning]++## Reversibility+If we're wrong, can we change course? At what cost?+```++## Mental Shortcuts++### The "What Else?" Question++Always ask: "If we didn't do this, what would we do instead?"++### The 10x Test++If opportunity cost is 10x the direct cost, rethink the decision.++### The Time Value Multiplier++Engineer time often has 3-5x multiplier in opportunity cost vs. dollar cost.++### The Status Quo Alternative++Always include "change nothing" as an explicit alternative.++## Verification Checklist++- [ ] Explicitly stated the choice and resource commitment+- [ ] Listed at least 3 alternatives (including status quo)+- [ ] Valued each alternative (even roughly)+- [ ] Identified the best foregone alternative+- [ ] Calculated opportunity cost explicitly+- [ ] Made decision accounting for full cost+- [ ] Considered reversibility++## Key Questions++- "What are we NOT doing by choosing this?"+- "Is the 'free' option actually free?"+- "What would we do with these resources otherwise?"+- "What's the value of our next-best alternative?"+- "Is this worth more than everything we're giving up?"+- "Have we included the status quo as an option?"++## Economic Wisdom++"There is no such thing as a free lunch." — Milton Friedman++Every choice has a cost, even if it's not written on an invoice. The cost is what you gave up to make that choice. Recognizing opportunity cost transforms how you evaluate decisions.++"The cost of a thing is the amount of what I will call life which is required to be exchanged for it." — Henry David Thoreau++For engineers: substitute "engineering time" for "life" — it's your most valuable and constrained resource.diff --git a/.claude/skills/thinking-probabilistic/SKILL.md b/.claude/skills/thinking-probabilistic/SKILL.mdnew file mode 100644index 0000000..d37e30b--- /dev/null+++ b/.claude/skills/thinking-probabilistic/SKILL.md@@ -0,0 +1,356 @@+---+name: thinking-probabilistic+description: Express confidence in ranges, update predictions with new information, and track calibration over time. Use for project estimation, risk assessment, and decision making under uncertainty.+---++# Probabilistic Thinking++## Overview++Probabilistic thinking, informed by the research of Philip Tetlock's "Superforecasting," treats beliefs as probabilities rather than certainties. Good probabilistic thinkers express confidence in ranges, update beliefs when evidence changes, and track their accuracy to improve calibration over time.++**Core Principle:** Express beliefs as probabilities. Track predictions. Update when wrong. Calibrate over time.++## When to Use++- Project timeline estimation+- Risk assessment+- Predicting outcomes (launches, decisions, events)+- Evaluating uncertain technical choices+- Making decisions without complete information+- Any forecast or prediction++Decision flow:++```+Making a prediction?+ → Is outcome uncertain? → yes → EXPRESS AS PROBABILITY+ → Can you track the outcome? → yes → RECORD AND CALIBRATE+ → New information available? → yes → UPDATE PROBABILITY+```++## Core Concepts++### Probability as Confidence++Convert vague language to numbers:++| Vague Statement | Probability Range |+|-----------------|-------------------|+| "Certain" | 99%+ |+| "Almost certain" | 90-99% |+| "Very likely" | 80-90% |+| "Likely" / "Probable" | 65-80% |+| "Better than even" | 55-65% |+| "Toss-up" | 45-55% |+| "Unlikely" | 20-35% |+| "Very unlikely" | 10-20% |+| "Almost impossible" | 1-10% |+| "Impossible" | <1% |++### Confidence Intervals++Express estimates as ranges, not points:++```+BAD: "The project will take 6 weeks"+GOOD: "I'm 80% confident the project will take 4-8 weeks"+BETTER: "50% confidence: 5-7 weeks; 90% confidence: 3-10 weeks"+```++### Base Rates++Start with how often similar things happen:++```+Question: Will this feature launch on time?+Base rate: What % of similar features launched on time? ~40%+Adjustment: This team is experienced (+10%), scope is clear (+10%)+Estimate: ~60% probability of on-time launch+```++## The Probabilistic Process++### Step 1: Express Initial Probability++State your belief as a number:++```markdown+## Prediction: Will we hit Q2 revenue target?++Initial estimate: 65%+Reasoning:+- Last 4 quarters: Hit 3/4 targets (75% base rate)+- Current pipeline: Slightly below historical (-10%)+- New product launching: Uncertain impact+```++### Step 2: Identify Key Uncertainties++What could change the probability?++```markdown+Key uncertainties:+1. Will Enterprise deal close? (+15% if yes)+2. Will new product cannibalize existing? (-10% if significant)+3. Will competitor launch disrupt? (-20% if aggressive)+```++### Step 3: Create Probability Tree++For complex predictions, branch scenarios:++```+Project success: ?+├── Technical risk resolves well (60%)+│ ├── Team stays intact (80%) → 0.60 × 0.80 = 48% → SUCCESS+│ └── Key person leaves (20%) → 0.60 × 0.20 × 0.50 = 6% → PARTIAL+├── Technical risk causes delays (30%)+│ ├── Scope reduced (60%) → 0.30 × 0.60 × 0.70 = 12.6% → SUCCESS+│ └── Scope maintained (40%) → 0.30 × 0.40 = 12% → FAILURE+└── Technical risk blocks project (10%) → 10% → FAILURE++P(Success) = 48% + 12.6% = 60.6% ≈ 60%+```++### Step 4: Update with New Information++When new evidence arrives, update:++```markdown+Original estimate: 65% hit revenue target++New information: Enterprise deal delayed to Q3+Impact: -15% (was +15% if closed, now neutral)+Updated estimate: 50%++New information: Competitor launch was weak+Impact: +10% (was -20% if aggressive)+Updated estimate: 60%+```++### Step 5: Record and Track++Keep a prediction log:++```markdown+## Prediction Log++| Date | Prediction | Probability | Actual | Brier Score |+|------|------------|-------------|--------|-------------|+| 2024-01-01 | Q1 launch | 70% | Yes | 0.09 |+| 2024-01-15 | Deal closes | 60% | No | 0.36 |+| 2024-02-01 | Bug resolved in 1 week | 80% | Yes | 0.04 |+```++### Step 6: Calibrate Over Time++Review your accuracy:++```markdown+## Calibration Review++For predictions I rated 70%:+- Total predictions: 20+- Actual outcomes "Yes": 12 (60%)+- I'm overconfident by 10% at this level++Adjustment: When I feel "70%", actual is closer to 60%+```++## Calibration Techniques++### The Equivalent Bet Test++"Would I bet at these odds?"++```+Prediction: 80% confident project finishes on time+Equivalent: Would I bet $4 to win $1?+If that feels wrong, adjust the probability.+```++### The Outside View++Always check base rates:++```+Inside view: "Our team is great, we'll definitely finish on time"+Outside view: "What % of similar projects finished on time?"++Inside tends toward overconfidence+Outside provides calibration anchor+```++### The Pre-Mortem Adjustment++Imagine failure, then adjust:++```+Initial estimate: 85% success+After pre-mortem: Identified 5 failure modes I hadn't considered+Adjusted estimate: 70%+```++### The Confidence Interval Check++Are your intervals too narrow?++```+Test: Of your 90% confidence intervals, do 90% contain the actual?+Common finding: Only 60-70% do+Fix: Widen intervals by 50%+```++## Application Examples++### Project Estimation++```markdown+## Project: Payment System Rewrite++Timeline estimate:+- 50% confidence: 8-12 weeks+- 80% confidence: 6-16 weeks+- 95% confidence: 4-24 weeks++Key variables:+- API complexity: High uncertainty (+/- 3 weeks)+- Team availability: Medium uncertainty (+/- 2 weeks)+- Integration testing: High uncertainty (+/- 4 weeks)++Commitment: "We're 80% confident we'll deliver in Q2"+```++### Risk Assessment++```markdown+## Risk: Database migration causes extended downtime++Probability assessment:+- Base rate for similar migrations: 20% have issues+- Our preparation level: Above average (-5%)+- Complexity of our schema: Above average (+5%)+- Rollback plan quality: Strong (-5%)++Estimate: 15% probability of extended downtime++Mitigation value:+- If issue occurs: 4 hours downtime × $10K/hour = $40K+- Expected loss: 15% × $40K = $6K+- Mitigation cost: $3K for additional testing+- Decision: Mitigation worth it (ROI positive)+```++### Technical Decision++```markdown+## Decision: Adopt new framework++Success probability factors:+| Factor | Probability | Weight |+|--------|-------------|--------|+| Team learns quickly | 70% | 0.3 |+| Framework matures | 80% | 0.2 |+| Performance meets needs | 60% | 0.3 |+| Integration works | 75% | 0.2 |++Combined probability (simplified):+0.70 × 0.80 × 0.60 × 0.75 = 25% (if all must succeed)+OR weighted average: 70% (if partial success acceptable)++Decision: High uncertainty suggests pilot first+```++## Brier Score for Calibration++Track prediction accuracy with Brier Score:++```+Brier Score = (probability - outcome)²++Where outcome = 1 if happened, 0 if not++Example:+Predicted 70% (0.70), it happened (1)+Brier = (0.70 - 1)² = 0.09++Predicted 70% (0.70), it didn't happen (0)+Brier = (0.70 - 0)² = 0.49++Lower is better. Perfect = 0, Random = 0.25+```++## Probabilistic Thinking Template++```markdown+# Probabilistic Assessment: [Prediction]++## Prediction+[Clear, falsifiable statement with timeframe]++## Initial Probability+Estimate: [X]%+Base rate: [Similar events: Y%]+Adjustment rationale: [Why different from base rate]++## Confidence Interval+- 50% CI: [Range]+- 80% CI: [Range]+- 95% CI: [Range]++## Key Uncertainties+| Uncertainty | If positive | If negative |+|-------------|-------------|-------------|+| [Factor 1] | +X% | -Y% |+| [Factor 2] | +X% | -Y% |++## Update Log+| Date | New Information | Old P | New P |+|------|-----------------|-------|-------|+| | | | |++## Resolution+Date: [When known]+Outcome: [What happened]+Brier Score: [Calculation]+Lessons: [What to learn]+```++## Verification Checklist++- [ ] Expressed prediction as specific probability+- [ ] Checked base rate for similar events+- [ ] Created appropriate confidence intervals+- [ ] Identified key uncertainties and their impacts+- [ ] Recorded prediction for future calibration+- [ ] Applied equivalent bet test for sanity check+- [ ] Willing to update when new information arrives++## Key Questions++- "What probability would I assign to this?"+- "What's the base rate for similar things?"+- "What would change my estimate up or down?"+- "Am I being overconfident? (Usually yes)"+- "What's my track record at this confidence level?"+- "Would I bet at these odds?"++## Tetlock's Superforecaster Traits++1. **Update often:** Change predictions when evidence changes+2. **Granular probabilities:** Use 65% not "likely"+3. **Outside view:** Start with base rates+4. **Seek disconfirming evidence:** Look for reasons you're wrong+5. **Track record:** Keep score, learn from errors+6. **Intellectual humility:** Know you're often wrong++## Tetlock's Wisdom++"The fox knows many things, but the hedgehog knows one big thing."++Superforecasters are foxes—they integrate many perspectives, update frequently, and avoid ideological certainty. They're not smarter; they're more calibrated.++"Beliefs are hypotheses to be tested, not treasures to be protected."++Your predictions should change as evidence changes. Holding steady when you should update is a calibration failure.diff --git a/.claude/skills/thinking-red-team/SKILL.md b/.claude/skills/thinking-red-team/SKILL.mdnew file mode 100644index 0000000..57d2cfa--- /dev/null+++ b/.claude/skills/thinking-red-team/SKILL.md@@ -0,0 +1,394 @@+---+name: thinking-red-team+description: Deliberately attack your own plans, systems, and assumptions to find weaknesses before adversaries or reality does. Use for security review, architecture validation, plan stress-testing, and pre-launch preparation.+---++# Red Team Thinking++## Overview++Red teaming, borrowed from military and security practice, involves deliberately attacking your own plans, systems, or ideas to find weaknesses. A dedicated "red team" assumes an adversarial role, trying to defeat the "blue team's" defenses. This reveals vulnerabilities that defenders' blind spots hide.++**Core Principle:** Attack yourself before others do. The best defense is knowing your weaknesses.++## When to Use++- Security architecture review+- Pre-launch preparation+- Validating critical decisions+- Stress-testing plans and assumptions+- Disaster preparedness+- Competitive strategy+- Code and system review++Decision flow:++```+Building or planning something important?+ → Have you tried to break it? → no → RED TEAM IT+ → Are you confident in your defenses? → yes → RED TEAM YOUR CONFIDENCE+ → Has an adversary tested you? → no → BE YOUR OWN ADVERSARY+```++## The Red Team Process++### Step 1: Define the Target++What are you attacking?++```markdown+## Red Team Target++System: User authentication system+Scope:+- Login flow+- Password reset+- Session management+- API authentication++Out of scope:+- Physical security+- Social engineering of employees+- Third-party services++Goal: Find vulnerabilities that could lead to:+- Unauthorized account access+- Session hijacking+- Privilege escalation+```++### Step 2: Adopt Adversary Mindset++Think like an attacker:++```markdown+## Adversary Profile++Who would attack this?+- Script kiddies: Automated scanning, known exploits+- Sophisticated attackers: Custom exploits, patience+- Insiders: Already have some access+- Competitors: Want data or disruption++Attacker motivations:+- Financial gain (steal data, ransom)+- Disruption (take down service)+- Credential harvesting (sell on dark web)+- Competitive advantage (steal IP)++What would I do if I were them?+```++### Step 3: Enumerate Attack Surfaces++Where can attacks happen?++```markdown+## Attack Surface Enumeration++Entry points:+| Surface | Exposure | Attacker Access |+|---------|----------|-----------------|+| Login form | Public | Anyone |+| API endpoints | Public | Anyone with API key |+| Password reset | Public | Anyone with email |+| Admin panel | Internal network | Employees |+| Database | No direct access | Only if compromised |++Trust boundaries:+- Public internet → Web server+- Web server → Application+- Application → Database+- User → Authenticated user+- User → Admin+```++### Step 4: Execute Attack Scenarios++Systematically try to break things:++```markdown+## Attack Scenario 1: Credential Stuffing++Attack: Try known breached credentials against login+Goal: Compromise accounts with reused passwords++Execution:+1. Obtain breach database (simulated)+2. Run credentials against login endpoint+3. Document rate limiting behavior+4. Test account lockout triggers+5. Attempt bypass techniques++Findings:+- Rate limiting triggers at 10 attempts/minute+- No account lockout+- No breach credential detection+- Login response time reveals valid usernames+```++```markdown+## Attack Scenario 2: Session Hijacking++Attack: Steal or forge session tokens+Goal: Access accounts without credentials++Execution:+1. Analyze session token structure+2. Test token entropy+3. Attempt token prediction+4. Test XSS vectors for token theft+5. Check secure cookie flags++Findings:+- Session tokens use secure random+- Cookies missing HttpOnly flag ←VULNERABILITY+- No session binding to IP+- Tokens don't expire on password change+```++### Step 5: Attempt Bypass++For each defense, try to bypass it:++```markdown+## Defense Bypass Attempts++Defense: Rate limiting on login+Bypass attempts:+| Attempt | Result |+|---------|--------|+| Distribute across IPs | BYPASSED - no IP correlation |+| Vary username slowly | Works - only per-IP limit |+| Use different user agents | No effect |+| Target password reset instead | BYPASSED - no rate limit |++Conclusion: Rate limiting is per-IP only, easily distributed+ Password reset has no rate limiting+```++### Step 6: Document Findings++Create an actionable report:++```markdown+## Red Team Findings Report++### Critical Vulnerabilities++#### CRIT-1: Password Reset No Rate Limit+Severity: Critical+Attack: Brute force password reset tokens+Impact: Mass account compromise+Remediation: Add rate limiting to password reset+Timeline: Immediate++#### CRIT-2: Session Tokens Vulnerable to XSS+Severity: Critical+Attack: Inject XSS, steal session cookies+Impact: Account takeover+Remediation: Add HttpOnly flag to session cookies+Timeline: Immediate++### High Vulnerabilities++#### HIGH-1: Rate Limiting Easily Bypassed+Severity: High+Attack: Distributed credential stuffing+Impact: Account compromise at scale+Remediation: Add account-level rate limiting+Timeline: 1 week++### Medium Vulnerabilities++#### MED-1: Username Enumeration via Timing+Severity: Medium+Attack: Determine valid usernames+Impact: Enables targeted attacks+Remediation: Constant-time response for login+Timeline: 2 weeks+```++## Red Team Patterns++### Security Red Team++```markdown+## Security Red Team Checklist++Authentication:+- [ ] Credential stuffing+- [ ] Brute force attacks+- [ ] Session hijacking+- [ ] Token prediction+- [ ] Password reset flaws++Authorization:+- [ ] Privilege escalation+- [ ] IDOR (insecure direct object reference)+- [ ] Missing function-level access control+- [ ] JWT manipulation++Input validation:+- [ ] SQL injection+- [ ] XSS (stored, reflected, DOM)+- [ ] Command injection+- [ ] Path traversal++Business logic:+- [ ] Race conditions+- [ ] State manipulation+- [ ] Price manipulation+- [ ] Workflow bypass+```++### Plan Red Team++```markdown+## Plan Red Team: Product Launch++Red team the launch plan:++What could go wrong?+| Failure Mode | Attack Vector | Mitigation |+|--------------|---------------|------------|+| Traffic spike | Product goes viral | Auto-scaling, load test |+| PR disaster | Journalist finds bug | Bug bash before launch |+| Payment failure | Provider outage | Backup payment provider |+| Support overwhelmed | Many questions | FAQ, chatbot, staff up |++Assumptions to challenge:+| Assumption | What if wrong? | How to verify? |+|------------|----------------|----------------|+| Users will understand new UI | Confusion, support tickets | User testing |+| Infrastructure handles 10x | Crashes | Load testing |+| Marketing will drive traffic | No signups | Organic channel backup |+```++### Architecture Red Team++```markdown+## Architecture Red Team: Microservices Migration++Attack the architecture:++Single points of failure:+- API Gateway - if down, everything down+- Auth service - if down, no logins+- Message queue - if down, async breaks++Cascade failures:+- Service A times out → retries → overwhelms B → cascade+- Database connection exhaustion → app servers stuck → timeout cascade++Data consistency attacks:+- Eventual consistency window exploits+- Distributed transaction rollback states+- Cache invalidation race conditions++Findings:+1. No circuit breakers between services+2. Shared database = coupled failure domains+3. No chaos engineering to verify resilience+```++### Decision Red Team++```markdown+## Decision Red Team: Technology Choice++Decision: Adopt Kubernetes for container orchestration++Red team the decision:++Arguments AGAINST:+- Operational complexity high for small team+- Learning curve delays delivery 3-6 months+- Could use simpler solutions (ECS, docker-compose)+- Over-engineering for current scale++Counter-arguments:+- Scale projections justify complexity+- Team wants to learn K8s anyway+- Platform engineering investment pays off++Red team verdict:+The learning curve argument is strongest.+Consider: Managed K8s (EKS/GKE) to reduce ops burden+ Start with single namespace, expand gradually+```++## Red Team Template++```markdown+# Red Team Report: [Target]++## Scope+Target: [What's being red teamed]+In scope: [What to attack]+Out of scope: [What to skip]+Goal: [What constitutes a successful attack]++## Adversary Model+Who: [Who would attack this]+Capabilities: [What they can do]+Motivation: [Why they'd attack]++## Attack Surface+| Surface | Exposure | Notes |+|---------|----------|-------|+| | | |++## Attack Scenarios Executed+| Scenario | Result | Severity |+|----------|--------|----------|+| | | |++## Findings++### Critical+[Findings requiring immediate action]++### High+[Findings requiring near-term action]++### Medium+[Findings for backlog]++### Low+[Informational findings]++## Recommendations+| Finding | Remediation | Priority | Effort |+|---------|-------------|----------|--------|+| | | | |++## Lessons Learned+[What did the red team reveal about blind spots?]+```++## Verification Checklist++- [ ] Defined clear scope and adversary model+- [ ] Adopted genuine adversary mindset+- [ ] Enumerated attack surfaces+- [ ] Executed multiple attack scenarios+- [ ] Attempted to bypass defenses+- [ ] Documented findings with severity+- [ ] Provided actionable remediation+- [ ] Updated defenses based on findings++## Key Questions++- "How would an attacker approach this?"+- "What assumptions am I making that an attacker wouldn't?"+- "What's the weakest point in this system?"+- "If I wanted to cause maximum damage, how would I?"+- "What am I confident about that I haven't actually tested?"+- "What would I find embarrassing if an attacker found it first?"++## Sun Tzu's Wisdom (Applied)++"If you know the enemy and know yourself, you need not fear the result of a hundred battles."++Red teaming is knowing yourself as the enemy would. You find your weaknesses before they do. You attack your confidence before it betrays you. The purpose isn't pessimism—it's preparation.diff --git a/.claude/skills/thinking-regret-minimization/SKILL.md b/.claude/skills/thinking-regret-minimization/SKILL.mdnew file mode 100644index 0000000..64dba4a--- /dev/null+++ b/.claude/skills/thinking-regret-minimization/SKILL.md@@ -0,0 +1,317 @@+---+name: thinking-regret-minimization+description: Project to your future self and ask what you would regret not doing. Use for career decisions, strategic pivots, risk-taking choices, and life-changing decisions.+---++# Regret Minimization Framework++## Overview++Jeff Bezos developed the Regret Minimization Framework to make the decision to leave his Wall Street job and start Amazon. By projecting to age 80 and asking what you'd regret, you cut through short-term fears and focus on what truly matters long-term.++**Core Principle:** When you're 80, looking back on your life, what will you regret not trying? Minimize that regret.++## When to Use++- Career-defining decisions+- Whether to pursue a risky opportunity+- Staying safe vs. taking a leap+- Decisions with fear of failure+- When short-term costs obscure long-term value+- Life-changing personal decisions+- Entrepreneurial choices++Decision flow:++```+Facing a significant life/career decision?+ → Afraid of failure or short-term costs? → yes → APPLY REGRET MINIMIZATION+ → Unclear if risk is worth it? → yes → PROJECT TO 80-YEAR-OLD SELF+ → Need long-term perspective? → yes → ASK "WHAT WOULD I REGRET?"+```++## The Framework++### Step 1: Project to Age 80++Imagine yourself at age 80, looking back on your life:++```+I am 80 years old.+I am reflecting on my life and the decisions I made.+I want to minimize the number of regrets I have.+```++### Step 2: Frame the Decision++State the choice clearly:++```+The decision: Should I leave my stable job to start a company?++Option A: Stay in stable job+- Known income, security, career progression+- Low risk, predictable outcomes++Option B: Start the company+- Uncertainty, potential failure+- Chance to build something meaningful+- Unknown outcomes+```++### Step 3: Apply the Regret Test++For each option, ask: "Will I regret NOT doing this?"++```+At 80, will I regret:+- Not trying to start the company? → Likely YES+- Not staying in the stable job? → Likely NO++Bezos's insight: "I knew that when I was 80, I was not going to regret+having tried this. I was not going to regret trying to participate+in this thing called the Internet that I thought was going to be+a really big deal."+```++### Step 4: Distinguish Regret Types++**Regrets of Action:** Things you did that went wrong+- Usually fade over time+- At least you tried+- Provide learning++**Regrets of Inaction:** Things you never tried+- Grow larger over time+- "What if?" haunts you+- No closure or learning++Research shows: Regrets of inaction are more painful and persistent than regrets of action.++### Step 5: Make the Decision++Choose the path with minimum lifetime regret:++```+The calculus:+- If I try and fail: Temporary pain, but no regret for not trying+- If I don't try: Permanent "what if?" regret+- The expected regret of inaction > expected regret of action++Decision: Try.+```++## Application Patterns++### Career Decisions++```markdown+## Regret Analysis: Take the startup job or stay at BigCorp?++At 80, looking back:+- Will I regret not taking the startup risk? → Likely YES+ "I wonder what could have been. I played it safe."+- Will I regret not staying at BigCorp? → Likely NO+ "I took a risk, it didn't work, but I learned and recovered."++Key insight: Career failures are recoverable. Unlived possibilities aren't.++Decision: Take the startup job.+```++### Entrepreneurial Decisions++```markdown+## Regret Analysis: Start the business now or wait until "ready"?++At 80, looking back:+- Will I regret not starting when I had the chance? → Likely YES+ "I waited for perfect conditions that never came."+- Will I regret starting before being fully ready? → Likely NO+ "I learned by doing. Even if it failed, I grew."++Key insight: "Ready" is often an illusion. Action creates readiness.++Decision: Start now.+```++### Personal Decisions++```markdown+## Regret Analysis: Relocate for the opportunity or stay near family?++At 80, looking back:+This is more nuanced—both paths have legitimate regret potential.++- Regret not relocating: "I passed up growth for comfort"+- Regret relocating: "I missed years with aging parents"++Key insight: When both paths have genuine regret potential,+the decision is about values, not just regret.++Process: Clarify which regret would be heavier for YOUR values.+```++### Learning Decisions++```markdown+## Regret Analysis: Pursue the degree/certification or focus on work?++At 80, looking back:+- Will I regret not getting the credential? → Maybe+ But: Will the credential matter in 40 years?+- Will I regret spending years on credential? → Maybe+ But: Education rarely creates lasting regret++Key insight: Educational regrets are rare;+ missed opportunities are common regrets.++Decision: Often favors learning, but depends on opportunity cost.+```++## When Regret Minimization is Less Applicable++### Reversible Decisions++If you can easily change course, regret minimization is overkill:++```+"Which framework should I learn first?"+This isn't a lifetime regret question—just pick one and learn.+```++### Decisions Affecting Others++When others bear the consequences, pure regret minimization is selfish:++```+"Should I risk the company's future on my vision?"+Your regret isn't the only consideration—employees, investors matter.+```++### When Both Options Have Equal Regret++Sometimes both paths lead to comparable regret:++```+"Career A or Career B?"+If both are good options, regret minimization won't differentiate.+Use other frameworks (values alignment, opportunity cost).+```++## Combining with Other Frameworks++### With Inversion++```+Inversion: "How would I guarantee regret?"+- Never take any risks+- Always choose safety+- Never pursue what excites me++Avoiding these → Minimizing regret+```++### With Pre-Mortem++```+Pre-mortem: "It's age 80 and I deeply regret this choice. Why?"++This is essentially regret minimization through narrative.+Write the story of future regret to clarify present choices.+```++### With Opportunity Cost++```+Opportunity cost of not trying:+- Direct: Lost potential upside+- Regret: Permanent "what if?"+- Learning: Missed growth opportunity++Full cost often favors action.+```++## Regret Minimization Template++```markdown+# Regret Minimization Analysis: [Decision]++## The Decision+[Clear statement of the choice]++## Option A: [Safe/Conservative Path]+Short-term: [Benefits and costs]+Long-term: [Likely trajectory]+At 80, regret for choosing A: [Assessment]+At 80, regret for NOT choosing A: [Assessment]++## Option B: [Risky/Bold Path]+Short-term: [Benefits and costs]+Long-term: [Likely trajectory]+At 80, regret for choosing B: [Assessment]+At 80, regret for NOT choosing B: [Assessment]++## Regret Comparison+| Scenario | Regret Level | Duration | Type |+|----------|--------------|----------|------|+| Choose A, works | Low | - | - |+| Choose A, miss B's upside | High | Permanent | Inaction |+| Choose B, works | Low | - | - |+| Choose B, fails | Medium | Temporary | Action |++## Key Insight+[What does the regret analysis reveal?]++## Decision+[Choice and reasoning]+```++## Common Regret Patterns in Tech Careers++### Things People Regret NOT Doing++- Not taking the risk earlier+- Not starting the side project+- Not negotiating harder+- Not leaving toxic situations sooner+- Not speaking up when it mattered+- Not investing in relationships+- Not pursuing meaningful work over safe work++### Things People Rarely Regret++- Taking the risk (even if it failed)+- Starting the company (even if it folded)+- Making the leap (even if they had to leap back)+- Speaking up (even if it was uncomfortable)+- Trying something hard (even if they failed)++## Verification Checklist++- [ ] Projected to age 80 perspective+- [ ] Identified regrets for each option+- [ ] Distinguished action vs. inaction regrets+- [ ] Considered whether regrets would grow or fade+- [ ] Checked if decision is significant enough for this framework+- [ ] Considered impact on others (not just self)+- [ ] Made decision aligned with long-term perspective++## Key Questions++- "When I'm 80, will I regret not trying this?"+- "Is this fear of failure or wisdom about risk?"+- "Will this regret grow or fade over time?"+- "What would my 80-year-old self tell me to do?"+- "Am I optimizing for short-term comfort or long-term meaning?"+- "Would I regret playing it safe?"++## Bezos's Story++"I went to my boss and said I was going to start a company selling books on the Internet. He said, 'That's a great idea, but it would be a better idea for someone who didn't already have a good job.' So he convinced me to think about it for 48 hours."++"I thought about it and I used this framework, which I call a regret minimization framework. I projected myself to age 80, and I thought, 'When I'm 80, am I going to regret leaving Wall Street in the middle of the year and forgoing my bonus? No. Am I going to regret missing the beginning of the Internet? Yes.'"++"Once I thought about it that way, it was easy to make the decision."++The lesson: Short-term costs (bonus, security, status) fade. Long-term "what-ifs" don't. When in doubt, minimize lifetime regret by trying.diff --git a/.claude/skills/thinking-reversibility/SKILL.md b/.claude/skills/thinking-reversibility/SKILL.mdnew file mode 100644index 0000000..fce434b--- /dev/null+++ b/.claude/skills/thinking-reversibility/SKILL.md@@ -0,0 +1,316 @@+---+name: thinking-reversibility+description: Classify decisions by reversibility and match decision process to decision type. Use for technology choices, architecture decisions, process changes, and hiring decisions.+---++# Reversibility Thinking++## Overview++Jeff Bezos distinguishes between Type 1 (irreversible, one-way door) and Type 2 (reversible, two-way door) decisions. The key insight: most decisions are Type 2 but get treated as Type 1, causing analysis paralysis. Match your decision process to the reversibility of the decision.++**Core Principle:** Reversible decisions should be made quickly by individuals. Irreversible decisions deserve deliberation. Most decisions are more reversible than they appear.++## When to Use++- Technology choices+- Architecture decisions+- Process changes+- Hiring decisions+- Feature implementations+- Organizational changes+- Any decision where you're uncertain how much analysis is warranted++Decision flow:++```+Decision to make?+ → Is it easily reversible? → yes → DECIDE QUICKLY (Type 2)+ → Is it hard/impossible to reverse? → yes → DELIBERATE CAREFULLY (Type 1)+ → Unsure of reversibility? → ANALYZE REVERSIBILITY FIRST+```++## Type 1 vs Type 2 Decisions++### Type 1: One-Way Doors++**Characteristics:**+- Irreversible or very costly to reverse+- Consequences are significant and lasting+- Changing course means starting over++**Examples:**+- Fundamental architecture choices (monolith vs microservices for core systems)+- Major technology platform (cloud provider for critical infra)+- Hiring for leadership positions+- Shutting down a product line+- Major acquisitions or contracts+- Public commitments or promises++**Process:**+- Extensive analysis+- Multiple stakeholder input+- Devil's advocate review+- Documentation of reasoning+- Senior decision maker++### Type 2: Two-Way Doors++**Characteristics:**+- Easily reversed if wrong+- Limited blast radius+- Can iterate and adjust++**Examples:**+- Most feature implementations+- UI/UX changes+- Internal tool selection+- Process experiments+- Meeting cadences+- Individual hiring decisions+- Marketing campaigns++**Process:**+- Decide quickly+- Empower individuals/small teams+- Monitor results+- Adjust as needed+- Don't over-analyze++## The Reversibility Analysis++### Step 1: Assess True Reversibility++| Factor | Question | Impact on Reversibility |+|--------|----------|------------------------|+| Technical cost | How hard to undo technically? | High cost = less reversible |+| Time cost | How long to reverse? | Months = less reversible |+| Financial cost | How expensive to change? | High cost = less reversible |+| Reputation cost | Will reversal damage trust? | Yes = less reversible |+| Learning cost | Will we lose the learning? | Critical learning = more complex |+| Dependency cost | Have others built on this? | Many dependents = less reversible |++### Step 2: Categorize the Decision++```+Reversibility Score:+- Can undo in days with minimal cost: TYPE 2 (two-way door)+- Can undo in weeks with moderate cost: TYPE 2 with monitoring+- Can undo in months with significant cost: TYPE 1.5 (evaluate carefully)+- Cannot realistically undo: TYPE 1 (one-way door)+```++### Step 3: Match Process to Type++| Decision Type | Process | Time | Decision Maker |+|---------------|---------|------|----------------|+| Type 1 | Full analysis, stakeholder review | Days-weeks | Senior leadership |+| Type 1.5 | Structured analysis, peer review | Days | Team lead + stakeholders |+| Type 2+ | Quick analysis, document rationale | Hours | Individual/small team |+| Type 2 | Just decide | Minutes | Individual |++## Common Reversibility Misclassifications++### Treating Type 2 as Type 1++```+Decision: Which logging library to use+Common mistake: Extensive evaluation, committee decision, weeks of analysis+Reality: Can swap libraries in a day; dependencies are isolated+Correct approach: Engineer picks one, team evaluates after 2 weeks++Cost of over-deliberation: Weeks of productivity lost+```++### Treating Type 1 as Type 2++```+Decision: Database technology for core product+Common mistake: Quick decision because "we can always change later"+Reality: Changing databases means rewriting queries, data migration, retraining+Correct approach: Thorough evaluation, prototype, stakeholder alignment++Cost of under-deliberation: Months of migration pain later+```++### Hidden Reversibility++Some seemingly irreversible decisions are actually reversible:++```+"We can't change our API because clients depend on it"+Reality: Versioning makes this reversible+ v1 continues, v2 adds improvements++"We can't change the architecture"+Reality: Strangler pattern enables gradual change+ Migrate piece by piece+```++### Hidden Irreversibility++Some seemingly reversible decisions lock you in:++```+"It's just a prototype, we can rewrite later"+Reality: Prototypes often become production+ "Temporary" code lives for years++"We can always switch cloud providers"+Reality: Deep integration creates massive switching cost+ Proprietary services create lock-in+```++## Reversibility Patterns++### The Pilot Pattern++Turn Type 1 into Type 2 through limited rollout:++```+Type 1: "Adopt new framework for entire codebase"+Piloted: "Use new framework for one service"+ → Now it's Type 2: Can abandon pilot with limited impact+ → If successful, expand incrementally+```++### The Abstraction Pattern++Create reversibility through interfaces:++```+Type 1: "Choose between Postgres and MySQL"+With abstraction: "Define data layer interface, start with Postgres"+ → Can swap implementation later+ → Cost of reversal dramatically reduced+```++### The Time-Box Pattern++Make long commitments into short experiments:++```+Type 1: "Commit to vendor for 3 years"+Time-boxed: "Start with 6-month pilot"+ → Can exit at known cost+ → Full commitment only after validation+```++### The Feature Flag Pattern++Deploy with reversibility built in:++```+Type 1: "Launch new pricing model"+With flags: "Launch to 5% of users, flag-controlled"+ → Can disable instantly+ → Expand only when confident+```++## Decision Speed Guidance++### Decisions to Make in Minutes++- Which test to write first+- Variable naming+- Comment wording+- Which task to pick up next+- Slack message tone++### Decisions to Make in Hours++- Library choices (within approved options)+- Implementation approach for a feature+- Meeting agenda+- Code organization within a module+- Bug fix approach++### Decisions to Make in Days++- Design patterns for new components+- API contract changes+- Team process changes+- Tool adoption+- Architectural changes to non-critical services++### Decisions to Make in Weeks++- Core architecture decisions+- Platform/infrastructure choices+- Significant hiring decisions+- Large feature scope+- Strategic priorities++## Reversibility Template++```markdown+# Reversibility Analysis: [Decision]++## The Decision+[What we're deciding]++## Reversibility Assessment++| Factor | Assessment | Score (1-5) |+|--------|------------|-------------|+| Technical effort to reverse | [Details] | |+| Time to reverse | [Duration] | |+| Financial cost to reverse | [Cost] | |+| Reputation impact of reversal | [Impact] | |+| Dependencies affected | [Count/scope] | |+| Learning lost if reversed | [Value] | |++Average: [X]+- 1-2: Clear Type 2+- 3: Type 1.5+- 4-5: Type 1++## Decision Type: [Type 1 / 1.5 / 2]++## Appropriate Process+- Analysis depth: [Minimal / Moderate / Extensive]+- Decision maker: [Individual / Team / Leadership]+- Time to decide: [Minutes / Hours / Days / Weeks]+- Documentation: [None / Brief / Full]++## Can We Increase Reversibility?+- Pilot: [Option]+- Abstraction: [Option]+- Time-box: [Option]+- Feature flag: [Option]++## Decision+[The choice made]++## Reversal Plan (if needed)+[How we would reverse if this proves wrong]+```++## Verification Checklist++- [ ] Assessed reversibility across multiple factors+- [ ] Categorized as Type 1, 1.5, or 2+- [ ] Matched decision process to decision type+- [ ] Explored options to increase reversibility+- [ ] Not over-analyzing Type 2 decisions+- [ ] Not under-analyzing Type 1 decisions+- [ ] Have a reversal plan for non-trivial decisions++## Key Questions++- "How hard would it be to undo this?"+- "Are we treating this like a one-way door when it's actually two-way?"+- "Can we pilot this to make it more reversible?"+- "What's the cost of being wrong vs. the cost of delay?"+- "Who else would be affected if we reverse?"+- "Is this actually irreversible, or does it just feel that way?"++## Bezos' Wisdom++"Some decisions are consequential and irreversible or nearly irreversible – one-way doors – and these decisions must be made methodically, carefully, slowly, with great deliberation and consultation."++"But most decisions aren't like that – they are changeable, reversible – they're two-way doors. If you've made a suboptimal Type 2 decision, you don't have to live with the consequences for that long. You can reopen the door and go back through."++"As organizations get larger, there seems to be a tendency to use the heavy-weight Type 1 decision-making process on most decisions, including many Type 2 decisions. The end result of this is slowness, unthoughtful risk aversion, failure to experiment sufficiently, and consequently diminished invention."++Speed matters. Most decisions are reversible. Decide, learn, adjust.diff --git a/.claude/skills/thinking-scientific-method/SKILL.md b/.claude/skills/thinking-scientific-method/SKILL.mdnew file mode 100644index 0000000..a6993f8--- /dev/null+++ b/.claude/skills/thinking-scientific-method/SKILL.md@@ -0,0 +1,348 @@+---+name: thinking-scientific-method+description: Hypothesis → Prediction → Test → Revise with explicit falsification. Use for debugging, feature experimentation, performance investigation, and A/B testing design.+---++# Scientific Method++## Overview++The scientific method is a systematic approach to understanding through observation, hypothesis formation, prediction, testing, and revision. In engineering, it provides rigor to debugging, experimentation, and investigation. The key insight: good hypotheses must be falsifiable—you must be able to prove them wrong.++**Core Principle:** Form hypotheses that could be proven false. Design experiments that could falsify them. Update beliefs based on evidence.++## When to Use++- Debugging (systematic cause identification)+- Performance investigation+- A/B test design+- Feature experimentation+- Root cause analysis+- Data analysis+- Any investigation where you're testing theories++Decision flow:++```+Investigating something?+ → Do you have a clear hypothesis? → no → FORM A HYPOTHESIS+ → Can your hypothesis be proven false? → no → MAKE IT FALSIFIABLE+ → Have you designed a test? → no → DESIGN AN EXPERIMENT+ → Did you update beliefs based on results? → no → REVISE AND ITERATE+```++## The Scientific Method Process++### Step 1: Observe++Gather data about the phenomenon:++```markdown+## Observation++What I'm seeing:+- API latency increased from 200ms to 800ms+- Started approximately Monday 9 AM+- Affects /checkout endpoint+- Other endpoints are normal+- Error rate is normal++Initial data:+- P50: 400ms (was 150ms)+- P99: 2.5s (was 500ms)+- Traffic: Normal levels+```++### Step 2: Question++What do you want to understand?++```markdown+## Question++Central question: Why did /checkout latency increase 4x on Monday?++Sub-questions:+- What changed on/around Monday 9 AM?+- Why only /checkout and not other endpoints?+- Why is P99 more affected than P50?+```++### Step 3: Hypothesize++Form a testable explanation:++```markdown+## Hypothesis++Primary hypothesis:+"The latency increase is caused by the payment provider SDK update+deployed Sunday night, which changed from async to sync API calls."++Why this hypothesis:+- SDK was updated Sunday (timing matches)+- /checkout is the only endpoint using payment SDK (scope matches)+- Sync calls would increase variance (P99 impact matches)+```++**Good hypothesis characteristics:**+- **Testable:** Can design an experiment+- **Falsifiable:** Can be proven wrong+- **Specific:** Not vague or unfalsifiable+- **Explanatory:** Accounts for observations++### Step 4: Predict++What would you expect IF the hypothesis is true?++```markdown+## Predictions++If hypothesis is true:+1. Rolling back the SDK should restore previous latency+2. Traffic to payment provider should show increased duration+3. Thread utilization should be higher (blocking calls)+4. Adding async wrapper should reduce latency++If hypothesis is false:+1. Rollback won't change latency+2. Payment provider call duration is unchanged+3. Thread utilization is normal+```++**Prediction requirement:**+Predictions must differentiate hypothesis-true from hypothesis-false. If both would produce the same observation, the prediction is useless.++### Step 5: Experiment++Design and run a test:++```markdown+## Experiment Design++Test: Deploy SDK rollback to canary group++Setup:+- Control: 90% traffic, new SDK+- Treatment: 10% traffic, old SDK+- Duration: 1 hour+- Metric: P50 and P99 latency++Success criteria:+- If P50 < 200ms in treatment → Hypothesis SUPPORTED+- If P50 > 350ms in treatment → Hypothesis FALSIFIED++Confounds controlled:+- Same time of day as original issue+- Same traffic routing rules+- Same downstream dependencies+```++### Step 6: Analyze++Examine the results:++```markdown+## Results++Control (new SDK):+- P50: 410ms+- P99: 2.4s+- n: 45,000 requests++Treatment (old SDK):+- P50: 155ms+- P99: 480ms+- n: 5,000 requests++Statistical significance: p < 0.001+Effect size: 62% reduction in P50++Analysis:+Hypothesis SUPPORTED. Old SDK shows pre-incident latency levels.+```++### Step 7: Conclude and Iterate++Update beliefs and act:++```markdown+## Conclusion++Finding: Payment SDK update caused latency regression+Confidence: High (controlled experiment, clear signal)++Action:+1. Roll back SDK immediately+2. File bug with payment provider+3. Add latency monitoring for SDK calls+4. Evaluate SDK changes before future updates++Next investigation:+Why didn't we catch this in staging?+Hypothesis: Staging doesn't have realistic payment provider latency+```++## Scientific Debugging++### The Debugging Scientific Method++```markdown+## Bug: Users sometimes see stale data++### Observation+- Reports of stale data from support tickets+- No clear pattern in who/when+- Estimated 5% of users affected++### Hypotheses (Multiple)+| # | Hypothesis | Falsification Test |+|---|------------|-------------------|+| 1 | Cache not invalidating | Check cache hits with stale data |+| 2 | Read replica lag | Check replica lag at time of reports |+| 3 | Browser caching | Check with cache-busted requests |+| 4 | CDN serving old content | Check CDN cache status |++### Testing Strategy+Test in order of: (ease × likelihood)+1. CDN cache status (easy to check)+2. Browser caching (easy to check)+3. Read replica lag (need to correlate times)+4. Cache invalidation (needs instrumentation)++### Test 1: CDN Cache Status+Prediction: If CDN is serving stale content,+ cache headers will show old timestamps+Result: CDN timestamps are fresh+Conclusion: CDN ruled out++### Test 2: Browser Caching+Prediction: If browser caching,+ force-refresh will show correct data+Result: Force-refresh still shows stale data sometimes+Conclusion: Browser caching ruled out++### Test 3: Read Replica Lag+Prediction: If replica lag,+ reports will correlate with lag spikes+Result: Strong correlation (r=0.84) between reports and lag spikes+Conclusion: SUPPORTED - read replica lag is the cause+```++## A/B Test Design++```markdown+## A/B Test: New Checkout Flow++### Hypothesis+"The simplified 2-step checkout will increase conversion rate+compared to current 4-step checkout."++### Predictions+If hypothesis is true:+- Conversion rate increases by >5%+- Time to complete decreases+- Abandonment rate decreases++If hypothesis is false:+- Conversion rate unchanged or decreases+- Potential confusion (errors increase)++### Experiment Design+Control: Current 4-step checkout+Treatment: New 2-step checkout+Traffic split: 50/50+Duration: 2 weeks (for statistical power)+Primary metric: Conversion rate+Guardrail metrics: Error rate, support tickets++### Sample Size Calculation+Baseline conversion: 3.2%+Minimum detectable effect: 5% relative (0.16% absolute)+Required n per group: 150,000 users++### Stopping Criteria+Stop early if:+- Treatment errors > 2x control+- Support tickets > 2x baseline+- p < 0.01 AND effect > 10%+```++## Scientific Method Template++```markdown+# Scientific Investigation: [Topic]++## Observation+What I'm seeing:+- [Observation 1]+- [Observation 2]++Data:+- [Metric]: [Value]++## Question+[Central question to answer]++## Hypotheses+| # | Hypothesis | How to Test | How to Falsify |+|---|------------|-------------|----------------|+| 1 | | | |+| 2 | | | |++## Predictions+If H1 is true:+- [Prediction 1]+- [Prediction 2]++If H1 is false:+- [Counter-prediction 1]++## Experiment+Design: [How to test]+Control: [Baseline]+Treatment: [Intervention]+Metric: [What to measure]+Duration: [How long]+Success criteria: [What constitutes support/falsification]++## Results+[Data from experiment]++## Analysis+Hypothesis [SUPPORTED/FALSIFIED]+Confidence: [High/Medium/Low]+Reasoning: [Why]++## Conclusion+Finding: [What I learned]+Action: [What to do]+Next: [Follow-up investigation]+```++## Verification Checklist++- [ ] Observations documented with data+- [ ] Hypothesis is falsifiable (can be proven wrong)+- [ ] Predictions differentiate true vs. false+- [ ] Experiment controls for confounding variables+- [ ] Results analyzed objectively+- [ ] Conclusion follows from evidence+- [ ] Updated beliefs based on evidence++## Key Questions++- "What would I expect to see if my hypothesis is true?"+- "What would I expect to see if my hypothesis is false?"+- "Can this hypothesis be proven wrong?"+- "Am I testing my hypothesis or confirming my beliefs?"+- "What's the simplest explanation that fits the data?"+- "What evidence would change my mind?"++## Feynman's Wisdom++"The first principle is that you must not fool yourself—and you are the easiest person to fool."++"It doesn't matter how beautiful your theory is, it doesn't matter how smart you are. If it doesn't agree with experiment, it's wrong."++The scientific method protects you from yourself. Your intuition generates hypotheses; the method tests them ruthlessly. When the experiment disagrees with your expectation, the experiment wins.diff --git a/.claude/skills/thinking-steel-manning/SKILL.md b/.claude/skills/thinking-steel-manning/SKILL.mdnew file mode 100644index 0000000..67215f5--- /dev/null+++ b/.claude/skills/thinking-steel-manning/SKILL.md@@ -0,0 +1,310 @@+---+name: thinking-steel-manning+description: Argue against the strongest version of opposing positions, not the weakest. Use for design reviews, evaluating alternatives, conflict resolution, and decision validation.+---++# Steel-Manning++## Overview++Steel-manning is the opposite of straw-manning. Instead of attacking the weakest version of an opposing argument, you construct and address the strongest possible version. This leads to better decisions, more productive debates, and deeper understanding of trade-offs.++**Core Principle:** To truly evaluate an idea, argue against its best form. If you can defeat the strongest version, you've actually learned something.++## When to Use++- Design reviews+- Evaluating alternative approaches+- Conflict resolution+- Validating your own decisions+- Code review discussions+- Architecture debates+- When you disagree with someone's proposal+- Before rejecting an idea++Decision flow:++```+Disagreeing with a proposal?+ → Can you state their best argument? → no → STEEL-MAN FIRST+ → Are you attacking a weak version? → yes → CONSTRUCT STRONGER VERSION+ → Have you found the core insight? → no → DIG DEEPER+```++## The Steel-Manning Process++### Step 1: Understand the Original Argument++Before improving, understand:++```markdown+## Original Proposal++Proposal: "We should rewrite the backend in Rust"++Stated reasons:+- Memory safety+- Better performance+- Modern language++Apparent weaknesses:+- Team doesn't know Rust+- Rewrite is risky+- Current system works+```++### Step 2: Identify the Core Insight++What's the strongest kernel of truth?++```markdown+## Core Insight++Behind "rewrite in Rust" is:+- Concern about memory-related bugs in production+- Performance problems that are hard to solve in current language+- Technical debt making changes slow++The proposal might be wrong, but the concerns are valid.+```++### Step 3: Construct the Strongest Version++Build the best possible case:++```markdown+## Steel-Manned Argument++"Our memory-safety issues have caused 3 major outages this year,+costing us ~$500K in engineering time and customer trust.+Our performance problems stem from GC pauses that are fundamental+to our current runtime. While a rewrite is risky, the incremental+cost of working around these limitations is growing.++A gradual rewrite of performance-critical paths to Rust would:+- Eliminate a class of bugs (memory safety)+- Solve GC-related latency issues+- Attract engineers who want modern tooling+- Create optionality for high-performance features++The risk can be mitigated by:+- Starting with one isolated service+- Keeping the team small and focused+- Maintaining the old system during transition+- Having clear rollback criteria"+```++### Step 4: Address the Steel-Manned Version++Now engage with the strongest argument:++```markdown+## Response to Steel-Manned Argument++The strongest case for Rust addresses real problems. However:++Memory safety issues:+- 2 of 3 outages were logic bugs, not memory bugs+- Could be addressed with better testing in current language+- Rust learning curve might introduce new bug classes++Performance:+- GC issues could be addressed with tuning+- Critical path is <5% of codebase+- FFI to native code is an option without full rewrite++The 6-month investment in Rust might be better spent:+- 2 months: Performance profiling and GC tuning+- 2 months: Targeted native extensions for hot paths+- 2 months: Improved testing/monitoring++This addresses the concerns with lower risk.+```++### Step 5: Find the Synthesis++What's the best answer considering both sides?++```markdown+## Synthesis++The Rust proposal was right about the problems, less right about the solution.++Agreed:+- Memory safety is a real concern (but smaller than stated)+- Performance needs improvement (but addressable incrementally)+- Technical modernization has value (but not at rewrite cost)++Plan:+1. Address immediate performance with profiling + tuning+2. Build one small service in Rust as learning experiment+3. Evaluate Rust for future services based on learnings+4. Don't rewrite existing system++This takes the best of both positions.+```++## Steel-Manning Patterns++### In Design Reviews++```markdown+## Design Review: Microservices Proposal++Weak version to avoid:+"They just want to use trendy tech"++Steel-manned version:+"The monolith has become a development bottleneck.+Deploy conflicts are causing delays. Different teams+need different scaling characteristics. The proposal+addresses real coordination problems."++Now address:+"The coordination problems are real, but can we solve them+with modular monolith patterns before taking on distributed+systems complexity?"+```++### In Code Reviews++```markdown+## Code Review: Complex Abstraction++Weak critique:+"This is over-engineered"++Steel-manned understanding:+"The author anticipated we'll need to support multiple+backends. This abstraction makes adding new backends+trivial. The complexity exists to serve future flexibility."++Better critique:+"I understand this enables multiple backends. Let's+validate that requirement—if we only ever need one,+the abstraction adds maintenance burden without benefit."+```++### In Conflict Resolution++```markdown+## Team Disagreement: Testing Strategy++Person A: "We need 100% code coverage"+Person B: "Code coverage is a vanity metric"++Steel-man A:+"Coverage ensures we think about edge cases and makes+refactoring safer. Without coverage requirements,+critical paths go untested."++Steel-man B:+"Coverage without quality gives false confidence.+Testing getters/setters wastes time better spent on+integration tests that catch real bugs."++Synthesis:+"Coverage is valuable for complex logic, less valuable+for trivial code. Let's require coverage for business+logic modules, but focus on integration tests for+overall system confidence."+```++### In Self-Critique++```markdown+## Validating My Own Decision++My decision: Use NoSQL for this project++Steel-man the opposite:+"SQL has survived 50 years because relational models+work for most data. NoSQL solves problems most projects+don't have. The flexibility of schemaless data becomes+a bug when requirements solidify. Joins are a feature,+not a limitation."++Now: Does my NoSQL choice survive this critique?+- Do I actually need schemaless flexibility?+- Will I regret not having joins?+- Am I solving a problem I don't have?+```++## Steel-Manning Red Flags++Signs you're straw-manning instead:++| Straw-Man Sign | Example | Fix |+|----------------|---------|-----|+| "They just want..." | "They just want to use new tech" | Find the legitimate concern |+| Attacking messenger | "They're inexperienced" | Address the argument |+| Cherry-picking worst example | "Remember when X failed?" | Consider best examples |+| Assuming bad faith | "They don't care about quality" | Assume they want good outcomes |+| Ignoring strong points | Skipping their best argument | Address strongest point first |++## Steel-Manning Template++```markdown+# Steel-Man Analysis: [Topic]++## Original Position+Who: [Person/group]+Position: [Their stated view]+Stated reasons: [Their explicit arguments]++## Apparent Weaknesses+[What seems wrong at first glance]++## Core Insight+[The legitimate concern or truth behind the position]++## Steel-Manned Version+[The strongest possible formulation of their argument]++"[Write it as if you were advocating for this position]"++## My Response to the Strong Version+[Now address the steel-manned argument]++## What I Learned+[How did steel-manning change my understanding?]++## Synthesis+[Best answer considering both positions]+```++## Verification Checklist++- [ ] Understood the original argument+- [ ] Identified the core insight/concern+- [ ] Constructed the strongest possible version+- [ ] Addressed the strong version, not a weak one+- [ ] Found what's legitimate in the opposing view+- [ ] Considered synthesis of positions+- [ ] Changed my mind if the steel-man is convincing++## Key Questions++- "What's the strongest version of this argument?"+- "What legitimate concern is behind this?"+- "Could I argue this position convincingly?"+- "What would make this position correct?"+- "Am I attacking the weakest or strongest form?"+- "If I were advocating for this, what would I say?"++## Rapoport's Rules (Related)++Daniel Dennett, channeling Anatol Rapoport, offers rules for criticizing:++1. Attempt to re-express the target's position so clearly that they say "Thanks, I wish I'd thought of putting it that way."+2. List any points of agreement (especially if not matters of widespread agreement).+3. Mention anything you learned from the target.+4. Only then are you permitted to say so much as a word of rebuttal or criticism.++This is steel-manning as ethical practice.++## Mill's Wisdom++"He who knows only his own side of the case knows little of that."++You don't truly understand your position until you can argue the opposition's best case. Steel-manning isn't weakness—it's the path to strong positions that can withstand strong criticism.diff --git a/.claude/skills/thinking-theory-of-constraints/SKILL.md b/.claude/skills/thinking-theory-of-constraints/SKILL.mdnew file mode 100644index 0000000..4f5acfe--- /dev/null+++ b/.claude/skills/thinking-theory-of-constraints/SKILL.md@@ -0,0 +1,343 @@+---+name: thinking-theory-of-constraints+description: Identify and manage the bottleneck; improvements elsewhere don't matter until the constraint is addressed. Use for performance optimization, process improvement, and resource allocation.+---++# Theory of Constraints++## Overview++The Theory of Constraints (TOC), developed by Eliyahu Goldratt in "The Goal," states that every system has exactly one constraint that limits its throughput. Optimizing anything other than the constraint is wasted effort—even counterproductive. Find the bottleneck, exploit it, subordinate everything else to it, and only then consider elevating it.++**Core Principle:** A chain is only as strong as its weakest link. Strengthening any other link does nothing.++## When to Use++- Performance optimization (systems, processes, teams)+- Process improvement+- Resource allocation+- Throughput analysis+- Project management+- Capacity planning+- Any optimization effort++Decision flow:++```+Trying to improve throughput?+ → Have you identified the constraint? → no → FIND THE CONSTRAINT FIRST+ → Are you optimizing a non-constraint? → yes → STOP, FOCUS ON CONSTRAINT+ → Is the constraint working at 100%? → no → EXPLOIT BEFORE ELEVATING+```++## The Five Focusing Steps++### Step 1: Identify the Constraint++Find the one thing limiting the system:++```markdown+## Constraint Identification++System: Software delivery pipeline++Potential constraints:+| Stage | Capacity | Utilization | Queue Time |+|-------|----------|-------------|------------|+| Requirements | 10/week | 60% | 0 days |+| Development | 8/week | 95% | 3 days |+| Code Review | 5/week | 100% | 5 days |←CONSTRAINT+| Testing | 12/week | 40% | 0 days |+| Deployment | 20/week | 20% | 0 days |++Constraint: Code Review+Evidence: 100% utilization, 5-day queue, lowest throughput+```++**How to find the constraint:**+- Highest utilization+- Longest queue/wait time+- Lowest throughput rate+- Where work piles up+- What people complain about waiting for++### Step 2: Exploit the Constraint++Get maximum output from the constraint without spending money:++```markdown+## Exploiting the Constraint++Constraint: Code Review (5/week capacity)++Exploitation strategies:+| Strategy | Effort | Impact |+|----------|--------|--------|+| Never let reviewers wait for reviewable PRs | Low | +10% |+| Batch small PRs together | Low | +15% |+| Clear review criteria to reduce back-and-forth | Low | +20% |+| Prioritize reviews over other reviewer work | Medium | +10% |+| Remove unnecessary review requirements | Low | +15% |++Total potential: 5/week → 8/week (60% increase, no new resources)+```++**Exploitation questions:**+- Is the constraint ever idle? Why?+- Is the constraint doing any unnecessary work?+- Is the constraint's output ever wasted downstream?+- Can we reduce setup/changeover time?+- Can we improve quality at the constraint (less rework)?++### Step 3: Subordinate Everything Else++Non-constraints should serve the constraint:++```markdown+## Subordination++Every other stage should optimize FOR code review, not for itself.++Requirements:+- DON'T: Maximize requirement throughput+- DO: Pace requirements to match code review capacity+- DO: Ensure requirements are clear (reduce review iterations)++Development:+- DON'T: Maximize development output+- DO: Produce review-ready code at the rate review can handle+- DO: Spend extra time on clarity (save reviewer time)++Testing:+- DON'T: Maximize testing efficiency+- DO: Be ready to test immediately when reviews complete+- DO: Provide feedback that helps reviewers learn++Counter-intuitive: Keeping developers busy beyond review capacity+ creates work-in-progress that HURTS throughput+```++**Subordination principle:**+Local optimization of non-constraints often hurts global throughput. A 100% utilized developer feeding a 100% utilized reviewer creates a queue that slows everything.++### Step 4: Elevate the Constraint++If exploitation isn't enough, invest in increasing constraint capacity:++```markdown+## Elevating the Constraint++Current constraint capacity: 8/week (after exploitation)+Required capacity: 12/week++Elevation options:+| Option | Cost | Capacity Gain |+|--------|------|---------------|+| Hire dedicated reviewer | $150K/year | +4/week |+| Train more reviewers | $10K training | +2/week |+| Adopt review tooling | $5K/year | +1/week |+| Pair reviewing | Process change | +3/week |++Recommendation: Training + tooling first ($15K for +3/week)+ Then hire if still insufficient+```++**Elevation timing:**+Only elevate after exploitation is maxed out. Elevating is expensive; exploitation is cheap.++### Step 5: Prevent Inertia (Go Back to Step 1)++When you elevate, the constraint often moves:++```markdown+## Constraint Movement++Before: Code Review was constraint (5/week)+After elevation: Code Review does 12/week++New constraint search:+| Stage | Capacity | Utilization |+|-------|----------|-------------|+| Requirements | 10/week | 100% | ←NEW CONSTRAINT+| Development | 15/week | 80% |+| Code Review | 12/week | 80% |+| Testing | 12/week | 100% | ←OR THIS ONE |++System bottleneck moved—repeat the process.+```++## Finding Constraints++### Types of Constraints++| Type | Examples | How to Find |+|------|----------|-------------|+| Physical | Machine capacity, server limits | Utilization metrics |+| Policy | Approval requirements, rules | Process analysis |+| Market | Customer demand | Sales/pipeline data |+| Time | Fixed deadlines | Schedule analysis |+| Knowledge | Expert availability | Skill matrix |++### Constraint Indicators++```+Signs of a constraint:+✓ Work queues up before this stage+✓ Downstream stages have idle time+✓ Increasing input doesn't increase output+✓ This stage is always at full capacity+✓ Small improvements here have large system effects++Signs of a non-constraint:+✓ Often has idle time+✓ Improvement has no system effect+✓ Work flows through without queuing+```++## TOC Application Patterns++### Performance Optimization++```markdown+## System Performance Analysis++Request flow:+API Gateway → Auth → App Logic → Database → Response++Latency breakdown:+| Component | Latency | % of Total |+|-----------|---------|------------|+| API Gateway | 5ms | 2% |+| Auth | 10ms | 4% |+| App Logic | 30ms | 12% |+| Database | 200ms | 80% | ←CONSTRAINT+| Response | 5ms | 2% |++Constraint: Database++Wrong approach: Optimize app logic (12% of latency)+Right approach: Focus 100% on database optimization+ Query optimization, caching, indexing, read replicas+```++### Team Productivity++```markdown+## Team Throughput Analysis++Team flow:+Backlog → Development → Review → Testing → Deployment++Throughput analysis:+| Stage | Capacity | Cycle Time |+|-------|----------|------------|+| Backlog | Unlimited | 0 |+| Development | 6 stories/sprint | 2 days |+| Review | 4 stories/sprint | 4 days | ←CONSTRAINT+| Testing | 10 stories/sprint | 1 day |+| Deployment | 20 stories/sprint | 0.5 days |++Team can only deliver 4 stories/sprint due to review constraint.+Having developers "work harder" just creates a bigger queue.++Solution: Subordinate development to review capacity+ - Developers do more review+ - Smaller stories (faster to review)+ - Better PR descriptions+```++### Project Management++```markdown+## Project Timeline Analysis++Project constraint analysis:+| Resource | Required | Available | Buffer |+|----------|----------|-----------|--------|+| Development | 8 weeks | 10 weeks | 2 weeks |+| Design | 2 weeks | 3 weeks | 1 week |+| Backend API | 3 weeks | 3 weeks | 0 weeks | ←CONSTRAINT+| Frontend | 4 weeks | 5 weeks | 1 week |+| Testing | 2 weeks | 3 weeks | 1 week |++Critical path goes through Backend API (no buffer).++Project management actions:+- Protect Backend API timeline at all costs+- Other resources support Backend API+- Don't let anything block Backend API+- Buffer should flow to protect the constraint+```++## Theory of Constraints Template++```markdown+# TOC Analysis: [System/Process]++## System Definition+What flows through this system: [Work items, requests, features]+Goal: [What throughput matters]++## Constraint Identification++| Stage | Capacity | Utilization | Queue Time | Throughput |+|-------|----------|-------------|------------|------------|+| | | | | |++**Identified Constraint:** [Stage]+**Evidence:** [Why this is the constraint]++## Step 2: Exploit++How to maximize constraint output without investment:+| Exploitation | Effort | Expected Gain |+|--------------|--------|---------------|+| | | |++## Step 3: Subordinate++How should non-constraints support the constraint?+| Stage | Current Behavior | Should Change To |+|-------|------------------|------------------|+| | | |++## Step 4: Elevate (if needed)++If exploitation isn't sufficient:+| Elevation Option | Cost | Capacity Gain |+|------------------|------|---------------|+| | | |++## Step 5: Next Constraint++After elevation, where will the constraint move?+[Prediction]+```++## Verification Checklist++- [ ] Identified the single constraint (not multiple "bottlenecks")+- [ ] Have data supporting the constraint identification+- [ ] Maximized exploitation before considering elevation+- [ ] Non-constraints are subordinated (not locally optimized)+- [ ] Not investing in non-constraint improvements+- [ ] Monitoring for constraint movement++## Key Questions++- "What's the ONE thing limiting throughput?"+- "Is the constraint ever idle? Why?"+- "Are we improving a non-constraint while ignoring the constraint?"+- "Are non-constraint improvements building inventory?"+- "What should the rest of the system do to serve the constraint?"+- "If we improve this, where will the constraint move?"++## Goldratt's Wisdom++"Every action that brings the company closer to its goal is productive. Every action that does not bring a company closer to its goal is not productive."++"An hour lost at a bottleneck is an hour lost forever. An hour saved at a non-bottleneck is a mirage."++"The sum of local optimums is not equal to the global optimum."++Optimizing everywhere is the same as optimizing nowhere. Find the constraint. Make it work. That's all that matters until the constraint moves.diff --git a/.claude/skills/thinking-thought-experiment/SKILL.md b/.claude/skills/thinking-thought-experiment/SKILL.mdnew file mode 100644index 0000000..d70f10c--- /dev/null+++ b/.claude/skills/thinking-thought-experiment/SKILL.md@@ -0,0 +1,338 @@+---+name: thinking-thought-experiment+description: Test ideas through hypothetical scenarios when empirical testing is impractical. Use for architecture evaluation, edge case analysis, ethics considerations, and strategy development.+---++# Thought Experiments++## Overview++Thought experiments use imagination to test ideas when direct experimentation is impractical, impossible, or premature. Einstein's elevator, Schrödinger's cat, and the trolley problem have advanced physics and philosophy. In engineering, thought experiments help evaluate designs, explore edge cases, and stress-test decisions before implementation.++**Core Principle:** Structured imagination is a tool. When you can't test in reality, test in your mind with discipline.++## When to Use++- Evaluating architecture before building+- Exploring edge cases and failure modes+- Stress-testing strategies and plans+- Ethical considerations+- Competitive scenario analysis+- Understanding complex systems+- When empirical testing is costly or impossible++Decision flow:++```+Need to evaluate an idea?+ → Can you test empirically? → yes → Test+ → Is empirical test too costly/slow? → yes → THOUGHT EXPERIMENT FIRST+ → Are you evaluating edge cases? → yes → THOUGHT EXPERIMENT+ → Is this a one-way decision? → yes → THOUGHT EXPERIMENT+```++## Types of Thought Experiments++### 1. The Hypothetical Scenario++Imagine a specific situation and trace consequences:++```+"What if we had 100x current traffic tomorrow?"+"What if our primary database failed right now?"+"What if a competitor copied our core feature?"+```++### 2. The Extreme Case++Push a parameter to its limit:++```+"What happens with 0 users? 1 billion users?"+"What if latency was 0? What if it was 10 seconds?"+"What if this team was 1 person? 100 people?"+```++### 3. The Counterfactual++Imagine the opposite of reality:++```+"What if we hadn't chosen microservices?"+"What if we didn't have this dependency?"+"What if our main customer segment didn't exist?"+```++### 4. The Role Reversal++Think from a different perspective:++```+"What would a malicious actor do with this system?"+"How would a new hire experience this codebase?"+"What would a competitor do with our technology?"+```++### 5. The Time Shift++Move forward or backward in time:++```+"How will this look in 5 years?"+"If we had known this a year ago, what would we have done?"+"What will we wish we had built today?"+```++## The Thought Experiment Process++### Step 1: Define the Experiment++State clearly what you're testing:++```markdown+## Thought Experiment: Database Failure Resilience++Question: How would our system behave if the primary database+ became unavailable for 30 minutes during peak traffic?++Variables:+- Database state: Unavailable+- Duration: 30 minutes+- Traffic: Peak (3x normal)+- Preparation time: None (unexpected)+```++### Step 2: Set the Initial Conditions++Describe the starting state precisely:++```markdown+## Initial Conditions++System state:+- 10,000 active users+- 500 RPS to database+- No circuit breaker currently+- 10-second connection timeout+- No read replica failover configured++User behavior:+- Users will retry failed requests+- ~50% will leave after 2 failures+```++### Step 3: Trace the Consequences++Walk through what happens step by step:++```markdown+## Consequence Chain++T+0s: Database becomes unavailable+T+0-10s: Requests queue waiting for connection+T+10s: Connection timeouts start+T+10-30s: App servers accumulate waiting requests+T+30s: Thread pools exhausted+T+30s-2m: Cascading timeouts to upstream services+T+2m: Load balancer health checks fail+T+2m: Alerts fire (too late - damage done)+T+2-30m: Service completely unavailable+T+30m: Database returns, but app servers need restart+T+35m: Service gradually recovers+T+1h: Backlog of failed requests processed+```++### Step 4: Identify Insights++What did you learn?++```markdown+## Insights++1. Circuit breaker would limit cascade (need to implement)+2. Thread pool exhaustion is the failure mode (need limits)+3. Alerts fire too late (need proactive monitoring)+4. Recovery is slow (need automated recovery)+5. User experience is terrible (need graceful degradation)+```++### Step 5: Derive Actions++What should you do based on this experiment?++```markdown+## Actions++| Insight | Action | Priority |+|---------|--------|----------|+| No circuit breaker | Implement circuit breaker | High |+| Thread pool exhaustion | Add connection limits | High |+| Late alerts | Add DB latency monitoring | Medium |+| Slow recovery | Automate failover | Medium |+| Poor UX | Implement degraded mode | Medium |+```++## Thought Experiment Patterns++### The Failure Mode Analysis++```markdown+## Thought Experiment: What if [component] fails?++For each critical component:+- API Gateway fails: [Trace consequences]+- Auth service fails: [Trace consequences]+- Cache layer fails: [Trace consequences]+- Message queue fails: [Trace consequences]++Template for each:+1. What fails immediately?+2. What fails within 1 minute?+3. What's the blast radius?+4. How would we know?+5. How would we recover?+```++### The Adversarial Analysis++```markdown+## Thought Experiment: Attacker Perspective++"I am a malicious actor with [access level]. How would I cause maximum damage?"++Scenario 1: External attacker with no access+- What public endpoints are vulnerable?+- What would a DDoS look like?+- What data could I infer from public behavior?++Scenario 2: Compromised user account+- What can I access beyond my own data?+- Can I escalate privileges?+- What's the blast radius of one compromised account?++Scenario 3: Malicious insider+- What would a rogue employee do?+- What access is over-provisioned?+- What audit trails would catch this?+```++### The Scale Experiment++```markdown+## Thought Experiment: 10x Scale++Current: 10,000 users, 100 RPS+Imagined: 100,000 users, 1,000 RPS++What breaks?+- [ ] Database connections (pool exhaustion at ~300)+- [ ] Single-threaded workers (CPU bound at ~500 RPS)+- [ ] Memory per request (OOM at ~800 RPS)+- [ ] Network bandwidth (saturated at ~1500 RPS)++What doesn't break?+- [x] Stateless API servers (horizontally scalable)+- [x] CDN-served assets (already edge-cached)+- [x] Read-heavy queries (can add replicas)++First constraint to address: Database connection pooling+```++### The Timeline Experiment++```markdown+## Thought Experiment: 3 Years From Now++It's 2027. Our system is [successful/struggling]. Why?++Success scenario:+- What architectural decisions paid off?+- What did we avoid that would have hurt us?+- What did we invest in that scaled well?++Struggle scenario:+- What technical debt crushed us?+- What market change did we miss?+- What architecture couldn't adapt?++Present implications:+- What should we invest in now for 2027 success?+- What should we avoid now to prevent 2027 failure?+```++## Thought Experiment Template++```markdown+# Thought Experiment: [Title]++## Question+What am I trying to understand?+[Precise question]++## Setup+Initial conditions:+- [Condition 1]+- [Condition 2]++Variables being tested:+- [Variable 1]: [Value in experiment]+- [Variable 2]: [Value in experiment]++## Thought Experiment+[Step-by-step trace of what happens]++T+0: [Initial event]+T+X: [Consequence]+T+Y: [Next consequence]+...+T+end: [Final state]++## Observations+What happened in the experiment?+- [Observation 1]+- [Observation 2]++## Insights+What did I learn?+- [Insight 1]+- [Insight 2]++## Implications+What should I do differently?+- [Action 1]+- [Action 2]++## Limitations+What didn't this experiment capture?+- [Limitation 1]+- [Limitation 2]+```++## Verification Checklist++- [ ] Defined a clear, specific question+- [ ] Set up realistic initial conditions+- [ ] Traced consequences systematically+- [ ] Considered second-order effects+- [ ] Identified non-obvious insights+- [ ] Derived actionable implications+- [ ] Acknowledged experiment limitations++## Key Questions++- "What happens if [extreme scenario]?"+- "How would this look from [different perspective]?"+- "What would [5 years from now] tell us about this decision?"+- "What if the opposite were true?"+- "What's the worst thing that could happen?"+- "How would a [malicious actor/competitor/novice] interact with this?"++## Einstein's Approach++"A thought experiment is a device with which one performs an intentional, structured process of intellectual deliberation in order to speculate, within a specifiable problem domain, about potential consequents (or antecedents) for a designated antecedent (or consequent)."++More simply: Imagine a scenario, trace what happens, and learn.++"I have no special talents. I am only passionately curious."++Thought experiments are curiosity with structure. Ask "what if?" systematically, trace the answer carefully, and you'll see what testing in reality would eventually show you—sometimes years sooner.diff --git a/.claude/skills/thinking-via-negativa/SKILL.md b/.claude/skills/thinking-via-negativa/SKILL.mdnew file mode 100644index 0000000..2425fbe--- /dev/null+++ b/.claude/skills/thinking-via-negativa/SKILL.md@@ -0,0 +1,342 @@+---+name: thinking-via-negativa+description: Improve by removal rather than addition. Focus on what to stop doing, eliminate the negative, and subtract complexity. Use for system simplification, process improvement, and feature prioritization.+---++# Via Negativa++## Overview++Via Negativa, articulated by Nassim Taleb in "Antifragile," is the principle that improvement often comes from subtraction rather than addition. We're biased toward adding (features, processes, complexity) when removing (bugs, friction, unnecessary work) often provides more value with less risk.++**Core Principle:** Focus on what to remove, not what to add. Subtraction is more robust than addition.++## When to Use++- System simplification+- Process improvement+- Feature prioritization (what NOT to build)+- Performance optimization+- Reducing technical debt+- Personal productivity+- Decision-making (what to avoid)+- Code review (what to delete)++Decision flow:++```+Trying to improve something?+ → First instinct is to add? → yes → PAUSE, CONSIDER SUBTRACTION+ → Can you achieve the goal by removing instead? → yes → REMOVE FIRST+ → Is current complexity necessary? → no → SIMPLIFY VIA NEGATIVA+```++## The Via Negativa Process++### Step 1: Identify What to Eliminate++Instead of "What should we add?", ask:++```+- What's not working that we should remove?+- What's causing harm we should stop?+- What's unnecessary complexity we should eliminate?+- What's outdated that we should delete?+```++### Step 2: Catalog Candidates for Removal++List elements that might be subtracted:++```markdown+## Candidates for Removal++Code:+- Dead code (unreachable)+- Deprecated features (still running)+- Unused dependencies+- Redundant abstractions++Process:+- Meetings that don't produce decisions+- Approval steps that don't add value+- Reports no one reads+- Alerts no one acts on++Features:+- Low-usage functionality+- Legacy features maintained "just in case"+- Edge cases that complicate the core+```++### Step 3: Evaluate Impact of Removal++For each candidate:++```markdown+| Element | Usage | Maintenance Cost | Risk of Removal | Value of Removal |+|---------|-------|------------------|-----------------|------------------|+| Feature X | 0.1% of users | 20 hrs/month | Low | High |+| Meeting Y | 8 people | 4 hrs/week | None | High |+| Process Z | 5 approvers | 2 days/request | Medium | Medium |+```++### Step 4: Remove with Monitoring++Subtract and verify no harm:++```markdown+Week 1: Remove Feature X for 10% of users+Week 2: Monitor complaints, metrics+Week 3: If no issues, remove for 50%+Week 4: Full removal and code deletion+```++## Via Negativa Patterns++### Subtractive Design++Add by removing:++```+Goal: Make the product easier to use+Additive approach: Add tutorial, tooltips, help section+Via Negativa: Remove confusing features, simplify flow, delete options++Often more effective:+- Fewer choices = easier decisions+- Less surface area = less to learn+- Simpler UI = faster adoption+```++### The Pruning Principle++Healthy growth requires pruning:++```+Codebase:+- Every feature has maintenance cost+- Old features create complexity tax+- Pruning unused code enables healthier growth++Team:+- Every process has coordination cost+- Old processes accumulate like barnacles+- Pruning enables focus on what matters+```++### Harm Reduction Over Benefit Addition++Removing bad is often more impactful than adding good:++```+Performance:+- Removing one slow query helps more than adding one cache+- Eliminating N+1 beats adding read replicas+- Deleting unused indexes beats adding new ones++Health (Taleb's domain):+- Removing sugar helps more than adding supplements+- Stopping smoking beats starting exercise+- Eliminating stress beats adding meditation+```++### The 80/20 Removal++Remove the 80% that provides 20% of value:++```markdown+## Feature Usage Analysis++| Feature | Users | Revenue | Maintenance |+|---------|-------|---------|-------------|+| Core A | 90% | 70% | 20% |+| Core B | 85% | 25% | 15% |+| Edge C | 5% | 3% | 25% |+| Edge D | 2% | 2% | 40% |++Via Negativa: Remove Edge C and D+Result: 65% less maintenance for 5% of value+ Enables focus on Core A and B+```++## Application Areas++### Code++```markdown+## Via Negativa Code Review++Before adding new code, ask:+1. Can we solve this by removing existing code?+2. Is there dead code to delete?+3. Are there unused imports/dependencies?+4. Is there duplication to consolidate?+5. Are there unnecessary abstractions?++Rule: Every PR should delete at least as much as it adds+ (aspirational, not mandatory)+```++### Process++```markdown+## Via Negativa Process Audit++List all recurring processes:+- Daily standup (15 min/day × 8 people = 10 hrs/week)+- Sprint planning (2 hrs × 8 people = 16 hrs/sprint)+- Weekly status report (2 hrs to write)+- Monthly review (4 hrs × 5 people = 20 hrs/month)++For each, ask:+- What happens if we stop?+- Can we reduce frequency?+- Can we reduce attendees?+- Can we reduce duration?++Often: Half the meetings, half the reports = more productive+```++### Features++```markdown+## Via Negativa Product Strategy++Instead of roadmap of additions, create:++## Sunset List+| Feature | Usage | Decision | Timeline |+|---------|-------|----------|----------|+| Export to CSV | 0.5% | Remove | Q2 |+| Legacy API v1 | 2% | Deprecate | Q3 |+| Advanced filters | 3% | Simplify | Q2 |++## Maintenance Liberation+Removing 3 features frees 2 engineers for core work++## Simplicity Gains+- Fewer code paths to test+- Smaller attack surface+- Easier onboarding+- Faster development+```++### Personal Productivity++```markdown+## Via Negativa for Focus++Don't add:+- More productivity apps+- More systems+- More commitments++Instead remove:+- Notifications+- Unnecessary meetings+- Low-value tasks+- Context switching+- Decision fatigue (reduce choices)++"Stop doing" list > "To do" list+```++### Architecture++```markdown+## Via Negativa Architecture Review++Before adding complexity, audit existing:++Services to consolidate:+- Microservice A and B do similar things → Merge+- Service C has one caller → Inline++Dependencies to remove:+- Library X is used for one function → Write function+- Framework Y is overkill → Use lighter alternative++Layers to eliminate:+- Abstraction that has one implementation → Remove+- API that wraps another API identically → Direct call+```++## Via Negativa Template++```markdown+# Via Negativa Analysis: [System/Process/Product]++## Current State+[Description of what exists]++## Candidates for Removal++### Category 1: Unused/Dead+| Element | Evidence of Non-Use | Removal Risk |+|---------|---------------------|--------------|+| | | |++### Category 2: Low-Value High-Cost+| Element | Value Provided | Maintenance Cost | Ratio |+|---------|---------------|------------------|-------|+| | | | |++### Category 3: Redundant+| Element | Duplicated By | Removal Path |+|---------|---------------|--------------|+| | | |++## Removal Priority+1. [Element] - [Why first]+2. [Element] - [Why second]++## Removal Plan+| Element | Week | Monitor | Rollback |+|---------|------|---------|----------|+| | | | |++## Expected Benefits+- Reduced complexity: [Measure]+- Freed resources: [Measure]+- Improved focus: [Measure]+```++## The Lindy Connection++Via Negativa aligns with Lindy:+- Old things that have survived removal attempts are robust+- New additions are fragile, unproven+- Subtracting recent additions is lower risk than adding new things++## Verification Checklist++- [ ] Asked "what can we remove?" before "what should we add?"+- [ ] Identified candidates for removal in multiple categories+- [ ] Evaluated usage/value of removal candidates+- [ ] Planned gradual removal with monitoring+- [ ] Considered second-order effects of removal+- [ ] Resisted the urge to add when subtraction would work++## Key Questions++- "What can we remove instead of add?"+- "What would happen if we stopped doing this?"+- "What's the maintenance cost of this existing thing?"+- "Is this complexity earning its keep?"+- "What should we stop doing?"+- "What would we not build if starting from scratch?"++## Taleb's Wisdom++"The first principle of iatrogenics: we do not need evidence of harm to claim that a treatment is harmful; we need evidence of benefit to claim it is not harmful."++Applied to software: We don't need evidence that a feature is actively harmful to remove it; we need evidence it provides benefit to keep it.++"Via Negativa is more powerful than Via Positiva: omission does less harm than commission."++Removing is safer than adding. Every addition has unknown side effects. Removal of recent additions reverts to a known-good state. When in doubt, subtract.++"The best way to live is to maximize the number of decisions not made."++Reduce decisions through simplification. Fewer features = fewer decisions to make. Fewer processes = fewer coordination points. Simpler is more robust.diff --git a/README.md b/README.mdindex 403dd45..9c4f087 100644--- a/README.md+++ b/README.md@@ -1,18 +1,19 @@# Claude Code Thinking Skills-> **18 Mental Models and Frameworks for Critical Thinking in Claude Code**+> **38 Mental Models and Frameworks for Critical Thinking in Claude Code**A comprehensive collection of thinking skills for [Claude Code](https://claude.ai/claude-code) that enhance AI-assisted problem solving, decision making, and strategic analysis. These skills provide structured frameworks based on proven mental models from leaders in systems thinking, cognitive science, and strategic analysis.[](https://github.com/tjboudreaux/cc-thinking-skills)[](https://opensource.org/licenses/MIT)-[](https://github.com/tjboudreaux/cc-thinking-skills)+[](https://github.com/tjboudreaux/cc-thinking-skills)## Features-- **18 Thinking Frameworks** - Comprehensive mental models for better decision-making+- **38 Thinking Frameworks** - Comprehensive mental models for better decision-making- **Battle-Tested** - Based on proven frameworks from cognitive science and systems thinking- **Claude Code Native** - Designed specifically for Claude Code's skill system+- **Quality Scripts** - Tools to validate and enhance skill quality- **Zero Configuration** - Just install and invoke with skill names## Quick Start@@ -40,6 +41,7 @@ Once installed, invoke any skill by name in Claude Code:> Use first-principles thinking to analyze this architecture decision> Apply the pre-mortem framework to this project plan> Help me use Bayesian reasoning to evaluate this hypothesis+> Use the theory of constraints to find our bottleneck```## Available Skills@@ -53,6 +55,9 @@ Once installed, invoke any skill by name in Claude Code:| `thinking-inversion` | Approach problems by identifying paths to failure | Risk identification, planning || `thinking-pre-mortem` | Imagine failure and work backward | Project kickoffs, risk assessment || `thinking-kepner-tregoe` | Systematic rational process for complex analysis | High-stakes decisions, root cause analysis |+| `thinking-reversibility` | Classify decisions by reversibility (Type 1/2) | Commitment sizing, risk assessment |+| `thinking-regret-minimization` | Project to future self to test decisions | Career choices, major life decisions |+| `thinking-opportunity-cost` | Evaluate choices by what you give up | Resource allocation, prioritization |### Cognitive & Behavioral@@ -63,6 +68,8 @@ Once installed, invoke any skill by name in Claude Code:| `thinking-dual-process` | Recognize when to trust intuition vs. analysis | Speed vs. accuracy tradeoffs || `thinking-bounded-rationality` | Make good-enough decisions under constraints | Time pressure, satisficing || `thinking-socratic` | Systematic questioning framework | Requirements, debugging, coaching |+| `thinking-probabilistic` | Calibrated probability estimation | Forecasting, uncertainty quantification |+| `thinking-steel-manning` | Argue the strongest opposing position | Debate, decision validation |### Systems & Strategy@@ -72,6 +79,9 @@ Once installed, invoke any skill by name in Claude Code:| `thinking-feedback-loops` | Identify reinforcing and balancing loops | Growth design, organizational dynamics || `thinking-archetypes` | Recognize recurring system patterns | Organizational problems, recurring issues || `thinking-ooda` | Rapid decision-making for dynamic situations | Incident response, competitive scenarios |+| `thinking-leverage-points` | Find where small changes have big effects | System optimization, intervention design |+| `thinking-theory-of-constraints` | Identify and manage bottlenecks | Performance optimization, throughput |+| `thinking-cynefin` | Classify problems by complexity domain | Methodology selection, approach matching |### Problem Solving & Innovation@@ -81,6 +91,73 @@ Once installed, invoke any skill by name in Claude Code:| `thinking-map-territory` | Recognize limits of mental models | Expectation mismatches, abstractions || `thinking-circle-of-competence` | Know the boundaries of expertise | Delegation, learning decisions || `thinking-triz` | Resolve technical contradictions | Engineering design, innovation |+| `thinking-five-whys-plus` | Enhanced root cause analysis with bias guards | Debugging, incident postmortems |+| `thinking-scientific-method` | Hypothesis-driven investigation | Debugging, A/B testing, experimentation |+| `thinking-thought-experiment` | Structured imagination for exploration | Architecture, edge cases, philosophy |++### Estimation & Risk++| Skill | Description | Best For |+|-------|-------------|----------|+| `thinking-fermi-estimation` | Order-of-magnitude calculations | Quick sizing, feasibility checks |+| `thinking-margin-of-safety` | Build in buffers for uncertainty | Risk management, system design |+| `thinking-lindy-effect` | Older things likely to last longer | Technology selection, durability |+| `thinking-via-negativa` | Improve by removing, not adding | Simplification, robustness |+| `thinking-red-team` | Attack your own plans adversarially | Security review, plan validation |++### Product & Innovation++| Skill | Description | Best For |+|-------|-------------|----------|+| `thinking-jobs-to-be-done` | Understand the job customers hire products for | Product development, feature design |+| `thinking-effectuation` | Start with means, not goals | Startups, innovation, uncertainty |++### Meta-Skills++| Skill | Description | Best For |+|-------|-------------|----------|+| `thinking-model-selection` | Choose the right model for the problem | New problems, approach selection |+| `thinking-model-combination` | Combine multiple models for richer analysis | Complex problems, high-stakes decisions |++## Quality Assurance Tools++This collection includes scripts to maintain and improve skill quality:++### Validate Skills++Check all skills against quality criteria:++```bash+node scripts/validate-skills.js+```++Outputs a report showing:+- Required sections present/missing+- Quality metrics (examples, tables, checklists)+- Overall score per skill+- Skills needing attention++### Generate Enhancement Suggestions++Get specific improvement suggestions for a skill:++```bash+# Single skill+node scripts/enhance-skill.js thinking-first-principles++# All skills summary+node scripts/enhance-skill.js+```++### Generate AI Improvement Prompts++Create prompts for Claude to enhance skills:++```bash+node scripts/generate-improvement-prompt.js thinking-bayesian+```++This generates a detailed prompt you can use with Claude Code to systematically improve any skill.## Detailed Skill Descriptions@@ -108,37 +185,38 @@ View problems as part of interconnected wholes with feedback loops and emergent- Fix in one place breaks another- Behavior seems emergent or unexpected-### OODA Loop-Rapid decision-making framework (Observe, Orient, Decide, Act) for dynamic situations. Speed through the loop creates competitive advantage.+### Theory of Constraints+Every system has exactly one constraint limiting throughput. Optimizing anything else is wasted effort. Based on Eliyahu Goldratt's work.**When to use:**-- Incident response and outages-- Time-sensitive decisions-- Rapidly changing requirements+- Performance optimization+- Process improvement+- Resource allocation+- Identifying bottlenecks-### Pre-Mortem Analysis-Imagine a project has failed and work backward to identify why. Improves risk identification by approximately 30%.+### Cynefin Framework+Classify problems by the relationship between cause and effect: Clear, Complicated, Complex, or Chaotic. Each domain requires a different approach.**When to use:**-- Project kickoffs-- Before major technical decisions-- When team seems overconfident+- Choosing methodologies+- Understanding why approaches fail+- Crisis management-### Cognitive Debiasing-Systematic checklist to identify cognitive biases. Based on Kahneman, Lovallo, and Sibony's research.+### Jobs to Be Done+Customers don't buy products—they hire them to do jobs. Understanding the job unlocks innovation.**When to use:**-- Before making major decisions-- When stakes are high-- When you feel very confident+- Product development+- Feature prioritization+- Understanding customer behavior-### TRIZ Innovation-Systematic innovation methodology from analyzing 200,000+ patents. Resolve contradictions rather than accepting trade-offs.+### Red Team Thinking+Attack your own plans before adversaries do. The best defense is knowing your weaknesses.**When to use:**-- Facing "impossible" trade-offs-- Need breakthrough innovation-- Stuck between conflicting requirements+- Security review+- Pre-launch preparation+- Plan stress-testing## Contributing@@ -151,20 +229,26 @@ We welcome contributions! See [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines.```yaml---name: thinking-your-skill-name-description: Brief description (used by Claude Code for skill matching)+description: Brief description under 200 chars (used by Claude Code for skill matching)---```3. Write comprehensive documentation with:- Overview and core principle- When to use decision flow- Step-by-step process- - Examples and templates+ - At least 2 practical examples+ - Reusable template- Verification checklist- Key questions+4. Validate your skill:+```bash+node scripts/validate-skills.js+```+## Keywords-`claude-code` `claude` `anthropic` `ai` `skills` `mental-models` `critical-thinking` `decision-making` `problem-solving` `systems-thinking` `first-principles` `bayesian-reasoning` `cognitive-bias` `strategic-thinking` `frameworks` `triz` `ooda` `pre-mortem` `socratic-method`+`claude-code` `claude` `anthropic` `ai` `skills` `mental-models` `critical-thinking` `decision-making` `problem-solving` `systems-thinking` `first-principles` `bayesian-reasoning` `cognitive-bias` `strategic-thinking` `frameworks` `triz` `ooda` `pre-mortem` `socratic-method` `theory-of-constraints` `cynefin` `jobs-to-be-done` `red-team` `fermi-estimation`## Related Resources@@ -172,6 +256,7 @@ description: Brief description (used by Claude Code for skill matching)- [Charlie Munger's Mental Models](https://fs.blog/mental-models/)- [Thinking in Systems - Donella Meadows](https://www.chelseagreen.com/product/thinking-in-systems/)- [Thinking, Fast and Slow - Daniel Kahneman](https://www.amazon.com/Thinking-Fast-Slow-Daniel-Kahneman/dp/0374533555)+- [The Goal - Eliyahu Goldratt](https://www.amazon.com/Goal-Process-Ongoing-Improvement/dp/0884271951)## Licensediff --git a/scripts/QUALITY_FRAMEWORK.md b/scripts/QUALITY_FRAMEWORK.mdnew file mode 100644index 0000000..ea53da5--- /dev/null+++ b/scripts/QUALITY_FRAMEWORK.md@@ -0,0 +1,161 @@+# Thinking Skills Quality Framework++## Overview++This document defines the quality standards and improvement processes for thinking skills in this collection. Each skill should meet these criteria to maximize its effectiveness when used in Claude Code.++## Quality Dimensions++### 1. Structure Quality++**Required Elements:**+- [ ] YAML frontmatter with `name` and `description`+- [ ] H1 title matching the skill name+- [ ] Overview section explaining the model+- [ ] Core Principle callout+- [ ] "When to Use" section with scenarios+- [ ] Decision flow diagram+- [ ] Step-by-step process+- [ ] Practical examples with code blocks+- [ ] Template section+- [ ] Verification checklist+- [ ] Key questions section+- [ ] Attribution/wisdom quote++**Format Standards:**+- Markdown code blocks for examples and templates+- Tables for comparisons and matrices+- Consistent header hierarchy (H2 for main sections, H3 for subsections)+- Decision flows using ASCII art or markdown++### 2. Content Quality++**Clarity Criteria:**+- [ ] Core concept explained in 2-3 sentences+- [ ] Jargon defined or avoided+- [ ] Examples are realistic and relatable+- [ ] Steps are actionable (start with verbs)++**Completeness Criteria:**+- [ ] Covers when to use AND when not to use+- [ ] Addresses common mistakes/anti-patterns+- [ ] Provides multiple examples (minimum 2)+- [ ] Includes both simple and complex applications++**Accuracy Criteria:**+- [ ] Model correctly represents source material+- [ ] Attribution to original thinkers+- [ ] No misrepresentation of concepts++### 3. Pedagogical Quality++**Learning Progression:**+- [ ] Starts with why (motivation)+- [ ] Builds from simple to complex+- [ ] Provides scaffolding (templates, checklists)+- [ ] Enables self-verification++**Application Support:**+- [ ] Clear decision criteria for when to apply+- [ ] Step-by-step process that can be followed+- [ ] Fill-in-the-blank templates+- [ ] Verification checklist to confirm proper use++### 4. Integration Quality++**Claude Code Optimization:**+- [ ] Description is concise (<200 chars) for tool hints+- [ ] First paragraph is self-contained summary+- [ ] Works well when partially quoted+- [ ] Key information front-loaded++## Quality Scoring Rubric++### Score: 5 (Excellent)+- All required elements present+- Multiple high-quality examples+- Templates are immediately usable+- Clear decision guidance+- Proper attribution+- No ambiguity in process++### Score: 4 (Good)+- All required elements present+- At least 2 examples+- Usable template+- Clear when-to-use guidance+- Minor clarity improvements possible++### Score: 3 (Adequate)+- Most required elements present+- At least 1 example+- Template present but needs work+- When-to-use needs more specificity+- Some sections thin++### Score: 2 (Needs Work)+- Missing required elements+- Examples weak or absent+- No usable template+- Unclear when to apply+- Process hard to follow++### Score: 1 (Poor)+- Missing multiple required elements+- No practical examples+- No template+- Confusing or incomplete process+- Would not help a user++## Improvement Process++### Phase 1: Structural Validation+1. Run validation script to check required elements+2. Add missing sections+3. Fix formatting issues++### Phase 2: Content Enhancement+1. Review against source material+2. Add missing examples+3. Improve templates+4. Add anti-patterns++### Phase 3: Pedagogical Review+1. Test with fresh eyes (does it make sense?)+2. Follow the process yourself+3. Fill in the template+4. Identify confusion points++### Phase 4: Integration Testing+1. Test in Claude Code+2. Verify description works in tool selection+3. Test partial quotation scenarios+4. Optimize for AI consumption++## Best Practices from Research++### From Cognitive Science+- **Worked Examples**: Show complete worked examples, not just abstract steps+- **Self-Explanation**: Include prompts for the user to explain back+- **Dual Coding**: Use both text and diagrams/tables+- **Spacing**: Break content into digestible chunks+- **Testing Effect**: Checklists that require active engagement++### From Technical Writing+- **Inverted Pyramid**: Most important information first+- **Chunking**: 3-7 items per list/section+- **Parallelism**: Consistent structure across similar sections+- **Active Voice**: "Identify the constraint" not "The constraint should be identified"+- **Specificity**: "3 examples" not "several examples"++### From UX Design+- **Progressive Disclosure**: Basic usage first, advanced later+- **Error Prevention**: Warn about common mistakes upfront+- **Recognition over Recall**: Templates > blank pages+- **Flexibility**: Support different skill levels++### From AI/LLM Optimization+- **Front-Loading**: Key info in first 200 chars for description+- **Self-Contained Sections**: Each section should work if quoted alone+- **Explicit Structure**: Clear markers for AI to parse+- **Concrete over Abstract**: Examples > theory for AI applicationdiff --git a/scripts/enhance-skill.js b/scripts/enhance-skill.jsnew file mode 100644index 0000000..f1aa7c8--- /dev/null+++ b/scripts/enhance-skill.js@@ -0,0 +1,363 @@+#!/usr/bin/env node++/**+ * Thinking Skills Enhancement Generator+ *+ * Analyzes a skill and generates specific enhancement suggestions.+ * Run with: node scripts/enhance-skill.js <skill-name>+ *+ * Example: node scripts/enhance-skill.js thinking-first-principles+ */++const fs = require('fs');+const path = require('path');++const SKILLS_DIR = path.join(__dirname, '..', '.claude', 'skills');++// Enhancement patterns with templates+const ENHANCEMENTS = {+ missingOverview: {+ detect: (content) => !/^## Overview/m.test(content),+ suggestion: `Add an Overview section:++## Overview++[1-2 sentence explanation of the mental model]+[1 sentence on its origin or key thinker]+[1 sentence on its core value proposition]++**Core Principle:** [Single powerful statement]+`+ },++ missingWhenToUse: {+ detect: (content) => !/^## When to Use/m.test(content),+ suggestion: `Add a "When to Use" section:++## When to Use++- [Scenario 1]+- [Scenario 2]+- [Scenario 3]+- [Scenario 4]++Decision flow:++\`\`\`+Facing [problem type]?+ → [Condition 1]? → yes → [Action]+ → [Condition 2]? → no → [Alternative]+ → [Condition 3]? → yes → USE THIS MODEL+\`\`\`+`+ },++ missingVerificationChecklist: {+ detect: (content) => !/^## Verification Checklist/m.test(content),+ suggestion: `Add a Verification Checklist:++## Verification Checklist++- [ ] [Step 1 completed correctly]+- [ ] [Step 2 completed correctly]+- [ ] [Common mistake avoided]+- [ ] [Quality criterion met]+- [ ] [Integration point checked]+- [ ] [Output validates correctly]+`+ },++ missingKeyQuestions: {+ detect: (content) => !/^## Key Questions/m.test(content),+ suggestion: `Add Key Questions:++## Key Questions++- "[Question that triggers this model]?"+- "[Question for Step 1]?"+- "[Question for validation]?"+- "[Question to check completion]?"+- "[Question that reveals insight]?"+- "[Meta-question about the process]?"+`+ },++ missingTemplate: {+ detect: (content) => !/^## .*Template/m.test(content),+ suggestion: `Add a Template section:++## [Model Name] Template++\`\`\`markdown+# [Model] Analysis: [Topic]++## Context+[What's being analyzed]++## Step 1: [First Step Name]+[Guidance for step 1]++## Step 2: [Second Step Name]+| Column 1 | Column 2 | Column 3 |+|----------|----------|----------|+| | | |++## Step 3: [Third Step Name]+[Guidance for step 3]++## Conclusion+[Summary guidance]++## Next Steps+[What to do after]+\`\`\`+`+ },++ missingAntiPatterns: {+ detect: (content) => !/anti-pattern|failure mode|common mistake|when not to|don't use/i.test(content),+ suggestion: `Add Anti-patterns or Failure Modes:++## Common Mistakes++### Mistake 1: [Name]+**What happens:** [Description]+**Why it's wrong:** [Explanation]+**Better approach:** [Correction]++### Mistake 2: [Name]+**What happens:** [Description]+**Why it's wrong:** [Explanation]+**Better approach:** [Correction]++### When NOT to Use This Model+- [Situation where model doesn't apply]+- [Context where different model is better]+- [Edge case to avoid]+`+ },++ fewExamples: {+ detect: (content) => {+ const examples = (content.match(/Example[s]?:/gi) || []).length ++ (content.match(/```markdown[\s\S]*?##/g) || []).length;+ return examples < 2;+ },+ suggestion: `Add more practical examples:++### Example 1: [Domain/Context]++\`\`\`markdown+## [Model] Applied to [Specific Situation]++Context: [Brief situation description]++Step 1 Result:+[Concrete output]++Step 2 Result:+[Concrete output]++Conclusion:+[What the model revealed]+\`\`\`++### Example 2: [Different Domain/Context]++\`\`\`markdown+## [Model] Applied to [Different Situation]++Context: [Brief situation description]++[Application of model]++Insight: [What this example uniquely shows]+\`\`\`+`+ },++ fewTables: {+ detect: (content) => (content.match(/\|.*\|.*\|/g) || []).length < 3,+ suggestion: `Add comparison tables:++### [Comparison Purpose]++| Aspect | Option A | Option B | Option C |+|--------|----------|----------|----------|+| [Criterion 1] | | | |+| [Criterion 2] | | | |+| [Criterion 3] | | | |++### [Another Comparison]++| Situation | Approach | Why |+|-----------|----------|-----|+| [Case 1] | [What to do] | [Rationale] |+| [Case 2] | [What to do] | [Rationale] |+| [Case 3] | [What to do] | [Rationale] |+`+ },++ longDescription: {+ detect: (content) => {+ const match = content.match(/description:\s*(.+)/);+ return match && match[1].length > 200;+ },+ suggestion: `Shorten the YAML description (current > 200 chars):++Best practices for descriptions:+- Keep under 200 characters+- Start with an action verb+- Focus on the core value+- Include key use cases++Example formats:+- "[Action] using [method]. Use for [use case 1], [use case 2]."+- "[One-line definition]. Best for [context]."+`+ },++ missingWisdom: {+ detect: (content) => !/Wisdom|'s (Wisdom|Quote)|"[^"]{20,}"/m.test(content),+ suggestion: `Add attribution and wisdom quote:++## [Thinker]'s Wisdom++"[Memorable quote from the originator of this model]"++"[Second quote if applicable]"++[1-2 sentence reflection connecting quote to practical application]+`+ },++ missingDecisionFlow: {+ detect: (content) => !(/```[\s\S]*?→[\s\S]*?```/m.test(content)),+ suggestion: `Add a decision flow diagram:++Decision flow:++\`\`\`+[Starting question]?+ → [Branch 1 condition]? → yes → [Action/Model to use]+ → [Branch 2 condition]? → no → [Alternative action]+ → [Branch 3 condition]? → yes → USE THIS MODEL+ → Otherwise → [Default/fallback]+\`\`\`++Or for process flows:++\`\`\`+[Step 1] → [Step 2] → [Decision Point]+ ↓+ [If condition]+ ↓+ [Step 3a] or [Step 3b]+ ↓+ [Result]+\`\`\`+`+ }+};++function analyzeSkill(skillPath) {+ const content = fs.readFileSync(skillPath, 'utf8');+ const skillName = path.basename(path.dirname(skillPath));++ const results = {+ name: skillName,+ enhancements: []+ };++ for (const [key, enhancement] of Object.entries(ENHANCEMENTS)) {+ if (enhancement.detect(content)) {+ results.enhancements.push({+ issue: key,+ suggestion: enhancement.suggestion+ });+ }+ }++ return results;+}++function generateReport(analysis) {+ const BOLD = '\x1b[1m';+ const GREEN = '\x1b[32m';+ const YELLOW = '\x1b[33m';+ const CYAN = '\x1b[36m';+ const RESET = '\x1b[0m';++ console.log(`\n${BOLD}=== Enhancement Report: ${analysis.name} ===${RESET}\n`);++ if (analysis.enhancements.length === 0) {+ console.log(`${GREEN}✓ This skill meets all quality criteria!${RESET}\n`);+ return;+ }++ console.log(`Found ${YELLOW}${analysis.enhancements.length}${RESET} enhancement opportunities:\n`);++ for (let i = 0; i < analysis.enhancements.length; i++) {+ const enh = analysis.enhancements[i];+ console.log(`${BOLD}${i + 1}. ${formatIssueName(enh.issue)}${RESET}`);+ console.log(`${CYAN}${enh.suggestion}${RESET}`);+ console.log('---\n');+ }+}++function formatIssueName(issue) {+ return issue+ .replace(/([A-Z])/g, ' $1')+ .replace(/^./, str => str.toUpperCase())+ .trim();+}++function main() {+ const args = process.argv.slice(2);++ if (args.length === 0) {+ // Analyze all skills+ const skillDirs = fs.readdirSync(SKILLS_DIR)+ .filter(d => d.startsWith('thinking-'))+ .map(d => path.join(SKILLS_DIR, d, 'SKILL.md'))+ .filter(p => fs.existsSync(p));++ console.log(`Analyzing ${skillDirs.length} skills for enhancement opportunities...\n`);++ const allResults = skillDirs.map(analyzeSkill);++ // Summary+ const needsWork = allResults.filter(r => r.enhancements.length > 0);++ console.log(`${needsWork.length}/${allResults.length} skills have enhancement opportunities:\n`);++ for (const result of needsWork.sort((a, b) => b.enhancements.length - a.enhancements.length)) {+ console.log(` ${result.name}: ${result.enhancements.length} suggestions`);+ for (const enh of result.enhancements) {+ console.log(` - ${formatIssueName(enh.issue)}`);+ }+ }++ console.log(`\nRun with skill name for detailed suggestions:`);+ console.log(` node scripts/enhance-skill.js thinking-first-principles\n`);++ } else {+ // Analyze specific skill+ let skillName = args[0];+ if (!skillName.startsWith('thinking-')) {+ skillName = 'thinking-' + skillName;+ }++ const skillPath = path.join(SKILLS_DIR, skillName, 'SKILL.md');++ if (!fs.existsSync(skillPath)) {+ console.error(`Skill not found: ${skillPath}`);+ process.exit(1);+ }++ const analysis = analyzeSkill(skillPath);+ generateReport(analysis);+ }+}++main();diff --git a/scripts/generate-improvement-prompt.js b/scripts/generate-improvement-prompt.jsnew file mode 100644index 0000000..2635d49--- /dev/null+++ b/scripts/generate-improvement-prompt.js@@ -0,0 +1,172 @@+#!/usr/bin/env node++/**+ * AI-Assisted Skill Enhancement Prompt Generator+ *+ * Generates prompts for Claude to improve specific skills based on quality analysis.+ * Run with: node scripts/generate-improvement-prompt.js <skill-name>+ *+ * The output can be used directly with Claude Code to enhance skills.+ */++const fs = require('fs');+const path = require('path');++const SKILLS_DIR = path.join(__dirname, '..', '.claude', 'skills');++// Quality criteria for the prompt+const QUALITY_CRITERIA = `+## Quality Criteria for Thinking Skills++### Required Structure+1. YAML frontmatter with name (matching directory) and description (<200 chars)+2. H1 title matching the skill name+3. Overview section with Core Principle callout+4. "When to Use" section with decision flow diagram+5. Step-by-step process with numbered steps+6. At least 2 practical examples in markdown code blocks+7. Reusable template section+8. Verification checklist with [ ] items+9. Key Questions section with 5-6 questions+10. Attribution/Wisdom quote from original thinker++### Content Quality+- Core concept explained in 2-3 sentences+- Examples are realistic engineering/product scenarios+- Steps start with action verbs+- Includes anti-patterns or "when not to use"+- Tables for comparisons and matrices+- Decision flows using ASCII art++### Pedagogical Quality+- Starts with WHY (motivation)+- Builds simple to complex+- Provides fill-in-the-blank templates+- Enables self-verification via checklist+`;++function analyzeAndGeneratePrompt(skillPath) {+ const content = fs.readFileSync(skillPath, 'utf8');+ const skillName = path.basename(path.dirname(skillPath));++ // Identify issues+ const issues = [];++ if (!/^## Overview/m.test(content)) issues.push('Missing Overview section');+ if (!/\*\*Core Principle:\*\*/m.test(content)) issues.push('Missing Core Principle callout');+ if (!/^## When to Use/m.test(content)) issues.push('Missing "When to Use" section');+ if (!(/```[\s\S]*?→[\s\S]*?```/m.test(content))) issues.push('Missing decision flow diagram');+ if (!/^## .*Template/m.test(content)) issues.push('Missing Template section');+ if (!/^## Verification Checklist/m.test(content)) issues.push('Missing Verification Checklist');+ if (!/^## Key Questions/m.test(content)) issues.push('Missing Key Questions section');++ const examples = (content.match(/Example[s]?:/gi) || []).length ++ (content.match(/```markdown[\s\S]*?##/g) || []).length;+ if (examples < 2) issues.push(`Only ${examples} example(s) - need at least 2`);++ const tables = (content.match(/\|.*\|.*\|/g) || []).length;+ if (tables < 3) issues.push(`Only ${tables} table rows - add comparison tables`);++ const checks = (content.match(/- \[ \]/g) || []).length;+ if (checks < 3) issues.push(`Only ${checks} checklist items - add more verification steps`);++ if (!/anti-pattern|failure mode|common mistake|when not to|don't use/i.test(content)) {+ issues.push('Missing anti-patterns or failure modes section');+ }++ const descMatch = content.match(/description:\s*(.+)/);+ if (descMatch && descMatch[1].length > 200) {+ issues.push(`Description too long (${descMatch[1].length} chars) - shorten to <200`);+ }++ // Generate prompt+ const prompt = `# Task: Enhance the ${skillName} Thinking Skill++## Current Skill Content+\`\`\`markdown+${content}+\`\`\`++## Issues Identified+${issues.length > 0 ? issues.map(i => `- ${i}`).join('\n') : '- No major issues found, but review for quality improvements'}++${QUALITY_CRITERIA}++## Instructions++Please enhance this skill by:++1. **Fixing all identified issues** listed above+2. **Maintaining the existing good content** - don't remove what works+3. **Adding practical software engineering examples** - debugging, architecture, product decisions+4. **Ensuring the template is immediately usable** - user can copy and fill in+5. **Making the verification checklist comprehensive** - should catch common mistakes+6. **Adding memorable quotes** from the original thinker if not present++Output the complete enhanced SKILL.md file, ready to save.++Keep the same overall structure and voice. Focus on making it MORE practical and actionable for software engineers using Claude Code.+`;++ return {+ skillName,+ issues,+ prompt+ };+}++function main() {+ const args = process.argv.slice(2);++ if (args.length === 0) {+ console.log('Usage: node scripts/generate-improvement-prompt.js <skill-name>');+ console.log(' node scripts/generate-improvement-prompt.js --all');+ console.log('\nExamples:');+ console.log(' node scripts/generate-improvement-prompt.js thinking-first-principles');+ console.log(' node scripts/generate-improvement-prompt.js first-principles');+ console.log(' node scripts/generate-improvement-prompt.js --all > prompts.md');+ process.exit(0);+ }++ if (args[0] === '--all') {+ // Generate prompts for all skills that need work+ const skillDirs = fs.readdirSync(SKILLS_DIR)+ .filter(d => d.startsWith('thinking-'))+ .map(d => path.join(SKILLS_DIR, d, 'SKILL.md'))+ .filter(p => fs.existsSync(p));++ for (const skillPath of skillDirs) {+ const result = analyzeAndGeneratePrompt(skillPath);+ if (result.issues.length > 0) {+ console.log(`\n${'='.repeat(80)}\n`);+ console.log(result.prompt);+ }+ }+ } else {+ let skillName = args[0];+ if (!skillName.startsWith('thinking-')) {+ skillName = 'thinking-' + skillName;+ }++ const skillPath = path.join(SKILLS_DIR, skillName, 'SKILL.md');++ if (!fs.existsSync(skillPath)) {+ console.error(`Skill not found: ${skillPath}`);+ console.error('\nAvailable skills:');+ fs.readdirSync(SKILLS_DIR)+ .filter(d => d.startsWith('thinking-'))+ .forEach(d => console.error(` - ${d}`));+ process.exit(1);+ }++ const result = analyzeAndGeneratePrompt(skillPath);++ console.log('# Improvement Prompt for', result.skillName);+ console.log('\n## Issues Found:', result.issues.length);+ result.issues.forEach(i => console.log(`- ${i}`));+ console.log('\n## Prompt for Claude:\n');+ console.log(result.prompt);+ }+}++main();diff --git a/scripts/validate-skills.js b/scripts/validate-skills.jsnew file mode 100644index 0000000..da65ea7--- /dev/null+++ b/scripts/validate-skills.js@@ -0,0 +1,225 @@+#!/usr/bin/env node++/**+ * Thinking Skills Quality Validator+ *+ * Validates each skill against the quality framework criteria.+ * Run with: node scripts/validate-skills.js+ */++const fs = require('fs');+const path = require('path');++const SKILLS_DIR = path.join(__dirname, '..', '.claude', 'skills');++// Required sections and their markers+const REQUIRED_SECTIONS = [+ { name: 'YAML Frontmatter', pattern: /^---\n[\s\S]*?name:[\s\S]*?description:[\s\S]*?---/m },+ { name: 'Overview', pattern: /^## Overview/m },+ { name: 'Core Principle', pattern: /\*\*Core Principle:\*\*/m },+ { name: 'When to Use', pattern: /^## When to Use/m },+ { name: 'Decision Flow', pattern: /```[\s\S]*?→[\s\S]*?```/m },+ { name: 'Process/Steps', pattern: /^### Step \d|^## The .* Process|^## .*Process$/m },+ { name: 'Examples', pattern: /^## .*Example|Example:|```markdown[\s\S]*?##/m },+ { name: 'Template', pattern: /^## .*Template|Template:/m },+ { name: 'Verification Checklist', pattern: /^## Verification Checklist/m },+ { name: 'Key Questions', pattern: /^## Key Questions/m },+ { name: 'Wisdom/Attribution', pattern: /Wisdom|".*"/m }+];++// Quality metrics+const QUALITY_CHECKS = [+ {+ name: 'Description Length',+ check: (content) => {+ const match = content.match(/description:\s*(.+)/);+ if (!match) return { pass: false, detail: 'No description found' };+ const len = match[1].length;+ return {+ pass: len <= 200,+ detail: `${len} chars (max 200)`+ };+ }+ },+ {+ name: 'Has Multiple Examples',+ check: (content) => {+ const examples = (content.match(/Example[s]?:/gi) || []).length ++ (content.match(/```markdown[\s\S]*?##/g) || []).length;+ return {+ pass: examples >= 2,+ detail: `Found ${examples} example(s)`+ };+ }+ },+ {+ name: 'Has Tables',+ check: (content) => {+ const tables = (content.match(/\|.*\|.*\|/g) || []).length;+ return {+ pass: tables >= 3,+ detail: `Found ${tables} table row(s)`+ };+ }+ },+ {+ name: 'Has Checklists',+ check: (content) => {+ const checks = (content.match(/- \[ \]/g) || []).length;+ return {+ pass: checks >= 3,+ detail: `Found ${checks} checklist item(s)`+ };+ }+ },+ {+ name: 'Has Code Blocks',+ check: (content) => {+ const blocks = (content.match(/```/g) || []).length / 2;+ return {+ pass: blocks >= 3,+ detail: `Found ${Math.floor(blocks)} code block(s)`+ };+ }+ },+ {+ name: 'Word Count (500-3000)',+ check: (content) => {+ const words = content.split(/\s+/).length;+ return {+ pass: words >= 500 && words <= 3000,+ detail: `${words} words`+ };+ }+ },+ {+ name: 'Has Anti-patterns/Failure Modes',+ check: (content) => {+ const hasAntiPatterns = /anti-pattern|failure mode|common mistake|when not to|don't use/i.test(content);+ return {+ pass: hasAntiPatterns,+ detail: hasAntiPatterns ? 'Found warnings' : 'No anti-patterns documented'+ };+ }+ }+];++function validateSkill(skillPath) {+ const content = fs.readFileSync(skillPath, 'utf8');+ const skillName = path.basename(path.dirname(skillPath));++ const results = {+ name: skillName,+ path: skillPath,+ sections: [],+ quality: [],+ score: 0,+ maxScore: 0+ };++ // Check required sections+ for (const section of REQUIRED_SECTIONS) {+ const found = section.pattern.test(content);+ results.sections.push({+ name: section.name,+ found+ });+ results.maxScore += 1;+ if (found) results.score += 1;+ }++ // Check quality metrics+ for (const check of QUALITY_CHECKS) {+ const result = check.check(content);+ results.quality.push({+ name: check.name,+ ...result+ });+ results.maxScore += 1;+ if (result.pass) results.score += 1;+ }++ return results;+}++function printResults(results) {+ const GREEN = '\x1b[32m';+ const RED = '\x1b[31m';+ const YELLOW = '\x1b[33m';+ const RESET = '\x1b[0m';+ const BOLD = '\x1b[1m';++ console.log(`\n${BOLD}=== Thinking Skills Quality Report ===${RESET}\n`);++ let totalScore = 0;+ let totalMax = 0;++ for (const skill of results) {+ const percentage = Math.round((skill.score / skill.maxScore) * 100);+ const color = percentage >= 80 ? GREEN : percentage >= 60 ? YELLOW : RED;++ console.log(`${BOLD}${skill.name}${RESET}: ${color}${skill.score}/${skill.maxScore} (${percentage}%)${RESET}`);++ // Show missing sections+ const missingSections = skill.sections.filter(s => !s.found);+ if (missingSections.length > 0) {+ console.log(` ${RED}Missing sections:${RESET}`);+ for (const section of missingSections) {+ console.log(` - ${section.name}`);+ }+ }++ // Show failed quality checks+ const failedChecks = skill.quality.filter(q => !q.pass);+ if (failedChecks.length > 0) {+ console.log(` ${YELLOW}Quality improvements needed:${RESET}`);+ for (const check of failedChecks) {+ console.log(` - ${check.name}: ${check.detail}`);+ }+ }++ totalScore += skill.score;+ totalMax += skill.maxScore;+ console.log('');+ }++ // Summary+ const overallPercentage = Math.round((totalScore / totalMax) * 100);+ console.log(`${BOLD}=== Summary ===${RESET}`);+ console.log(`Total Skills: ${results.length}`);+ console.log(`Overall Score: ${totalScore}/${totalMax} (${overallPercentage}%)`);++ // Skills needing attention+ const needsWork = results.filter(r => (r.score / r.maxScore) < 0.7);+ if (needsWork.length > 0) {+ console.log(`\n${YELLOW}Skills needing attention (< 70%):${RESET}`);+ for (const skill of needsWork) {+ const pct = Math.round((skill.score / skill.maxScore) * 100);+ console.log(` - ${skill.name} (${pct}%)`);+ }+ }++ // Output JSON for further processing+ const jsonPath = path.join(__dirname, 'quality-report.json');+ fs.writeFileSync(jsonPath, JSON.stringify(results, null, 2));+ console.log(`\nDetailed report saved to: ${jsonPath}`);+}++function main() {+ // Find all skills+ const skillDirs = fs.readdirSync(SKILLS_DIR)+ .filter(d => d.startsWith('thinking-'))+ .map(d => path.join(SKILLS_DIR, d, 'SKILL.md'))+ .filter(p => fs.existsSync(p));++ console.log(`Found ${skillDirs.length} thinking skills to validate...`);++ const results = skillDirs.map(validateSkill);++ // Sort by score (lowest first to highlight what needs work)+ results.sort((a, b) => (a.score / a.maxScore) - (b.score / b.maxScore));++ printResults(results);+}++main();