This prompt is designed for code review bots, CI/CD pipelines, and developer tools that post automated lint feedback on pull requests. Its primary job is to transform a noisy, repetitive list of raw lint findings into a single, well-structured, and developer-actionable review comment. The ideal user is a platform engineer, DevSecOps lead, or developer building an AI-assisted code review harness. The prompt expects a structured input containing multiple lint findings, each with a file path, line number, rule ID, severity, and message. It produces a grouped summary that deduplicates identical violations, clusters related issues by file and category, and maintains a constructive, non-blaming tone that respects the developer's time.
Prompt
Pull Request Lint Comment Summarization Prompt Template

When to Use This Prompt
Define the job, ideal user, required inputs, and constraints for the Pull Request Lint Comment Summarization prompt.
Use this prompt when you have a batch of lint findings from one or more tools (ESLint, Pylint, RuboCop, Checkstyle, etc.) and need a single, coherent PR comment. It is appropriate when the findings are already deduplicated at the tool level or when you want the model to handle cross-tool deduplication. The prompt is not suitable for real-time IDE feedback where individual, immediate squiggles are more useful than a summary. It is also not a replacement for a security triage workflow: if the findings include critical SAST results that require immediate human review, route those through a dedicated security escalation path before summarization. The prompt assumes the input findings are already parsed into a consistent schema—it does not handle raw, unstructured linter output.
Before wiring this into a production PR workflow, ensure you have a clear contract for the input schema and a validation step that checks the output comment for length limits, markdown validity, and the presence of required sections. The prompt works best when combined with a post-generation evaluation that verifies no finding was dropped, severity levels are preserved, and the tone remains constructive. For high-risk repositories (compliance, safety-critical systems), always require human review of the summarized comment before it is posted to the PR. The next section provides the copy-ready prompt template you can adapt to your specific linter ecosystem and PR platform conventions.
Use Case Fit
Where the PR Lint Comment Summarization prompt works and where it introduces risk.
Good Fit: High-Volume Lint Feedback on PRs
Use when: A PR receives 10+ lint findings across multiple files and categories. The prompt reduces noise by grouping, deduplicating, and prioritizing findings into a single actionable comment. Guardrail: Always include the raw linter output as [INPUT] so reviewers can drill into individual findings.
Bad Fit: Single-Finding or Trivial Lint Output
Avoid when: The PR has zero or one lint finding. Summarization adds latency and abstraction without value. A direct inline comment is faster and more precise. Guardrail: Gate the prompt behind a minimum-finding threshold (e.g., >3 findings) before invoking summarization.
Required Inputs: Structured Lint Output Plus File Context
Risk: Summarization quality collapses if the model receives only raw, unstructured linter text without file paths, line numbers, or rule identifiers. Guardrail: Require [LINT_OUTPUT] in a structured format (JSON or line-oriented with file:line:rule:message fields) and optional [FILE_DIFF] for context-aware grouping.
Operational Risk: Suppressing Critical Security Findings
Risk: Deduplication and summarization can accidentally collapse distinct security findings into a single vague category, causing reviewers to miss a high-severity vulnerability. Guardrail: Never deduplicate across severity levels. Always surface security-category findings individually with their original severity, even if they appear similar.
Operational Risk: Tone Drift Toward Blame or Dismissal
Risk: Without explicit tone constraints, the summary can sound accusatory ('the developer ignored...') or dismissive ('minor style issues only'), damaging team culture. Guardrail: Include a [TONE] constraint requiring neutral, objective language focused on the code, not the author. Test with adversarial examples.
Boundary: Not a Replacement for Linter Configuration
Risk: Teams may rely on summarization to paper over noisy linter configs instead of tuning rules. Summarization becomes a permanent crutch. Guardrail: Treat this prompt as a transitional tool. Pair it with a periodic Linting Rule Effectiveness Audit to reduce noise at the source.
Copy-Ready Prompt Template
A reusable prompt template with square-bracket placeholders for summarizing multiple lint findings into a concise, actionable PR review comment.
This prompt template is designed to be dropped into a code review bot, CI pipeline, or AI coding agent workflow that receives raw linter output and must produce a single, well-structured review comment for a pull request. The template expects pre-processed lint findings grouped by file and category, and it outputs a deduplicated summary that a developer can act on without reading through hundreds of raw linter lines. Use this when you have multiple linters posting to the same PR and need a single coherent voice, or when raw lint output is too noisy for meaningful human review.
textYou are a code review assistant summarizing lint findings for a pull request. ## INPUT [LINT_FINDINGS] ## CONSTRAINTS - Group findings by file path, then by category (e.g., style, bug-risk, security, performance, type-safety). - Deduplicate identical findings within the same file. If the same violation appears on multiple lines, mention the line range instead of listing every line. - For each group, write a single sentence that states the category, the count of occurrences, and the most representative example. - Do not repeat the same advice across files. If a pattern spans multiple files, note it once under a "Cross-File Patterns" section. - Use a neutral, non-blaming tone. Frame findings as opportunities, not failures. - If a finding is likely a false positive based on [FALSE_POSITIVE_RULES], flag it with "[likely FP]" and a one-line justification. - If the total finding count exceeds [MAX_FINDINGS], add a note: "[TRUNCATION_NOTICE] additional findings omitted. Run locally for full results." ## OUTPUT_SCHEMA Return a single markdown comment with this structure: 1. A one-line summary: "This PR introduces [N] lint findings across [M] files." 2. A "## Findings by File" section with subsections per file. 3. An optional "## Cross-File Patterns" section if patterns repeat. 4. An optional "## Likely False Positives" section if any findings are flagged. 5. A "## Next Steps" section with one to three concrete actions. ## EXAMPLES [FEW_SHOT_EXAMPLES] ## RISK_LEVEL [RISK_LEVEL]
Adaptation guidance: Replace [LINT_FINDINGS] with pre-grouped JSON or markdown output from your linter aggregation step. [FALSE_POSITIVE_RULES] should be a list of patterns your team has agreed to suppress (e.g., specific rules in test files, generated code directories). [MAX_FINDINGS] prevents comment bloat on large PRs — set this based on your review tool's character limits or team attention budget. [FEW_SHOT_EXAMPLES] should include two to three examples of well-formed summaries from your actual codebase so the model learns your team's tone and grouping conventions. [RISK_LEVEL] controls how conservative the summary is: set to "high" to require explicit false-positive checks and truncation notices, or "low" for internal draft PRs where brevity matters more than auditability. Before shipping, validate the output against your PR comment schema, test with a golden set of known lint outputs, and ensure the truncation behavior triggers correctly when finding counts exceed your threshold.
Prompt Variables
Required inputs for the Pull Request Lint Comment Summarization Prompt. Each placeholder must be populated before the prompt is sent. Validation notes describe how to check that the input is well-formed and safe.
| Placeholder | Purpose | Example | Validation Notes |
|---|---|---|---|
[LINT_FINDINGS] | Raw list of lint findings from one or more linters, including file path, line number, rule ID, severity, and message. | {"findings": [{"file": "src/auth.py", "line": 42, "rule": "E501", "severity": "error", "message": "line too long"}]} | Must be valid JSON array. Each finding must have file, line, rule, severity, and message fields. Reject if empty or missing required fields. Severity must be one of error, warning, info, or hint. |
[PR_CONTEXT] | Metadata about the pull request: title, description, changed files list, and author. | {"title": "Add OAuth2 flow", "description": "Implements PKCE...", "files": ["src/auth.py"], "author": "alex"} | Must be valid JSON object. title and files are required. files array must not be empty. description may be null. Validate that files array entries are strings. |
[REPO_CONVENTIONS] | Team-specific conventions for code style, comment tone, and review norms. Used to calibrate the summary's voice and actionability. | "We prefer direct, concise comments. Avoid passive voice. Link to internal style guide for rule rationale." | String or null. If provided, must be non-empty string under 2000 characters. If null, the prompt uses a neutral, professional tone. Check for injection attempts if sourced from user input. |
[MAX_COMMENT_LENGTH] | Maximum character length for the generated summary comment. Prevents overly verbose PR comments. | 1500 | Must be a positive integer between 200 and 4000. Default to 1500 if not provided. Reject values below 200 as too restrictive for meaningful summaries. |
[DEDUPLICATION_MODE] | Controls how duplicate findings are handled: strict (identical rule+file+line), relaxed (same rule+file, different lines), or none. | "relaxed" | Must be one of strict, relaxed, or none. Default to relaxed if not provided. Reject unknown values. strict mode may produce more granular comments; relaxed mode groups by file+rule. |
[OUTPUT_FORMAT] | Specifies the output structure: markdown_comment for PR comment boxes, json_payload for API consumption, or plain_text for logs. | "markdown_comment" | Must be one of markdown_comment, json_payload, or plain_text. Default to markdown_comment. Reject unknown values. json_payload requires a downstream schema validator. |
[SEVERITY_THRESHOLD] | Minimum severity level to include in the summary. Findings below this threshold are omitted. | "warning" | Must be one of error, warning, info, hint, or all. Default to warning. error > warning > info > hint. all includes everything. Reject unknown values. |
[FILE_FOCUS] | Optional list of file paths to scope the summary to. If provided, findings outside these files are excluded. | ["src/auth.py", "src/tokens.py"] | Array of strings or null. If provided, each entry must be a non-empty string matching a file path pattern. Reject if array contains non-string entries. If null, all files in [PR_CONTEXT] are included. |
Implementation Harness Notes
How to wire the PR lint comment summarization prompt into a CI/CD pipeline or code review bot with validation, retries, and human review gates.
This prompt is designed to sit inside a code review automation step that runs after linting tools produce their raw output. The typical integration point is a CI pipeline job or a webhook handler that receives lint results, invokes the LLM with this prompt, and posts the summarized comment to the pull request. The harness must handle input assembly, output validation, and fallback behavior when the model produces an unusable summary. Because the output will be posted as a public PR comment visible to the development team, the harness should enforce tone and accuracy checks before publishing.
Input assembly starts by collecting the raw lint findings from one or more tools (ESLint, Pylint, RuboCop, etc.) and grouping them by file path. The [LINT_FINDINGS] placeholder expects a structured list where each finding includes file, line, severity, rule_id, and message. If your lint tools output JSON or SARIF, transform that into the expected format before populating the prompt. The [REPOSITORY_CONTEXT] placeholder should include the PR diff or changed-file list so the model can distinguish new violations from pre-existing ones. The [TEAM_CONVENTIONS] placeholder is optional but valuable: supply a short markdown snippet of your team's style guide or suppression policy to help the model decide what's worth flagging. Model choice matters here. Use a model with strong instruction-following and structured output capabilities (GPT-4o, Claude 3.5 Sonnet, or equivalent). Avoid smaller models that may hallucinate file paths or merge unrelated findings.
Output validation is the critical safety layer. Before posting the summary to the PR, validate the model's output against a schema: it must be valid markdown, must not exceed a configurable character limit (e.g., 2000 characters), must not contain placeholder tokens or unresolved references, and must not fabricate file paths or line numbers not present in the input. Implement a retry loop with up to 2 additional attempts if validation fails, feeding the validation error back to the model as [PREVIOUS_OUTPUT] and [VALIDATION_ERROR] in a retry prompt variant. If all retries fail, fall back to a simple template that lists files with violations and a link to the full lint report. Logging should capture the raw prompt, the model response, validation results, and whether the summary was posted or escalated. This audit trail is essential for debugging prompt drift and for teams that need to demonstrate review process compliance.
Human review gates depend on your risk tolerance. For most teams, auto-posting the summary is acceptable because the underlying lint findings are already visible in CI logs. However, if the summary includes severity classifications or fix suggestions that could mislead reviewers, add a draft comment step: post the summary as a hidden or draft PR comment, require a single reviewer approval, then publish. For security-sensitive repositories, consider routing summaries that flag CRITICAL or HIGH severity findings to a dedicated security review channel instead of the general PR comment thread. Tool integration is straightforward: the prompt expects no external tool calls during generation, but the harness itself may call the GitHub/GitLab/Bitbucket API to post the comment, fetch the diff, or query team membership for reviewer assignment.
What to avoid: Do not use this prompt to generate fix suggestions or code patches—that's a separate workflow with higher risk and requires diff verification. Do not skip output validation even if the model has been reliable in testing; production PR comments are a shared surface and a garbled or misleading summary erodes trust in the automation. Do not run this prompt on every push without diff-aware filtering; summarizing the same pre-existing lint violations on every commit creates noise. Finally, version your prompt template alongside your lint configuration so that changes to rules or severity thresholds are reflected in the summarization behavior.
Expected Output Contract
Define the shape of the PR lint summary comment so downstream consumers (CI bots, code review tools, Slack notifications) can parse and validate the output reliably.
| Field or Element | Type or Format | Required | Validation Rule |
|---|---|---|---|
summary_comment | string (Markdown) | Must be non-empty. Must contain no more than 3 top-level sections. Must not exceed 2000 characters. | |
summary_comment.file_groups | array of objects | Must contain at least 1 file group. Each group must have a unique file_path. | |
summary_comment.file_groups[].file_path | string (relative path) | Must match a valid relative path from the repository root. Must exist in the provided [DIFF_CONTEXT] or [LINT_OUTPUT]. | |
summary_comment.file_groups[].category | string (enum) | Must be one of: 'bug-risk', 'style', 'performance', 'security', 'maintainability', 'type-safety', 'unused-code'. Must match the majority category of findings in the group. | |
summary_comment.file_groups[].finding_count | integer | Must be a positive integer. Must equal the count of distinct findings summarized for this file. | |
summary_comment.file_groups[].summary | string | Must be a single sentence describing the primary issue pattern. Must not repeat the raw linter message verbatim. Must include a concrete, actionable suggestion. | |
deduplication_applied | boolean | Must be true if any findings were merged. If true, the deduplication_key field must be present in the metadata. | |
metadata.deduplication_key | string | Required when deduplication_applied is true. Must describe the strategy used: 'rule-and-file', 'rule-and-message-hash', or 'rule-and-line-range'. |
Common Failure Modes
PR lint comment summarization fails in predictable ways. These are the most common failure modes and the guardrails that catch them before developers waste time on bad summaries.
Duplicate Findings Flood the Summary
What to watch: The same lint violation reported across multiple lines or files gets repeated verbatim in the summary instead of being grouped. A 200-finding lint run becomes a 200-line comment that nobody reads. Guardrail: Require deduplication by (rule_id, file, message_pattern) before summarization. Add a deduplicated_count field to the output schema and validate that no two summary items share the same rule and identical message text.
Summary Loses File and Line Grounding
What to watch: The model produces a fluent paragraph about code quality issues but drops the file paths and line numbers that developers need to act. The comment reads well but is useless for remediation. Guardrail: Enforce a structured output schema where every finding group includes file, line_range, and rule_id. Validate that every claim in the summary text can be traced back to a specific source finding in the input.
Tone Shifts from Actionable to Judgmental
What to watch: The summary uses language like 'sloppy,' 'careless,' or 'obviously wrong' instead of neutral, finding-focused descriptions. Developers ignore or resent the feedback, defeating the purpose of automated lint commenting. Guardrail: Add a tone constraint to the prompt: 'Use neutral, finding-focused language. Describe the violation and the fix, not the author.' Run a post-generation tone check for subjective adjectives and re-prompt if any are detected.
Category Grouping Collapses Distinct Issues
What to watch: The model groups findings too aggressively, merging a security vulnerability, a style nit, and a potential bug under 'code quality issues.' Developers can't triage by severity because everything looks the same. Guardrail: Require grouping by both category (security, bug-risk, style, performance) and severity. Include a highest_severity field per group. Validate that groups don't mix categories unless explicitly allowed by a configurable policy.
Summary Omits Actionable Fix Guidance
What to watch: The summary lists what's wrong but provides no fix suggestion, leaving developers to look up each rule individually. The comment becomes a restatement of the linter output rather than a value-add. Guardrail: For each finding group, require a suggested_fix field with a concrete, code-level recommendation. Validate that the suggestion references the specific rule documentation and matches the file's language and framework context.
Context Window Overflow on Large PRs
What to watch: A PR with hundreds of lint findings exceeds the model's context window when raw output is included inline. The summary is truncated, hallucinated, or fails entirely. Guardrail: Pre-process lint output before prompting: deduplicate, sort by severity, and cap findings at a configurable limit (e.g., top 50 by severity). Include a truncated flag in the output when findings were omitted, with a count of omitted items and a recommendation to run the linter locally.
Evaluation Rubric
Use this rubric to evaluate the quality of the summarized PR lint comment before it is posted. Each criterion should be checked programmatically or via a model-graded eval before the output is considered ready for a developer.
| Criterion | Pass Standard | Failure Signal | Test Method |
|---|---|---|---|
Deduplication Accuracy | No duplicate findings exist across the summary. Each distinct issue is reported exactly once. | The same file, line, and rule identifier appears in multiple summary items. | Parse output into a list of findings. Group by file, line, and rule ID. Assert that each group has a count of exactly 1. |
Actionable Tone | Every finding includes a concrete, imperative suggestion for the developer to fix the issue. | A finding contains only a description of the violation without a suggested fix or next step. | Model-graded eval: prompt a judge model to check if each finding block contains a directive phrase like 'Replace', 'Add', 'Remove', or 'Refactor'. |
Category Grouping | Findings are correctly grouped under the specified categories (e.g., 'Security', 'Style', 'Performance'). | A finding is placed in a category that contradicts the linter rule's documented purpose. | Maintain a mapping of known linter rule IDs to expected categories. Assert that the output category for each finding matches the mapping. |
File-Level Aggregation | Comments are aggregated by file path. No file's findings are split across multiple sections. | Findings for the same file path appear in two different file sections. | Parse the output structure. Assert that the list of file paths in section headers is unique and contains no duplicates. |
Conciseness Constraint | The total output is under the specified [MAX_LENGTH] token or character limit. | The output exceeds the [MAX_LENGTH] constraint. | Tokenize the final output string. Assert that the token count is less than or equal to the [MAX_LENGTH] variable. |
Source Grounding | Every finding references the exact file path and line number from the raw lint input. | A finding references a file or line number not present in the [RAW_LINT_OUTPUT] input. | Extract all file:line references from the summary. Assert that each is a substring match or exact match within the provided [RAW_LINT_OUTPUT]. |
No Information Loss | All critical and high-severity findings from the input are present in the summary. | A finding with severity 'error' or 'critical' in [RAW_LINT_OUTPUT] is missing from the summary. | Parse severities from [RAW_LINT_OUTPUT]. Filter for 'error' and 'critical'. Assert that the count of such findings in the summary matches the input count. |
Enabling Efficiency, Speed & Accuracy
Intelligent Analysis, Decision & Execution
We build AI systems for teams that need search across company data, workflow automation across tools, or AI features inside products and internal software.
Talk to Us
Search across company data
Give teams answers from docs, tickets, runbooks, and product data with sources and permissions.
Useful when people spend too long searching or get different answers from different systems.

Automate internal workflows
Use AI to route work, draft outputs, trigger actions, and keep approvals and logs in place.
Useful when repetitive work moves across multiple tools and teams.

Add AI to products and internal tools
Build assistants, guided actions, or decision support into the software your team or customers already use.
Useful when AI needs to be part of the product, not a separate tool.
Adapt This Prompt
How to adapt
Start with the base template and a single model call. Use a simple [LINT_FINDINGS] JSON array as input. Skip strict output schema enforcement initially—just verify the summary is readable and groups findings by file.
codeSystem: You are a code review assistant. Summarize the following lint findings into a concise PR comment. User: [LINT_FINDINGS]
Watch for
- Repetition when the same finding appears across multiple lines
- Overly verbose output that defeats the summarization purpose
- Missing file paths in the summary when the input includes them

About the author
Prasad Kumkar
CEO & MD, Inference Systems
Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.
His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.
Partnered with leading AI, data, and software stack.
How We Work
Custom AI workflows for your Business
One-fit-all AI don't work for modern businesses. At Inferensys, we aim to understand your business & custom requirements; which we use to define most efficient agentic workflows, the data, and the tools for your business.
01
Review the use case
We understand the task, the users, and where AI can actually help.
Read more02
Pick the right approach
We define what needs search, automation, or product integration.
Read more03
Build the first useful version
We implement the part that proves the value first.
Read more04
Improve from there
We add the checks and visibility needed to keep it useful.
Read moreThe first call is a practical review of your use case and the right next step.
Talk to Us