From adbf8fdf18fabfe3b56d32db7e7089e7c2153447 Mon Sep 17 00:00:00 2001 From: Ajay Raghav <22BCS16075@cuchd.in> Date: Thu, 6 Aug 2026 16:39:24 +0530 Subject: [PATCH] feat: Add commit-activity-digest template MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Single-flow template that turns raw git log output into a structured engineering activity digest — work type breakdown, technology detection, and key highlights for standups or stakeholder updates. Co-authored-by: Cursor --- kits/commit-activity-digest/README.md | 131 +++++++++++++++++ kits/commit-activity-digest/agent.md | 32 ++++ .../constitutions/default.md | 7 + .../flows/commit-activity-digest.ts | 139 ++++++++++++++++++ kits/commit-activity-digest/lamatic.config.ts | 23 +++ ...t_analyzeActivity_generative-model-name.ts | 15 ++ ...activity-digest_analyze-activity_system.md | 40 +++++ ...t-activity-digest_analyze-activity_user.md | 9 ++ 8 files changed, 396 insertions(+) create mode 100644 kits/commit-activity-digest/README.md create mode 100644 kits/commit-activity-digest/agent.md create mode 100644 kits/commit-activity-digest/constitutions/default.md create mode 100644 kits/commit-activity-digest/flows/commit-activity-digest.ts create mode 100644 kits/commit-activity-digest/lamatic.config.ts create mode 100644 kits/commit-activity-digest/model-configs/commit-activity-digest_analyzeActivity_generative-model-name.ts create mode 100644 kits/commit-activity-digest/prompts/commit-activity-digest_analyze-activity_system.md create mode 100644 kits/commit-activity-digest/prompts/commit-activity-digest_analyze-activity_user.md diff --git a/kits/commit-activity-digest/README.md b/kits/commit-activity-digest/README.md new file mode 100644 index 000000000..bea44f620 --- /dev/null +++ b/kits/commit-activity-digest/README.md @@ -0,0 +1,131 @@ +# Commit Activity Digest + +Turn a block of raw `git log` output into a structured engineering activity digest — categorized by work type, with technology detection and key highlights — ready for standups, weekly reports, or stakeholder updates. + +> **Type:** Template (single Lamatic flow) + +## The problem + +Every week, someone asks "what did we ship?" and someone else spends 20 minutes scrolling through commit history, mentally grouping features vs fixes vs chores, and writing a summary in Slack. It's tedious, inconsistent, and easy to miss things. + +## What it does + +Paste your `git log` output (commit messages + optionally file paths and stats) and get back a Markdown digest with: + +- **Summary** — 2-3 sentence overview of the period +- **Work Breakdown** — commits grouped by type (Features, Fixes, Refactoring, Infrastructure, Tests, Docs) +- **Technologies Touched** — languages and frameworks detected from file paths +- **Key Metrics** — commit count, lines changed, areas affected +- **Highlights** — the 1-3 things a busy reader should know + +### Example + +**Input** + +```text +a1f2e3d feat: add JWT refresh endpoint + src/auth/refresh.ts | 45 ++++ + src/auth/middleware.ts | 12 +- + +b2c3d4e fix: prevent crash on empty CSV upload + src/upload/parser.ts | 8 ++-- + +c3d4e5f refactor: extract shared validation logic + src/lib/validators.ts | 62 ++++++ + src/api/users.ts | 18 +-- + +d4e5f6g feat: add dark mode toggle to settings + src/components/settings.tsx | 34 ++++ + src/styles/theme.css | 22 ++++ +``` + +**Output** + +```markdown +### Summary +This period focused on authentication improvements and UI enhancements, +with a JWT refresh endpoint and dark mode toggle as the headline additions. +A crash on CSV upload was fixed and shared validation logic was consolidated. + +### Work Breakdown + +**Features** +- Added JWT token refresh endpoint (auth module) +- Added dark mode toggle to settings page (UI) + +**Fixes** +- Fixed crash when uploading empty CSV files (upload module) + +**Refactoring** +- Extracted shared validation logic into a reusable module + +### Technologies Touched +TypeScript, React, CSS + +### Highlights +- JWT refresh endpoint strengthens the auth flow +- Dark mode is now available in settings +``` + +## Setup + +1. Import the flow into your Lamatic Studio project +2. Attach a text model to the **Analyze Activity** node +3. Deploy the flow +4. Call via GraphQL API with your git log as input + +## Usage + +Send a request with your git log output: + +```json +{ + "git_log": "a1f2e3d feat: add auth endpoint\n src/auth.ts | 45 ++++\n...", + "context": "Last 7 days, main branch" +} +``` + +The `context` field is optional — use it to tell the model what period or branch this covers. + +**Tip:** Generate the input with: + +```bash +git log --oneline --stat --since="7 days ago" --no-merges +``` + +## How it works + +```text +API Request (git_log, context?) + │ + ▼ +Analyze Activity (LLM) ──uses──▶ prompts/* · constitutions/default.md · model-configs/* + │ + ▼ +API Response → { digest } +``` + +A single flow, one LLM node. Prompts, guardrails, and model settings are externalized via `@references`. + +## Project structure + +```text +commit-activity-digest/ +├── lamatic.config.ts +├── agent.md +├── README.md +├── flows/ +│ └── commit-activity-digest.ts +├── constitutions/ +│ └── default.md +├── prompts/ +│ ├── commit-activity-digest_analyze-activity_system.md +│ └── commit-activity-digest_analyze-activity_user.md +└── model-configs/ + └── commit-activity-digest_analyzeActivity_generative-model-name.ts +``` + +## Stack + +- [Lamatic.ai](https://lamatic.ai) — AI flow orchestration +- LLM — activity analysis and digest generation diff --git a/kits/commit-activity-digest/agent.md b/kits/commit-activity-digest/agent.md new file mode 100644 index 000000000..ebe053a65 --- /dev/null +++ b/kits/commit-activity-digest/agent.md @@ -0,0 +1,32 @@ +# Commit Activity Digest + +## Identity + +You are an engineering activity analyst that turns raw git history into structured, human-readable digests. + +## Capabilities + +- Parse git log output (commit messages, file paths, line stats) +- Categorize commits by work type (feature, fix, refactor, infra, test, docs) +- Detect technologies from file extensions and paths +- Produce scannable Markdown digests suitable for standups and stakeholder updates +- Collapse noise (typo, lint, wip) into housekeeping summaries + +## Behavior + +- Only report what is present in the input — never fabricate +- Keep output concise and structured +- Lead with the most impactful work +- Use bullet points and short paragraphs, not prose blocks + +## Flow + +| Flow | Trigger | Output | +|------|---------|--------| +| `commit-activity-digest` | API request with `git_log` (string) and optional `context` (string) | `{ digest }` — Markdown activity digest | + +## Guardrails + +- No fabricated commits or statistics +- No commentary on developer performance or productivity +- No access to external systems — works only on the provided input diff --git a/kits/commit-activity-digest/constitutions/default.md b/kits/commit-activity-digest/constitutions/default.md new file mode 100644 index 000000000..fd0942646 --- /dev/null +++ b/kits/commit-activity-digest/constitutions/default.md @@ -0,0 +1,7 @@ +# Default Constitution + +- Only analyze commits present in the provided git log output +- Never fabricate commits, file changes, or statistics that are not in the input +- If the input is empty or contains no parseable commits, say so clearly +- Keep the digest factual and scannable — no filler, no motivational language +- Do not editorialize about code quality unless the commits explicitly indicate issues diff --git a/kits/commit-activity-digest/flows/commit-activity-digest.ts b/kits/commit-activity-digest/flows/commit-activity-digest.ts new file mode 100644 index 000000000..4f0284ef6 --- /dev/null +++ b/kits/commit-activity-digest/flows/commit-activity-digest.ts @@ -0,0 +1,139 @@ +// Flow: commit-activity-digest + +// -- Meta -- +export const meta = { + "name": "commit-activity-digest", + "description": "Takes raw git log output and produces a structured engineering activity digest with work type breakdown, technology detection, and key highlights.", + "tags": ["git", "developer-tools", "productivity", "reporting", "automation"], + "testInput": { + "git_log": "a]1f2e3d4 feat: add JWT refresh endpoint\n src/auth/refresh.ts | 45 ++++\n src/auth/middleware.ts | 12 +-\n\nb2c3d4e5 fix: prevent crash on empty CSV upload\n src/upload/parser.ts | 8 ++--\n src/upload/validate.ts | 3 +-\n\nc3d4e5f6 refactor: extract shared validation logic\n src/lib/validators.ts | 62 ++++++\n src/api/users.ts | 18 +--\n src/api/billing.ts | 14 +--\n\nd4e5f6g7 chore: bump next from 15.1 to 16.0\n package.json | 2 +-\n package-lock.json | 1842 ++++--\n\ne5f6g7h8 feat: add dark mode toggle to settings\n src/components/settings.tsx | 34 ++++\n src/styles/theme.css | 22 ++++\n\nf6g7h8i9 fix: correct timezone offset in scheduled posts\n src/queue/scheduler.ts | 6 +-\n\ng7h8i9j0 test: add integration tests for webhook retry\n tests/webhook.test.ts | 89 ++++++\n src/webhooks/retry.ts | 4 +-", + "context": "Last 7 days of activity on our main product repo" + }, + "githubUrl": "https://github.com/Lamatic/AgentKit/tree/main/kits/commit-activity-digest", + "documentationUrl": "https://lamatic.ai/docs", + "deployUrl": "", + "author": { + "name": "Ajay Raghav", + "email": "22BCS16075@cuchd.in" + } +}; + +// -- Inputs -- +export const inputs = { + "analyzeActivity": [ + { + "name": "generativeModelName", + "label": "Generative Model Name", + "type": "model" + } + ] +}; + +// -- References -- +export const references = { + "constitutions": { + "default": "@constitutions/default.md" + }, + "prompts": { + "commit_activity_digest_analyze_activity_system": "@prompts/commit-activity-digest_analyze-activity_system.md", + "commit_activity_digest_analyze_activity_user": "@prompts/commit-activity-digest_analyze-activity_user.md" + }, + "modelConfigs": { + "commit_activity_digest_analyzeActivity_generative_model_name": "@model-configs/commit-activity-digest_analyzeActivity_generative-model-name.ts" + } +}; + +// -- Nodes & Edges -- +export const nodes = [ + { + "id": "apiRequest", + "type": "triggerNode", + "position": { "x": 0, "y": 0 }, + "data": { + "nodeId": "graphqlNode", + "trigger": true, + "values": { + "id": "apiRequest", + "nodeName": "API Request", + "responeType": "realtime", + "advance_schema": "{\n \"git_log\": \"string\",\n \"context\": \"string\"\n}" + } + } + }, + { + "id": "analyzeActivity", + "type": "dynamicNode", + "position": { "x": 0, "y": 0 }, + "data": { + "nodeId": "LLMNode", + "values": { + "id": "analyzeActivity", + "tools": [], + "prompts": [ + { + "id": "prompt_system", + "role": "system", + "content": "@prompts/commit-activity-digest_analyze-activity_system.md" + }, + { + "id": "prompt_user", + "role": "user", + "content": "@prompts/commit-activity-digest_analyze-activity_user.md" + } + ], + "memories": "[]", + "messages": "[]", + "nodeName": "Analyze Activity", + "attachments": "", + "credentials": "", + "generativeModelName": "@model-configs/commit-activity-digest_analyzeActivity_generative-model-name.ts" + } + } + }, + { + "id": "apiResponse", + "type": "responseNode", + "position": { "x": 0, "y": 0 }, + "data": { + "nodeId": "graphqlResponseNode", + "values": { + "id": "apiResponse", + "headers": "{\"content-type\":\"application/json\"}", + "retries": "0", + "nodeName": "API Response", + "webhookUrl": "", + "retry_delay": "0", + "outputMapping": "{\n \"digest\": \"{{analyzeActivity.output.generatedResponse}}\"\n}" + } + } + } +]; + +export const edges = [ + { + "id": "apiRequest-analyzeActivity", + "source": "apiRequest", + "target": "analyzeActivity", + "sourceHandle": "bottom", + "targetHandle": "top", + "type": "defaultEdge" + }, + { + "id": "analyzeActivity-apiResponse", + "source": "analyzeActivity", + "target": "apiResponse", + "sourceHandle": "bottom", + "targetHandle": "top", + "type": "defaultEdge" + }, + { + "id": "response-trigger_apiRequest", + "source": "apiRequest", + "target": "apiResponse", + "sourceHandle": "to-response", + "targetHandle": "from-trigger", + "type": "responseEdge" + } +]; + +export default { meta, inputs, references, nodes, edges }; diff --git a/kits/commit-activity-digest/lamatic.config.ts b/kits/commit-activity-digest/lamatic.config.ts new file mode 100644 index 000000000..d6b76a34a --- /dev/null +++ b/kits/commit-activity-digest/lamatic.config.ts @@ -0,0 +1,23 @@ +export default { + name: "Commit Activity Digest", + description: + "Paste raw git log output and get a structured engineering activity digest — what was built, technologies involved, work type breakdown, and key highlights — ready for standups, weekly reports, or stakeholder updates.", + version: "1.0.0", + type: "template" as const, + author: { + name: "Ajay Raghav", + email: "22BCS16075@cuchd.in", + }, + tags: ["git", "developer-tools", "productivity", "reporting", "automation"], + steps: [ + { + id: "commit-activity-digest", + type: "mandatory" as const, + }, + ], + links: { + github: + "https://github.com/Lamatic/AgentKit/tree/main/kits/commit-activity-digest", + docs: "https://lamatic.ai/docs", + }, +}; diff --git a/kits/commit-activity-digest/model-configs/commit-activity-digest_analyzeActivity_generative-model-name.ts b/kits/commit-activity-digest/model-configs/commit-activity-digest_analyzeActivity_generative-model-name.ts new file mode 100644 index 000000000..c4042ec03 --- /dev/null +++ b/kits/commit-activity-digest/model-configs/commit-activity-digest_analyzeActivity_generative-model-name.ts @@ -0,0 +1,15 @@ +// Model config: analyzeActivity + +export default { + "generativeModelName": [ + { + "type": "generator/text", + "params": {}, + "configName": "configA", + "model_name": "gpt-4o-mini", + "credentialId": "", + "provider_name": "openai", + "credential_name": "" + } + ] +}; diff --git a/kits/commit-activity-digest/prompts/commit-activity-digest_analyze-activity_system.md b/kits/commit-activity-digest/prompts/commit-activity-digest_analyze-activity_system.md new file mode 100644 index 000000000..4086a25e7 --- /dev/null +++ b/kits/commit-activity-digest/prompts/commit-activity-digest_analyze-activity_system.md @@ -0,0 +1,40 @@ +You are a senior engineering manager who writes clear, structured activity digests from raw git history. + +Your job is to take git log output — commit messages, file paths, and line-change stats — and produce a concise engineering activity digest suitable for standups, weekly reports, or stakeholder updates. + +## Output format + +Return a Markdown document with these sections: + +### Summary +A 2-3 sentence overview of what happened in this period. Lead with the most impactful work. + +### Work Breakdown +Categorize each commit into one of these types and list them grouped: +- **Features** — new capabilities, user-facing additions +- **Fixes** — bug fixes, corrections, error handling +- **Refactoring** — code cleanup, restructuring, optimization +- **Infrastructure** — CI/CD, config, dependencies, deployment +- **Tests** — new or updated tests +- **Docs** — documentation changes + +For each item, write a short human-readable description (not the raw commit message). Include the file areas affected. + +### Technologies Touched +List the languages, frameworks, and tooling areas involved, inferred from file extensions and paths (e.g., `.ts` → TypeScript, `.tsx` → React, `Dockerfile` → Docker). + +### Key Metrics +- Total commits +- Approximate lines added / removed (if stats are available) +- Number of distinct areas changed + +### Highlights +1-3 bullet points calling out the most noteworthy changes — things a busy reader should know about even if they skip the rest. + +## Rules + +- Only report what is present in the git log. Never fabricate commits, files, or changes. +- If a commit message is vague (e.g., "update", "wip", "fix"), still include it but describe it honestly as unclear. +- Collapse trivial commits (typo, lint, formatting) into a single "housekeeping" line rather than listing each one. +- If file stats (insertions/deletions) are present, use them. If not, skip the metrics that depend on them. +- Keep the digest scannable — short paragraphs, bullet points, no walls of text. diff --git a/kits/commit-activity-digest/prompts/commit-activity-digest_analyze-activity_user.md b/kits/commit-activity-digest/prompts/commit-activity-digest_analyze-activity_user.md new file mode 100644 index 000000000..1c5982b57 --- /dev/null +++ b/kits/commit-activity-digest/prompts/commit-activity-digest_analyze-activity_user.md @@ -0,0 +1,9 @@ +Generate an engineering activity digest from this git log output. + +{{#if apiRequest.output.context}} +Context: {{apiRequest.output.context}} +{{/if}} + +``` +{{apiRequest.output.git_log}} +```