com um clique
github-workflow
GitHub workflow, commit conventions, and PR process for MAPL
Instalar com Codex ou Claude Copie este prompt, cole no Codex, Claude ou outro assistente e deixe que ele revise a página da skill e instale para você.
Menu
GitHub workflow, commit conventions, and PR process for MAPL
Instalar com Codex ou Claude Copie este prompt, cole no Codex, Claude ou outro assistente e deixe que ele revise a página da skill e instale para você.
Baseado na classificação ocupacional SOC
Safely switch between NAG, gfortran, and Intel compilers when building MAPL
MAPL Fortran coding standards and style conventions
Build MAPL with NAG, gfortran, or Intel compilers on macOS and Linux
MAPL error handling macros and best practices
First-time MAPL development environment setup and configuration
Run and debug MAPL tests with pFUnit framework
| name | github-workflow |
| description | GitHub workflow, commit conventions, and PR process for MAPL |
| compatibility | opencode |
Provide comprehensive Git and GitHub workflow guidance for MAPL development, including:
Use this skill when:
These rules exist to maintain code quality and prevent accidental breaking changes.
IMPORTANT: Always clarify which base branch to use before starting work!
Purpose: Legacy MAPL (MAPL 2.x) maintenance and development
Use for:
Status: Stable, production-ready code
Purpose: MAPL v3 pre-release development
Use for:
Status: Active development, pre-release
All development work happens on feature branches that follow this pattern:
feature/#ISSUE-description
bugfix/#ISSUE-description
hotfix/#ISSUE-description
Where:
#ISSUE is the GitHub issue number (e.g., #4392)description is a brief kebab-case descriptionExamples:
feature/#4392-add-opencode-agent-skills
bugfix/#4388-vector-basis-kind-default
feature/#4376-support-rotated-vectors
hotfix/#4390-memory-leak-gridcomp
Step 1: Create GitHub issue FIRST
Before creating a branch, you need an issue number:
# Create issue via gh CLI
gh issue create --title "Add support for rotated vectors"
# Or create via web interface
# https://github.com/GEOS-ESM/MAPL/issues/new
Step 2: Checkout base branch
# For MAPL 2.x work
git checkout develop
git pull origin develop
# For MAPL v3 work
git checkout release/MAPL-v3
git pull origin release/MAPL-v3
Step 3: Create feature branch
# Using issue number from Step 1
git checkout -b feature/#4376-support-rotated-vectors
Step 4: Do your work, create commits
# Make changes
git add <files>
git commit -m "Add rotated vector support"
# More changes
git add <files>
git commit -m "Add tests for rotated vectors"
Step 5: Push (ONLY WITH PERMISSION)
git push -u origin feature/#4376-support-rotated-vectors
Format: Imperative mood, concise summary
Good examples:
Add dark mode toggle to settings
Fix memory leak in GridComp
Refactor VerticalRegridder for clarity
Update documentation for ExtData
Remove deprecated HistoryV1 code
Bad examples:
Added support for the new dark mode feature in settings (too long!)
fix (too vague)
WIP (not descriptive)
Updated code (what code? how?)
Imperative mood means: Command form, as if giving an instruction
After first line, add blank line, then details:
Add rotated vector support to regridding
The regridding framework now supports vector fields defined
in rotated coordinate systems. This is required for regional
climate models that use rotated pole grids.
Implementation includes:
- New RotatedVectorTransform class
- Coordinate transformation matrices
- Tests for common rotation angles
- Documentation updates
<verb> <what> in <where> (< 50 chars total)
<blank line>
<optional detailed explanation>
<why this change is needed>
<how it's implemented>
<any caveats or special considerations>
Before creating PR:
fortran-style skill)mapl-error-handling skill)develop branch)# Make sure feature branch is pushed
git push -u origin feature/#4376-support-rotated-vectors
# Create PR
gh pr create \
--base develop \
--title "Add rotated vector support to regridding" \
--body "Fixes #4376"
Or via web interface: https://github.com/GEOS-ESM/MAPL/pulls
Pull requests should include:
## Types of change(s)
- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to change)
- [ ] Trivial change (affects only documentation or cleanup)
- [ ] Refactor (no functional changes, no api changes)
## Checklist
- [ ] Tested this change with a run of GEOSgcm
- [ ] Ran the Unit Tests (`make tests` or `ctest`)
## Description
Brief description of what this PR does and why.
## Related Issue
Fixes #ISSUE_NUMBER
Format: Same as commit message - concise, imperative, < 50 chars if possible
Examples:
Add rotated vector support to regridding
Fix memory leak in GridComp initialization
Refactor VerticalRegridder for performance
Update ExtData documentation
CRITICAL: All PRs to the develop branch MUST include a CHANGELOG.md entry.
MAPL follows Keep a Changelog format with these sections:
Add your change under the [Unreleased] section in the appropriate category:
## [Unreleased]
### Fixed
- Your bug fix here
### Added
- Your new feature here
- Another feature
### Changed
- Your change here
Good entries:
### Added
- Added rotated vector support to regridding framework
- Added MAPL_GetPartition() implementation with unit tests
### Fixed
- Fixed memory leak in GridComp initialization
- Fixed 32-bit integer overflow in QSsort
### Changed
- Update components.yaml
- ESMA_env v5.17.0
- Update to Baselibs 8.24.0
Bad entries:
### Added
- Updated code (too vague)
- Bug fix (which bug? belongs in Fixed)
- Made changes (what changes?)
Simple changes:
- Added support for rotated vectors in regridding
Complex changes with details:
- Update `components.yaml`
- `ESMA_env` v5.17.0
- Update to Baselibs 8.24.0
- ESMF v9.0.0b08
- GFE v1.22.0
Multiple related changes:
- Added implementation for `mapl_GetPartition()` with unit tests
- Added backwards compatibility with non-CF dimensionless vertical coordinate in ExtData2G
- Added logic in History to check for consistent History and averaging coupler alarms
Update CHANGELOG when:
Don't update CHANGELOG for:
# 1. Make your code changes
git add src/MyFile.F90
# 2. Update CHANGELOG.md
# Edit CHANGELOG.md under [Unreleased] section
vi CHANGELOG.md
# 3. Commit together
git add CHANGELOG.md
git commit -m "Add rotated vector support to regridding
Implements support for vector fields in rotated coordinate systems.
Required for regional climate models using rotated pole grids."
# 4. Push and create PR
git push -u origin feature/#1234-rotated-vectors
gh pr create --base develop
IMPORTANT: Include CHANGELOG changes in the same commit as your code changes, or in a dedicated CHANGELOG commit if your PR has multiple commits.
From the Code Review Checklist:
Error Handling:
_SUCCESS at end of procedures_RC macro where appropriate_STATOptional Variables:
Code Quality:
Thread Safety:
Style:
>, == not .gt., .eq.)implicit none in all modulesBe responsive:
Be collaborative:
Update PR:
# Make requested changes
git add <files>
git commit -m "Address review comments
- Fix error handling in process_data
- Rename confusing variable names
- Add missing assertions"
# Push updates (with permission)
git push
Keep your feature branch up to date with base branch:
# On your feature branch
git fetch origin
# Merge base branch into feature branch
git merge origin/develop # or origin/release/MAPL-v3
# Resolve any conflicts
git add <resolved-files>
git commit -m "Merge develop into feature branch"
# Push (with permission)
git push
If you haven't pushed yet:
# Fix most recent commit message
git commit --amend
# This opens editor to modify message
# Save and close to update
If you already pushed: Be very careful with amend/rebase after pushing. Discuss with team first.
Large PRs are hard to review. Consider splitting:
Option 1: Multiple PRs in sequence
# PR 1: Refactoring prep work
feature/#4380-refactor-regridder-prep
# PR 2: New feature (depends on PR 1)
feature/#4376-add-rotated-vectors
Option 2: Multiple commits in one PR
Organize commits logically in single PR:
commit 1: Refactor existing code for clarity
commit 2: Add new RotatedVectorTransform class
commit 3: Integrate into regridding framework
commit 4: Add tests
commit 5: Update documentation
DO NOT merge your own PR without approval!
After approval:
Typical merge: Maintainer merges approved PRs
Changes flow from develop to release/MAPL-v3:
develop → release/MAPL-v3
This means:
Sometimes need to apply same fix to both branches:
# Fix merged to develop
# Now apply to release/MAPL-v3
git checkout release/MAPL-v3
git cherry-pick <commit-hash-from-develop>
git push # With permission
Use sparingly - usually develop flows to v3 naturally
Problem: Local and remote branches have different histories
Solution:
git fetch origin
git status # See how many commits ahead/behind
# If you haven't pushed problematic commits
git reset --hard origin/<branch-name> # CAUTION: loses local commits
# If coordination needed with team
# Discuss before force pushing or resetting
Problem: Made commits directly on develop instead of feature branch
Solution:
# Create feature branch from current develop
git checkout -b feature/#ISSUE-emergency-fix
# Reset develop to match origin
git checkout develop
git reset --hard origin/develop
# Continue work on feature branch
git checkout feature/#ISSUE-emergency-fix
Before pushing:
# Interactive rebase last 3 commits
git rebase -i HEAD~3
# Mark commits to squash in editor
# Save and close
After pushing: Discuss with team first (requires force push)
# 1. Create GitHub issue first (get #ISSUE number)
gh issue create --title "Your feature description"
# 2. Checkout base branch
git checkout develop # or release/MAPL-v3
git pull origin develop
# 3. Create feature branch
git checkout -b feature/#ISSUE-description
# 4. Do work, commit with proper messages (< 50 char first line)
git add <files>
git commit -m "Add feature description"
# 5. Push (with permission)
git push -u origin feature/#ISSUE-description
# 6. Create PR
gh pr create --base develop
# Check first line length
git log --oneline -1 | wc -c # Should be < 52 (50 + newline + SHA)
# View last commit message
git log -1
# Amend if needed (before pushing)
git commit --amend
fortran-style - Coding standards for code reviewmapl-error-handling - Error handling review checklistCritical Reminders:
feature/#ISSUE-descriptionWhen in doubt: Ask the team! Better to clarify than to cause problems.