-
Notifications
You must be signed in to change notification settings - Fork 50
Open
Description
Description
We have duplicate PR creation logic in both work_issue and create_pr prompts. This creates a maintenance burden and violates DRY principles. We should extract the common PR creation logic into a Handlebars partial that both prompts can use.
Context
- Project area: MCP Server / Prompt Templates
- Related to: Improve work_issue command: add git sync check and remove redundancies #30 (improved work_issue prompt), SQLite database lock error when using log_activity tool #33 (database fixes)
- Complexity: 4/10
Technical Details
- Affected files:
mcp-server/src/templates/prompts/create_pr.yaml- Refactor to use new partialmcp-server/src/templates/prompts/work_issue.yaml- Refactor to use new partialmcp-server/src/templates/prompts/partials/_pr_creation.hbs- New partial to create
- Key functions/classes: Handlebars partial system, prompt templates
Requirements
Current Problems
- Duplicate PR creation logic in two places (maintenance burden)
- create_pr prompt has prescriptive git commands (against new standards from Improve work_issue command: add git sync check and remove redundancies #30)
- No single source of truth for PR creation
Proposed Solution
- Extract PR creation logic into a shared Handlebars partial (e.g.,
_pr_creation.hbs) create_pr.yamlkeeps its context gathering (fetch issue, analyze changes) then uses partialwork_issue.yamlskips context gathering (already has it) and uses the partial- Update
create_prto follow new prompt standards (no prescriptive commands)
Benefits
- Single source of truth for PR creation
- Context-aware usage (create_pr gathers context, work_issue already has it)
- Follows DRY principles
- Uses existing Handlebars infrastructure
Implementation Steps
- Step 1: Create new partial file
_pr_creation.hbsin partials directory - Step 2: Extract common PR creation logic from work_issue.yaml step 6
- Step 3: Define partial interface (expected variables: title, body, issue number, etc.)
- Step 4: Update work_issue.yaml to use {{> pr_creation}} instead of inline logic
- Step 5: Remove prescriptive git commands from create_pr.yaml
- Step 6: Update create_pr.yaml to use {{> pr_creation}} for PR creation
- Step 7: Test both prompts to ensure they still work correctly
Acceptance Criteria
- Single
_pr_creation.hbspartial contains all PR creation logic - Both
create_prandwork_issueprompts use the shared partial - No duplicate PR creation code exists
-
create_prprompt follows new standards (no prescriptive commands) - Both prompts successfully create PRs when tested
- Partial gracefully handles missing optional parameters
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request