Skip to content

feat: Add AI PR Code Reviewer Kit - #313

Open
IamSushii wants to merge 8 commits into
Lamatic:mainfrom
IamSushii:main
Open

feat: Add AI PR Code Reviewer Kit#313
IamSushii wants to merge 8 commits into
Lamatic:mainfrom
IamSushii:main

Conversation

@IamSushii

@IamSushii IamSushii commented Aug 1, 2026

Copy link
Copy Markdown

PR Checklist

1. Select Contribution Type

  • Kit (kits/ai-pr-reviewer)
  • Bundle (bundles/<bundle-name>/)
  • Template (templates/<template-name>/)

2. General Requirements

  • PR is for one project only (no unrelated changes)
  • No secrets, API keys, or real credentials are committed
  • Folder name uses kebab-case and matches the flow ID
  • All changes are documented in README.md (purpose, setup, usage)

3. File Structure (Check what applies)

  • lamatic.config.ts present with valid metadata
  • All flows in flows/<flow-name>/ (where applicable) include:
    • config.json (Lamatic flow export)
    • inputs.json
    • meta.json
    • README.md
  • .env.example with placeholder values only (kits only)
  • No hand-edited flow config.json node graphs (changes via Lamatic Studio export)

4. Validation

  • npm install && npm run dev works locally (kits: UI runs; bundles/templates: flows are valid)
  • PR title is clear (e.g., [kit] Add <name> for <use case>)
  • GitHub Actions workflows pass (all checks are green)
  • All CodeRabbit or other PR review comments are addressed and resolved
  • No unrelated files or projects are modified

Hi team! Submitting my AgentKit challenge. I built an AI PR Code Reviewer that evaluates code for security vulnerabilities and outputs structured JSON.

  • Added kits/ai-pr-reviewer as an AI code review and security audit kit.
  • Added README.md with the kit purpose, CI/CD workflow, security checks, optimization checks, and structured JSON output.
  • Added agent.md with the agent role and review focus.
  • Added constitutions/default.md with security, refactoring, and GitHub comment guidelines.
  • Added lamatic.config.ts with kit metadata, classification tags, author details, and the GitHub kit link.
  • Added flows/code-review.ts with a three-stage flow:
    • Accepts source code or a code diff.
    • Sends the input to a low-temperature GPT-4o security reviewer.
    • Returns structured JSON with pass/fail status, vulnerabilities, optimization suggestions, and a GitHub-ready comment.
  • The provided changes do not include flow.json; therefore, no separate flow.json node-type definitions were available to inspect.

This configuration file defines an AI-powered code reviewer and security auditor with relevant metadata.
@coderabbitai

coderabbitai Bot commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Important

Review skipped

No new commits to review since the last review.

⚙️ Run configuration

Configuration used: Repository UI (base), Organization UI (inherited)

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 1a163b87-86d2-49bf-9155-547f8f9ab1df

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Walkthrough

Changes

AI PR reviewer template

Layer / File(s) Summary
Template registration
kits/ai-pr-reviewer/lamatic.config.ts, kits/ai-pr-reviewer/agent.md
Adds template metadata and defines the AI PR Code Reviewer agent.
Automated review flow
kits/ai-pr-reviewer/flows/code-review.ts, kits/ai-pr-reviewer/constitutions/default.md, kits/ai-pr-reviewer/README.md
Adds DevSecOps LLM analysis, structured JSON output, review-comment principles, and workflow documentation.

Suggested reviewers: amanintech, d-pamneja

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed No linked issue is provided, but the repository template does not require an issue reference.
Out of Scope Changes check ✅ Passed All listed changes are limited to the new kits/ai-pr-reviewer project.
Title check ✅ Passed The title clearly identifies the addition of the AI PR Code Reviewer Kit and matches the main change.
Description check ✅ Passed The description follows the required template and documents the kit, but local validation, CI status, and review resolution remain unchecked.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

@github-actions

github-actions Bot commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

:robot_face: AgentKit Structural Validation

New Contributions Detected

  • Template: kits/ai-pr-reviewer

Check Results

Check Status
No edits to existing kits ✅ Pass
Required root files present ✅ Pass
Flow .ts files present ✅ Pass
lamatic.config.ts valid ✅ Pass
No changes outside kits/ ✅ Pass

🎉 All checks passed! This contribution follows the AgentKit structure.

@github-actions

github-actions Bot commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

Failure recorded at 2026-08-01T10:57:55Z UTC. If this PR is not fixed within 4 weeks it will be automatically closed.

@coderabbitai
coderabbitai Bot requested a review from d-pamneja August 1, 2026 10:58

@coderabbitai coderabbitai Bot left a comment

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.

Actionable comments posted: 7

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@kits/ai-pr-reviewer/flows/code-review.json`:
- Line 21: Align the response schema across the systemPrompt, output validation,
and README documentation: choose one canonical field set, ensuring the
optimization suggestions key and GitHub-ready review comment key match
everywhere. Update the flow’s documented JSON contract and any validation or
consumer references together, using the existing symbols for the response schema
rather than maintaining aliases.
- Line 21: The response schema must match across both documentation and
implementation. In kits/ai-pr-reviewer/flows/code-review.json:21-21, update the
systemPrompt to use the canonical response field names; in
kits/ai-pr-reviewer/README.md:19-19, document those same keys and types,
including optimizations and pr_comment and removing or renaming
refactor_suggestions.
- Line 21: Update the systemPrompt in the code-review flow to define explicit
vulnerability severity levels and the threshold that makes the review fail, then
require pass_fail to reflect those rules. Ensure CI enforcement derives its
result from the classified vulnerabilities and configured fail threshold rather
than trusting the LLM-generated boolean alone.
- Around line 25-30: Update the output_report response configuration to enforce
a supported strict JSON schema for pass_fail, vulnerabilities, optimizations,
and pr_comment before emitting CI output. Require all four fields with their
expected types, reject markdown fences, extra text, missing keys, and type
mismatches, and preserve the existing JSON response behavior for valid results.

In `@kits/ai-pr-reviewer/lamatic.config.ts`:
- Around line 1-9: Update the default kit metadata object in lamatic.config.ts
to include the required steps entry for the AI PR code-review flow and links for
GitHub, deployment, and documentation. Align the type and author fields with the
documented metadata contract while preserving the existing identity,
description, category, and tags.

In `@kits/ai-pr-reviewer/README.md`:
- Around line 3-19: Add a human-readable Setup section to the README covering
prerequisites, AgentKit flow registration, required environment variables or
credentials, accepted code/diff input format, the structured output schema, and
a minimal CI or webhook invocation example. Keep the existing purpose and
workflow sections unchanged and document the concrete setup and consumption
steps using the kit’s established symbols and configuration names.
- Around line 5-6: Update the Markdown headings in README.md at the affected
sections, including “The Problem” and the headings at the other reported
locations, by inserting exactly one blank line after each heading. Preserve the
existing heading text and surrounding content so all MD022 violations are
resolved.
🪄 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: Repository UI (base), Organization UI (inherited)

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 5b36397f-dfa2-4c6d-bc7e-9311d3207e6f

📥 Commits

Reviewing files that changed from the base of the PR and between c12bd02 and 5d909fc.

📒 Files selected for processing (3)
  • kits/ai-pr-reviewer/README.md
  • kits/ai-pr-reviewer/flows/code-review.json
  • kits/ai-pr-reviewer/lamatic.config.ts

"config": {
"model": "gpt-4o",
"temperature": 0.1,
"systemPrompt": "You are a Principal Security Engineer and strict code reviewer. Analyze the provided code. Output a JSON object containing: 1) 'pass_fail' (boolean), 2) 'vulnerabilities' (array of strings, empty if none), 3) 'optimizations' (array of specific refactoring suggestions), and 4) 'pr_comment' (a polite markdown summary of your review ready for GitHub)."

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.

🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

Align the flow fields with the documented response contract.

The systemPrompt requires optimizations and pr_comment, but kits/ai-pr-reviewer/README.md documents refactor_suggestions and omits pr_comment. Consumers can parse the wrong key or miss the GitHub-ready comment. Choose one canonical schema and use it in the prompt, output validation, and documentation.

Based on the supplied flow and README, the response field names are inconsistent.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@kits/ai-pr-reviewer/flows/code-review.json` at line 21, Align the response
schema across the systemPrompt, output validation, and README documentation:
choose one canonical field set, ensuring the optimization suggestions key and
GitHub-ready review comment key match everywhere. Update the flow’s documented
JSON contract and any validation or consumer references together, using the
existing symbols for the response schema rather than maintaining aliases.

🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

Keep one response schema across the flow and README.

The flow and README define different JSON keys for the same response contract. The flow requires optimizations and pr_comment, while the README documents refactor_suggestions and omits pr_comment; this can make CI consumers parse the wrong key or miss the GitHub-ready comment.

  • kits/ai-pr-reviewer/flows/code-review.json#L21-L21: use the canonical field names in systemPrompt.
  • kits/ai-pr-reviewer/README.md#L19-L19: document the same keys and types as the flow.

Based on the supplied flow and README, the response contract must be identical at both sites.

📍 Affects 2 files
  • kits/ai-pr-reviewer/flows/code-review.json#L21-L21 (this comment)
  • kits/ai-pr-reviewer/README.md#L19-L19
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@kits/ai-pr-reviewer/flows/code-review.json` at line 21, The response schema
must match across both documentation and implementation. In
kits/ai-pr-reviewer/flows/code-review.json:21-21, update the systemPrompt to use
the canonical response field names; in kits/ai-pr-reviewer/README.md:19-19,
document those same keys and types, including optimizations and pr_comment and
removing or renaming refactor_suggestions.

🎯 Functional Correctness | 🟠 Major | 🏗️ Heavy lift

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== locate flow file =="
fd -a 'code-review\.json$' . || true

echo "== inspect target file =="
if [ -f kits/ai-pr-reviewer/flows/code-review.json ]; then
  cat -n kits/ai-pr-reviewer/flows/code-review.json
fi

echo "== search for code-review pass_fail usage =="
rg -n "code-review|pass_fail|vulnerabilities|strict code reviewer|systemPrompt" . || true

echo "== inspect kit package metadata =="
fd -a . kits/ai-pr-reviewer | head -50
[ -f kits/ai-pr-reviewer/package.json ] && cat -n kits/ai-pr-reviewer/package.json
[ -f kits/ai-pr-reviewer/README.md ] && cat -n kits/ai-pr-reviewer/README.md

Repository: Lamatic/AgentKit

Length of output: 35442


Define the pass_fail policy before running this flow in CI.

The LLM is asked for a pass_fail boolean, but no threshold makes it false. An LLM response can list critical security issues and still return true. Define severity levels, set explicit fail thresholds, and enforce the CI result from vulnerabilities instead of trusting the free-form boolean.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@kits/ai-pr-reviewer/flows/code-review.json` at line 21, Update the
systemPrompt in the code-review flow to define explicit vulnerability severity
levels and the threshold that makes the review fail, then require pass_fail to
reflect those rules. Ensure CI enforcement derives its result from the
classified vulnerabilities and configured fail threshold rather than trusting
the LLM-generated boolean alone.

Comment on lines +25 to +30
"id": "output_report",
"type": "response",
"label": "CI/CD JSON Response",
"config": {
"format": "json"
}

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.

🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

rg -n -C 10 '"type": "(llm|response)"|format": "json"|schema|response_format|structured' kits --glob '*.json'

Repository: Lamatic/AgentKit

Length of output: 50373


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== target file =="
wc -l kits/ai-pr-reviewer/flows/code-review.json
cat -n kits/ai-pr-reviewer/flows/code-review.json | sed -n '1,80p'

