@balazsbarta/mp-skills 0.1.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.
- package/.agents/skills/brainstorming/SKILL.md +201 -0
- package/.agents/skills/brainstorming/references/option-evaluation.md +64 -0
- package/.agents/skills/brainstorming/references/questioning-playbook.md +57 -0
- package/.agents/skills/brainstorming/references/repo-analysis.md +60 -0
- package/.agents/skills/conventional-commits/SKILL.md +124 -0
- package/.agents/skills/conventional-commits/references/commit-types-scopes.md +75 -0
- package/.agents/skills/conventional-commits/references/semantic-release.md +71 -0
- package/.agents/skills/jest/SKILL.md +219 -0
- package/.agents/skills/jest/references/common-errors.md +274 -0
- package/.agents/skills/jest/references/configuration.md +175 -0
- package/.agents/skills/jest/references/embedded-docs.md +44 -0
- package/.agents/skills/jest/references/mocking.md +206 -0
- package/.agents/skills/jest/references/remote-docs.md +19 -0
- package/.agents/skills/jest/references/snapshot-testing.md +181 -0
- package/.agents/skills/jest/references/transforms.md +216 -0
- package/.agents/skills/maestro/SKILL.md +230 -0
- package/.agents/skills/maestro/references/assertions-commands.md +259 -0
- package/.agents/skills/maestro/references/common-errors.md +273 -0
- package/.agents/skills/maestro/references/eas-ci-integration.md +219 -0
- package/.agents/skills/maestro/references/flow-authoring.md +224 -0
- package/.agents/skills/maestro/references/remote-docs.md +23 -0
- package/.agents/skills/mastra/SKILL.md +159 -0
- package/.agents/skills/mastra/references/common-errors.md +535 -0
- package/.agents/skills/mastra/references/create-mastra.md +220 -0
- package/.agents/skills/mastra/references/embedded-docs.md +123 -0
- package/.agents/skills/mastra/references/migration-guide.md +180 -0
- package/.agents/skills/mastra/references/remote-docs.md +193 -0
- package/.agents/skills/next-js/SKILL.md +209 -0
- package/.agents/skills/next-js/references/api-routes.md +213 -0
- package/.agents/skills/next-js/references/app-router.md +206 -0
- package/.agents/skills/next-js/references/caching-revalidation.md +211 -0
- package/.agents/skills/next-js/references/common-errors.md +251 -0
- package/.agents/skills/next-js/references/embedded-docs.md +43 -0
- package/.agents/skills/next-js/references/metadata-seo.md +257 -0
- package/.agents/skills/next-js/references/remote-docs.md +22 -0
- package/.agents/skills/playwright/SKILL.md +218 -0
- package/.agents/skills/playwright/references/ci-configuration.md +208 -0
- package/.agents/skills/playwright/references/common-errors.md +258 -0
- package/.agents/skills/playwright/references/embedded-docs.md +41 -0
- package/.agents/skills/playwright/references/fixtures-assertions.md +208 -0
- package/.agents/skills/playwright/references/page-objects.md +167 -0
- package/.agents/skills/playwright/references/remote-docs.md +23 -0
- package/.agents/skills/playwright/references/visual-regression.md +206 -0
- package/.agents/skills/pull-request-lifecycle/SKILL.md +116 -0
- package/.agents/skills/pull-request-lifecycle/references/changelog-versioning.md +72 -0
- package/.agents/skills/pull-request-lifecycle/references/merge-strategies.md +33 -0
- package/.agents/skills/pull-request-lifecycle/references/pr-description-template.md +72 -0
- package/.agents/skills/pull-request-lifecycle/references/review-process.md +54 -0
- package/.agents/skills/pull-request-lifecycle/scripts/code_review.py +220 -0
- package/.agents/skills/react-native-expo/SKILL.md +212 -0
- package/.agents/skills/react-native-expo/references/common-errors.md +251 -0
- package/.agents/skills/react-native-expo/references/eas-build-submit.md +238 -0
- package/.agents/skills/react-native-expo/references/embedded-docs.md +42 -0
- package/.agents/skills/react-native-expo/references/native-modules.md +181 -0
- package/.agents/skills/react-native-expo/references/navigation-setup.md +229 -0
- package/.agents/skills/react-native-expo/references/remote-docs.md +23 -0
- package/.agents/skills/supabase/SKILL.md +216 -0
- package/.agents/skills/supabase/references/auth-setup.md +206 -0
- package/.agents/skills/supabase/references/common-errors.md +285 -0
- package/.agents/skills/supabase/references/edge-functions.md +178 -0
- package/.agents/skills/supabase/references/embedded-docs.md +43 -0
- package/.agents/skills/supabase/references/migrations.md +193 -0
- package/.agents/skills/supabase/references/remote-docs.md +24 -0
- package/.agents/skills/supabase/references/rls-policies.md +187 -0
- package/.agents/skills/supabase/references/storage.md +182 -0
- package/.agents/skills/task-breakdown/SKILL.md +179 -0
- package/.agents/skills/task-breakdown/references/acceptance-criteria.md +165 -0
- package/.agents/skills/task-breakdown/references/epic-story-format.md +209 -0
- package/.agents/skills/task-breakdown/references/estimation-guide.md +140 -0
- package/.agents/skills/vitest/SKILL.md +219 -0
- package/.agents/skills/vitest/references/common-errors.md +271 -0
- package/.agents/skills/vitest/references/component-testing.md +182 -0
- package/.agents/skills/vitest/references/configuration.md +184 -0
- package/.agents/skills/vitest/references/coverage.md +179 -0
- package/.agents/skills/vitest/references/embedded-docs.md +43 -0
- package/.agents/skills/vitest/references/mocking.md +182 -0
- package/.agents/skills/vitest/references/remote-docs.md +22 -0
- package/README.md +235 -0
- package/package.json +20 -0
- package/scripts/skills.mjs +849 -0
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
# Visual Regression Testing
|
|
2
|
+
|
|
3
|
+
Configure screenshot comparison testing with Playwright.
|
|
4
|
+
|
|
5
|
+
## When to use this reference
|
|
6
|
+
|
|
7
|
+
- Adding visual regression tests to catch UI changes
|
|
8
|
+
- Configuring screenshot comparison thresholds
|
|
9
|
+
- Managing visual snapshots across environments
|
|
10
|
+
|
|
11
|
+
## Basic visual test
|
|
12
|
+
|
|
13
|
+
```typescript
|
|
14
|
+
import { test, expect } from '@playwright/test';
|
|
15
|
+
|
|
16
|
+
test('homepage visual', async ({ page }) => {
|
|
17
|
+
await page.goto('/');
|
|
18
|
+
await expect(page).toHaveScreenshot('homepage.png');
|
|
19
|
+
});
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
First run creates the reference screenshot. Subsequent runs compare against it.
|
|
23
|
+
|
|
24
|
+
## Element screenshot
|
|
25
|
+
|
|
26
|
+
```typescript
|
|
27
|
+
test('button visual', async ({ page }) => {
|
|
28
|
+
await page.goto('/components');
|
|
29
|
+
const button = page.getByRole('button', { name: 'Submit' });
|
|
30
|
+
await expect(button).toHaveScreenshot('submit-button.png');
|
|
31
|
+
});
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
## Configuration options
|
|
35
|
+
|
|
36
|
+
### Threshold
|
|
37
|
+
|
|
38
|
+
```typescript
|
|
39
|
+
await expect(page).toHaveScreenshot('page.png', {
|
|
40
|
+
maxDiffPixels: 100, // Allow up to 100 different pixels
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
await expect(page).toHaveScreenshot('page.png', {
|
|
44
|
+
maxDiffPixelRatio: 0.01, // Allow 1% pixel difference
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
await expect(page).toHaveScreenshot('page.png', {
|
|
48
|
+
threshold: 0.2, // Per-pixel color threshold (0-1)
|
|
49
|
+
});
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
### Global config
|
|
53
|
+
|
|
54
|
+
```typescript
|
|
55
|
+
// playwright.config.ts
|
|
56
|
+
export default defineConfig({
|
|
57
|
+
expect: {
|
|
58
|
+
toHaveScreenshot: {
|
|
59
|
+
maxDiffPixelRatio: 0.01,
|
|
60
|
+
threshold: 0.2,
|
|
61
|
+
},
|
|
62
|
+
},
|
|
63
|
+
});
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
## Masking dynamic content
|
|
67
|
+
|
|
68
|
+
Hide elements that change between runs (timestamps, ads, avatars):
|
|
69
|
+
|
|
70
|
+
```typescript
|
|
71
|
+
test('dashboard visual', async ({ page }) => {
|
|
72
|
+
await page.goto('/dashboard');
|
|
73
|
+
await expect(page).toHaveScreenshot('dashboard.png', {
|
|
74
|
+
mask: [
|
|
75
|
+
page.getByTestId('timestamp'),
|
|
76
|
+
page.getByTestId('avatar'),
|
|
77
|
+
page.locator('.ad-banner'),
|
|
78
|
+
],
|
|
79
|
+
});
|
|
80
|
+
});
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
## Updating snapshots
|
|
84
|
+
|
|
85
|
+
```bash
|
|
86
|
+
# Update all visual snapshots
|
|
87
|
+
npx playwright test --update-snapshots
|
|
88
|
+
|
|
89
|
+
# Update specific test
|
|
90
|
+
npx playwright test visual.spec.ts --update-snapshots
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
## Snapshot directory structure
|
|
94
|
+
|
|
95
|
+
```
|
|
96
|
+
tests/
|
|
97
|
+
├── visual.spec.ts
|
|
98
|
+
└── visual.spec.ts-snapshots/
|
|
99
|
+
├── homepage-chromium-linux.png
|
|
100
|
+
├── homepage-firefox-linux.png
|
|
101
|
+
└── homepage-webkit-linux.png
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
Screenshots are browser and platform-specific by default.
|
|
105
|
+
|
|
106
|
+
## Cross-platform snapshots
|
|
107
|
+
|
|
108
|
+
### Problem
|
|
109
|
+
|
|
110
|
+
Screenshots differ between macOS, Linux, and Windows (font rendering, anti-aliasing).
|
|
111
|
+
|
|
112
|
+
### Solutions
|
|
113
|
+
|
|
114
|
+
**Option 1: Generate on CI only** (recommended)
|
|
115
|
+
|
|
116
|
+
```bash
|
|
117
|
+
# Generate reference screenshots in CI
|
|
118
|
+
npx playwright test --update-snapshots
|
|
119
|
+
# Commit the snapshots from CI
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
**Option 2: Docker for consistent rendering**
|
|
123
|
+
|
|
124
|
+
```bash
|
|
125
|
+
docker run --rm -v $(pwd):/work -w /work mcr.microsoft.com/playwright:v1.49.0-noble \
|
|
126
|
+
npx playwright test --update-snapshots
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
**Option 3: Increase threshold**
|
|
130
|
+
|
|
131
|
+
```typescript
|
|
132
|
+
expect: {
|
|
133
|
+
toHaveScreenshot: {
|
|
134
|
+
maxDiffPixelRatio: 0.05, // More lenient
|
|
135
|
+
},
|
|
136
|
+
},
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
## Full page screenshots
|
|
140
|
+
|
|
141
|
+
```typescript
|
|
142
|
+
test('full page visual', async ({ page }) => {
|
|
143
|
+
await page.goto('/long-page');
|
|
144
|
+
await expect(page).toHaveScreenshot('full-page.png', {
|
|
145
|
+
fullPage: true,
|
|
146
|
+
});
|
|
147
|
+
});
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
## Animations
|
|
151
|
+
|
|
152
|
+
Disable animations to avoid flaky visual tests:
|
|
153
|
+
|
|
154
|
+
```typescript
|
|
155
|
+
// playwright.config.ts
|
|
156
|
+
export default defineConfig({
|
|
157
|
+
use: {
|
|
158
|
+
// Disable CSS animations and transitions
|
|
159
|
+
launchOptions: {
|
|
160
|
+
args: ['--force-prefers-reduced-motion'],
|
|
161
|
+
},
|
|
162
|
+
},
|
|
163
|
+
});
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
Or via CSS:
|
|
167
|
+
|
|
168
|
+
```typescript
|
|
169
|
+
test('stable visual', async ({ page }) => {
|
|
170
|
+
await page.goto('/');
|
|
171
|
+
// Disable animations
|
|
172
|
+
await page.addStyleTag({
|
|
173
|
+
content: '*, *::before, *::after { animation: none !important; transition: none !important; }',
|
|
174
|
+
});
|
|
175
|
+
await expect(page).toHaveScreenshot('page.png');
|
|
176
|
+
});
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
## CI workflow for visual tests
|
|
180
|
+
|
|
181
|
+
```yaml
|
|
182
|
+
- name: Run visual tests
|
|
183
|
+
run: npx playwright test --grep @visual
|
|
184
|
+
|
|
185
|
+
- name: Upload diff artifacts
|
|
186
|
+
uses: actions/upload-artifact@v4
|
|
187
|
+
if: failure()
|
|
188
|
+
with:
|
|
189
|
+
name: visual-diffs
|
|
190
|
+
path: test-results/
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
## Troubleshooting
|
|
194
|
+
|
|
195
|
+
### Screenshots always differ
|
|
196
|
+
|
|
197
|
+
- Check for animations → disable them
|
|
198
|
+
- Check for dynamic content → mask it
|
|
199
|
+
- Check for font loading → wait for fonts
|
|
200
|
+
- Increase `maxDiffPixelRatio` threshold
|
|
201
|
+
|
|
202
|
+
### Different results on CI vs local
|
|
203
|
+
|
|
204
|
+
- Use Docker for consistent rendering
|
|
205
|
+
- Or generate snapshots in CI and commit them
|
|
206
|
+
- Never mix snapshots from different platforms
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: pull-request-lifecycle
|
|
3
|
+
description: "Deterministic Machinery Partner pull request workflow. Produces a fixed PR format, updates version/changelog, and creates a PR with GitHub CLI."
|
|
4
|
+
license: MIT
|
|
5
|
+
metadata:
|
|
6
|
+
author: Balazs Barta
|
|
7
|
+
version: "2.0.0"
|
|
8
|
+
repository: https://github.com/balazsbarta/mp-skills
|
|
9
|
+
tags:
|
|
10
|
+
- git
|
|
11
|
+
- pull-request
|
|
12
|
+
- changelog
|
|
13
|
+
- versioning
|
|
14
|
+
- github
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
# Machinery Partner Pull Request Workflow
|
|
18
|
+
|
|
19
|
+
Use this skill when the user asks to prepare a pull request. This workflow is deterministic and always produces the same structure.
|
|
20
|
+
|
|
21
|
+
## Workflow contract
|
|
22
|
+
|
|
23
|
+
- Use exactly two checkpoints:
|
|
24
|
+
1. Step 0 review opt-in
|
|
25
|
+
2. Step 1 plan approval
|
|
26
|
+
- Do not ask extra preference questions beyond these checkpoints.
|
|
27
|
+
- Do not add extra PR description sections beyond the required template.
|
|
28
|
+
- PR title format is always `[VERSION] - Description`.
|
|
29
|
+
- CHANGELOG heading format is always `## [VERSION]() - YYYY-MM-DD`.
|
|
30
|
+
|
|
31
|
+
## Prerequisites
|
|
32
|
+
|
|
33
|
+
- `git` repository
|
|
34
|
+
- `gh` CLI authenticated
|
|
35
|
+
- `python3` available
|
|
36
|
+
- `package.json` present
|
|
37
|
+
- `CHANGELOG.md` present
|
|
38
|
+
|
|
39
|
+
If a required file or command is missing, stop and report the exact missing dependency with a remediation command.
|
|
40
|
+
|
|
41
|
+
## Step 0: Optional automated code review
|
|
42
|
+
|
|
43
|
+
Ask exactly:
|
|
44
|
+
|
|
45
|
+
`Would you like to run automated code review before creating the PR?`
|
|
46
|
+
|
|
47
|
+
- If user says yes, run:
|
|
48
|
+
`python3 .agents/skills/pull-request-lifecycle/scripts/code_review.py`
|
|
49
|
+
- If user says no, skip to Step 1.
|
|
50
|
+
|
|
51
|
+
Interpret exit codes from the script:
|
|
52
|
+
|
|
53
|
+
- `0`: Review passed or warnings only
|
|
54
|
+
- `2`: Critical issues found
|
|
55
|
+
- `1`: Script or tooling failure; stop and report output
|
|
56
|
+
|
|
57
|
+
If exit code is `2`, present findings and ask the user to choose one:
|
|
58
|
+
|
|
59
|
+
- Fix issues before continuing
|
|
60
|
+
- Skip issues and proceed with PR
|
|
61
|
+
- Cancel PR creation
|
|
62
|
+
|
|
63
|
+
If user chooses cancel, stop the workflow.
|
|
64
|
+
|
|
65
|
+
## Step 1: Present PR plan
|
|
66
|
+
|
|
67
|
+
Analyze current changes and present exactly:
|
|
68
|
+
|
|
69
|
+
- **Proposed PR Title**: `[VERSION] - Brief description`
|
|
70
|
+
- **Proposed PR Description**: Using `references/pr-description-template.md`
|
|
71
|
+
- **Version Bump Type**: `patch`, `minor`, or `major`
|
|
72
|
+
- **CHANGELOG Entry**: New top entry for `CHANGELOG.md`
|
|
73
|
+
|
|
74
|
+
Wait for approval or requested edits. Apply requested edits and re-present until approved.
|
|
75
|
+
|
|
76
|
+
## Step 2: Execute PR preparation
|
|
77
|
+
|
|
78
|
+
After approval, run in this exact order:
|
|
79
|
+
|
|
80
|
+
1. Run tests:
|
|
81
|
+
`yarn test`
|
|
82
|
+
If tests fail, stop and report failures.
|
|
83
|
+
2. Bump version in `package.json`:
|
|
84
|
+
`npm version <patch|minor|major> --no-git-tag-version`
|
|
85
|
+
3. Add a new version section at the top of `CHANGELOG.md` using `references/changelog-versioning.md`.
|
|
86
|
+
4. Stage all files:
|
|
87
|
+
`git add -A`
|
|
88
|
+
5. Commit using Conventional Commits:
|
|
89
|
+
`<type>(pull-request-lifecycle): <summary>`
|
|
90
|
+
6. Create PR:
|
|
91
|
+
`gh pr create --title "[VERSION] - Description" --body "<approved body>"`
|
|
92
|
+
|
|
93
|
+
## Required PR description structure
|
|
94
|
+
|
|
95
|
+
PR descriptions must follow `references/pr-description-template.md` exactly and include:
|
|
96
|
+
|
|
97
|
+
- `### **User description**`
|
|
98
|
+
- `### **Code Review**` (only if Step 0 review was run)
|
|
99
|
+
- `### **PR Type**`
|
|
100
|
+
- `### **Description**`
|
|
101
|
+
|
|
102
|
+
## Requirements checklist
|
|
103
|
+
|
|
104
|
+
- `yarn test` passes
|
|
105
|
+
- `package.json` version bumped
|
|
106
|
+
- `CHANGELOG.md` updated with new top version section
|
|
107
|
+
- Commit uses Conventional Commits format
|
|
108
|
+
- PR title uses `[VERSION] - Description`
|
|
109
|
+
|
|
110
|
+
## References
|
|
111
|
+
|
|
112
|
+
- PR description template: `references/pr-description-template.md`
|
|
113
|
+
- Changelog and versioning: `references/changelog-versioning.md`
|
|
114
|
+
- Automated review process: `references/review-process.md`
|
|
115
|
+
- PR creation command guide: `references/merge-strategies.md`
|
|
116
|
+
- Conventional commit format: `../conventional-commits/SKILL.md`
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
# Machinery Partner Changelog and Versioning
|
|
2
|
+
|
|
3
|
+
This workflow uses a deterministic SemVer bump and changelog insertion flow.
|
|
4
|
+
|
|
5
|
+
## Version bump types
|
|
6
|
+
|
|
7
|
+
- `patch`: Backward-compatible bug fixes and small corrections
|
|
8
|
+
- `minor`: Backward-compatible features and enhancements
|
|
9
|
+
- `major`: Breaking changes
|
|
10
|
+
|
|
11
|
+
## Required changelog heading format
|
|
12
|
+
|
|
13
|
+
Every release entry must start with:
|
|
14
|
+
|
|
15
|
+
```markdown
|
|
16
|
+
## [VERSION]() - YYYY-MM-DD
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
Use the version selected in Step 1 and the current date in `YYYY-MM-DD` format.
|
|
20
|
+
|
|
21
|
+
## Allowed category headings
|
|
22
|
+
|
|
23
|
+
Use only these categories:
|
|
24
|
+
|
|
25
|
+
- `Added`
|
|
26
|
+
- `Changed`
|
|
27
|
+
- `Deprecated`
|
|
28
|
+
- `Removed`
|
|
29
|
+
- `Fixed`
|
|
30
|
+
- `Security`
|
|
31
|
+
|
|
32
|
+
Only include categories that contain at least one bullet item.
|
|
33
|
+
|
|
34
|
+
## Canonical entry format
|
|
35
|
+
|
|
36
|
+
```markdown
|
|
37
|
+
## [10.11.4]() - 2025-11-11
|
|
38
|
+
|
|
39
|
+
### Fixed
|
|
40
|
+
- Description of fix
|
|
41
|
+
|
|
42
|
+
### Added
|
|
43
|
+
- Description of new feature
|
|
44
|
+
|
|
45
|
+
### Changed
|
|
46
|
+
- Description of change
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
## Placement rules
|
|
50
|
+
|
|
51
|
+
1. Insert the new version section at the top of `CHANGELOG.md`, directly under any title/introduction block.
|
|
52
|
+
2. Keep newest versions first.
|
|
53
|
+
3. Keep one blank line between heading and category blocks.
|
|
54
|
+
4. Keep one blank line between category blocks.
|
|
55
|
+
|
|
56
|
+
## Category selection guidance
|
|
57
|
+
|
|
58
|
+
- `Added`: New capabilities
|
|
59
|
+
- `Changed`: Behavioral updates to existing capability
|
|
60
|
+
- `Deprecated`: Features marked for future removal
|
|
61
|
+
- `Removed`: Features deleted in this release
|
|
62
|
+
- `Fixed`: Defect corrections
|
|
63
|
+
- `Security`: Security hardening, patches, or policy improvements
|
|
64
|
+
|
|
65
|
+
## Workflow-aligned commands
|
|
66
|
+
|
|
67
|
+
```bash
|
|
68
|
+
# Bump package version without creating a tag
|
|
69
|
+
npm version <patch|minor|major> --no-git-tag-version
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
After bumping, use the resulting `package.json` version in the changelog heading.
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# PR Creation Commands
|
|
2
|
+
|
|
3
|
+
This workflow focuses on deterministic PR creation. Merge strategy selection is out of scope for this skill.
|
|
4
|
+
|
|
5
|
+
## Required PR creation command
|
|
6
|
+
|
|
7
|
+
Use the approved title and body exactly:
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
gh pr create --title "[VERSION] - Description" --body "<approved body>"
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Multiline body-safe variant
|
|
14
|
+
|
|
15
|
+
Use a temporary file for large descriptions:
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
cat > /tmp/pr-body.md <<'PRBODY'
|
|
19
|
+
[VERSION] - Brief description
|
|
20
|
+
|
|
21
|
+
### **User description**
|
|
22
|
+
...
|
|
23
|
+
PRBODY
|
|
24
|
+
|
|
25
|
+
gh pr create --title "[VERSION] - Description" --body-file /tmp/pr-body.md
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## Scope boundary
|
|
29
|
+
|
|
30
|
+
- In scope: opening a PR with the deterministic template
|
|
31
|
+
- Out of scope: choosing squash/rebase/merge strategies and branch protection policy
|
|
32
|
+
|
|
33
|
+
Those merge decisions should be handled by repository policy, not by this workflow.
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
# Machinery Partner PR Description Template
|
|
2
|
+
|
|
3
|
+
Use this exact structure for every pull request body. Do not reorder sections.
|
|
4
|
+
|
|
5
|
+
## Canonical template
|
|
6
|
+
|
|
7
|
+
```markdown
|
|
8
|
+
[VERSION] - Brief description
|
|
9
|
+
|
|
10
|
+
### **User description**
|
|
11
|
+
Detailed explanation of changes with grouped sections.
|
|
12
|
+
|
|
13
|
+
**Category heading:**
|
|
14
|
+
- Specific change details
|
|
15
|
+
- More details
|
|
16
|
+
|
|
17
|
+
___
|
|
18
|
+
|
|
19
|
+
### **Code Review**
|
|
20
|
+
**Quality Gates**: ✅ All passed / ⚠️ X warnings / ❌ X errors
|
|
21
|
+
**Complexity**: No issues / X suggestions
|
|
22
|
+
**Impact**: Files changed: X, Features affected: ...
|
|
23
|
+
**Review Status**: Approved / Changes requested
|
|
24
|
+
|
|
25
|
+
___
|
|
26
|
+
|
|
27
|
+
### **PR Type**
|
|
28
|
+
Bug fix, Enhancement, Feature, etc.
|
|
29
|
+
|
|
30
|
+
___
|
|
31
|
+
|
|
32
|
+
### **Description**
|
|
33
|
+
- Concise bullet per change
|
|
34
|
+
- Include component/file names
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
## Rule when Step 0 review is skipped
|
|
38
|
+
|
|
39
|
+
If automated review is skipped, remove only the `### **Code Review**` block and keep all remaining sections in the same order.
|
|
40
|
+
|
|
41
|
+
## Example with review block
|
|
42
|
+
|
|
43
|
+
```markdown
|
|
44
|
+
[2.4.1] - Improve changelog validation workflow
|
|
45
|
+
|
|
46
|
+
### **User description**
|
|
47
|
+
This update standardizes changelog generation and prevents malformed release entries.
|
|
48
|
+
|
|
49
|
+
**Release automation:**
|
|
50
|
+
- Added deterministic changelog section rendering
|
|
51
|
+
- Added version/date formatting guardrails
|
|
52
|
+
|
|
53
|
+
___
|
|
54
|
+
|
|
55
|
+
### **Code Review**
|
|
56
|
+
**Quality Gates**: ✅ All passed
|
|
57
|
+
**Complexity**: No issues
|
|
58
|
+
**Impact**: Files changed: 5, Features affected: release-workflow
|
|
59
|
+
**Review Status**: Approved
|
|
60
|
+
|
|
61
|
+
___
|
|
62
|
+
|
|
63
|
+
### **PR Type**
|
|
64
|
+
Enhancement
|
|
65
|
+
|
|
66
|
+
___
|
|
67
|
+
|
|
68
|
+
### **Description**
|
|
69
|
+
- Updated `.agents/skills/pull-request-lifecycle/SKILL.md` with fixed PR workflow
|
|
70
|
+
- Added `.agents/skills/pull-request-lifecycle/scripts/code_review.py`
|
|
71
|
+
- Rewrote pull-request lifecycle reference templates for deterministic output
|
|
72
|
+
```
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
# Automated Review Process
|
|
2
|
+
|
|
3
|
+
This reference defines Step 0 of the Machinery Partner pull-request workflow.
|
|
4
|
+
|
|
5
|
+
## Step 0 prompt
|
|
6
|
+
|
|
7
|
+
Ask exactly:
|
|
8
|
+
|
|
9
|
+
`Would you like to run automated code review before creating the PR?`
|
|
10
|
+
|
|
11
|
+
## Script command
|
|
12
|
+
|
|
13
|
+
If the user says yes, run:
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
python3 .agents/skills/pull-request-lifecycle/scripts/code_review.py
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Exit code contract
|
|
20
|
+
|
|
21
|
+
- `0`: Review completed with no critical issues (warnings allowed)
|
|
22
|
+
- `2`: Critical issues found; user decision required
|
|
23
|
+
- `1`: Script execution failure; stop and report output
|
|
24
|
+
|
|
25
|
+
## Critical issue decision flow
|
|
26
|
+
|
|
27
|
+
When exit code is `2`, present findings and ask the user to choose one:
|
|
28
|
+
|
|
29
|
+
1. Fix issues before continuing
|
|
30
|
+
2. Skip issues and proceed with PR
|
|
31
|
+
3. Cancel PR creation
|
|
32
|
+
|
|
33
|
+
If the user chooses cancel, stop immediately.
|
|
34
|
+
|
|
35
|
+
## Required summary fields for PR body
|
|
36
|
+
|
|
37
|
+
When review is run, include this block in PR description:
|
|
38
|
+
|
|
39
|
+
```markdown
|
|
40
|
+
### **Code Review**
|
|
41
|
+
**Quality Gates**: ✅ All passed / ⚠️ X warnings / ❌ X errors
|
|
42
|
+
**Complexity**: No issues / X suggestions
|
|
43
|
+
**Impact**: Files changed: X, Features affected: ...
|
|
44
|
+
**Review Status**: Approved / Changes requested
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
## Script output format expectations
|
|
48
|
+
|
|
49
|
+
The script outputs:
|
|
50
|
+
|
|
51
|
+
- Human-readable review summary
|
|
52
|
+
- A JSON block between `BEGIN_REVIEW_JSON` and `END_REVIEW_JSON`
|
|
53
|
+
|
|
54
|
+
Use the JSON fields to fill the PR `Code Review` section without rewording the labels.
|