Skip to content

Prompt Tuning: kelos-workers prompt missing PR template compliance (kind labels, release-note blocks) #538

@kelos-bot

Description

@kelos-bot

🤖 Kelos Agent @gjkim42

Area: Prompt Tuning

Summary

The kelos-workers prompt does not instruct agents to follow the project's PR template (.github/PULL_REQUEST_TEMPLATE.md), resulting in nearly all agent PRs missing /kind labels and release-note blocks. The agentconfig.yaml agentsMD also omits the "Pull Requests" conventions from CLAUDE.md. This is a systemic prompt gap — not covered by #515 (which focuses on agentconfig drift for build/test conventions and missing types/state fields).

Evidence

1. CLAUDE.md requires PR template compliance, but neither agentconfig nor worker prompt mentions it

CLAUDE.md has a dedicated "Pull Requests" section:

## Pull Requests
- **Always follow `.github/PULL_REQUEST_TEMPLATE.md`** when creating PRs.
- Fill in every section of the template. Do not remove or skip sections — use "N/A" or "NONE" where appropriate.
- Choose exactly one `/kind` label from: `bug`, `cleanup`, `documentation`, `feature`.
- If there is no associated issue, write "N/A" under the issue section.
- If the PR does not introduce a user-facing change, write "NONE" in the `release-note` block.

Neither agentconfig.yaml agentsMD nor the kelos-workers.yaml promptTemplate reference any of these conventions.

2. Data: 27 of the last 30 agent PRs lack /kind labels

Analyzing recent generated-by-kelos PRs:

PR Has /kind in body Has release-note block Has needs-kind label
#536 ✅ (not yet triaged)
#535 ✅ (not yet triaged)
#534 ✅ (not yet triaged)
#525 ✅ (custom format) ❌ (triaged externally)
#524
#523 ❌ (triaged externally)
#521
#514
#512
#510
#505#462

Only 4 of 30 PRs include a /kind label. The 3 most recent (#534-536) likely picked up the convention from the .github/PULL_REQUEST_TEMPLATE.md file itself (since PR #521 added it), but this is inconsistent and unreliable.

3. New CI checks highlight the gap but don't fix agent behavior

PRs #530, #531, #534, and #535 recently added CI enforcement that labels PRs with needs-kind and needs-release-note when they lack these fields. This is a good enforcement mechanism, but it doesn't fix the root cause — the worker agent prompt doesn't know about these requirements. The result: agents create PRs → CI adds needs-kind → PR is blocked → but the agent has already finished its work and can't fix it.

4. Worker prompt gives partial PR body instructions but misses template sections

The current worker prompt says:

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.

This addresses one aspect of PR body formatting but omits the template structure entirely. The agent doesn't know it should include:

  • #### What type of PR is this? with a /kind label
  • #### Which issue(s) this PR is related to:
  • #### Special notes for your reviewer:
  • #### Does this PR introduce a user-facing change? with a release-note block

Proposed Changes

1. Add PR conventions to agentconfig.yaml agentsMD

Add the "Pull Requests" section from CLAUDE.md to the shared agent config:

    ## Pull Requests
    - Always follow `.github/PULL_REQUEST_TEMPLATE.md` when creating PRs
    - Fill in every section of the template. Do not remove or skip sections — use "N/A" or "NONE" where appropriate
    - Choose exactly one `/kind` label from: `bug`, `cleanup`, `documentation`, `feature`
    - If the PR does not introduce a user-facing change, write "NONE" in the `release-note` block

2. Update kelos-workers.yaml prompt for PR creation (step 5b)

Replace the current step 5b instruction:

- 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.

With:

- 5b. Create a PR following the `.github/PULL_REQUEST_TEMPLATE.md` format. The PR body must include:
  - `#### What type of PR is this?` with exactly one `/kind <type>` (bug, cleanup, documentation, or feature)
  - `#### What this PR does / why we need it:` with a summary of the changes
  - `#### Which issue(s) this PR is related to:` with `Fixes #{{.Number}}` on its own line
  - `#### Special notes for your reviewer:` (use "N/A" if none)
  - `#### Does this PR introduce a user-facing change?` with a `release-note` block (use "NONE" if no user-facing change)
  Use `gh pr create --label generated-by-kelos --label ok-to-test`, then /review it.

3. Update step 7a (existing PR update path) similarly

Ensure the PR update path (step 7a) also enforces template compliance when updating PR descriptions.

Impact

  • Immediate: Agent PRs will pass the new needs-kind and needs-release-note CI checks on first submission
  • Release notes: The hack/release-notes/main.go tool (added in Add categorized release notes tool #521) parses release-note blocks from PR bodies — agent PRs without these blocks won't appear in release notes
  • Reduced maintainer burden: Maintainers won't need to manually add /kind labels to every agent PR
  • Consistency: Agent PRs will match the same format as human PRs

Related Issues

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions