Skip to content

feat: Add commit-pr-generator template#193

Open
Ayazsaifi200 wants to merge 3 commits into
Lamatic:mainfrom
Ayazsaifi200:feat/commit-pr-generator
Open

feat: Add commit-pr-generator template#193
Ayazsaifi200 wants to merge 3 commits into
Lamatic:mainfrom
Ayazsaifi200:feat/commit-pr-generator

Conversation

@Ayazsaifi200

@Ayazsaifi200 Ayazsaifi200 commented Jul 7, 2026

Copy link
Copy Markdown

Summary

A new template that converts a raw git diff into a Conventional Commits message and a ready-to-paste PR description (Summary / Changes / Testing) using a single Lamatic flow (API Request → Generate Text (Gemini) → API Response).

Why it's unique: No existing kit turns a git diff into commit messages / PR descriptions.


1. Contribution Type

  • Template (kits/commit-pr-generator/)
  • Bundle
  • Kit

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 (commit-pr-generator)
  • Purpose, setup, and usage documented in README.md

3. File Structure

  • lamatic.config.ts present with valid metadata (name, description, tags, steps, author, links)
  • agent.md present
  • constitutions/default.md present
  • flows/commit-pr-generator.ts present (exported from Lamatic Studio)
  • Prompts & model config externalized via @references (prompts/, model-configs/)
  • No .env committed (template has no env vars)
  • Flow graph not hand-edited (exported from Lamatic Studio)

4. Validation

  • Flow deployed and tested in Lamatic Studio (returns commit message + --- + Markdown PR body)
  • PR title starts with feat:
  • GitHub Actions checks pass
  • All CodeRabbit review comments addressed
  • Added new Lamatic template kit at kits/commit-pr-generator/ named commit-pr-generator that converts a raw git diff into a Conventional Commits message plus a ready-to-paste Markdown PR description (## Summary, ## Changes, ## Testing), returned as a single result string separated by ---.
  • Added/updated files:
    • kits/commit-pr-generator/.gitignore (ignore node_modules/, .env*, and .lamatic/)
    • kits/commit-pr-generator/README.md (end-to-end setup/usage + expected output format and the exact empty/invalid-diff behavior)
    • kits/commit-pr-generator/agent.md (template/flow documentation + guardrails and failure modes)
    • kits/commit-pr-generator/constitutions/default.md (safety/data-handling/tone rules; treats inputs as adversarial)
    • kits/commit-pr-generator/lamatic.config.ts (kit registration + single step commit-pr-generator + metadata/links)
    • kits/commit-pr-generator/flows/commit-pr-generator.ts (flow definition)
    • kits/commit-pr-generator/model-configs/commit-pr-generator_llmnode-223_generative-model-name.ts (Gemini model config for the LLM node; provider/credential fields included for binding)
    • kits/commit-pr-generator/prompts/commit-pr-generator_llmnode-223_system_0.md (system prompt with strict output layout and ERROR: no valid diff provided for empty/invalid diffs)
    • kits/commit-pr-generator/prompts/commit-pr-generator_llmnode-223_user_1.md (injects {{triggerNode_1.output.diff}} into the user prompt)
  • Flow high-level behavior (kits/commit-pr-generator/flows/commit-pr-generator.ts):
    • Note: no flow.json exists in this kit; the flow is defined in the TS file.
    • API Request trigger (type: "triggerNode", GraphQL-based) accepts diff: string.
    • Generate Text (type: "dynamicNode") calls Gemini with the referenced system/user prompts and constitution, producing generatedResponse.
    • API Response (type: "responseNode") returns JSON with result mapped from {{LLMNode_223.output.generatedResponse}}.
    • Node/edge types used: triggerNodedynamicNoderesponseNode, with defaultEdge plus a final responseEdge.
    • Expected output format: Conventional Commits header first, then ---, then the Markdown PR body.

A single-flow Lamatic template that converts a raw git diff into a Conventional Commits message and a ready-to-paste PR description using Google Gemini.
Copilot AI review requested due to automatic review settings July 7, 2026 18:56
@coderabbitai

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

Run ID: 50abaf8a-178b-4a80-81f5-89d3b665cc58

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

This PR adds a new Lamatic template kit, commit-pr-generator, with kit config, flow wiring, Gemini model settings, prompts, guardrail constitution, documentation, and ignore rules for generating a Conventional Commits message and PR description from a git diff.

Changes

Commit & PR Generator Template Kit

Layer / File(s) Summary
Kit configuration and gitignore
kits/commit-pr-generator/lamatic.config.ts, kits/commit-pr-generator/.gitignore
Adds kit metadata, tags, a required step, GitHub link metadata, and ignores local tool, dependency, and env files.
Flow definition, model config, and prompts
kits/commit-pr-generator/flows/commit-pr-generator.ts, kits/commit-pr-generator/model-configs/commit-pr-generator_llmnode-223_generative-model-name.ts, kits/commit-pr-generator/prompts/*
Defines the API-triggered flow graph, Gemini model configuration, and prompt text for generating the commit message and PR description with the expected error handling.
Agent behavior, constitution, and README docs
kits/commit-pr-generator/agent.md, kits/commit-pr-generator/constitutions/default.md, kits/commit-pr-generator/README.md
Documents the agent behavior, safety and data-handling rules, setup steps, usage example, and template notes.

Suggested reviewers: amanintech, d-pamneja

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title is concise and accurately summarizes the main change: adding the commit-pr-generator template.
Description check ✅ Passed The description covers the required sections, file structure, and validation items, and it is specific to this template.
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.
✨ 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 Jul 7, 2026

Copy link
Copy Markdown
Contributor

:robot_face: AgentKit Structural Validation

New Contributions Detected

  • Template: kits/commit-pr-generator

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.

Copilot AI 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.

Pull request overview

Adds a new Lamatic template (kits/commit-pr-generator/) that takes a raw git diff and generates (1) a Conventional Commits message and (2) a ready-to-paste PR description via a single API Request → LLM → API Response flow.

Changes:

  • Introduces the exported Lamatic flow graph and template metadata for commit-pr-generator.
  • Adds prompts/constitution/agent documentation and a usage README for the template.
  • Adds a Gemini model config reference used by the Generate Text node.

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
kits/commit-pr-generator/README.md Documents purpose, setup, usage, and expected output format.
kits/commit-pr-generator/agent.md Agent capability/guardrails and integration notes for the template.
kits/commit-pr-generator/constitutions/default.md Template constitution (identity/safety/data handling/tone).
kits/commit-pr-generator/flows/commit-pr-generator.ts Exported Lamatic flow definition (trigger → LLM → response).
kits/commit-pr-generator/lamatic.config.ts Template metadata (name/description/tags/steps/links).
kits/commit-pr-generator/model-configs/commit-pr-generator_llmnode-223_generative-model-name.ts Gemini model configuration referenced by the flow.
kits/commit-pr-generator/prompts/commit-pr-generator_llmnode-223_system_0.md System prompt specifying output contract and rules.
kits/commit-pr-generator/prompts/commit-pr-generator_llmnode-223_user_1.md User prompt injecting the diff payload.
kits/commit-pr-generator/.gitignore Ignores Lamatic local artifacts, node_modules, and env files.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@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/commit-pr-generator/prompts/commit-pr-generator_llmnode-223_system_0.md`:
- Around line 8-11: The current prompt only instructs the model to return an
error string for empty or invalid diffs, which is not a deterministic guard. Add
a real pre-check before invoking LLMNode_223 so invalid or empty input is
detected in code and returns the exact error response immediately, rather than
relying on the prompt text to handle validation. Make the change where the
prompt for the commit-pr generator is assembled so the fallback path is enforced
outside the LLM.
🪄 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

Run ID: f8a5d1f9-1ad9-435b-8cc9-96e9c1e31d8e

📥 Commits

Reviewing files that changed from the base of the PR and between dafde4c and 549fc8e.

📒 Files selected for processing (9)
  • kits/commit-pr-generator/.gitignore
  • kits/commit-pr-generator/README.md
  • kits/commit-pr-generator/agent.md
  • kits/commit-pr-generator/constitutions/default.md
  • kits/commit-pr-generator/flows/commit-pr-generator.ts
  • kits/commit-pr-generator/lamatic.config.ts
  • kits/commit-pr-generator/model-configs/commit-pr-generator_llmnode-223_generative-model-name.ts
  • kits/commit-pr-generator/prompts/commit-pr-generator_llmnode-223_system_0.md
  • kits/commit-pr-generator/prompts/commit-pr-generator_llmnode-223_user_1.md

@github-actions

github-actions Bot commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Hi @Ayazsaifi200! 👋

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! 🙏

- Blank credentialId/credential_name so each user binds their own Lamatic credential (Copilot review). - Treat diff as untrusted input and use a bare error sentinel consistent with README/agent.md (Copilot review).
@Ayazsaifi200

Copy link
Copy Markdown
Author

Thanks for the review! I've addressed all comments:

1. Hard-coded workspace credential (Copilot) — Fixed. credentialId and credential_name are now blank so each user binds their own credential in Lamatic Studio. (commit 8976478)

2. Error-string consistency + prompt injection (Copilot) — Fixed. The system prompt now (a) explicitly treats the diff as untrusted data and ignores any instructions embedded in it, and (b) uses the bare ERROR: no valid diff provided sentinel, consistent with README.md and agent.md. (commit 8976478)

3. Deterministic invalid-input check (CodeRabbit) — This is an intentional design choice for a minimal single-flow template (API Request → LLM → API Response). The model reliably returns the deterministic ERROR: no valid diff provided sentinel for empty/malformed input (verified in Studio testing), and the diff is now treated as untrusted. I've documented in the README that a pre-LLM Condition/Code node (checking for diff --git / @@ markers) is the recommended hardening step for high-volume/unattended pipelines, kept out to preserve the template's minimal scope. Happy to add the branching node if you'd prefer it included.

Please re-review — thanks!

@coderabbitai review

@Ayazsaifi200

Copy link
Copy Markdown
Author

@coderabbitai review

@coderabbitai

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

@coderabbitai

coderabbitai Bot commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

@Ayazsaifi200, your mission was accepted, and it appears you've completed it with distinction. Confirming the debrief:

  1. Hard-coded credential — Blanking credentialId/credential_name so each operative binds their own Gemini credential is the correct move.
  2. Error-string consistency + prompt injection — Treating the diff as untrusted data and standardizing on the bare ERROR: no valid diff provided sentinel closes that gap nicely.
  3. Deterministic invalid-input check — Fair call for a minimal single-flow template. Documenting the recommended pre-LLM Condition/Code node hardening step in the README gives future adopters a clear upgrade path without bloating the template's scope. I won't insist on the branching node — this message will self-destruct... metaphorically.

Dispatching a fresh review pass now. Good luck, and should you accept future missions, this channel remains open.

✅ 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.

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