echo
echo "== focused response/json/schema occurrences in kits/ai-pr-reviewer =="
rg -n -C 6 '"id": "output_report"|"type": "response"|"format": "json"|schema|jsonOutput|parse_json|json' kits/ai-pr-reviewer --glob '*.json' --glob '*.ts' --glob '*.js' || true

echo
echo "== candidates for response node implementation =="
rg -n 'registerNode|type.*response|format[": ]+.json|json-format|parse.*json|response_format|structured' kits/ai-pr-reviewer packages core src --glob '*.ts' --glob '*.js' --glob '*.tsx' --glob '*.jsx' || true

Repository: Lamatic/AgentKit

Length of output: 3505


🌐 Web query:

Lamatic AgentKit response node format json schema validation

💡 Result:

In the Lamatic ecosystem, there is no single monolithic "response node schema validation" format. Instead, validation is handled through specific nodes and configuration practices depending on whether you are working with flow-level response definitions or agent-level structured data generation [1][2]. 1. Flow Response Node: The responseNode in a flow configuration does not typically enforce a strict JSON schema validation at the node level itself [1]. Instead, it uses an outputMapping block within the node configuration to aggregate data from previous nodes [1]. This mapping uses a dictionary of key-value pairs where you can structure your final response by referencing outputs from earlier nodes (e.g., "{{LLMNode_187.output.generatedResponse}}") [1]. 2. Structured Data Generation: If you require strict JSON schema validation, you should use the Generate JSON Node [2][3]. This node is specifically designed to enforce a fixed output shape [3]. It allows you to define an Output Schema using Zod JSON, which the AI model then uses to generate structured JSON data that conforms to your specified rules [2]. 3. AgentKit Validation: If you are referring to validating AgentKit contributions or configurations, this is handled by external tools rather than a runtime response node [4]. The @lamatic/mcp tools, specifically kit_validate_structure, are used to perform structural checks on local kit folders to ensure they meet the project requirements before submitting a PR [5][4]. Summary of approaches: - To shape final output: Use outputMapping in the responseNode [1]. - To enforce strict JSON structure: Use the Generate JSON Node with a Zod JSON schema [2]. - To validate AgentKit projects: Use the @lamatic/mcp utility tool kit_validate_structure [5][4].

Citations:


Mission requirement: enforce the CI JSON shape before emitting output.

