Create or modify amrvac.par for an AGILE (GPU AMR) simulation. Use this skill whenever the user mentions amrvac.par, par files, AGILE simulation setup, physics namelists (&ffhd_list, &mhd_list, &hd_list), boundary conditions for AGILE, or wants to configure a new simulation run. Even if the user just says "set up my simulation" or "I need a par file", use this skill.
Path: .agile_par_progress.md alongside amrvac.par; if no par path yet, write in CWD.
Template: assets/agile-par-progress.md
Step order: [0, 1, 1a, 2, 3, 4, 5]
Purpose: persists state, required_gaps, problem_description, and
across context resets.
hooks_neededResume: Step 0 checks for this file; if found and phase != done, restore all fields and resume from the entry after last-step in the step order list. Done: at Step 5, mark phase=done.
Triggered inline — apply immediately when confirmed new knowledge surfaces; do not wait. Match the format of existing rows in the target file.
NL phrase rule (Step 1a Stage 2, and Stage 3 after scan confirms) Target: references/agile_par_request_mapping.md
Scan rule (Step 1a Stage 3) Target: delegate to Update protocol in references/agile_par_knowledge_scan.md (handles registry + connections if a trigger is found)
Connection rule (any step — user reveals a feature→consequence link not in connections) Target: references/agile_par_connections.md §Feature triggers
Registry rule (any step — user names a parameter absent from registry, no scan needed) Target: references/agile_par_registry.md — matching §section
Patch = add missing namelists and parameters only; never modify or remove an existing value. If a conflict is found between state and an existing value in the par file, warn and ask the user before overwriting.
required_gaps must never contain params that have trigger dependencies (connections). Params with triggers are handled exclusively by Step 3's trigger loop. This makes the Step 5 completeness gate safe: any param remaining in required_gaps at Step 5 has no downstream trigger effects.
ACCESS: shell — check $AMRVAC_DIR ACTION:
ACCESS: check for .agile_par_progress.md alongside amrvac.par (or in CWD) read §Required gaps from references/agile_par_registry.md grep "&\w*list" in amrvac.par (if par file given) → existing sections and set params ACTION:
ACCESS: references/agile_par_request_mapping.md (read in full) ACTION:
Run per pending phrase. On resume, restore pending_phrases from progress file and continue with the next unresolved phrase.
ACCESS: grep references/agile_par_registry.md notes column for domain keywords from phrase ACTION: Stage 1 — present candidates compactly: "I found these parameters related to [category]: &xxx_list: param_a — <one-line purpose> Do any of these match what you need?"
if user confirms → Stage 2; if no candidate or user cannot confirm → Stage 3
Stage 2 — on confirmation: 1. add confirmed param to state 2. remove from required_gaps if present 3. apply NL phrase rule (write-back protocol)
Stage 3 — unresolved: 1. ask: "What should [concept] change about the simulation's physical behavior or output?" 2. re-run category search 3. if still unresolved: run knowledge scan (unknown parameter — see agile_par_knowledge_scan.md) 4. after scan confirms the parameter: 4a. apply scan rule (write-back protocol) 4b. apply NL phrase rule for the original phrase (write-back protocol) 4c. add to state; remove from required_gaps if present
After each phrase resolution: 1. check: if the user's response revealed a new parameter, connection, or a correction not already in the knowledge files, apply the relevant write-back rule 2. remove resolved phrase from pending_phrases 3. if pending_phrases not empty: write progress file (last-step: 1a); process next phrase if pending_phrases empty: write progress file (last-step: 1)
ACCESS: read only sections with entries in required_gaps from references/agile_par_registry.md ACTION:
Round 1 — phys (skip entirely if phys already in state; Step 1 write already covers it): 2. ask: "What physics module? (hd | mhd | ffhd)" 3. add answer to state; remove phys from required_gaps 4. write progress file (phys now in state; crash-safe before Round 2)
Round 2 — structured form for remaining required_gaps: 5. for each param in required_gaps: check registry default column if default exists: apply default; add to state; remove from required_gaps; record in progress file §Defaults applied as " §ion: param = value (registry default)" 6. ACCESS: Step 2 form template from references/agile_par_registry.md 7. render form: blank fields = params still in required_gaps (need user input) pre-filled = params already in state (shown for context only) 8. parse response: only process blank fields as new answers; add to state; remove from required_gaps pre-filled values are not re-processed unless the user explicitly changes them 9. check: if the user's response revealed a new parameter, connection, or a correction not already in the knowledge files, apply the relevant write-back rule 10. write progress file (state, required_gaps, last-step: 2)
ACCESS: references/agile_par_connections.md §Feature triggers (evaluate against full state) references/agile_par_registry.md — targeted read for each newly opened section ACTION: Pass 1 seeds from all params currently in state; subsequent passes seed only from params added during that pass.
ACCESS: references/agile_par_connections.md §Physics triggers (for nwfluxbc formula) ACTION:
ACCESS: assets/constraint-packet.md, assets/agile-state.md references/agile_par_registry.md — default column for any remaining required_gaps ACTION: