@windagency/valora-plugin-engineering 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,401 @@
1
+ ---
2
+ name: create-pr
3
+ description: Generate and submit pull requests with intelligent title/description generation, automated reviewer assignment, label management, and quality validation
4
+ experimental: true
5
+ argument-hint: '[--title="<custom-title>"] [--draft] [--base=<branch>] [--reviewers=<user1,user2>] [--labels=<label1,label2>] [--auto-assign] [--template=<name>] [--link-issues] [--require-checks] [--auto-merge] [--squash] [--no-push]'
6
+ allowed-tools:
7
+ - codebase_search
8
+ - read_file
9
+ - grep
10
+ - list_dir
11
+ - glob_file_search
12
+ - run_terminal_cmd
13
+ # MCP: GitHub for PR creation, commits, issues, branches
14
+ - mcp_github
15
+ model: claude-haiku-4.5
16
+ agent: lead
17
+ prompts:
18
+ pipeline:
19
+ # Stage 1: Analyze Git Branch State
20
+ - stage: context
21
+ prompt: context.analyze-git-branch
22
+ required: true
23
+ inputs:
24
+ base_branch_arg: $ARG_base
25
+ outputs:
26
+ - current_branch
27
+ - base_branch
28
+ - branch_name_convention
29
+ - commits_ahead
30
+ - commits_behind
31
+
32
+ # Stage 2: Extract Ticket References (Conditional)
33
+ - stage: context
34
+ prompt: context.extract-ticket-references
35
+ required: false
36
+ conditional: $ARG_link_issues == true
37
+ inputs:
38
+ current_branch: $STAGE_context.current_branch
39
+ commits_ahead: $STAGE_context.commits_ahead
40
+ outputs:
41
+ - related_issues
42
+ - ticket_numbers
43
+ - issue_titles
44
+
45
+ # Stage 3: Analyze Commits for PR
46
+ - stage: context
47
+ prompt: context.analyze-commits-for-pr
48
+ required: true
49
+ inputs:
50
+ current_branch: $STAGE_context.current_branch
51
+ base_branch: $STAGE_context.base_branch
52
+ commits_ahead: $STAGE_context.commits_ahead
53
+ outputs:
54
+ - commit_messages
55
+ - change_summary
56
+ - affected_files
57
+ - change_types
58
+ - breaking_changes
59
+ - authors
60
+
61
+ # Stage 4: Load PR Template (Conditional)
62
+ - stage: context
63
+ prompt: context.load-pr-template
64
+ required: false
65
+ conditional: $ARG_template != null
66
+ inputs:
67
+ template_name: $ARG_template
68
+ outputs:
69
+ - template_content
70
+ - required_sections
71
+ - checklist_items
72
+
73
+ # Stage 5: Analyze Codebase Changes (Parallel)
74
+ - stage: context
75
+ prompt: context.analyze-codebase-changes
76
+ required: true
77
+ parallel: true
78
+ inputs:
79
+ affected_files: $STAGE_context.affected_files
80
+ change_types: $STAGE_context.change_types
81
+ outputs:
82
+ - impact_areas
83
+ - test_coverage_delta
84
+ - complexity_metrics
85
+ - dependencies_changed
86
+
87
+ # Stage 6: Validate PR Readiness
88
+ - stage: review
89
+ prompt: review.validate-pr-readiness
90
+ required: true
91
+ inputs:
92
+ change_summary: $STAGE_context.change_summary
93
+ breaking_changes: $STAGE_context.breaking_changes
94
+ test_coverage_delta: $STAGE_context.test_coverage_delta
95
+ complexity_metrics: $STAGE_context.complexity_metrics
96
+ outputs:
97
+ - pr_ready
98
+ - readiness_issues
99
+ - quality_score
100
+ - recommendations
101
+
102
+ # Stage 7: Generate PR Title
103
+ - stage: code
104
+ prompt: code.generate-pr-title
105
+ required: true
106
+ inputs:
107
+ custom_title: $ARG_title
108
+ change_summary: $STAGE_context.change_summary
109
+ change_types: $STAGE_context.change_types
110
+ ticket_numbers: $STAGE_context.ticket_numbers
111
+ branch_name_convention: $STAGE_context.branch_name_convention
112
+ outputs:
113
+ - pr_title
114
+ - title_format
115
+
116
+ # Stage 8: Generate PR Description
117
+ - stage: code
118
+ prompt: code.generate-pr-description
119
+ required: true
120
+ inputs:
121
+ template_content: $STAGE_context.template_content
122
+ change_summary: $STAGE_context.change_summary
123
+ commit_messages: $STAGE_context.commit_messages
124
+ affected_files: $STAGE_context.affected_files
125
+ breaking_changes: $STAGE_context.breaking_changes
126
+ related_issues: $STAGE_context.related_issues
127
+ impact_areas: $STAGE_context.impact_areas
128
+ test_coverage_delta: $STAGE_context.test_coverage_delta
129
+ complexity_metrics: $STAGE_context.complexity_metrics
130
+ outputs:
131
+ - pr_description
132
+ - description_sections
133
+
134
+ # Stage 9: Determine Reviewers
135
+ - stage: code
136
+ prompt: code.determine-reviewers
137
+ required: true
138
+ inputs:
139
+ reviewers_arg: $ARG_reviewers
140
+ auto_assign: $ARG_auto_assign
141
+ affected_files: $STAGE_context.affected_files
142
+ impact_areas: $STAGE_context.impact_areas
143
+ authors: $STAGE_context.authors
144
+ outputs:
145
+ - reviewers_list
146
+ - reviewer_rationale
147
+
148
+ # Stage 10: Determine Labels
149
+ - stage: code
150
+ prompt: code.determine-labels
151
+ required: true
152
+ inputs:
153
+ labels_arg: $ARG_labels
154
+ change_types: $STAGE_context.change_types
155
+ impact_areas: $STAGE_context.impact_areas
156
+ breaking_changes: $STAGE_context.breaking_changes
157
+ complexity_metrics: $STAGE_context.complexity_metrics
158
+ outputs:
159
+ - labels_list
160
+ - label_rationale
161
+
162
+ # Stage 11: Push and Create PR
163
+ - stage: code
164
+ prompt: code.push-and-create-pr
165
+ required: true
166
+ inputs:
167
+ current_branch: $STAGE_context.current_branch
168
+ base_branch: $STAGE_context.base_branch
169
+ pr_title: $STAGE_code.pr_title
170
+ pr_description: $STAGE_code.pr_description
171
+ reviewers_list: $STAGE_code.reviewers_list
172
+ labels_list: $STAGE_code.labels_list
173
+ draft: $ARG_draft
174
+ no_push: $ARG_no_push
175
+ outputs:
176
+ - pr_url
177
+ - pr_number
178
+ - push_status
179
+
180
+ # Stage 12: Validate PR Creation
181
+ - stage: validation
182
+ prompt: review.validate-pr-creation
183
+ required: true
184
+ inputs:
185
+ pr_url: $STAGE_code.pr_url
186
+ pr_number: $STAGE_code.pr_number
187
+ require_checks: $ARG_require_checks
188
+ outputs:
189
+ - pr_status
190
+ - validation_result
191
+ - next_steps
192
+ merge_strategy: sequential
193
+ rollback_on_failure: context
194
+ cache_strategy: stage
195
+ retry_policy:
196
+ max_attempts: 2
197
+ backoff_ms: 1000
198
+ retry_on:
199
+ - timeout
200
+ - error
201
+ ---
202
+
203
+ # Pull Request Creation Command
204
+
205
+ ## Role
206
+
207
+ Use the [agent] profile
208
+
209
+ ## Goal
210
+
211
+ Generate and submit a comprehensive, well-structured pull request through a 12-stage pipeline:
212
+
213
+ 1. **Context Gathering** (Stages 1-5): Analyze Git state, commits, templates, and codebase changes
214
+ 2. **Validation** (Stage 6): Ensure PR meets quality standards before creation
215
+ 3. **Content Generation** (Stages 7-10): Generate title, description, reviewers, and labels
216
+ 4. **Submission** (Stage 11): Push branch and create PR
217
+ 5. **Post-Creation** (Stage 12): Validate successful creation and provide next steps
218
+
219
+ The pipeline automatically handles conventional commits, CODEOWNERS, issue linking, and quality validation.
220
+
221
+ ## Pipeline Overview
222
+
223
+ The command executes 12 sequential stages (with one parallel stage):
224
+
225
+ **Context Stages** (1-5):
226
+
227
+ - `context.analyze-git-branch`: Identify branch, base, commits ahead/behind
228
+ - `context.extract-ticket-references`: Parse issue/ticket references (conditional)
229
+ - `context.analyze-commits-for-pr`: Extract commit details, changes, breaking changes
230
+ - `context.load-pr-template`: Load repository PR template (conditional)
231
+ - `context.analyze-codebase-changes`: Deep analysis of impact and coverage (parallel)
232
+
233
+ **Review Stages** (6, 12):
234
+
235
+ - `review.validate-pr-readiness`: Quality checks before PR creation
236
+ - `review.validate-pr-creation`: Verify successful creation
237
+
238
+ **Code Stages** (7-11):
239
+
240
+ - `code.generate-pr-title`: Create concise, conventional title
241
+ - `code.generate-pr-description`: Generate comprehensive description
242
+ - `code.determine-reviewers`: Auto-assign based on CODEOWNERS/history
243
+ - `code.determine-labels`: Auto-detect labels from changes
244
+ - `code.push-and-create-pr`: Push and submit PR
245
+
246
+ Each stage produces outputs consumed by subsequent stages. See individual prompts for detailed instructions.
247
+
248
+ ## Context
249
+
250
+ ```plaintext
251
+ $ARGUMENTS
252
+ ```
253
+
254
+ ### Available Arguments
255
+
256
+ - `--title="<custom-title>"`: Override auto-generated title
257
+ - `--draft`: Create PR as draft
258
+ - `--base=<branch>`: Specify base branch (default: auto-detect)
259
+ - `--reviewers=<user1,user2>`: Manually assign reviewers
260
+ - `--labels=<label1,label2>`: Manually assign labels
261
+ - `--auto-assign`: Automatically assign reviewers based on CODEOWNERS
262
+ - `--template=<name>`: Use specific PR template
263
+ - `--link-issues`: Automatically link related issues
264
+ - `--require-checks`: Validate CI checks before finalizing
265
+ - `--auto-merge`: Enable auto-merge on approval
266
+ - `--squash`: Configure squash merge as preferred method
267
+ - `--no-push`: Skip pushing branch (for testing)
268
+
269
+ ## Core Principles
270
+
271
+ **Quality First**:
272
+
273
+ - Validate PR readiness before creation (quality score ≥70%)
274
+ - Ensure proper test coverage for new features
275
+ - Document breaking changes with migration guides
276
+ - Follow conventional commit format
277
+ - Respect CODEOWNERS and team conventions
278
+
279
+ **Automation**:
280
+
281
+ - Auto-detect change types from commits
282
+ - Auto-assign reviewers based on file ownership
283
+ - Auto-apply labels based on impact analysis
284
+ - Auto-link related issues from commits/branches
285
+ - Auto-generate descriptive titles and descriptions
286
+
287
+ **Clarity**:
288
+
289
+ - Comprehensive PR descriptions with context
290
+ - Clear titles following `type(scope): description` format
291
+ - Rationale for reviewer assignments
292
+ - Quality metrics and recommendations
293
+ - Actionable next steps
294
+
295
+ ## Success Criteria
296
+
297
+ - ✅ PR created with clear title and description
298
+ - ✅ Appropriate reviewers assigned (if `--auto-assign`)
299
+ - ✅ Relevant labels applied
300
+ - ✅ Related issues linked (if `--link-issues`)
301
+ - ✅ CI checks initiated
302
+ - ✅ Quality score ≥ 70/100
303
+ - ✅ No blocking readiness issues
304
+
305
+ ## Workflow Integration
306
+
307
+ **Entry Point**: After implementation phase, before code review
308
+
309
+ **Exit Paths**:
310
+
311
+ - ✅ **Success**: PR created → Proceed to code review
312
+ - ⚠️ **Validation Warnings**: PR created with recommendations
313
+ - 🔴 **Validation Failure**: Address quality issues before PR creation
314
+
315
+ **Follows Template**: [Pull Request](../templates/PULL_REQUEST.md)
316
+
317
+ ## Command Output Summary
318
+
319
+ Print the following summary at command completion:
320
+
321
+ **For successful PR creation:**
322
+
323
+ ```markdown
324
+ ## ✅ Pull Request Created
325
+
326
+ **PR Number**: #[number]
327
+ **URL**: [pr-url]
328
+ **Status**: [Draft | Ready for Review]
329
+
330
+ ### PR Details
331
+
332
+ - **Title**: [pr-title]
333
+ - **Base**: [base-branch] ← [feature-branch]
334
+ - **Commits**: [N] commits
335
+
336
+ ### Reviewers & Labels
337
+
338
+ - **Reviewers**: [assigned-reviewers]
339
+ - **Labels**: [applied-labels]
340
+
341
+ ### Quality Score
342
+
343
+ - **Readiness**: [XX]/100
344
+ - **CI Status**: Pending
345
+
346
+ ### PR Description Preview
347
+
348
+ > [First 2-3 lines of description]
349
+
350
+ ### Next Step
351
+
352
+ → Await code review and approval
353
+ → `/feedback` after PR is merged
354
+ ```
355
+
356
+ **For PR with warnings:**
357
+
358
+ ```markdown
359
+ ## ⚠️ Pull Request Created with Warnings
360
+
361
+ **PR Number**: #[number]
362
+ **URL**: [pr-url]
363
+ **Status**: Ready for Review (with notes)
364
+
365
+ ### Warnings
366
+
367
+ - ⚠️ [Warning 1]
368
+ - ⚠️ [Warning 2]
369
+
370
+ ### Recommendations
371
+
372
+ - [Recommendation 1]
373
+ - [Recommendation 2]
374
+
375
+ ### Next Step
376
+
377
+ → Review warnings before requesting reviews
378
+ → Consider addressing recommendations
379
+ ```
380
+
381
+ **For validation failure:**
382
+
383
+ ```markdown
384
+ ## ❌ Pull Request Not Created
385
+
386
+ **Reason**: Quality validation failed
387
+ **Readiness Score**: [XX]/100 (below 70% threshold)
388
+
389
+ ### Blocking Issues
390
+
391
+ 1. **[Issue]**: [Description]
392
+ 2. **[Issue]**: [Description]
393
+
394
+ ### Required Actions
395
+
396
+ - [Action to fix issue]
397
+
398
+ ### Next Step
399
+
400
+ → Address issues and re-run `/create-pr`
401
+ ```