-
Notifications
You must be signed in to change notification settings - Fork 441
feat: Add commit-activity-digest template #329
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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 | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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 }; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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", | ||
| }, | ||
| }; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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": "" | ||
| } | ||
| ] | ||
| }; |
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -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 | ||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+13
to
+19
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win Define Lines 13-19 list six allowed categories. Line 38 also requires a Proposed contract update - **Docs** — documentation changes
+- **Housekeeping** — trivial typo, lint, formatting, or WIP commitsAlso applies to: 34-38 🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||
| 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 | ||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+21
to
+29
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win Make file-based output conditional on supplied paths. Line 21 requires file areas for every item. Line 24 requires technology inference from paths. Line 29 requires distinct areas. The README allows inputs without file paths. When paths are absent, these instructions can cause fabricated areas or technologies. State that these fields are included only when paths are present. Proposed prompt adjustment-For each item, write a short human-readable description (not the raw commit message). Include the file areas affected.
+For each item, write a short human-readable description. Include affected file areas only when file paths are present. Do not infer missing paths.
-List the languages, frameworks, and tooling areas involved, inferred from file extensions and paths (e.g., `.ts` → TypeScript, `.tsx` → React, `Dockerfile` → Docker).
+List languages, frameworks, and tooling only when file extensions or paths provide evidence. Otherwise omit this section.
-- Number of distinct areas changed
+- Number of distinct areas changed, when file paths are present📝 Committable suggestion
Suggested change
🧰 Tools🪛 markdownlint-cli2 (0.23.2)[warning] 23-23: Headings should be surrounded by blank lines (MD022, blanks-around-headings) [warning] 26-26: Headings should be surrounded by blank lines (MD022, blanks-around-headings) 🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||
| ### 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. | ||||||||||||||||||||||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
Complete the output example with
Key Metrics.The README lists
Key Metricsas a digest section. The system prompt also requires it. The example input contains file statistics, but the output at Lines 42-68 omits the section. Add metrics derived from the example, or state that the example is abbreviated. If omission is intended without statistics, document that rule explicitly.🤖 Prompt for AI Agents