Skip to content

chore: add pr-precheck skill#4054

Open
mark-vass-konghq wants to merge 1 commit intomainfrom
chore/add-pr-precheck-skill
Open

chore: add pr-precheck skill#4054
mark-vass-konghq wants to merge 1 commit intomainfrom
chore/add-pr-precheck-skill

Conversation

@mark-vass-konghq
Copy link
Copy Markdown
Contributor

@mark-vass-konghq mark-vass-konghq commented Apr 1, 2026

Add pr-precheck skill to agents. The purpose is improve your self-review skills and save time to not wait for coderabbit and CI.

Summary by CodeRabbit

  • Chores
    • Added automated pre-check validation for pull requests to enforce architectural boundaries, domain compliance requirements, coding standards, and safety protocols during code review.

@mark-vass-konghq mark-vass-konghq self-assigned this Apr 1, 2026
@mark-vass-konghq mark-vass-konghq requested a review from a team as a code owner April 1, 2026 16:40
@mark-vass-konghq mark-vass-konghq added the devex-improvement Features/tools which are improves developer experience label Apr 1, 2026
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 1, 2026

📝 Walkthrough

Walkthrough

Introduces a new PR pre-check skill definition that specifies architectural, code quality, and safety review protocols for pull request validation against OpenMeter standards.

Changes

Cohort / File(s) Summary
New PR Pre-Check Skill
.agents/skills/pr-precheck/SKILL.md
New skill definition file with comprehensive checklist covering architectural boundaries, domain/data requirements, Go coding standards, and safety checks. Includes control-flow logic to handle empty diffs and provide categorized feedback.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change—adding a new pr-precheck skill to the agents directory.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore/add-pr-precheck-skill

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (1)
.agents/skills/pr-precheck/SKILL.md (1)

16-22: Consider referencing the existing /service skill for patterns.

This architectural guidance looks solid! Just a thought—since there's already a /service skill that documents service/adapter patterns, constructors, DI wiring, and other architectural conventions, you might want to reference it here to avoid duplicating or diverging from that guidance over time.

💡 Optional improvement

You could add a note like:

 ## 1. Architectural Layers & Logic Placement
 OpenMeter relies on a highly optimized stack for real-time event ingestion and billing. Ensure changes respect the following boundaries:
+
+> **Note:** For detailed service/adapter patterns, constructors, and DI wiring conventions, see the `/service` skill documentation.
+
 * **API Layer (TypeSpec/Handlers):** Must remain thin. Complex business logic should not reside in API handlers.

Based on learnings that reference the /service skill for Go architectural patterns.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.agents/skills/pr-precheck/SKILL.md around lines 16 - 22, The guidance in
SKILL.md should reference the existing /service skill to avoid duplication;
update the Architectural Layers & Logic Placement section to add a brief pointer
mentioning the /service skill (or its canonical name) for established
service/adapter patterns, constructors, and DI wiring so readers follow a single
source of truth; locate the section under "Architectural Layers & Logic
Placement" and insert a short sentence like "See /service for service/adapter
patterns, constructors, and DI conventions" to ensure consistency with existing
Go architectural patterns.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.agents/skills/pr-precheck/SKILL.md:
- Line 27: Update the Meters aggregation list in the SKILL.md documentation so
it includes the two missing supported types: UNIQUE_COUNT and LATEST;
specifically change the line that currently lists "SUM, COUNT, AVG, MIN, MAX" to
list "SUM, COUNT, AVG, MIN, MAX, UNIQUE_COUNT, LATEST" so the pre-check reflects
all seven supported aggregation types from the meter module.

---

Nitpick comments:
In @.agents/skills/pr-precheck/SKILL.md:
- Around line 16-22: The guidance in SKILL.md should reference the existing
/service skill to avoid duplication; update the Architectural Layers & Logic
Placement section to add a brief pointer mentioning the /service skill (or its
canonical name) for established service/adapter patterns, constructors, and DI
wiring so readers follow a single source of truth; locate the section under
"Architectural Layers & Logic Placement" and insert a short sentence like "See
/service for service/adapter patterns, constructors, and DI conventions" to
ensure consistency with existing Go architectural patterns.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 65e316fa-0ea5-47d7-8bc4-dcffadfc8082

📥 Commits

Reviewing files that changed from the base of the PR and between a4a2fa1 and bb45898.

📒 Files selected for processing (1)
  • .agents/skills/pr-precheck/SKILL.md

## 2. Domain & Data Patterns
* **CloudEvents:** OpenMeter ingests events in the CloudEvents format. Any changes to event ingestion must strictly validate or adhere to the CloudEvents schema (`id`, `source`, `subject`, `type`, `time`, `data`).
* **Event Deduplication:** Ensure any ingestion modifications respect deduplication logic (handled via `id` and `source` fields).
* **Meters:** Check that aggregations use supported types (SUM, COUNT, AVG, MIN, MAX).
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Description: Verify all supported meter aggregation types in the codebase

# Search for MeterAggregation constant definitions
ast-grep --pattern $'const (
  $$$
)'  --lang go | rg -A 20 'MeterAggregation'

# Also check the Values() method implementation
rg -A 15 'func \(MeterAggregation\) Values\(\)' --type go

Repository: openmeterio/openmeter

Length of output: 8318


Meter aggregations list needs updating—missing UNIQUE_COUNT and LATEST.

The pre-check currently validates against only "SUM, COUNT, AVG, MIN, MAX", but the codebase actually supports 7 types. Missing from the list are UNIQUE_COUNT and LATEST, which are legitimate aggregation types defined in the meter module. This gaps means the skill won't catch code using these types, leading to false negatives.

Update the list to: SUM, COUNT, AVG, MIN, MAX, UNIQUE_COUNT, LATEST.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.agents/skills/pr-precheck/SKILL.md at line 27, Update the Meters
aggregation list in the SKILL.md documentation so it includes the two missing
supported types: UNIQUE_COUNT and LATEST; specifically change the line that
currently lists "SUM, COUNT, AVG, MIN, MAX" to list "SUM, COUNT, AVG, MIN, MAX,
UNIQUE_COUNT, LATEST" so the pre-check reflects all seven supported aggregation
types from the meter module.

@mark-vass-konghq mark-vass-konghq added the release-note/misc Miscellaneous changes label Apr 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

devex-improvement Features/tools which are improves developer experience release-note/misc Miscellaneous changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant