diff --git a/AGENTS.md b/AGENTS.md index 51eea5be..ebe1ba0c 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -5,6 +5,9 @@ - **Keep changes minimal.** Do not refactor, reorganize, or 'improve' code beyond what was explicitly requested. - **For CI/release workflows**, always use existing Makefile targets rather than reimplementing build logic in YAML. - **Better tests.** Always try to add or improve tests(including integration, e2e) when modifying code. +- **Run `make verify` before pushing.** Always run `make verify` locally to catch lint, fmt, and vet issues before pushing changes. +- **Verify your diff.** Before pushing, run `git diff origin/main --stat` to confirm only files relevant to your task are modified. Revert any unrelated changes. +- **Squash commits.** Squash your commits into a single clean commit before the final push. - **Logging conventions.** Start log messages with capital letters and do not end with punctuation. - **Commit messages.** Do not include PR links in commit messages. diff --git a/self-development/agentconfig.yaml b/self-development/agentconfig.yaml index 499d945a..e7d3f002 100644 --- a/self-development/agentconfig.yaml +++ b/self-development/agentconfig.yaml @@ -27,5 +27,8 @@ spec: - `make test-integration` — run integration tests - `make build` — build binary - Always try to add or improve tests when modifying code + - Run `make verify` before pushing to catch lint, fmt, and vet issues locally + - Before pushing, run `git diff origin/main --stat` to confirm only relevant files are modified — revert any unrelated changes + - Squash commits into a single clean commit before the final push - Logging conventions: start log messages with capital letters and do not end with punctuation - Commit messages: do not include PR links in commit messages diff --git a/self-development/kelos-pr-responder.yaml b/self-development/kelos-pr-responder.yaml index 197e7823..f1b2946c 100644 --- a/self-development/kelos-pr-responder.yaml +++ b/self-development/kelos-pr-responder.yaml @@ -81,10 +81,13 @@ spec: - 2. Read ALL comments on the linked issue referenced by the PR body. First determine the linked issue number from the PR body, then run `gh issue view --comments`. If `KELOS_UPSTREAM_REPO` is set, use `--repo "$KELOS_UPSTREAM_REPO"`. - 3. Read the existing diff (git diff main...HEAD) to understand what has already been done. Do NOT start over or rewrite from scratch. - 4. Make only the incremental changes needed to address review feedback or remaining issues. Preserve existing work. - - 5. Commit and push your changes to origin {{.Branch}}. - - 6. /review the PR to verify your changes address the feedback. If changes are needed, make them, commit and push, then /review again. Repeat until the review passes. - - 7. Update the PR title and description to reflect the final diff. The PR body MUST contain a standard closing keyword reference on its own line (e.g., `Fixes #123` or `Closes #123`). Do not embed the issue number in natural language. Ensure the PR has labels "generated-by-kelos" and "ok-to-test" (use `gh pr edit {{.Number}} --add-label generated-by-kelos --add-label ok-to-test` if missing). If `KELOS_UPSTREAM_REPO` is set, include `--repo "$KELOS_UPSTREAM_REPO"`. - - 8. Make sure the PR passes all CI tests. + - 5. Before pushing, verify your changes are clean: + - Run `make verify` to catch lint, fmt, and vet issues locally. + - Run `git diff origin/main --stat` (or `git diff upstream/main --stat` if upstream is set) to confirm only files relevant to the task are modified. Revert any unrelated changes. + - 6. Squash your commits into a single clean commit, then push to origin {{.Branch}}. + - 7. /review the PR to verify your changes address the feedback. If changes are needed, make them, commit and push, then /review again. Repeat until the review passes. + - 8. Update the PR title and description to reflect the final diff. The PR body MUST contain a standard closing keyword reference on its own line (e.g., `Fixes #123` or `Closes #123`). Do not embed the issue number in natural language. Ensure the PR has labels "generated-by-kelos" and "ok-to-test" (use `gh pr edit {{.Number}} --add-label generated-by-kelos --add-label ok-to-test` if missing). If `KELOS_UPSTREAM_REPO` is set, include `--repo "$KELOS_UPSTREAM_REPO"`. + - 9. Make sure the PR passes all CI tests. Post-checklist: - If the PR is ready for human review, you need more information, or you cannot make progress, post a PR comment whose first line is `/kelos needs-input` and explain why below it. Maintainers can resume the PR later with `/kelos pick-up`. diff --git a/self-development/kelos-workers.yaml b/self-development/kelos-workers.yaml index 3ea99813..bf815b63 100644 --- a/self-development/kelos-workers.yaml +++ b/self-development/kelos-workers.yaml @@ -98,10 +98,13 @@ spec: - Also read ALL comments on the linked issue (gh issue view {{.Number}} --comments), not just the PR. - 3a. Read the existing diff (git diff main...HEAD) to understand what has already been done. Do NOT start over or rewrite from scratch. - 4a. Make only the incremental changes needed to address review feedback or remaining issues. Preserve existing work. - - 5a. Commit and push your changes to origin kelos-task-{{.Number}}. - - 6a. /review the PR to verify your changes address the feedback. If changes are needed, make them, commit and push, then /review again. Repeat until the review passes. - - 7a. Update the PR title and description to reflect the final diff. The PR body MUST contain a standard closing keyword reference on its own line (e.g., `Fixes #{{.Number}}` or `Closes #{{.Number}}`). Do not embed the issue number in natural language. Ensure the PR has labels "generated-by-kelos" and "ok-to-test" (use `gh pr edit {{.Number}} --add-label generated-by-kelos --add-label ok-to-test` if missing). - - 8a. Make sure the PR passes all CI tests. + - 5a. Before pushing, verify your changes are clean: + - Run `make verify` to catch lint, fmt, and vet issues locally. + - Run `git diff origin/main --stat` to confirm only files relevant to the task are modified. Revert any unrelated changes. + - 6a. Squash your commits into a single clean commit, then push to origin kelos-task-{{.Number}}. + - 7a. /review the PR to verify your changes address the feedback. If changes are needed, make them, commit and push, then /review again. Repeat until the review passes. + - 8a. Update the PR title and description to reflect the final diff. The PR body MUST contain a standard closing keyword reference on its own line (e.g., `Fixes #{{.Number}}` or `Closes #{{.Number}}`). Do not embed the issue number in natural language. Ensure the PR has labels "generated-by-kelos" and "ok-to-test" (use `gh pr edit {{.Number}} --add-label generated-by-kelos --add-label ok-to-test` if missing). + - 9a. Make sure the PR passes all CI tests. If no PR exists: - 2b. Investigate the issue #{{.Number}}. @@ -110,10 +113,13 @@ spec: - Search the codebase for existing constants, types, and patterns before creating new ones. Do not duplicate definitions. - Only implement what the issue explicitly asks for. If you discover related improvements, create separate issues for them. - 3b. Create a commit that fixes the issue. - - 4b. Push your branch to origin kelos-task-{{.Number}}. - - 5b. Create a PR with labels "generated-by-kelos" and "ok-to-test" (use `gh pr create --label generated-by-kelos --label ok-to-test`), then /review it. If changes are needed, make them, commit and push, then /review again. Repeat until the review passes. - - 6b. Update the PR title and description to reflect the final diff. The PR body MUST contain a standard closing keyword reference on its own line (e.g., `Fixes #{{.Number}}` or `Closes #{{.Number}}`). Do not embed the issue number in natural language. - - 7b. Make sure the PR passes all CI tests. + - 4b. Before pushing, verify your changes are clean: + - Run `make verify` to catch lint, fmt, and vet issues locally. + - Run `git diff origin/main --stat` to confirm only files relevant to the task are modified. Revert any unrelated changes. + - 5b. Squash your commits into a single clean commit, then push your branch to origin kelos-task-{{.Number}}. + - 6b. Create a PR with labels "generated-by-kelos" and "ok-to-test" (use `gh pr create --label generated-by-kelos --label ok-to-test`), then /review it. If changes are needed, make them, commit and push, then /review again. Repeat until the review passes. + - 7b. Update the PR title and description to reflect the final diff. The PR body MUST contain a standard closing keyword reference on its own line (e.g., `Fixes #{{.Number}}` or `Closes #{{.Number}}`). Do not embed the issue number in natural language. + - 8b. Make sure the PR passes all CI tests. Post-checklist: - Post a `/kelos needs-input` comment on the issue (gh issue comment {{.Number}} --body "/kelos needs-input") and leave a comment for the reason if any of the following applies: