Add jj-commit-message-generator agent and /sta:commit slash command to automate conventional commit message creation for STA project tasks. Features: - Agent analyzes jj diff and task specs to generate messages - Slash command provides simple interface: /sta:commit T020 - Follows project conventions and TDD workflow patterns - Uses lightweight Haiku model for fast generation
2.2 KiB
2.2 KiB
Generate and Set Commit Message for Task
Generate a conventional commit message for the specified task from specs/001-modbus-relay-control/tasks.md and set it on the current Jujutsu revision.
Instructions
- Extract the task ID from the command argument (e.g., "T020" from
/sta:commit T020) - Read the task details from
specs/001-modbus-relay-control/tasks.mdto understand what was implemented - Check the current working copy changes with
jj diffto see what files were modified - Use the
jj-commit-message-generatoragent via the Task tool with this prompt:
Generate a conventional commit message for the current Jujutsu revision. I've just completed task {TASK_ID} from specs/001-modbus-relay-control/tasks.md, which involved {brief description from task}. Analyze the changes and generate an appropriate commit message following the project's TDD workflow conventions.
- After the agent generates the message, set it on the current revision using
jj describe -m "..." - Confirm to the user that the commit message has been set successfully
Task Context
- Tasks are numbered like T001, T017, T020, etc.
- Tasks follow TDD (Test-Driven Development):
- Odd-numbered tasks (T017, T019, T021) are typically RED phase (failing tests)
- Even-numbered tasks (T018, T020, T022) are typically GREEN phase (implementation)
- Some tasks are marked with
[P]indicating they can be done in parallel - Task descriptions include complexity, files to modify, and test requirements
Commit Message Format
The agent should generate messages following this format:
<type>(<scope>): <subject>
<body>
TDD phase: <red/green/refactor phase info if applicable>
Ref: {TASK_ID} (specs/001-modbus-relay-control/tasks.md)
Where:
type: test, feat, refactor, docs, chore, fixscope: domain, application, infrastructure, presentation, settings, middlewaresubject: imperative mood, lowercase, no period, <72 charsbody: explain what and why, not how
Usage Examples
/sta:commit T020
This would:
- Read T020 from tasks.md (implement RelayState enum)
- Analyze current changes
- Generate message like:
feat(domain): implement RelayState enum with serialization support - Set it on current revision