| name | generate-theory |
| description | Generate a complete, NASA-level theory section for any mechanical engineering topic. 11+ sections, all formulas in KaTeX, term tables, SVG diagrams, worked example. Shigley/Hibbeler depth. |
| metadata | {"priority":8,"promptSignals":{"phrases":["generate theory","write theory","theory section","theory for","explain the theory","add theory"],"minScore":5}} |
Generate Theory — Complete Skill
Standards (Non-Negotiable)
Every theory section must meet the NASA/MIT standard:
- People's lives depend on correct information
- Teach age-10 curiosity → master's-level rigor in the SAME section
- Never shortcut — walk the full textbook chapter
- Sources: Shigley, Hibbeler, Popov, Beer & Johnston, Roark's
Mandatory Section Checklist
Generate ALL of these, customized for the topic:
Section 1: Introduction
- What physical phenomenon this describes
- When/why it matters (real failure examples)
- Assumptions and validity range
- Relationship to other phenomena (how it connects to adjacent theory)
Section 2: Governing Equation
<TheorySection title="Governing Equation">
<p>Plain English: what the equation says physically.</p>
<MathBlock>{String.raw`\sigma = \frac{Mc}{I}`}</MathBlock>
<TermTable rows={[
{ symbol: 'σ', name: 'Normal Stress', meaning: 'Stress at distance c from NA', imperial: 'psi or ksi', si: 'Pa or MPa' },
{ symbol: 'M', name: 'Bending Moment', meaning: 'Internal moment at section', imperial: 'lbf·in', si: 'N·m' },
...
]} />
</TheorySection>
Section 3: Derivation (condensed — show key steps)
- Start from first principles or fundamental law
- Show the key simplification steps
- State every assumption made
Section 4: Cross-Section Properties
- I, S, Z formulas for rectangle, circle, hollow circle, standard sections
- How to find centroid (first moment of area)
- Parallel axis theorem: I = I_c + Ad²
- Include SVG cross-section diagram with v3 labels
Section 5: Material Properties
- Which properties matter for this analysis
- Typical values table (Imperial and SI)
- Temperature effects
- When to worry about anisotropy
Section 6: Failure Modes (comprehensive)
- List ALL failure modes that can occur
- Formula for each
- How to check — inequality to verify
- Factor of safety for each mode
Section 7: Stress Concentrations
- Where they occur (geometric discontinuities)
- Kt charts or equations for common geometries
- Fatigue reduction factor Kf
- How to apply in design
Section 8: Combined Loading (if applicable)
- How this stress combines with axial, shear, torsional
- Superposition principle (valid for linear elastic only)
- Von Mises or maximum shear stress criterion
Section 9: Design Codes
- Applicable codes: AISC, ASME, ASCE, AWS, API, ASHRAE
- Safety factors required by code
- Code check format (LRFD vs. ASD)
- Citation: code edition, section number
Section 10: Special Cases / Edge Cases
- What happens at limiting geometries
- Plastic analysis (vs. elastic assumed above)
- Residual stresses
- Thermal effects
- Dynamic vs. static loading differences
Section 11: Worked Example
<WorkedExample
title="Example: Calculate stress in W12×26 at midspan"
given={['P = 10 kips', 'L = 15 ft', 'W12×26 (Ix = 204 in⁴, c = 6.11 in)']}
find={['Maximum bending stress σ_max', 'Factor of safety vs. yield (Fy = 36 ksi)']}
solution={[
{ step: '1. Find M_max', equation: 'M = PL/4 = (10)(15×12)/4 = 450 kip·in' },
{ step: '2. Calculate σ', equation: 'σ = Mc/I = (450)(6.11)/204 = 13.5 ksi' },
{ step: '3. Factor of safety', equation: 'n = Fy/σ = 36/13.5 = 2.67 ✓' },
]}
/>
Section 12+: Advanced Topics (add as needed)
- Buckling / instability interaction
- Fatigue under this loading
- Fracture mechanics consideration
- FEA modeling tips for this problem type
- Historical failures and lessons learned
KaTeX Syntax Rules
- Fractions:
\frac{numerator}{denominator}
- Square root:
\sqrt{expression} or \sqrt[n]{expression}
- Subscripts:
\sigma_{allow}, \tau_{xy}
- Superscripts:
E^{1/2}, \sigma^2
- Greek:
\sigma \tau \epsilon \gamma \phi \nu \rho \mu \omega \alpha \beta \delta \Delta
- Always use String.raw for complex expressions:
String.raw\sigma = \frac{Mc}{I}``
- Inline:
<Math>{\sigma}</Math>
- Block:
<MathBlock>{String.raw\sigma = \frac{Mc}{I}}</MathBlock>
SVG Diagrams in Theory
Every theory section should have ≥ 2 diagrams showing:
- The geometry being analyzed (cross-section, loading diagram)
- The stress distribution (color gradient or zone diagram)
Use v3 layered pattern — SVG shapes, HTML labels.