---
name: abaqus-subroutine-validation
description: Use when validating Abaqus User Subroutine outputs against stored reference artifacts, checking metadata, source hashes, Abaqus and compiler versions, msg/dat/log/sta tails, externally generated CSV schemas, and tolerances.
---

# Abaqus Subroutine Validation

Use this skill to validate implemented subroutines against no-Abaqus results and externally generated Abaqus reference artifacts without changing either side. Subroutine validation is the owned artifact for this skill.

## Inputs

Read first:

- `AGENTS.md`
- `docs/ABAQUS_SUBROUTINE_AGENT_DESIGN.md`
- `docs/reference-models/<feature-id>-reference-models.md`
- `references/<feature-id>/<model-id>/metadata.json`
- Generated no-Abaqus and extracted CSV outputs

## Workflow

1. Validate artifact metadata with `python scripts/validate_reference_artifacts.py`.
2. For `ready-for-comparison`, check model `.inp`, metadata.json, source hash, Abaqus version, compiler version, msg/dat/log/sta tail files, ODB extraction provenance, and declared CSV files.
3. Run no-Abaqus comparison commands when available.
4. Do not run Abaqus analyses; consume externally generated ODB-extracted CSV artifacts only.
5. Compare generated CSVs against reference CSVs by documented IDs, units, coordinate system, output location, component naming, and tolerance.
6. Classify failures as `missing-reference-artifact | missing-generated-output | schema-mismatch | id-mismatch | source-hash-mismatch | unit-or-coordinate-mismatch | tolerance-failure | nonfinite-result | environment | upstream-contract`.

## Output Contract

Produce or revise `docs/reference-verifications/<feature-id>-reference-verification.md` with Artifact Inventory, Comparison Contract, Quantity Results, Failure Classification, Validation Evidence, Handoff Recommendation, and No-Change Assertion.

## Boundaries

- Do not edit source code.
- Do not edit tests.
- Do not change reference artifacts.
- Do not change tolerance policies.
- Do not generate reference CSVs.
- Do not run Abaqus analyses.
- Do not approve release readiness.

## Quality Gate

- `ready-for-comparison` artifacts pass metadata validation.
- Source hash, Abaqus version, compiler version, msg/dat/log/sta provenance, ODB extraction provenance, and CSV schemas are reported.
- Every compared quantity reports max absolute error, max relative error, RMS error when applicable, worst row, and pass/fail.
- Nonfinite values are reported explicitly.

## Handoff

Send implementation-owned mismatches to Correction Agent, artifact gaps to Reference Model Agent, ABI/schema gaps to I/O Definition Agent, and physically suspicious passing results to Physics Evaluation Agent.
