diff --git a/AGENTS.md b/AGENTS.md index e5ffbf449816..db109ecb7d92 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -185,19 +185,38 @@ This means: ## Commit Messages -Please see /hypershift/.cursor/rules/git-commit-format.mdc for information on how commit messages should be generated or formatted -in this project. - -### Gitlint Integration - -- The project uses gitlint to enforce commit message format -- gitlint can be run by using this command `make run-gitlint` -- Ensure all commit messages pass gitlint validation -- Common gitlint rules to follow: - - Conventional commit format - - Proper line length limits - - Required footers - - No trailing whitespace +Use the `git-commit-format` skill for formatting rules and required footers. Validate with `make run-gitlint`. Do NOT put Jira IDs in commit messages — they belong only in PR titles. + +### Restructuring Commits Before PR Submission + +Before creating a PR or after addressing review comments, use the `restructure-hypershift-commits` skill to reorganize all branch commits into logical, component-based commits. This ensures every PR has a clean, reviewable commit history grouped by architectural boundary. + +## Pull Requests + +See [CONTRIBUTING.md](.github/CONTRIBUTING.md) for the full contribution guidelines. Key points for agents: + +### Before Creating a PR + +1. Use the `restructure-hypershift-commits` skill to organize commits by component (see [Restructuring Commits](#restructuring-commits-before-pr-submission) above) +2. Run `make pre-commit` to update dependencies, build, verify formatting, run tests, and validate commit messages via gitlint + +### PR Title + +Prefix with a Jira ticket number: `OCPBUGS-12345: Fix memory leak in controller`. Use `NO-JIRA:` only when no Jira issue exists (sparingly). + +### PR Description + +Follow the template in `.github/PULL_REQUEST_TEMPLATE.md`. + +### PR Workflow + +1. Open the PR in **draft mode** to avoid triggering all CI jobs and notifying approvers +2. Run necessary CI jobs manually with `/test ` +3. Mark as "Ready for Review" once tests pass and required labels are applied + +### After Review Comments + +After addressing review feedback, use the `restructure-hypershift-commits` skill again to reorganize commits before force-pushing. This keeps the commit history clean for subsequent review rounds. ## Code conventions