- Version: 2.0
Commits staged changes with conventional commit messages and updates story progress logs.
/plugin marketplace add ninthspace/claude-code-marketplace/plugin install sdd@ninthspace-marketplacePurpose: Save current progress by creating a properly formatted git commit with automatic commit type detection, story context integration, and story file progress logging.
Syntax: /sdd:story-save [message]
| Parameter | Type | Required | Default | Description | Validation |
|---|---|---|---|---|---|
| message | string | No | auto-generated | Custom commit message or description | Max 500 chars |
/docs/stories/development/, /docs/stories/review/, or /docs/stories/qa//docs/project-context/ (optional for enhanced commit messages)CHECK git repository status:
git status --porcelainCATEGORIZE changes:
ANALYZE file sizes:
DISPLAY changes summary:
š CHANGES TO COMMIT
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
Modified: [count] files
- [file1]
- [file2]
Untracked: [count] files
- [file3]
- [file4]
[If warnings exist:]
ā ļø WARNINGS:
- Large file detected: [file] ([size]MB)
- Potential secret: [file]
IDENTIFY current story:
READ story file (if found):
VALIDATE story alignment:
ANALYZE changed files to determine commit type:
Detection Rules:
feat: New feature files, new components, new functionality
fix: Bug fixes, error corrections
refactor: Code restructuring without behavior change
test: Test additions or modifications
docs: Documentation only
style: Formatting, whitespace, linting
perf: Performance improvements
chore: Maintenance, dependencies, configuration
SELECT primary commit type:
DETERMINE scope from changes:
IF user provided message:
[type]([scope]): [user message]ELSE auto-generate message:
[type]([scope]): [auto-generated description]CREATE full commit message:
[type]([scope]): [description]
[If story exists:]
Story: [STORY-ID] - [Story Title]
Changes:
- [Change 1]
- [Change 2]
- [Change 3]
[If applicable:]
Files: [count] modified, [count] added, [count] deleted
VALIDATE commit message format:
IF story file exists:
- [YYYY-MM-DD HH:MM]: [commit description]
* Files: [list key files]
* Type: [commit type]
* [Additional context if significant changes]
UPDATE checklist items (if applicable):
NOTE implementation decisions (if significant):
STAGE changes:
CREATE commit:
git add [files]git commit -m "[commit message]"UPDATE story file with commit hash:
Commit: [hash]VERIFY commit succeeded:
git log -1 --onelineā
CHANGES COMMITTED
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
Commit: [hash]
Type: [type]
Scope: [scope]
Message: [description]
[If story exists:]
Story: [STORY-ID] - [Story Title]
Files Changed: [count]
š Modified: [count]
- [file1] ([+X/-Y lines])
- [file2] ([+X/-Y lines])
ā Added: [count]
- [file3] ([+X lines])
ā Deleted: [count]
- [file4] ([X lines])
Statistics:
Lines Added: [count]
Lines Removed: [count]
š” NEXT STEPS:
1. /sdd:story-implement [story-id] - Continue development
2. /sdd:story-review - Move to code review when ready
3. git push - Push to remote when ready to share
INPUT:
/sdd:story-save
PROCESS:
ā Checking git status...
ā Found 5 modified files, 2 new files
ā Detecting story context...
ā Current branch: feature/STORY-AUTH-001-login-form
ā Story: STORY-AUTH-001 - Implement Login Form
ā Analyzing changes...
ā Detected commit type: feat
ā Generating commit message...
ā Updating story file...
ā Staging changes...
ā Creating commit...
OUTPUT:
ā
CHANGES COMMITTED
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
Commit: abc1234
Type: feat
Scope: auth
Message: implement login form with validation
Story: STORY-AUTH-001 - Implement Login Form
Files Changed: 7
š Modified: 5
- app/Livewire/Auth/LoginForm.php (+145/-0 lines)
- resources/views/livewire/auth/login-form.blade.php (+67/-0 lines)
- routes/web.php (+5/-0 lines)
- tests/Feature/Auth/LoginTest.php (+89/-0 lines)
- stories/development/STORY-AUTH-001.md (+8/-1 lines)
ā Added: 2
- app/Http/Controllers/Auth/LoginController.php (+52 lines)
- tests/Browser/Auth/LoginFormTest.php (+43 lines)
Statistics:
Lines Added: 409
Lines Removed: 1
š” NEXT STEPS:
1. /sdd:story-implement STORY-AUTH-001 - Continue development
2. /sdd:story-review - Move to code review when ready
3. git push - Push to remote when ready to share
INPUT:
/sdd:story-save "add rate limiting to login endpoint"
PROCESS:
ā Checking git status...
ā Found 2 modified files
ā Using custom message: "add rate limiting to login endpoint"
ā Detecting story context...
ā Story: STORY-AUTH-001 - Implement Login Form
ā Analyzing changes...
ā Detected commit type: feat
ā Generating commit message...
ā Updating story file...
ā Creating commit...
OUTPUT:
ā
CHANGES COMMITTED
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
Commit: def5678
Type: feat
Scope: auth
Message: add rate limiting to login endpoint
Story: STORY-AUTH-001 - Implement Login Form
Changes:
- Added rate limiting middleware (5 attempts per minute)
- Updated login controller to use rate limiter
- Added rate limit exceeded error message
Files Changed: 2
š Modified: 2
- app/Http/Middleware/RateLimitLogin.php (+28/-0 lines)
- app/Livewire/Auth/LoginForm.php (+12/-3 lines)
Statistics:
Lines Added: 40
Lines Removed: 3
š” NEXT STEPS:
1. /sdd:story-implement STORY-AUTH-001 - Continue development
2. /sdd:story-review - Move to code review when ready
3. git push - Push to remote when ready to share
INPUT:
/sdd:story-save
PROCESS:
ā Checking git status...
ā Found 3 new files (all tests)
ā Detecting story context...
ā Story: STORY-PROFILE-002 - User Profile Settings
ā Analyzing changes...
ā Detected commit type: test
ā Generating commit message...
ā Updating story file (marking test checklist items complete)...
ā Creating commit...
OUTPUT:
ā
CHANGES COMMITTED
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
Commit: ghi9012
Type: test
Scope: profile
Message: add comprehensive unit and browser tests
Story: STORY-PROFILE-002 - User Profile Settings
Files Changed: 4
ā Added: 3
- tests/Unit/ProfileSettingsTest.php (+76 lines)
- tests/Feature/ProfileUpdateTest.php (+92 lines)
- tests/Browser/ProfileSettingsTest.php (+58 lines)
š Modified: 1
- stories/development/STORY-PROFILE-002.md (+3/-3 lines)
* Marked "Unit tests" as complete
* Marked "Browser tests" as complete
Statistics:
Lines Added: 229
Lines Removed: 3
š” NEXT STEPS:
1. /sdd:story-implement STORY-PROFILE-002 - Continue development
2. /sdd:story-review - Move to code review when ready
3. git push - Push to remote when ready to share
INPUT:
/sdd:story-save
PROCESS:
ā Checking git status...
ā No uncommitted changes found
OUTPUT:
ā
WORKING TREE CLEAN
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
No changes to commit.
Current Status:
Branch: feature/STORY-AUTH-001-login-form
Story: STORY-AUTH-001 - Implement Login Form
Last Commit: abc1234 (2 hours ago)
š” NEXT STEPS:
1. /sdd:story-implement STORY-AUTH-001 - Continue implementation
2. /sdd:story-review - Move to code review if complete
3. /sdd:story-continue - Resume work on story
INPUT:
/sdd:story-save
PROCESS:
ā Checking git status...
ā Found 3 modified files, 1 large file
ā Warning: Large file detected
OUTPUT:
ā ļø LARGE FILE DETECTED
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
Found large file that may bloat repository:
- public/videos/demo.mp4 (12.5 MB)
Changes to commit:
š Modified: 2
- app/Livewire/VideoPlayer.php
- resources/views/livewire/video-player.blade.php
ā Added: 1
- public/videos/demo.mp4 (12.5 MB) ā ļø
Recommendation:
Large files should be stored externally (S3, CDN) or
use Git LFS for version control.
Continue with commit? [y/n]
> n
Commit cancelled.
š” SUGGESTIONS:
1. Move large files to external storage
2. Add to .gitignore if not needed in repository
3. Use Git LFS for large binary files
4. /sdd:story-save (retry after removing large files)
INPUT:
/sdd:story-save
PROCESS:
ā Checking git status...
ā Found 2 modified files
ā Detecting story context...
ā Story: STORY-CART-003 - Shopping Cart Checkout
ā Analyzing changes...
ā Detected commit type: fix (error handling changes detected)
ā Generating commit message...
ā Creating commit...
OUTPUT:
ā
CHANGES COMMITTED
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
Commit: jkl3456
Type: fix
Scope: cart
Message: fix cart total calculation rounding error
Story: STORY-CART-003 - Shopping Cart Checkout
Changes:
- Fixed rounding error in cart total calculation
- Changed to use Decimal for currency calculations
- Updated tests to verify correct rounding
Files Changed: 2
š Modified: 2
- app/Services/CartService.php (+8/-4 lines)
- tests/Unit/CartServiceTest.php (+15/-2 lines)
Statistics:
Lines Added: 23
Lines Removed: 6
š” NEXT STEPS:
1. /sdd:story-implement STORY-CART-003 - Continue development
2. /sdd:story-review - Move to code review when ready
3. git push - Push to remote when ready to share
IF no story can be determined from branch or files:
- PROCEED with commit using generic scope
- USE directory name or "app" as scope
- SKIP story file update
- WARN: "No story context found - commit without story reference"
IF branch name doesn't match active story:
- WARN: "Branch name suggests [STORY-A] but active story is [STORY-B]"
- ASK: Which story should this commit be associated with?
- USE selected story for commit message and file update
IF story file exists but is untracked:
- INCLUDE story file in commit
- NOTE: "Adding story file to repository"
- PROCEED with normal commit flow
IF generated message exceeds 72 characters:
- TRUNCATE first line to 72 chars
- MOVE details to commit body
- ENSURE proper formatting
IF in detached HEAD state:
- WARN: "Currently in detached HEAD state"
- SHOW current commit
- SUGGEST: Create branch or checkout existing branch
- OFFER: Continue commit anyway? (y/n)
IF merge conflicts detected:
- HALT: "Cannot commit with unresolved merge conflicts"
- LIST conflicted files
- SUGGEST: Resolve conflicts first using git mergetool
- EXIT with error
git status --porcelain for fast, parseable outputgit diff --stat instead of full diff for summary/sdd:story-implement - Generate implementation before saving/sdd:story-continue - Resume work before saving/sdd:story-review - Move to review after saving/sdd:story-start - Begin development before implementation/sdd:project-status - View all stories and their status