| name | hsem-pr-workflow |
| description | Activate when creating, updating, or managing a pull request for the HSEM repository. Covers conventional commits, PR description, quality gates, and merge rules. |
HSEM Pull Request Workflow
Activate this skill when:
- Creating a new pull request
- Updating an existing PR after follow-up commits
- Preparing to merge a PR
Pre-PR Checklist
Before opening a PR, all four quality gates must pass:
tox -e lint
tox -e typing
tox -e quality
tox -e py314
Verify: git --no-optional-locks status shows only intended changes.
Documentation Update
Before opening a PR, check and update ALL documentation that describes changed behavior:
A PR is not done until all affected docs are consistent with the implementation.
Commit Messages — Conventional Commits
Format: <type>(<scope>): <description>
Types: feat, fix, chore, docs, refactor, perf, test, ci
Scopes should be specific to the domain: sensor, flow, config, planner, milp, etc.
Examples:
fix(planner): correct cycle cost denominator — Fixes #444
feat(sensor): add temperature-adaptive charge rate — Fixes #123
Creating a PR
PR Title
Must follow Conventional Commits format: <type>(<scope>): <description>
PR Description Must Include
- Summary of changes
- Branch name
- Files changed
- What changed and why
- Tests added or updated
- Test and lint results
- Known limitations or open questions
- Any required configuration changes
Fixes #<ISSUE_NUMBER> (if applicable)
PR Scope Rules
Keeping an Open PR Up to Date
After every follow-up commit on a branch that already has an open PR:
- Update the PR title if the scope or description has changed
- Update the PR body to reflect ALL changes made so far
- Tick off completed items in any checklist inside the PR description
- Never leave the PR description stale after follow-up commits
How to Update a PR
Always use a temp file for the body — never pass multiline body inline:
cat > /tmp/pr_body.md << 'EOF'
<markdown body here>
EOF
gh pr edit <PR_NUMBER> --title "<type>(scope): updated title" --body-file /tmp/pr_body.md
rm /tmp/pr_body.md
Never use --body "..." with inline multiline text — PowerShell corrupts newlines and backticks.
Merge Rules
Before merging ANY PR:
Never merge without explicit user permission.
After merge, delete the branch locally and remotely.
PR Review Request
If requesting a Copilot code review:
Definition of Done
A PR is complete when: