feat: Add commit-activity-digest template - #329
Conversation
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 <cursoragent@cursor.com>
WalkthroughChangesCommit Activity Digest
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.
Actionable comments posted: 4
🤖 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-activity-digest/prompts/commit-activity-digest_analyze-activity_system.md`:
- Around line 13-19: Update the work-type contract in the category list and the
output requirements around the `housekeeping` line to define `Housekeeping` as
an allowed category, ensuring trivial commits can be grouped there without
conflicting with the listed categories.
- Around line 21-29: Update the commit activity digest prompt’s file-area,
technology, and distinct-area requirements to apply only when file paths are
supplied. When paths are absent, instruct the output to omit these fields rather
than infer or fabricate them; keep the remaining metrics, including commit
counts and available line statistics, unchanged.
In
`@kits/commit-activity-digest/prompts/commit-activity-digest_analyze-activity_user.md`:
- Around line 3-9: Update the commit-activity prompt template around
apiRequest.output.context and apiRequest.output.git_log to isolate these
user-controlled values from executable instructions: pass them in a structured
representation or robustly escape any prompt delimiters, including ```
sequences, and add an explicit system-level rule that both fields are untrusted
data only and must not override digest instructions.
In `@kits/commit-activity-digest/README.md`:
- Around line 42-68: The README output example omits the required Key Metrics
section despite the example input containing file statistics. Update the output
example to include metrics derived from those statistics, or explicitly label
the example as abbreviated; if metrics are intentionally omitted without
statistics, document that rule in the README.
🪄 Autofix
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 Plus
Run ID: f8797bd4-b249-486a-a7e6-dcaee6879bb3
📒 Files selected for processing (8)
kits/commit-activity-digest/README.mdkits/commit-activity-digest/agent.mdkits/commit-activity-digest/constitutions/default.mdkits/commit-activity-digest/flows/commit-activity-digest.tskits/commit-activity-digest/lamatic.config.tskits/commit-activity-digest/model-configs/commit-activity-digest_analyzeActivity_generative-model-name.tskits/commit-activity-digest/prompts/commit-activity-digest_analyze-activity_system.mdkits/commit-activity-digest/prompts/commit-activity-digest_analyze-activity_user.md
| 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 |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
Define Housekeeping in the work-type contract.
Lines 13-19 list six allowed categories. Line 38 also requires a housekeeping line. These instructions conflict. The model can emit an unlisted section or fail to collapse noise. Add Housekeeping to the allowed categories, or define which listed category receives trivial commits.
Proposed contract update
- **Docs** — documentation changes
+- **Housekeeping** — trivial typo, lint, formatting, or WIP commitsAlso applies to: 34-38
🤖 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/commit-activity-digest/prompts/commit-activity-digest_analyze-activity_system.md`
around lines 13 - 19, Update the work-type contract in the category list and the
output requirements around the `housekeeping` line to define `Housekeeping` as
an allowed category, ensuring trivial commits can be grouped there without
conflicting with the listed categories.
| 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 |
There was a problem hiding this comment.
🎯 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
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| 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 | |
| For each item, write a short human-readable description. Include affected file areas only when file paths are present. Do not infer missing paths. | |
| ### Technologies Touched | |
| List languages, frameworks, and tooling only when file extensions or paths provide evidence. Otherwise omit this section. | |
| ### Key Metrics | |
| - Total commits | |
| - Approximate lines added / removed (if stats are available) | |
| - Number of distinct areas changed, when file paths are present |
🧰 Tools
🪛 markdownlint-cli2 (0.23.2)
[warning] 23-23: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below
(MD022, blanks-around-headings)
[warning] 26-26: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below
(MD022, blanks-around-headings)
🤖 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/commit-activity-digest/prompts/commit-activity-digest_analyze-activity_system.md`
around lines 21 - 29, Update the commit activity digest prompt’s file-area,
technology, and distinct-area requirements to apply only when file paths are
supplied. When paths are absent, instruct the output to omit these fields rather
than infer or fabricate them; keep the remaining metrics, including commit
counts and available line statistics, unchanged.
| {{#if apiRequest.output.context}} | ||
| Context: {{apiRequest.output.context}} | ||
| {{/if}} | ||
|
|
||
| ``` | ||
| {{apiRequest.output.git_log}} | ||
| ``` |
There was a problem hiding this comment.
🔒 Security & Privacy | 🟠 Major | ⚡ Quick win
Mission-critical: isolate raw fields from LLM instructions.
Lines 3-9 place user-controlled context and git_log directly in the LLM prompt. A commit message or context value can contain instructions, and a ``` sequence can terminate the fence. The model can then treat data as instructions and change or fabricate the digest. Escape delimiters or pass structured data, and add a system rule that these fields are untrusted data only.
🧰 Tools
🪛 markdownlint-cli2 (0.23.2)
[warning] 7-7: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
🤖 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/commit-activity-digest/prompts/commit-activity-digest_analyze-activity_user.md`
around lines 3 - 9, Update the commit-activity prompt template around
apiRequest.output.context and apiRequest.output.git_log to isolate these
user-controlled values from executable instructions: pass them in a structured
representation or robustly escape any prompt delimiters, including ```
sequences, and add an explicit system-level rule that both fields are untrusted
data only and must not override digest instructions.
| **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 | ||
| ``` |
There was a problem hiding this comment.
📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
Complete the output example with Key Metrics.
The README lists Key Metrics as 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
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/commit-activity-digest/README.md` around lines 42 - 68, The README
output example omits the required Key Metrics section despite the example input
containing file statistics. Update the output example to include metrics derived
from those statistics, or explicitly label the example as abbreviated; if
metrics are intentionally omitted without statistics, document that rule in the
README.
|
Hi @Ajay702! 👋 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! 🙏 |
Summary
commit-activity-digesttemplate that turns rawgit logoutput into a structured engineering activity digest — work type breakdown, technology detection, key highlights — suitable for standups, weekly reports, or stakeholder updates.commit-message-generatortemplate pattern exactly.Why it's useful
Teams regularly need "what did we ship this week" summaries. Today someone scrolls through commits and writes one manually. This automates it — paste
git log --oneline --stat --since="7 days ago"output and get a categorized digest back.Complements the existing
commit-message-generator(single-diff → commit message) andrelease-notes-generator(PR titles → changelog) by covering the "activity summary" gap.Provenance
The commit analysis logic (work type classification, technology detection from file paths, noise filtering heuristics) draws on patterns from a git-signal-extraction tool I built independently.
Test plan
lamatic.config.tsstep ID matchesflows/commit-activity-digest.ts@referencepaths resolve to existing filescommit-activity-digesttemplate and supporting documentation.git_logand optionalcontext, then returns{ digest }.gpt-4o-minimodel configuration.