From dcf7146cb17a79aa27fb22fea992d01302d96b55 Mon Sep 17 00:00:00 2001 From: Lucas C Date: Sun, 20 Jul 2025 18:25:07 +0200 Subject: [PATCH] feat: Add comprehensive commit and PR workflows as generic tasks - Created create-comprehensive-commit.md task with anti-tunnel vision mechanisms - Multi-stream aware commit message generation - Systematic evidence gathering from multiple sources - Comprehensive context analysis and rationale documentation - Quality checklist to prevent tunnel vision - Created create-comprehensive-pr.md task for detailed PR descriptions - Work stream identification and documentation - Per-stream testing instructions - Visual evidence requirements - Review focus areas and deployment notes - Integrated workflows into dev and architect agents - Added *comprehensive-commit command - Added *comprehensive-pr command - Made workflows available to agents who create commits/PRs These workflows ensure high-quality git documentation with comprehensive coverage of all changes, preventing the tunnel vision that often results in incomplete commit messages or PR descriptions. --- bmad-core/agents/architect.md | 4 + bmad-core/agents/dev.md | 4 + .../tasks/create-comprehensive-commit.md | 231 +++++++++++++ bmad-core/tasks/create-comprehensive-pr.md | 309 ++++++++++++++++++ 4 files changed, 548 insertions(+) create mode 100644 bmad-core/tasks/create-comprehensive-commit.md create mode 100644 bmad-core/tasks/create-comprehensive-pr.md diff --git a/bmad-core/agents/architect.md b/bmad-core/agents/architect.md index dc33db84..507c2335 100644 --- a/bmad-core/agents/architect.md +++ b/bmad-core/agents/architect.md @@ -74,6 +74,8 @@ commands: - execute-checklist {checklist}: Run task execute-checklist (default->architect-checklist) - research {topic}: execute task create-deep-research-prompt - shard-prd: run the task shard-doc.md for the provided architecture.md (ask if not found) + - comprehensive-commit: Execute task create-comprehensive-commit for high-quality commit messages + - comprehensive-pr: Execute task create-comprehensive-pr for detailed pull request descriptions - yolo: Toggle Yolo Mode - exit: Say goodbye as the Architect, and then abandon inhabiting this persona dependencies: @@ -83,6 +85,8 @@ dependencies: - document-project.md - execute-checklist.md - create-adr.md + - create-comprehensive-commit.md + - create-comprehensive-pr.md templates: - architecture-tmpl.yaml - front-end-architecture-tmpl.yaml diff --git a/bmad-core/agents/dev.md b/bmad-core/agents/dev.md index 4b6dd6aa..293d367e 100644 --- a/bmad-core/agents/dev.md +++ b/bmad-core/agents/dev.md @@ -66,6 +66,8 @@ commands: - explain: teach me what and why you did whatever you just did in detail so I can learn. Explain to me as if you were training a junior engineer. - create-dev-journal: Create a development journal entry documenting the session's work - list-dev-journals: Show recent dev journal entries from docs/devJournal + - comprehensive-commit: Execute task create-comprehensive-commit for high-quality commit messages + - comprehensive-pr: Execute task create-comprehensive-pr for detailed pull request descriptions - exit: Say goodbye as the Developer, and then abandon inhabiting this persona develop-story: order-of-execution: "Read (first or next) task→Implement Task and its subtasks→Write tests→Execute validations→Only if ALL pass, then update the task checkbox with [x]→Update story section File List to ensure it lists and new or modified or deleted source file→repeat order-of-execution until complete" @@ -82,6 +84,8 @@ dependencies: - execute-checklist.md - validate-next-story.md - create-dev-journal.md + - create-comprehensive-commit.md + - create-comprehensive-pr.md checklists: - story-dod-checklist.md templates: diff --git a/bmad-core/tasks/create-comprehensive-commit.md b/bmad-core/tasks/create-comprehensive-commit.md new file mode 100644 index 00000000..11dbc3c4 --- /dev/null +++ b/bmad-core/tasks/create-comprehensive-commit.md @@ -0,0 +1,231 @@ +# Create Comprehensive Commit + +This task guides the creation of a high-quality, comprehensive commit message that accurately reflects all staged changes, adhering to Conventional Commits 1.0 standard with anti-tunnel vision mechanisms. + +## Purpose + +Create commit messages that: +- Capture ALL work streams, not just the primary change +- Provide context for future developers +- Follow Conventional Commits standard +- Document the "why" behind changes +- Prevent tunnel vision through systematic evidence gathering + +## Process + +### 1. Comprehensive Evidence Gathering (MANDATORY) + +#### 1.1 Staged Changes Analysis +Execute and analyze: +```bash +# Get summary and detailed view +git diff --staged --stat + +# See operation types (Modified, Added, Deleted) +git diff --staged --name-status +``` + +Group changes by functional area: +- **Source Code**: Core application logic +- **API/Backend**: Endpoints, services, repositories +- **UI/Frontend**: Components, styles, templates +- **Documentation**: README, docs/, *.md files +- **Tests**: Test files, test utilities +- **Configuration**: Config files, environment settings +- **Database**: Migrations, schema changes +- **Build/Deploy**: CI/CD, build scripts + +For each file, identify: +- New functionality added +- Existing functionality modified +- Bug fixes +- Refactoring or cleanup +- Documentation updates +- Test additions/modifications + +#### 1.2 Completeness Check +```bash +# Check for unstaged/untracked files +git status --porcelain +``` + +If related files are unstaged: +- Prompt user about inclusion +- Ensure completeness of the commit + +#### 1.3 Work Stream Identification +Identify: +- **Primary Work Stream**: Main focus of the commit +- **Secondary Work Streams**: Supporting changes +- **Cross-Functional Impact**: Changes spanning multiple areas +- **Architecture Impact**: Pattern or structural changes + +### 2. Multi-Context Analysis (MANDATORY) + +#### 2.1 Session Context +Review: +- Conversation history for context +- Original problem/request +- Key decisions made +- Scope evolution (if any) + +#### 2.2 Development Context +Check for: +- Related dev journal entries +- Part of larger feature/fix +- Recent related commits +- Project milestones + +#### 2.3 Business & Technical Context +Understand: +- User-facing benefits +- Technical improvements +- Problem-solution mapping +- Alternatives considered + +### 3. Commit Message Synthesis + +#### 3.1 Type and Scope Selection + +**Types** (choose most significant): +- `feat`: New feature +- `fix`: Bug fix +- `docs`: Documentation only +- `style`: Formatting, no logic change +- `refactor`: Code restructuring +- `perf`: Performance improvement +- `test`: Test additions/modifications +- `chore`: Maintenance tasks + +**Scope** examples: +- Component-specific: `api`, `ui`, `auth`, `db` +- Feature-specific: `user-management`, `reporting` +- System-wide: Use when changes affect multiple areas + +#### 3.2 Message Structure + +``` +(): + + + +