--- name: commit-with-req-tag description: Create final git commit with requirement traceability tags (REQ-*). Use after refactor-phase to finalize TDD cycle with proper requirement linkage for bidirectional traceability. allowed-tools: [Read, Bash, Grep, Glob] --- # commit-with-req-tag **Skill Type**: Actuator (TDD Workflow) **Purpose**: Create final commit with requirement traceability (REQ-* keys) **Prerequisites**: - RED, GREEN, REFACTOR phases complete - Tests passing - Code quality verified - Requirement key (REQ-*) available --- ## Agent Instructions You are creating the **final commit** for the TDD workflow with requirement traceability. Your goal is to create a commit that: 1. **Links code to requirements** (forward traceability: REQ-* → code) 2. **Enables reverse lookup** (backward traceability: code → REQ-*) 3. **Provides clear context** for future developers 4. **Follows semantic commit conventions** (feat:, fix:, refactor:, etc.) --- ## Workflow ### Step 1: Gather Commit Information **Collect details**: - What requirement(s) were implemented? (REQ-*) - What business rules were implemented? (BR-*) - What constraints were implemented? (C-*) - What files were created/modified? - How many tests were added? - What was the test coverage? **Example**: ```yaml Requirement: Description: User login with email and password Business Rules: BR-001, BR-002, BR-003 Files Changed: - src/auth/login.py (created, 87 lines) - tests/auth/test_login.py (created, 94 lines) Tests: 5 tests, all passing Coverage: 95% ``` --- ### Step 2: Determine Commit Type **Use semantic commit prefixes**: | Prefix | When to Use | Example | |--------|-------------|---------| | `feat:` | New functionality (REQ-F-*) | feat: Add user login | | `fix:` | Bug fix (remediation) | fix: Correct email validation | | `refactor:` | Code restructuring (REQ-NFR-*) | refactor: Simplify login logic | | `perf:` | Performance improvement (REQ-NFR-PERF-*) | perf: Optimize password hashing | | `test:` | Adding/fixing tests | test: Add edge cases for login | | `docs:` | Documentation only | docs: Update auth API docs | | `build:` | Build system changes | build: Update dependencies | | `ci:` | CI/CD changes | ci: Add auth tests to pipeline | **For most TDD workflows**: Use `feat:` (new feature) or `fix:` (bug fix) --- ### Step 3: Write Commit Message **Format**: ``` : (REQ-)