// AI-powered PR creation after spec completion. Analyzes spec metadata, git diffs, commit history, and journal entries to generate comprehensive PR descriptions with user approval before creation.
| name | sdd-pr |
| description | AI-powered PR creation after spec completion. Analyzes spec metadata, git diffs, commit history, and journal entries to generate comprehensive PR descriptions with user approval before creation. |
The sdd-pr skill creates professional, comprehensive pull requests by analyzing your completed specs and git history. Instead of manually writing PR descriptions, this skill uses AI to analyze all available context and generate detailed, well-structured PR descriptions that make code review more effective.
Use Skill(sdd-toolkit:sdd-pr) to:
When NOT to use:
This skill may run operations that take up to 5 minutes. Be patient and wait for completion.
Bash(command="...", timeout=300000)run_in_background=True for test suites, builds, or analysisPolling BashOutput repeatedly creates spam and degrades user experience. Long operations should run in foreground with appropriate timeout, not in background with frequent polling.
# Test suite that might take 5 minutes (timeout in milliseconds)
result = Bash(command="pytest src/", timeout=300000) # Wait up to 5 minutes
# The command will block here until completion - this is correct behavior
# Don't use background + polling
bash_id = Bash(command="pytest", run_in_background=True)
output = BashOutput(bash_id) # Creates spam!
Traditional PR creation uses static templates that miss important context. The sdd-pr skill:
Analyzes Multiple Sources
Generates Context-Aware Descriptions
Requires User Approval
The skill is typically invoked via handoff from sdd-update after spec completion:
Skill(sdd-toolkit:sdd-pr) "Create PR for spec my-feature-2025-11-03-001"
The skill gathers context from multiple sources:
Spec Metadata
{
"title": "Add user authentication",
"description": "Implement OAuth 2.0 authentication...",
"objectives": ["Support GitHub and Google OAuth providers", ...]
}
Completed Tasks
Commit History
Journal Entries
Git Diff
The agent analyzes all gathered context to:
The agent generates a comprehensive PR description following best practices:
═══════════════════════════════════════════════════════════════════
Pull Request Draft
═══════════════════════════════════════════════════════════════════
Title: Add user authentication with OAuth 2.0
Branch: feat-auth → main
─────────────────────────────────────────────────────────────────────
## Summary
Adds user authentication using OAuth 2.0, supporting GitHub and Google
providers. Includes login/logout flows, session management, and profile access.
## What Changed
### Key Features
- OAuth 2.0 integration with GitHub and Google
- Secure session management with httpOnly cookies
- User profile endpoint with auth middleware
### Files Modified
- `src/auth/oauth.py`: OAuth provider implementation
- `src/auth/middleware.py`: Auth middleware
- `src/api/routes.py`: Login/logout/profile endpoints
## Technical Approach
Chose OAuth 2.0 over JWT-based auth for better security and simpler
implementation. OAuth handles token refresh automatically and provides
better user experience with provider-managed consent screens.
## Implementation Details
### Phase 1: OAuth Integration
- ✅ Implement OAuth provider classes
- ✅ Add callback URL handling
- ✅ Store tokens securely
### Phase 2: Session Management
- ✅ Create session middleware
- ✅ Implement logout functionality
## Testing
- Added 15 unit tests for OAuth providers
- Verified login/logout flows manually
- Tested with both GitHub and Google accounts
## Commits
- abc1234: task-1-1: Implement OAuth providers
- def5678: task-1-2: Add session middleware
- ghi9012: task-2-1: Create profile endpoint
─────────────────────────────────────────────────────────────────────
The agent shows the draft and asks for user approval:
Agent: "Here's the PR description I've generated:
[shows full PR with title and body]
Would you like me to create this PR, or would you like me to revise it?"
Once approved, the agent invokes the creation command:
sdd create-pr spec-id --approve --title "PR Title" --description "$(cat <<'EOF'
[full PR body]
EOF
)"
The skill then:
gh CLI immediately (no additional confirmation)The skill analyzes four key sources:
High-level information about the feature/change:
Granular details about implementation:
Development progression:
Decision logs and notes:
CLI Command:
sdd get-journal <spec-id> [--task-id <task-id>]
Actual code changes:
The generated PR follows this structure:
Add user authentication with OAuth 2.0
Action-oriented, specific, concise.
High-level overview of what changed and why it matters.
Explains key decisions and technical rationale from journal entries.
Breakdown by phase with completed tasks.
Verification steps and test coverage.
Development history showing progression.
Write Detailed Journal Entries The AI uses journal entries to explain technical decisions:
sdd journal my-spec --content "Chose approach X because of Y..."
Use Clear Commit Messages Commit messages help explain the development flow:
git commit -m "task-1-1: Implement OAuth provider classes"
Review Before Approving Always review the draft and ask for revisions if needed:
"Can you emphasize the security aspects more?"
Keep Specs Updated Ensure spec metadata is current before completion:
# Skill invoked after spec completion
Skill(sdd-toolkit:sdd-pr) "Create PR for oauth-feature-2025-11-03-001"
# Agent analyzes context and shows draft
# User reviews and approves
# PR created automatically
Generated PR: Comprehensive description with OAuth implementation details, security considerations, and testing approach.
# Skill invoked for bug fix spec
Skill(sdd-toolkit:sdd-pr) "Create PR for memory-leak-fix-2025-11-03-002"
# Agent analyzes and shows draft
# PR explains root cause, fix approach, and verification
Generated PR: Detailed bug analysis with root cause from journal entries, fix implementation, and memory usage improvements.
# Invoke skill directly with prompt
Skill(sdd-toolkit:sdd-pr) "Create PR for spec refactor-api-2025-11-03-003"
# Agent gathers context, analyzes, and shows draft
# Review and approve
# PR created
Problem: Spec doesn't have branch information
Solution: Ensure git integration is enabled when creating the spec. The spec must have branch metadata.
Problem: Git push errors
Solution:
# Check remote
git remote -v
# Check credentials
git push -u origin <branch-name>
Problem: Git diff exceeds size limit
Solution: Skill automatically shows file-level summary instead of full diff when it's too large.