feat: Add api-breaking-change-detector template - #328
Conversation
:robot_face: AgentKit Structural ValidationNew Contributions Detected
Check Results
🎉 All checks passed! This contribution follows the AgentKit structure. |
|
Important Review skippedNo new commits to review since the last review. ⚙️ Run configurationConfiguration used: Repository UI (base), Organization UI (inherited) Review profile: ASSERTIVE Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
WalkthroughThe 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. ChangesAPI Breaking Change Detector
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
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
📒 Files selected for processing (13)
kits/api-breaking-change-detector/.gitignorekits/api-breaking-change-detector/README.mdkits/api-breaking-change-detector/agent.mdkits/api-breaking-change-detector/constitutions/default.mdkits/api-breaking-change-detector/flows/api-breaking-change-detector.tskits/api-breaking-change-detector/lamatic.config.tskits/api-breaking-change-detector/model-configs/api-breaking-change-detector_llmnode-543_generative-model-name.tskits/api-breaking-change-detector/prompts/api-breaking-change-detector_llmnode-543_system_0.mdkits/api-breaking-change-detector/prompts/api-breaking-change-detector_llmnode-543_user_1.mdkits/api-breaking-change-detector/samples/.env.examplekits/api-breaking-change-detector/samples/test_flow.pykits/api-breaking-change-detector/samples/v1_schema.jsonkits/api-breaking-change-detector/samples/v2_schema.json
There was a problem hiding this comment.
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 winMission: document the required API URL.
Add
LAMATIC_API_URLto this example.samples/test_flow.pyrequires it before execution. The current documented setup always raisesValueError. RemoveLAMATIC_PROJECT_IDandLAMATIC_WORKFLOW_IDif 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
📒 Files selected for processing (5)
kits/api-breaking-change-detector/README.mdkits/api-breaking-change-detector/agent.mdkits/api-breaking-change-detector/prompts/api-breaking-change-detector_llmnode-543_system_0.mdkits/api-breaking-change-detector/prompts/api-breaking-change-detector_llmnode-543_user_1.mdkits/api-breaking-change-detector/samples/test_flow.py
Added details about guardrails and security measures for the API Breaking Change Detector.
|
@coderabbitai review |
|
Summary
Adds the
api-breaking-change-detectortemplate 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")kits/api-breaking-change-detectorlamatic.config.ts: Metadata, step definition (api-breaking-change-detector), and GitHub links.flows/api-breaking-change-detector.ts: Full flow definition with@referencepaths.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
kits/<category>/<kit-name>/)bundles/<bundle-name>/)kits/api-breaking-change-detector/)2. General Requirements
kebab-caseand matches the flow ID (api-breaking-change-detector)README.md(purpose, setup, usage)3. File Structure
lamatic.config.tspresent with valid metadata (name, description, tags, steps, author)@referencescripts/prompts are in placesamples/api-breaking-change-detectortemplate and Lamatic configuration.README.mdandagent.md.triggerNodeacceptsv1_schemaandv2_schema.dynamicNoderuns deterministic schema comparison code.LLMuses Gemini with externalized system and user prompts.responseNodereturns the generated migration report as JSON.gemini-3.5-flash-lite.samples/test_flow.pyto submit schemas through the Lamatic API and print the response..gitignorerules and a.env.examplefile for local setup.