output_report only declares "format": "json". The LLM prompt requests four typed fields, but the flow has no schema or validation for pass_fail, vulnerabilities, optimizations, and pr_comment. Add a supported strict schema validation before the CI output so markdown fences, extra text, missing keys, and wrong types cannot pass as valid JSON.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@kits/ai-pr-reviewer/flows/code-review.json` around lines 25 - 30, Update the
output_report response configuration to enforce a supported strict JSON schema
for pass_fail, vulnerabilities, optimizations, and pr_comment before emitting CI
output. Require all four fields with their expected types, reject markdown
fences, extra text, missing keys, and type mismatches, and preserve the existing
JSON response behavior for valid results.

Comment on lines +1 to +9
export default {
id: "ai-pr-reviewer",
name: "AI PR Code Reviewer & Security Auditor",
description: "An automated agent that analyzes git diffs or code snippets for security vulnerabilities, performance bottlenecks, and clean-code refactoring.",
type: "template",
author: "Sushobhita Majhi",
category: "Developer Tools / CI-CD",
tags: ["LLM", "Code Review", "DevSecOps", "Agentic Workflow"]
};

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.

🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== locate configs =="
git ls-files 'kits/*/lamatic.config.ts' | sed -n '1,80p'

echo
echo "== targeted configs =="
for f in kits/ai-pr-reviewer/lamatic.config.ts kits/sentinel-iq/lamatic.config.ts; do
  if [ -f "$f" ]; then
    echo "--- $f ---"
    cat -n "$f"
  fi
done

echo
echo "== files in ai-pr-reviewer =="
git ls-files kits/ai-pr-reviewer | sed -n '1,120p'

echo
echo "== schema/metadata references for kit config fields =="
rg -n "lamatic\.config|type: \"template\"|type: \"kit\"|author|steps|links" -S --glob '!node_modules/**' --glob '!dist/**' --glob '!build/**' . | sed -n '1,220p'

Repository: Lamatic/AgentKit

Length of output: 15738


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== flow id =="
python3 - <<'PY'
import json
from pathlib import Path
p = Path('kits/ai-pr-reviewer/flows/code-review.json')
if p.exists():
    data = json.loads(p.read_text())
    print("file:", p)
    for key in ["name", "id", "type", "title", "steps"]:
        print(f"{key}:", repr(data.get(key)))
PY

echo
echo "== lamatic.config metadata docs =="
sed -n '85,125p' CLAUDE.md

echo
echo "== registry entries for ai-pr-reviewer =="
python3 - <<'PY'
import json
from pathlib import Path
p = Path('registry.json')
if p.exists():
    data = json.loads(p.read_text())
    if isinstance(data, list):
        entries = [e for e in data if e.get('id') == 'ai-pr-reviewer' or e.get('name') == 'AI PR Code Reviewer & Security Auditor']
    else:
        entries = []
    print("match_count:", len(entries))
    for e in entries[:5]:
        print(json.dumps({k:e.get(k) for k in sorted(e.keys()) if k in {'id','name','type','author','steps','links'}}, indent=2))
PY

echo
echo "== occurrences of ai-pr-reviewer =="
rg -n "ai-pr-reviewer|AI PR Code Reviewer" -S --glob '!node_modules/**' --glob '!dist/**' --glob '!build/**' . | sed -n '1,120p'

Repository: Lamatic/AgentKit

Length of output: 1880


Mission: register the code-review flow in kit metadata.

kits/ai-pr-reviewer/lamatic.config.ts is missing required steps and links. Add a steps entry for the code-review flow and populate the kit metadata links for GitHub/deploy/docs. Use the documented type/author metadata shape so this kit passes the metadata contract.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@kits/ai-pr-reviewer/lamatic.config.ts` around lines 1 - 9, Update the default
kit metadata object in lamatic.config.ts to include the required steps entry for
the AI PR code-review flow and links for GitHub, deployment, and documentation.
Align the type and author fields with the documented metadata contract while
preserving the existing identity, description, category, and tags.

Source: Coding guidelines

Comment on lines +3 to +19
An agentic workflow built on **Lamatic.ai AgentKit** designed to automate Pull Request reviews. This agent acts as a first line of defense in CI/CD pipelines by analyzing code snippets or git diffs for security vulnerabilities and performance improvements.

## The Problem
Manual code reviews are time-consuming, and senior engineers often waste hours pointing out basic linting errors or missing security checks.

## The Solution (This Agent)
By integrating this AgentKit flow into a webhook or CI pipeline, development teams get instant, structured feedback on their code before a human ever looks at it.

## Features
- **Security Audit:** Flags OWASP top 10 vulnerabilities (e.g., SQL injection, hardcoded secrets).
- **Code Optimization:** Suggests specific refactors for time/space complexity.
- **Structured JSON Output:** Returns actionable data that can be parsed directly into GitHub PR comments.

## Workflow Structure
1. **Trigger:** Receives raw code or a git diff.
2. **Review Node (LLM):** A highly constrained prompt evaluates the code against strict engineering standards.
3. **Formatting Node:** Outputs a structured JSON payload with `vulnerabilities`, `refactor_suggestions`, and a `pass_fail` boolean.

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.

📐 Maintainability & Code Quality | 🟠 Major | ⚡ Quick win

Mission requirement: add a human-readable setup guide.

This README describes the purpose and workflow but does not explain how to install, register, configure, invoke, or consume the kit. Add a Setup section with prerequisites, flow registration, required environment variables or credentials, input format, output schema, and a minimal CI or webhook example.

As per coding guidelines, each kits/*/README.md file must contain a human-readable setup guide.

🧰 Tools
🪛 markdownlint-cli2 (0.23.1)

[warning] 5-5: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below

(MD022, blanks-around-headings)


[warning] 8-8: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below

(MD022, blanks-around-headings)


[warning] 11-11: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below

(MD022, blanks-around-headings)


[warning] 16-16: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below

(MD022, blanks-around-headings)

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@kits/ai-pr-reviewer/README.md` around lines 3 - 19, Add a human-readable
Setup section to the README covering prerequisites, AgentKit flow registration,
required environment variables or credentials, accepted code/diff input format,
the structured output schema, and a minimal CI or webhook invocation example.
Keep the existing purpose and workflow sections unchanged and document the
concrete setup and consumption steps using the kit’s established symbols and
configuration names.

Source: Coding guidelines

Comment on lines +5 to +6
## The Problem
Manual code reviews are time-consuming, and senior engineers often waste hours pointing out basic linting errors or missing security checks.

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.

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Fix the Markdown heading spacing.

Insert one blank line after the headings at Line 5, Line 8, Line 11, and Line 16. markdownlint-cli2 reports MD022 for each location, which can fail documentation checks.

Based on the supplied static-analysis report, these four MD022 violations require correction.

Also applies to: 8-9, 11-12, 16-17

🧰 Tools
🪛 markdownlint-cli2 (0.23.1)

[warning] 5-5: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below

(MD022, blanks-around-headings)

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@kits/ai-pr-reviewer/README.md` around lines 5 - 6, Update the Markdown
headings in README.md at the affected sections, including “The Problem” and the
headings at the other reported locations, by inserting exactly one blank line
after each heading. Preserve the existing heading text and surrounding content
so all MD022 violations are resolved.

Source: Linters/SAST tools

@coderabbitai coderabbitai Bot left a comment

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.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@kits/ai-pr-reviewer/agent.md`:
- Around line 1-2: Insert a single blank line immediately after the “AI PR Code
Reviewer” heading in the document, before the descriptive paragraph, while
leaving the heading and surrounding content unchanged.
🪄 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: Repository UI (base), Organization UI (inherited)

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 8e082726-edd2-4d4a-9a91-98379a54fc75

📥 Commits

Reviewing files that changed from the base of the PR and between 5d909fc and 295151a.

📒 Files selected for processing (1)
  • kits/ai-pr-reviewer/agent.md

Comment on lines +1 to +2
# AI PR Code Reviewer
This agent automatically reviews code for security vulnerabilities and performance bottlenecks, acting as a first line of defense in your CI/CD pipeline.

@coderabbitai coderabbitai Bot Aug 1, 2026

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.

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Mission requirement: add the missing blank line.

Insert one blank line after the AI PR Code Reviewer heading. This fixes Markdown rule MD022 and preserves the documented agent identity and capabilities.

Proposed fix
 # AI PR Code Reviewer
+
 This agent automatically reviews code for security vulnerabilities and performance bottlenecks, acting as a first line of defense in your CI/CD pipeline.
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
# AI PR Code Reviewer
This agent automatically reviews code for security vulnerabilities and performance bottlenecks, acting as a first line of defense in your CI/CD pipeline.
# AI PR Code Reviewer
This agent automatically reviews code for security vulnerabilities and performance bottlenecks, acting as a first line of defense in your CI/CD pipeline.
🧰 Tools
🪛 markdownlint-cli2 (0.23.1)

[warning] 1-1: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below

(MD022, blanks-around-headings)

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@kits/ai-pr-reviewer/agent.md` around lines 1 - 2, Insert a single blank line
immediately after the “AI PR Code Reviewer” heading in the document, before the
descriptive paragraph, while leaving the heading and surrounding content
unchanged.

Source: Linters/SAST tools

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.

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf '%s\n' '--- changed files ---'
git diff --name-status "$(git merge-base HEAD origin/main)" HEAD 2>/dev/null || git diff --name-status HEAD~1 HEAD

printf '%s\n' '--- kit file structure ---'
fd . kits/ai-pr-reviewer --type f 2>/dev/null | sort

printf '%s\n' '--- agent.md with line numbers ---'
nl -ba kits/ai-pr-reviewer/agent.md

printf '%s\n' '--- configuration and flow ---'
for f in kits/ai-pr-reviewer/lamatic.config.ts kits/ai-pr-reviewer/flows/code-review.json kits/ai-pr-reviewer/README.md kits/ai-pr-reviewer/constitutions/default.md; do
  if [ -f "$f" ]; then
    echo "### $f"
    nl -ba "$f"
  fi
done

printf '%s\n' '--- markdownlint configuration ---'
fd -HI 'markdownlint*' . --max-depth 3 --type f -x sh -c 'echo "### $1"; cat "$1"' sh {} \;

Length of output: 1603


🏁 Script executed:

#!/bin/bash
set -euo pipefail

print_file() {
  file="$1"
  if [ -f "$file" ]; then
    printf '\n### %s\n' "$file"
    awk '{ printf "%6d  %s\n", NR, $0 }' "$file"
  fi
}

print_file kits/ai-pr-reviewer/agent.md
print_file kits/ai-pr-reviewer/lamatic.config.ts
print_file kits/ai-pr-reviewer/flows/code-review.ts
print_file kits/ai-pr-reviewer/README.md
print_file kits/ai-pr-reviewer/constitutions/default.md

printf '\n--- relevant repository examples ---\n'
find kits -path '*/flows/*.ts' -type f -print | head -20 | while IFS= read -r file; do
  printf '\n### %s\n' "$file"
  sed -n '1,160p' "$file"
done

printf '\n--- Markdown lint configuration ---\n'
find . -maxdepth 3 -type f \( -iname '*markdownlint*' -o -name '.remarkrc*' \) -print | while IFS= read -r file; do
  printf '\n### %s\n' "$file"
  sed -n '1,200p' "$file"
done

Length of output: 161730


@IamSushii, mission review complete.

Findings

  1. Blocking — Flow module does not use the AgentKit flow format
    kits/ai-pr-reviewer/flows/code-review.ts exports a raw { name, nodes, edges } object. Other kit flows export meta, inputs, references, nodes, and edges, then default-export those values. The current node types ("trigger", "llm", "response") also do not match the Lamatic node definitions used by the repository. The template will not load as an executable AgentKit flow. Convert this file to the established flow module format.

  2. Minor — Markdown heading requires a blank line
    kits/ai-pr-reviewer/agent.md Line 1 must have one blank line before the description on Line 2. This resolves MD022.

You are interacting with an AI system.

@IamSushii

Copy link
Copy Markdown
Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Aug 1, 2026

Copy link
Copy Markdown
Contributor
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@github-actions

github-actions Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@akshatvirmani

Copy link
Copy Markdown
Contributor

@IamSushii your pr is not up to the mark. Please check contributing md file as well

@github-actions

github-actions Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor
⚠️ Action not completed

Already reviewed.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai coderabbitai Bot left a comment

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.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@kits/ai-pr-reviewer/flows/code-review.ts`:
- Around line 1-4: Add the missing top-level meta, inputs, and references
sections to the default exported flow object in code-review.ts, alongside the
existing name, description, nodes, and edges. Populate them with the flow
metadata, input contract, and node references required for a self-contained
kits/*/flows/*.ts definition, while preserving the existing nodes and edges.
🪄 Autofix

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: Repository UI (base), Organization UI (inherited)

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: ef6fb36a-621c-4517-9b8b-715dcbc2c4e6

📥 Commits

Reviewing files that changed from the base of the PR and between 3ce5ee8 and 65a3c63.

📒 Files selected for processing (1)
  • kits/ai-pr-reviewer/flows/code-review.ts

Comment on lines +1 to +4
export default {
"name": "Automated Code Review Flow",
"description": "Analyzes input code snippets for security vulnerabilities and optimization opportunities.",
"nodes": [

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.

🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

Mission requirement: add the required self-contained flow sections.

The export defines name, description, nodes, and edges, but it does not define meta, inputs, or references. Add the required top-level sections and place the flow metadata, input contract, and node references in them before merge.

As per coding guidelines, each kits/*/flows/*.ts file must contain self-contained meta, inputs, references, nodes, and edges.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@kits/ai-pr-reviewer/flows/code-review.ts` around lines 1 - 4, Add the missing
top-level meta, inputs, and references sections to the default exported flow
object in code-review.ts, alongside the existing name, description, nodes, and
edges. Populate them with the flow metadata, input contract, and node references
required for a self-contained kits/*/flows/*.ts definition, while preserving the
existing nodes and edges.

Source: Coding guidelines

@coderabbitai

coderabbitai Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor
⚠️ Action not completed

Already reviewed.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@IamSushii

Copy link
Copy Markdown
Author

@coderabbitai fix

@coderabbitai

coderabbitai Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Tip

For best results, initiate chat on the files or code changes.

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf '%s\n' '== Contribution guidance =='
if [ -f CONTRIBUTING.md ]; then
  cat -n CONTRIBUTING.md
else
  fd -HI '^CONTRIBUTING\.md$' . -x sh -c 'echo "== $1 =="; cat -n "$1"' sh {}
fi

printf '%s\n' '== Added kit files =='
fd -HI . kits/ai-pr-reviewer -t f -x sh -c 'echo "== $1 =="; cat -n "$1"' sh {}

printf '%s\n' '== Existing kit configuration and flow examples =='
fd -HI '^lamatic\.config\.ts$' kits -t f -E ai-pr-reviewer | head -n 5 | while IFS= read -r file; do
  echo "== $file =="
  cat -n "$file"
done

fd -HI . kits -t f -g '*.ts' -E ai-pr-reviewer | rg -n -m 5 -C 6 'model|temperature|json|flow' || true

Length of output: 34518


🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf '%s\n' '== PR metadata and changed files =='
gh pr view 313 --repo Lamatic/AgentKit --json title,files \
  --jq '"title: \(.title)\nchanged files:\n" + (.files[].path)'

printf '%s\n' '== Reference template map =='
ast-grep outline kits/article-summariser --items all

printf '%s\n' '== Reference template metadata and flow =='
for file in \
  kits/article-summariser/lamatic.config.ts \
  kits/article-summariser/flows/article-summariser.ts
do
  if [ -f "$file" ]; then
    echo "== $file =="
    cat -n "$file"
  fi
done

printf '%s\n' '== Referenced prompt and model configuration examples =='
fd -HI . kits/article-summariser -t f \
  | rg '/(prompts/.*\.md|model-configs/.*\.ts)$' \
  | head -n 10 \
  | while IFS= read -r file; do
      echo "== $file =="
      cat -n "$file"
    done

Length of output: 19977


@IamSushii, the PR title and file scope meet the contribution rules.

The remaining work is inside kits/ai-pr-reviewer. The flow must be a Lamatic Studio export. Do not convert the current hand-written node format by guesswork.

  • Update the template metadata in kits/ai-pr-reviewer/lamatic.config.ts.
  • Replace the hand-written flow with the Lamatic Studio exported flow.
  • Add the referenced prompt and model configuration files.
  • Extend the README with the input, output, and usage contract.
  • Validate all required references and metadata fields.

  • 📌 Create a pull request with these changes

You are interacting with an AI system.

@github-actions

github-actions Bot commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Hi @IamSushii! 👋

Before this PR can be reviewed by maintainers, please resolve all comments and requested changes from the CodeRabbit automated review.

Steps to follow:

  1. Read through all CodeRabbit comments carefully
  2. Address each issue raised (or reply explaining why you disagree)
  3. Push your fixes as new commits
  4. Once all issues are resolved, comment here so we can re-review

This helps keep the review process efficient for everyone. Thank you! 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants