Skip to content

feat: Add api-breaking-change-detector template - #328

Open
Sabeer65 wants to merge 4 commits into
Lamatic:mainfrom
Sabeer65:feat/add-api-breaking-change-detector
Open

feat: Add api-breaking-change-detector template#328
Sabeer65 wants to merge 4 commits into
Lamatic:mainfrom
Sabeer65:feat/add-api-breaking-change-detector

Conversation

@Sabeer65

@Sabeer65 Sabeer65 commented Aug 6, 2026

Copy link
Copy Markdown

Summary

Adds the api-breaking-change-detector template to the AgentKit repository.

When migrating REST APIs from v1 to v2, unannounced breaking schema changes (dropped properties, mutated data types, or route shifts) break downstream applications. This template runs a deterministic JavaScript diffing function (codeNode_676) to extract exact field modifications and feeds the result into Gemini (LLMNode_543) to automatically synthesize structured developer migration guides.


Walkthrough Video


Contribution Details

  • Type: Template (type: "template")
  • Kit Directory: kits/api-breaking-change-detector
  • Key Files Included:
    • lamatic.config.ts: Metadata, step definition (api-breaking-change-detector), and GitHub links.
    • flows/api-breaking-change-detector.ts: Full flow definition with @reference paths.
    • scripts/codeNode_676.ts: Deterministic JS schema diffing algorithm.
    • prompts/: Externalized system & user prompts for LLM synthesis.
    • samples/: Test runner (test_flow.py) and schema payloads (v1_schema.json, v2_schema.json).

PR Checklist

1. Select Contribution Type

  • Kit (kits/<category>/<kit-name>/)
  • Bundle (bundles/<bundle-name>/)
  • Template (kits/api-breaking-change-detector/)

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 (api-breaking-change-detector)
  • All changes are documented in README.md (purpose, setup, usage)

3. File Structure

  • lamatic.config.ts present with valid metadata (name, description, tags, steps, author)
  • Flows and externalized @reference scripts/prompts are in place
  • Sample schemas and test harness provided in samples/
  • Added the api-breaking-change-detector template and Lamatic configuration.
  • Added documentation in README.md and agent.md.
  • Added security guidance through the default constitution, prompt-injection protections, input validation, and data-handling rules.
  • Added the API Breaking Change Detector flow.
    • triggerNode accepts v1_schema and v2_schema.
    • dynamicNode runs deterministic schema comparison code.
    • LLM uses Gemini with externalized system and user prompts.
    • responseNode returns the generated migration report as JSON.
    • Flow references connect the constitution, prompts, model configuration, and code node.
  • The detector identifies removed properties, data type changes, and route changes.
  • Added Gemini model configuration for gemini-3.5-flash-lite.
  • Added sample v1 and v2 API schemas.
  • Added samples/test_flow.py to submit schemas through the Lamatic API and print the response.
  • Added .gitignore rules and a .env.example file for local setup.

@github-actions

github-actions Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

:robot_face: AgentKit Structural Validation

New Contributions Detected

  • Template: kits/api-breaking-change-detector

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.

@coderabbitai

coderabbitai Bot commented Aug 6, 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: 947237e7-d476-49b6-a42f-a7aa60e214ad

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

The PR adds an API Breaking Change Detector kit. It defines a Lamatic workflow, Gemini model configuration, prompts, constitution, sample schemas, an authenticated Python runner, environment configuration, documentation, and ignore rules.

Changes

API Breaking Change Detector

Layer / File(s) Summary
Workflow definition
kits/api-breaking-change-detector/flows/api-breaking-change-detector.ts, kits/api-breaking-change-detector/lamatic.config.ts
Defines workflow metadata, schema inputs, referenced resources, the trigger-to-report node graph, and template registration.
Model and policy configuration
kits/api-breaking-change-detector/model-configs/*, kits/api-breaking-change-detector/prompts/*, kits/api-breaking-change-detector/constitutions/default.md
Adds the Gemini configuration, API compatibility prompts, migration-report requirements, and assistant rules.
Sample schemas and execution runner
kits/api-breaking-change-detector/samples/*
Adds versioned API schemas, environment placeholders, and a Python runner that loads schemas, sends an authenticated request, validates the response, and prints the result.
Kit documentation and local setup
kits/api-breaking-change-detector/README.md, kits/api-breaking-change-detector/agent.md, kits/api-breaking-change-detector/.gitignore
Documents the workflow, assumptions, guardrails, local setup, repository structure, contribution guidance, and ignored local files.

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 Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly identifies the addition of the api-breaking-change-detector template.
Description check ✅ Passed The description explains the template, files, contribution type, and most checklist items, but it omits the required Validation section.
✨ 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.

@coderabbitai
coderabbitai Bot requested review from amanintech and d-pamneja August 6, 2026 10:27

@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/api-breaking-change-detector/agent.md`:
- Around line 1-3: Replace the TODO in agent.md with complete agent
documentation for api-breaking-change-detector, including its identity, purpose,
workflow, capabilities, guardrails, and integration references. Follow the
repository’s established agent.md format and ensure the document provides the
required LLM-generated identity and capability details.

In
`@kits/api-breaking-change-detector/prompts/api-breaking-change-detector_llmnode-543_user_1.md`:
- Line 14: Add exactly one trailing newline to
kits/api-breaking-change-detector/prompts/api-breaking-change-detector_llmnode-543_user_1.md
at line 14 and
kits/api-breaking-change-detector/prompts/api-breaking-change-detector_llmnode-543_system_0.md
at line 1. Preserve both prompts’ existing Markdown structure and content; do
not add headings, blank lines, formatting, or suppression comments.
- Line 2: Harden the prompt around the “Analyze the JSON payload provided from
the Code Node” instruction by clearly delimiting the interpolated
codeNode_676.output as untrusted data and explicitly directing the model to
ignore any instructions contained within it. Preserve the payload’s role as data
for analysis while preventing caller-controlled v1_schema or v2_schema text from
influencing the deployment-status response.

In `@kits/api-breaking-change-detector/README.md`:
- Around line 45-50: Repair the README Markdown structure around the report
example by using four backticks for its outer markdown fence so the nested JSON
fences remain intact. Add the required blank lines near the sections
corresponding to lines 45, 105, and 113, and ensure the file ends with a final
newline.

In `@kits/api-breaking-change-detector/samples/test_flow.py`:
- Around line 19-37: Use the committed JSON fixtures as the canonical schemas:
update kits/api-breaking-change-detector/samples/test_flow.py lines 19-37 to
load v1_schema.json and v2_schema.json relative to __file__ instead of embedding
payloads, and update kits/api-breaking-change-detector/samples/v2_schema.json
lines 2-7 to match the documented v2 schema. Ensure the runner and fixture
produce the same migration report.
- Around line 68-76: Update the response-handling flow around the HTTP request
and report extraction: call raise_for_status(), inspect res_data["errors"],
validate that executeWorkflow.result exists before accessing report, and exit
with a non-zero status whenever GraphQL errors or a missing report are
encountered. Preserve printing the generated report only when a valid report is
returned.
- Line 66: Update the external request in the test flow around requests.post to
pass an explicit finite timeout tuple with separate connect and read durations,
while preserving the existing URL, payload, and headers.
🪄 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: d6ac7945-1564-477b-8a36-18200b4e45d2

📥 Commits

Reviewing files that changed from the base of the PR and between fd6104d and 145ae3d.

📒 Files selected for processing (13)
  • kits/api-breaking-change-detector/.gitignore
  • kits/api-breaking-change-detector/README.md
  • kits/api-breaking-change-detector/agent.md
  • kits/api-breaking-change-detector/constitutions/default.md
  • kits/api-breaking-change-detector/flows/api-breaking-change-detector.ts
  • kits/api-breaking-change-detector/lamatic.config.ts
  • kits/api-breaking-change-detector/model-configs/api-breaking-change-detector_llmnode-543_generative-model-name.ts
  • kits/api-breaking-change-detector/prompts/api-breaking-change-detector_llmnode-543_system_0.md
  • kits/api-breaking-change-detector/prompts/api-breaking-change-detector_llmnode-543_user_1.md
  • kits/api-breaking-change-detector/samples/.env.example
  • kits/api-breaking-change-detector/samples/test_flow.py
  • kits/api-breaking-change-detector/samples/v1_schema.json
  • kits/api-breaking-change-detector/samples/v2_schema.json

Comment thread kits/api-breaking-change-detector/agent.md Outdated
Comment thread kits/api-breaking-change-detector/README.md
Comment thread kits/api-breaking-change-detector/samples/test_flow.py Outdated
Comment thread kits/api-breaking-change-detector/samples/test_flow.py Outdated
Comment thread kits/api-breaking-change-detector/samples/test_flow.py Outdated

@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: 2

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
kits/api-breaking-change-detector/README.md (1)

105-111: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Mission: document the required API URL.

Add LAMATIC_API_URL to this example. samples/test_flow.py requires it before execution. The current documented setup always raises ValueError. Remove LAMATIC_PROJECT_ID and LAMATIC_WORKFLOW_ID if the runner does not use them.

Proposed fix
 LAMATIC_API_KEY=your_lamatic_api_key
-LAMATIC_PROJECT_ID=your_project_id
-LAMATIC_WORKFLOW_ID=your_workflow_id
+LAMATIC_API_URL=your_lamatic_flow_endpoint
🤖 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/api-breaking-change-detector/README.md` around lines 105 - 111, Update
the “Configure Environment Variables” example to include the required
LAMATIC_API_URL entry so samples/test_flow.py can run without raising
ValueError; remove LAMATIC_PROJECT_ID and LAMATIC_WORKFLOW_ID from the example
if they are not consumed by the sample runner, while retaining LAMATIC_API_KEY.
🤖 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/api-breaking-change-detector/agent.md`:
- Around line 3-18: Update the Markdown structure in the agent document by
inserting one blank line after every ## heading and ensuring the file ends with
exactly one trailing newline. Preserve all existing text and content.

In `@kits/api-breaking-change-detector/samples/test_flow.py`:
- Around line 49-54: Update the workflow result handling after the existing
errors check to validate that res_data contains a non-null data value and a
non-empty executeWorkflow.result. Raise a RuntimeError when the expected result
is absent, before printing “Flow Execution Successful!” or the output report;
preserve the existing errors handling for responses with an errors key.

---

Outside diff comments:
In `@kits/api-breaking-change-detector/README.md`:
- Around line 105-111: Update the “Configure Environment Variables” example to
include the required LAMATIC_API_URL entry so samples/test_flow.py can run
without raising ValueError; remove LAMATIC_PROJECT_ID and LAMATIC_WORKFLOW_ID
from the example if they are not consumed by the sample runner, while retaining
LAMATIC_API_KEY.
🪄 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: 97080803-50ae-4a19-9f45-0a222a1c32ba

📥 Commits

Reviewing files that changed from the base of the PR and between 145ae3d and e56461c.

📒 Files selected for processing (5)
  • kits/api-breaking-change-detector/README.md
  • kits/api-breaking-change-detector/agent.md
  • kits/api-breaking-change-detector/prompts/api-breaking-change-detector_llmnode-543_system_0.md
  • kits/api-breaking-change-detector/prompts/api-breaking-change-detector_llmnode-543_user_1.md
  • kits/api-breaking-change-detector/samples/test_flow.py

Comment thread kits/api-breaking-change-detector/agent.md Outdated
Comment thread kits/api-breaking-change-detector/samples/test_flow.py
Added details about guardrails and security measures for the API Breaking Change Detector.
@github-actions

github-actions Bot commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Aug 7, 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.

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.

1 participant