Skip to content

Add AI-assistance policy, agent instructions, and code style docs#1698

Closed
adcroft wants to merge 1 commit into
mom-ocean:mainfrom
adcroft:agents-and-policy
Closed

Add AI-assistance policy, agent instructions, and code style docs#1698
adcroft wants to merge 1 commit into
mom-ocean:mainfrom
adcroft:agents-and-policy

Conversation

@adcroft
Copy link
Copy Markdown
Collaborator

@adcroft adcroft commented Apr 2, 2026

Adds three files that arose out of the dev call on March 23, namely a policy statement and two guides, and a few pointer files to cover various AI tools, and makes changes to existing documentation files to avoid duplication.

This is being submitted in draft mode so we can evaluate/comment on, but also so I can later rebase on top of #1691 (to give credit to @glwagner) and #1697 (since it's changing the file touched here).

The code style guide was mostly derived from the wiki pages although we also incorporated elements from proposed AGENT files. The AGENTS file was primarily based on that submitted in PR #1691 but with code style parts moved out.

The three new files are:

  • docs/Consortium-policy-on-AI.md : Project policy on AI-assisted contributions, authored by Hallberg and Ward. Establishes that a human contributor is accountable for all submitted code, requires disclosure of AI assistance in PRs, and catalogs specific risks (physical correctness, comprehension debt, vacuous tests, code churn, unsafe code). Permits AI for development assistance, debugging, documentation, CI triage, and PR review; prohibits autonomous contribution without human oversight.

  • docs/AGENTS.md : Technical instructions for AI coding assistants covering the parameter system (get_param, _BUG flags, ANSWER_DATE), diagnostics (registration, posting, masking conventions), the test suite (.testing/ with tc0–tc4, test categories, verification via bitwise-identical checksums), git workflow (fork-based branching, commit message conventions with */+ prefixes, PR description style), physics domain knowledge, common development tasks (new parameterizations, diagnostics, runtime parameters, bug fixes), architecture constraints (infra/framework layering), and defensive programming practices.

  • docs/Code-style.md : Fortran code style guide migrated from the wiki and extended with sections on module structure, naming conventions, memory macros (SZI_, SZIB_, etc.), the dimensional unit annotation system ([rescaled ~> MKS]), and Doxygen documentation requirements. The line-length guideline is set to 120 characters to match what trailer.py and the GitHub Action enforce.

Pointer files so AI tools auto-discover the conventions:

  • CLAUDE.md (Claude Code) — uses @docs/AGENTS.md directive
  • AGENTS.md (OpenAI Codex / OpenCode) — links to docs/AGENTS.md
  • .github/copilot-instructions.md (GitHub Copilot) — links to docs/AGENTS.md

Also updates existing documentation:

  • README.md: expanded project description, added resource links (developer wiki, forum, CVMix, TEOS-10, GOTM)
  • docs/code_organization.rst: updated directory tree to reflect current layout (added FMS2, nuopc_cap, timing_tests, unit_tests; removed mct_cap; added driver descriptions)
  • docs/about.rst: fixed typos
  • docs/front_page.md: updated link to Code-style.md
  • docs/README.md: pointed Doxygen style references to docs/Code-style.md instead of the retired wiki pages
  • docs/Doxygen_* were modified to include new markdown files

And, for full disclosure, copilot/Claude Opus 4.6 was used to reconcile the redundant or conflicting information between our first draft of the docs (on google drive) and files in the repository.

Add three new documentation files and supporting pointer files to
guide both human contributors and AI coding assistants:

- docs/Consortium-policy-on-AI.md : Project policy on AI-assisted
contributions, authored by Hallberg and Ward. Establishes that a human
contributor is accountable for all submitted code, requires disclosure
of AI assistance in PRs, and catalogs specific risks (physical
correctness, comprehension debt, vacuous tests, code churn, unsafe
code). Permits AI for development assistance, debugging, documentation,
CI triage, and PR review; prohibits autonomous contribution without
human oversight.

- docs/AGENTS.md : Technical instructions for AI coding assistants
covering the parameter system (get_param, _BUG flags, ANSWER_DATE),
diagnostics (registration, posting, masking conventions), the test
suite (.testing/ with tc0–tc4, test categories, verification via
bitwise-identical checksums), git workflow (fork-based branching, commit
message conventions with */+ prefixes, PR description style), physics
domain knowledge, common development tasks (new parameterizations,
diagnostics, runtime parameters, bug fixes), architecture constraints
(infra/framework layering), and defensive programming practices.

- docs/Code-style.md : Fortran code style guide migrated from the wiki
and extended with sections on module structure, naming conventions,
memory macros (SZI_, SZIB_, etc.), the dimensional unit annotation
system ([rescaled ~> MKS]), and Doxygen documentation requirements.
The line-length guideline is set to 120 characters to match what
trailer.py and the GitHub Action enforce.

Pointer files so AI tools auto-discover the conventions:
- CLAUDE.md (Claude Code) — uses @docs/AGENTS.md directive
- AGENTS.md (OpenAI Codex / OpenCode) — links to docs/AGENTS.md
- .github/copilot-instructions.md (GitHub Copilot) — links to
  docs/AGENTS.md

Also updates existing documentation:
- README.md: expanded project description, added resource links
  (developer wiki, forum, CVMix, TEOS-10, GOTM)
- docs/code_organization.rst: updated directory tree to reflect current
  layout (added FMS2, nuopc_cap, timing_tests, unit_tests; removed
  mct_cap; added driver descriptions)
- docs/about.rst: fixed typos
- docs/front_page.md: updated link to Code-style.md
- docs/README.md: pointed Doxygen style references to docs/Code-style.md
  instead of the retired wiki pages
- docs/Doxygen_* were modified to include new markdown files

And, for full disclosure, copilot/Claude Opus 4.6 was used to reconcile
the redundant or conflicting information between our first draft of the
docs (on google drive) and files in the repository.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant