Skip to content

[Draft] Add skills and agents for configuring Marlim3 simulations - #77

Draft
yantavares wants to merge 23 commits into
petrobras:developfrom
yantavares:feature/marlim3-agentic-workflow
Draft

[Draft] Add skills and agents for configuring Marlim3 simulations#77
yantavares wants to merge 23 commits into
petrobras:developfrom
yantavares:feature/marlim3-agentic-workflow

Conversation

@yantavares

@yantavares yantavares commented Aug 5, 2026

Copy link
Copy Markdown

Add skills and agents for configuring Marlim3 simulations

This pull request introduces an agent-based workflow for developing Marlim3 simulations, defining the role of each agent, the orchestration logic, and the documentation required for usage and maintenance. The workflow organizes the planning, implementation, and validation stages of the simulation process.

Workflow and agent definitions

  • Adds .github/agents/marlim3.agent.md, which defines the orchestrator agent, responsible for coordinating the development workflow, delegating tasks to the planning, implementation, and QA agents, and managing approval and revision cycles.
  • Adds .github/agents/marlim3-planner.agent.md, which defines the planning agent, responsible for conducting interviews, extracting information from the documentation, and generating ADRs while following rules for handling default values, units, and source documents.
  • Adds .github/agents/marlim3-specialist.agent.md, which defines the specialist agent, responsible for implementing the ADR in .mr3 files, Python scripts, and pytest tests, following the ADR specifications and the repository conventions.
  • Adds .github/agents/marlim3-qa.agent.md, which defines the QA agent, responsible for validating the implementation against the ADR, performing schema and plausibility checks, running the test suite, and generating a validation report.
flowchart TD
    U([User describes the simulation]) --> O[marlim3<br/>orchestrator]
    O --> P[marlim3-planner<br/>interview via askQuestions]
    P --> ADR["docs/slug.adr.md"]
    ADR --> G{User approves the ADR?}
    G -- revise --> P
    G -- yes --> S[marlim3-specialist<br/>implements and tests]
    S --> IMPL["simulations/slug/slug.mr3<br/>tests/test_slug.py"]
    IMPL --> Q[marlim3-qa<br/>validates against the ADR]
    Q --> R["docs/slug.qa.md"]
    R --> V{Verdict}
    V -- FAIL, max. 2 cycles --> S
    V -- PASS --> F([Final report])
Loading

Documentation and developer guidance

  • Adds .github/README-agents.md, providing an overview of the workflow, usage instructions, descriptions of the agents and skills, and guidance for using the pipeline.
  • Adds .github/copilot-instructions.md, containing instructions for GitHub Copilot and contributors about the agent workflow, along with references to the project's documentation and conventions.

yantavares added 22 commits May 3, 2026 13:41
Defines the top-level JSON input structure, mandatory fields (sistema,
versao, versaoJson), complete section listing with types, cross-reference
validation rules, and a minimal working example.
Covers fluidosProducao (Black Oil, compositional, flash table models),
fluidoGas, fluidoComplementar, emulsion types 0-7, dead oil viscosity
models, PVT file configuration, and configuracaoInicial fluid flags.
Defines material thermal properties (steel, cement, insulation, fluids),
secaoTransversal geometry with radial layers (thickness and diameter
modes), formation rock properties, and common reference values.
Covers dutosProducao and dutosServico configuration, discretization,
initial conditions (compInter, temp, pressao, holdup), XY coordinate
mode, thermal coupling, and angle conventions.
Covers IPR (linear/Vogel), fonteLiquido, fonteGas, fonteMassa,
fontePressao, separador, gasInj, condicaoPressao, condicaoVazPres,
and CondicaoContPocInjec for injection wells.
Covers fonteGasLift (gas lift valves with IPO/orifice types), bcs
(ESP/BCS pumps with performance curves), multibcs, bombaVolumetrica,
and deltaPressao devices.
Covers valvula (inline valves), chokeSup/chokeInj, fonteChoke,
master1/master2 (ANM valves), pig operations, and a typical
shutdown scenario example.
Covers transient vs steady-state mode, tempo configuration with
tempos/dtmax pairs, mass transfer models 0-3, condicaoInicial 0-3,
slip correlations per flow pattern, and gas-lift unloading mode.
Covers perfilProducao/Servico (40+ boolean variable flags),
tendP/tendS trend monitors, tendTransP/S transverse temperature,
perfisTransP/S snapshots, tela screen output, and correcao factors.
Covers Avancado numerical parameters, threading (nthrd/nthrdMatriz),
tabela P/T generation, hidrato modeling (Hammerschmidt/Turner),
parafina (wax deposition), intermitenciaSevera, and 3D diffusion.
Planning agent that writes ADRs to docs/adr/. Knows all 10 skills
via relative markdown links with mandatory loading rules (5 always,
5 conditional). Includes ADR template, units table, and physical
defaults. user-invocable: false (only reachable via orchestrator).
Specialist agent that generates simulation JSON/Python code strictly
following ADR plans. Includes rules for field naming (Portuguese),
versioning, ID sequencing, array consistency, and unit reference.
user-invocable: false (only reachable via orchestrator).
QA agent with comprehensive validation checklist: plan conformance,
structural validation (cross-references), array consistency, physical
consistency, completeness, and equipment checks. Includes standardized
report format. user-invocable: false (only reachable via orchestrator).
Master orchestrator with phased execution model. Delegates to
@marlim3-planner, @marlim3-specialist, and @marlim3-qa. Includes
parallelization rules, file conflict prevention strategies, and
explicit scoping guidelines. Only user-invocable agent in the dropdown.
Add Marlim3 skills and agents for simulation configuration
…ist, testing conventions, and time/transient configuration

- Introduced `marlim3-planning-interview` skill for structured user interviews and ADR authoring.
- Added `marlim3-python-api` skill detailing the Python API for building and running simulations.
- Created `marlim3-qa-checklist` skill for validating simulation implementations against ADRs.
- Established `marlim3-testing` skill outlining testing conventions and patterns for simulation cases.
- Updated `marlim3-time-transient` skill to clarify time stepping and transient configuration.
- Revised `marlim3-valves-choke` skill to focus on flow restrictions, valve configurations, and shutdown scenarios.
@yantavares yantavares changed the title [Draft] Adiciona skills e agentes para configuração de simulações do Marlim3 [Draft] Add skills and agents for configuring Marlim3 simulations Aug 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant