feat: Add release-notes-generator kit#205
Conversation
Turns a raw list of merged pull requests / commit messages into clean, categorized Markdown release notes (Highlights, Features, Fixes, Breaking Changes, Chore) via a single Lamatic flow plus a Next.js app.
WalkthroughChangesThe PR adds a Release Notes Generator kit with a Lamatic flow, configurable prompts and model references, server-side orchestration, demo mode, and a Next.js interface for generating and copying Markdown release notes. Release Notes Generator
Suggested reviewers: 🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 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. |
Studio Phase 2 validation requires the GraphQL trigger to declare its input schema. Declares changes, version and date so the flow loads in Studio.
There was a problem hiding this comment.
Actionable comments posted: 10
🤖 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/release-notes-generator/.gitignore`:
- Around line 3-4: Update the ignore rules in .gitignore to exclude all dotenv
environment-specific variants while explicitly re-including the example template
file, such as .env.example. Preserve the existing exclusions for .env and
.env.local and ensure files like .env.production and .env.development are
covered.
In `@kits/release-notes-generator/agent.md`:
- Around line 3-45: Resolve MD022/MD058 markdownlint warnings in the agent guide
by adding blank lines before and after every affected heading and table,
including the headings and tables in the sections around Overview, Purpose,
Flows, Guardrails, Integration Reference, Environment Setup, Quickstart, and
Common Failure Modes; preserve all existing content.
- Around line 20-22: Update the `Input constraints` documentation to specify
that `changes` is a non-empty newline-delimited string, with one PR title or
commit message per line, matching the `input.changes?.trim()` handling in the
bundled orchestration flow; remove the misleading list terminology.
In `@kits/release-notes-generator/apps/actions/orchestrate.ts`:
- Around line 1-69: The flow ID lookup in generateReleaseNotes is hardcoded to
RELEASE_NOTES_GENERATOR instead of using the kit metadata. Import
../../lamatic.config, read the step’s envKey from the configured release-notes
generator step, and use that key for the process.env lookup and missing-variable
error while preserving the existing execution flow.
In `@kits/release-notes-generator/apps/app/page.tsx`:
- Around line 86-103: The “Load sample” button is incorrectly nested inside the
label associated with the textarea. In the form component, restructure the
markup so the button is outside the label, or replace the label association with
an appropriate heading and aria-labelledby relationship while preserving the
textarea’s accessible name and sample-loading behavior.
- Around line 61-126: Refactor the form in the page component to use
react-hook-form with a zod schema instead of raw useState field management.
Define validation for version, date, and changes, initialize useForm with the
schema resolver and defaults, register the inputs, and update handleSubmit to
receive validated form values while preserving loading, error, sample-loading,
and disabled-submit behavior.
- Around line 41-45: Guard the clipboard operation in handleCopy: verify
navigator.clipboard and writeText availability before calling it, wrap the
asynchronous call in try/catch, and handle failures without setting copied or
leaving an unhandled rejection. Preserve the success-only copied state and
timeout behavior, optionally providing user-facing failure feedback consistent
with the page.
- Around line 25-39: handleSubmit lacks exception handling around
generateReleaseNotes, leaving the form stuck in a loading state when the call
throws. Wrap the generateReleaseNotes invocation and success/error state updates
in try/catch, report thrown failures via setError, and place setLoading(false)
in a finally block so loading is always cleared.
In `@kits/release-notes-generator/apps/package.json`:
- Around line 16-23: Pin the lamatic dependency to a specific compatible version
instead of latest. Review the form implementation in page.tsx: either migrate
the plain useState form to react-hook-form with zod validation and add the
required dependencies plus shadcn/ui components, or document the intentional
exception if the simple form does not require them.
In `@kits/release-notes-generator/README.md`:
- Around line 22-32: Resolve markdownlint violations in the README examples by
adding blank lines before and after every fenced code block, including the
related section at lines 55–69, and specifying a language on each fence; use
text where no more specific language applies.
🪄 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: bb9747d9-51c3-4c8a-82ac-a520d2321625
⛔ Files ignored due to path filters (1)
kits/release-notes-generator/apps/package-lock.jsonis excluded by!**/package-lock.json
📒 Files selected for processing (23)
kits/release-notes-generator/.env.examplekits/release-notes-generator/.gitignorekits/release-notes-generator/README.mdkits/release-notes-generator/agent.mdkits/release-notes-generator/apps/.env.examplekits/release-notes-generator/apps/.gitignorekits/release-notes-generator/apps/actions/orchestrate.tskits/release-notes-generator/apps/app/globals.csskits/release-notes-generator/apps/app/layout.tsxkits/release-notes-generator/apps/app/page.tsxkits/release-notes-generator/apps/components/header.tsxkits/release-notes-generator/apps/lib/demo.tskits/release-notes-generator/apps/lib/lamatic-client.tskits/release-notes-generator/apps/next.config.mjskits/release-notes-generator/apps/package.jsonkits/release-notes-generator/apps/postcss.config.mjskits/release-notes-generator/apps/tsconfig.jsonkits/release-notes-generator/constitutions/default.mdkits/release-notes-generator/flows/release-notes-generator.tskits/release-notes-generator/lamatic.config.tskits/release-notes-generator/model-configs/release-notes-generator_generate-notes.tskits/release-notes-generator/prompts/release-notes-generator_generate-notes_system.mdkits/release-notes-generator/prompts/release-notes-generator_generate-notes_user.md
- Harden .gitignore to exclude all dotenv variants, keep .env.example - Refactor form to react-hook-form + zod with schema validation - Move Load sample button out of the textarea label - Guard clipboard write and submit call with try/catch - Read flow envKey from lamatic.config (single source of truth) - Pin lamatic dependency; add form libraries - Fix markdownlint spacing in agent.md and README.md - Document changes input as a newline-delimited string
|
@coderabbitai review |
✅ Action performedReview finished.
|
There was a problem hiding this comment.
♻️ Duplicate comments (1)
kits/release-notes-generator/agent.md (1)
16-16: 🗄️ Data Integrity & Integration | 🟡 Minor | ⚡ Quick winMission check: keep the
changescontract singular.The flow is correctly documented here as a newline-delimited string, but the Guardrails section at Line 26 still calls it a “list.” Update that wording to “non-empty newline-delimited string” so integrations do not send an array that the app cannot process.
🤖 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/release-notes-generator/agent.md` at line 16, Update the Guardrails section to describe `changes` as a “non-empty newline-delimited string” instead of a “list,” preserving the singular input contract documented in the Input format section.
🤖 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.
Duplicate comments:
In `@kits/release-notes-generator/agent.md`:
- Line 16: Update the Guardrails section to describe `changes` as a “non-empty
newline-delimited string” instead of a “list,” preserving the singular input
contract documented in the Input format section.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI (base), Organization UI (inherited)
Review profile: ASSERTIVE
Plan: Pro
Run ID: 2ab4f50f-f267-408e-a83d-4ff2a0586cc6
⛔ Files ignored due to path filters (1)
kits/release-notes-generator/apps/package-lock.jsonis excluded by!**/package-lock.json
📒 Files selected for processing (8)
kits/release-notes-generator/.gitignorekits/release-notes-generator/README.mdkits/release-notes-generator/agent.mdkits/release-notes-generator/apps/.gitignorekits/release-notes-generator/apps/actions/orchestrate.tskits/release-notes-generator/apps/app/page.tsxkits/release-notes-generator/apps/next.config.mjskits/release-notes-generator/apps/package.json
Problem
Writing release notes by hand is a repetitive chore: commit logs are noisy,
related changes are scattered, and breaking changes are easy to miss.
What this kit does
Release Notes Generator turns a raw list of merged PR titles / commit⚠️ Breaking Changes, 🧹 Chore — with duplicates collapsed,
messages into clean, categorized Markdown release notes — Highlights, ✨ Features,
🐛 Fixes,
#123references preserved, and nothing fabricated.
How it works
A single Lamatic flow:
API Request → Generate Notes (LLM) → API Response.Prompts, guardrails (constitution), and model config are externalized via
@references. A minimal Next.js app provides the UI (with an optionalDEMO_MODEso the interface can be explored without credentials).Type
Kit (Lamatic flow + Next.js app) — new folder
kits/release-notes-generator/,touches nothing else in the repo.
Testing
npm run buildpasses clean (no type/lint errors)@referencepaths resolve, no
.envcommitted)kits/release-notes-generatorrelease-notes-generator kit configuration and docs:kits/release-notes-generator/.env.examplekits/release-notes-generator/.gitignore(ignores kit runtime artifacts and env files, unignores!.env.example)kits/release-notes-generator/README.mdkits/release-notes-generator/agent.mdkits/release-notes-generator/lamatic.config.tskits/release-notes-generator/constitutions/default.mdkits/release-notes-generator/prompts/release-notes-generator_generate-notes_system.mdkits/release-notes-generator/prompts/release-notes-generator_generate-notes_user.mdkits/release-notes-generator/model-configs/release-notes-generator_generate-notes.tskits/release-notes-generator/flows/release-notes-generator.tskits/release-notes-generator/apps/.env.examplekits/release-notes-generator/apps/.gitignorekits/release-notes-generator/apps/actions/orchestrate.ts(generateReleaseNotesserver action; trims/validates input; supportsDEMO_MODE; executes the Lamatic flow and returns{ success, releaseNotes?, error? })kits/release-notes-generator/apps/app/globals.csskits/release-notes-generator/apps/app/layout.tsxkits/release-notes-generator/apps/app/page.tsx(form withreact-hook-form+ Zod validation, renders Markdown viareact-markdown, “Load sample”, and “Copy” output)kits/release-notes-generator/apps/components/header.tsxkits/release-notes-generator/apps/lib/demo.ts(demo Markdown generator)kits/release-notes-generator/apps/lib/lamatic-client.ts(lazy Lamatic client creation with runtime env/credential checks)kits/release-notes-generator/apps/next.config.mjskits/release-notes-generator/apps/package.jsonkits/release-notes-generator/apps/package-lock.jsonkits/release-notes-generator/apps/postcss.config.mjskits/release-notes-generator/apps/tsconfig.jsonkits/release-notes-generator/flows/release-notes-generator.ts):triggerNode_1(type: triggerNode) exposes the API Request and declares an advance input schema forchanges,version, anddate.LLMNode_200(type: dynamicNode) runs the LLM using the referenced system/user prompts and referenced model config to producegeneratedResponse.graphqlResponseNode_300(type: dynamicNode) is the API Response mapper that outputsreleaseNotesfrom{{LLMNode_200.output.generatedResponse}}.triggerNode_1→LLMNode_200(default edge)LLMNode_200→graphqlResponseNode_300(default edge)triggerNode_1→graphqlResponseNode_300(response edge for completion)#123references.