feat: Add commit-pr-generator template#193
Conversation
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.
|
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 Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
WalkthroughThis PR adds a new Lamatic template kit, ChangesCommit & PR Generator Template Kit
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 |
:robot_face: AgentKit Structural ValidationNew Contributions Detected
Check Results
🎉 All checks passed! This contribution follows the AgentKit structure. |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
📒 Files selected for processing (9)
kits/commit-pr-generator/.gitignorekits/commit-pr-generator/README.mdkits/commit-pr-generator/agent.mdkits/commit-pr-generator/constitutions/default.mdkits/commit-pr-generator/flows/commit-pr-generator.tskits/commit-pr-generator/lamatic.config.tskits/commit-pr-generator/model-configs/commit-pr-generator_llmnode-223_generative-model-name.tskits/commit-pr-generator/prompts/commit-pr-generator_llmnode-223_system_0.mdkits/commit-pr-generator/prompts/commit-pr-generator_llmnode-223_user_1.md
|
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:
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).
|
Thanks for the review! I've addressed all comments: 1. Hard-coded workspace credential (Copilot) — Fixed. 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 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 Please re-review — thanks! @coderabbitai review |
|
@coderabbitai review |
✅ Action performedReview finished.
|
|
Dispatching a fresh review pass now. Good luck, and should you accept future missions, this channel remains open. ✅ Action performedReview finished.
|
Summary
A new template that converts a raw
git diffinto 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
kits/commit-pr-generator/)2. General Requirements
kebab-caseand matches the flow ID (commit-pr-generator)README.md3. File Structure
lamatic.config.tspresent with valid metadata (name, description, tags, steps, author, links)agent.mdpresentconstitutions/default.mdpresentflows/commit-pr-generator.tspresent (exported from Lamatic Studio)@references(prompts/,model-configs/).envcommitted (template has no env vars)4. Validation
---+ Markdown PR body)feat:kits/commit-pr-generator/namedcommit-pr-generatorthat converts a rawgit diffinto a Conventional Commits message plus a ready-to-paste Markdown PR description (## Summary,## Changes,## Testing), returned as a singleresultstring separated by---.kits/commit-pr-generator/.gitignore(ignorenode_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 stepcommit-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 andERROR: no valid diff providedfor 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)kits/commit-pr-generator/flows/commit-pr-generator.ts):flow.jsonexists in this kit; the flow is defined in the TS file.type: "triggerNode", GraphQL-based) acceptsdiff: string.type: "dynamicNode") calls Gemini with the referenced system/user prompts and constitution, producinggeneratedResponse.type: "responseNode") returns JSON withresultmapped from{{LLMNode_223.output.generatedResponse}}.triggerNode→dynamicNode→responseNode, withdefaultEdgeplus a finalresponseEdge.---, then the Markdown PR body.