---
name: fesa-formulation-spec
description: Use when drafting FESA FEM formulation specifications, strong or weak forms, shape functions, element equations, numerical integration, Jacobian rules, and output recovery contracts.
---

# FESA Formulation Spec

Use this skill to turn approved requirements and research evidence into an implementable math-level FEM contract.

## Inputs

Read these first:

- `AGENTS.md`
- `docs/SOLVER_AGENT_DESIGN.md`
- `docs/<feature-id>/requirements.md`
- `docs/<feature-id>/research.md`

## Workflow

1. Confirm scope, assumptions, primary variables, DOFs, sign convention, units, and coordinate system.
2. Write the Strong Form and boundary conditions.
3. Write the Weak or Variational Form and natural boundary terms.
4. Define Discretization: interpolation, shape functions, partition of unity, Kronecker delta checks, and nodal layout.
5. Define Kinematics: strain-displacement relation, B matrix or kinematic operator, strain measure, and deformation assumptions.
6. Define Constitutive Contract without creating C++ APIs.
7. Define Element Equations: residual or internal force, external force, stiffness or tangent, mass or damping when applicable, and dimensions.
8. Define Mapping and Numerical Integration: reference coordinates, isoparametric mapping, Jacobian, derivative transform, determinant checks, Gauss points, and weights.
9. Define Output Recovery for displacement, reaction, element force, strain, stress, and nodal extrapolation.
10. List Numerical Risks and downstream tests.

## Output Contract

Produce or revise `docs/<feature-id>/formulation.md` with:

- Scope and Assumptions
- Primary Variables and DOFs
- Strong Form
- Weak or Variational Form
- Discretization
- Kinematics
- Constitutive Contract
- Element Equations
- Mapping and Numerical Integration
- Output Recovery
- Algorithm Pseudocode
- Numerical Risks
- Open Issues and Downstream Handoff

## Boundaries

- Do not implement C++ code.
- Do not design C++ APIs.
- Do not implement parsers.
- Do not run Abaqus, Nastran, or any reference solver.
- Do not generate or modify Abaqus reference CSV files.
- Do not approve release readiness.

## Quality Gate

- Strong form, weak form, discretization, kinematics, constitutive contract, and element equations are distinct.
- Shape functions include partition of unity and Kronecker delta checks when applicable.
- Jacobian, determinant validity, derivative transform, integration rule, and output location are explicit.
- Missing research or requirements become open issues, not assumptions.
- The document is `ready-for-numerical-review` only when all derivations, assumptions, output recovery rules, numerical risks, and open issues are explicit.

## Handoff

Return `docs/<feature-id>/formulation.md`, status, evidence summary, blockers, and all review evidence to Numerical Review Agent through Coordinator Agent. Do not bypass the numerical/reference gate with a downstream handoff.
