|
1 | 1 | --- |
2 | 2 | name: activitypub-pr-workflow |
3 | | -description: Pull request creation and review workflow for WordPress ActivityPub plugin. Use when creating branches, managing PRs, adding changelogs, assigning reviewers, or following branch naming conventions. |
| 3 | +description: INVOKE THIS SKILL before creating any PR to ensure compliance with branch naming, changelog requirements, and reviewer assignment. |
4 | 4 | --- |
5 | 5 |
|
6 | 6 | # ActivityPub PR Workflow |
7 | 7 |
|
8 | | -Workflow guidance for creating and managing pull requests in the WordPress ActivityPub plugin repository. |
| 8 | +## Branch Naming |
9 | 9 |
|
10 | | -## Quick Reference |
| 10 | +| Prefix | Use | |
| 11 | +|--------|-----| |
| 12 | +| `add/{feature}` | New features | |
| 13 | +| `update/{feature}` | Iterating on existing features | |
| 14 | +| `fix/{bug}` | Bug fixes | |
| 15 | +| `try/{idea}` | Experimental ideas | |
11 | 16 |
|
12 | | -### Branch Naming |
13 | | -```bash |
14 | | -add/{feature} # New features. |
15 | | -update/{feature} # Iterating on existing features. |
16 | | -fix/{bug} # Bug fixes. |
17 | | -try/{idea} # Experimental ideas. |
18 | | -``` |
| 17 | +**Reserved:** `release/{X.Y.Z}` (releases only), `trunk` (main branch). |
19 | 18 |
|
20 | | -**Reserved branches:** |
21 | | -- `release/{X.Y.Z}` - Release process only. |
22 | | -- `trunk` - Main development branch. |
| 19 | +## PR Creation |
23 | 20 |
|
24 | | -### PR Requirements |
25 | | -- ✅ Changelog entry (or "Skip Changelog" label). |
26 | | -- ✅ Passing CI checks. |
27 | | -- ✅ Clean merge with trunk. |
28 | | -- ✅ **Always assign @me**. |
29 | | -- ✅ **Always add Fediverse team as reviewer**. |
30 | | -- ✅ Proper branch naming. |
| 21 | +**Every PR must:** |
| 22 | +- Assign `@me` |
| 23 | +- Add `Automattic/fediverse` as reviewer |
| 24 | +- Include changelog entry OR "Skip Changelog" label |
| 25 | +- Pass CI checks |
| 26 | +- Merge cleanly with trunk |
31 | 27 |
|
32 | | -### Quick Commands |
33 | 28 | ```bash |
34 | | -# Create and switch to branch. |
35 | | -git checkout -b add/new-feature |
36 | | - |
37 | | -# Create PR with GitHub CLI. |
| 29 | +# Create PR (includes required assignment/reviewer) |
38 | 30 | gh pr create --assignee @me --reviewer Automattic/fediverse |
39 | | - |
40 | | -# Check PR status and CI. |
41 | | -gh pr status |
42 | | -gh pr checks |
43 | 31 | ``` |
44 | 32 |
|
45 | | -## Comprehensive Workflow Guide |
46 | | - |
47 | | -See [Pull Request Guide](../../../docs/pull-request.md) for complete PR workflow, detailed checklist, and git best practices. |
48 | | - |
49 | | -## Critical Rules |
50 | | - |
51 | | -### AI Tool Usage |
52 | | - |
53 | | -**CRITICAL:** Never add Claude Code as a co-author or mention AI tools in: |
54 | | -- Commit messages |
55 | | -- PR descriptions |
56 | | -- PR comments |
57 | | -- Code comments |
58 | | -- Anywhere in the codebase |
59 | | - |
60 | | -This is a hard requirement for all PRs. |
61 | | - |
62 | | -### Assignment and Review |
63 | | - |
64 | | -**Required for every PR:** |
65 | | -- **Always assign yourself** as assignee. |
66 | | -- **Always add Fediverse** as reviewer. |
67 | | -- Add other relevant reviewers if needed. |
68 | | - |
69 | | -## Changelog Management |
70 | | - |
71 | | -The repository uses Jetpack Changelogger for automated changelog generation. |
72 | | - |
73 | | -### PR Template Changelog Section |
| 33 | +**Use the exact template from `.github/PULL_REQUEST_TEMPLATE.md`** — do not create custom formatting. |
74 | 34 |
|
75 | | -Every PR template (`.github/PULL_REQUEST_TEMPLATE.md`) includes changelog fields: |
| 35 | +## Changelog |
76 | 36 |
|
77 | | -**CRITICAL:** You must use the exact template markup from `.github/PULL_REQUEST_TEMPLATE.md`. Do not create custom formatting - use the actual checkboxes `- [x]` and `<details>` sections exactly as shown in the template. |
78 | | - |
79 | | -1. **Check "Automatically create a changelog entry" checkbox** |
80 | | -2. **Select Significance:** Patch/Minor/Major |
81 | | -3. **Select Type:** Added/Changed/Deprecated/Removed/Fixed/Security |
82 | | -4. **Write Message:** Clear description that **must end with punctuation!** |
83 | | - |
84 | | -**OR** add "Skip Changelog" label if no changelog entry needed. |
85 | | - |
86 | | -### Changelog Requirements |
87 | | - |
88 | | -**Always end changelog messages with proper punctuation:** |
| 37 | +End all changelog messages with punctuation: |
89 | 38 | ``` |
90 | 39 | ✅ Add support for custom post types. |
91 | | -✅ Fix signature verification bug. |
92 | 40 | ❌ Add support for custom post types |
93 | | -❌ Fix signature verification bug |
94 | 41 | ``` |
95 | 42 |
|
96 | | -See [Release Process - Changelog Management](../activitypub-release/SKILL.md) for complete changelog details. |
97 | | - |
98 | | -### Manual Changelog Entry |
99 | | - |
100 | | -If you forgot changelog in PR: |
| 43 | +Add manually if forgotten: |
101 | 44 | ```bash |
102 | | -composer changelog:add # Interactive prompt. |
103 | | -git add . |
104 | | -git commit -m "Add changelog entry" |
105 | | -git push |
| 45 | +composer changelog:add |
| 46 | +git add . && git commit -m "Add changelog entry" && git push |
106 | 47 | ``` |
107 | 48 |
|
108 | | -## Development Workflow Best Practices |
109 | | - |
110 | | -### Break Down Features |
| 49 | +See [activitypub-release](../activitypub-release/SKILL.md) for complete changelog details. |
111 | 50 |
|
112 | | -**Important:** Break features into small, focused PRs. Each piece should be its own PR. |
113 | | - |
114 | | -**Good approach:** |
115 | | -``` |
116 | | -PR 1: Add database schema |
117 | | -PR 2: Add REST endpoint |
118 | | -PR 3: Add UI component |
119 | | -PR 4: Add tests |
120 | | -``` |
121 | | - |
122 | | -**Bad approach:** |
123 | | -``` |
124 | | -Single PR with all changes |
125 | | -``` |
126 | | - |
127 | | -**For multi-PR features:** |
128 | | -1. Create tracking issue. |
129 | | -2. Link all related PRs to issue. |
130 | | -3. Use consistent naming: `add/feature-part-1`, `add/feature-part-2`. |
131 | | -4. Merge in order. |
132 | | - |
133 | | -### Branch Creation Workflow |
| 51 | +## Workflow |
134 | 52 |
|
| 53 | +### Create Branch |
135 | 54 | ```bash |
136 | | -# Always branch from trunk. |
137 | | -git checkout trunk |
138 | | -git pull origin trunk |
139 | | - |
140 | | -# Create branch with appropriate prefix. |
| 55 | +git checkout trunk && git pull origin trunk |
141 | 56 | git checkout -b fix/notification-issue |
142 | | - |
143 | | -# Make changes, commit frequently. |
144 | | -git add . |
145 | | -git commit -m "Add follower validation" |
146 | | - |
147 | | -# Push to remote. |
148 | | -git push -u origin fix/notification-issue |
149 | 57 | ``` |
150 | 58 |
|
151 | 59 | ### Pre-Push Checks |
152 | | - |
153 | | -Before creating PR or pushing changes: |
154 | | - |
155 | 60 | ```bash |
156 | | -# Check PHP standards. |
157 | | -composer lint |
158 | | -composer lint:fix # Auto-fix issues. |
159 | | - |
160 | | -# Check JavaScript/CSS if you made changes. |
161 | | -npm run lint:js |
162 | | -npm run lint:css |
163 | | - |
164 | | -# Run tests. |
165 | | -npm run env-test |
166 | | - |
167 | | -# Build assets if needed. |
168 | | -npm run build |
| 61 | +composer lint # PHP standards (composer lint:fix to auto-fix) |
| 62 | +npm run lint:js # If JS changed |
| 63 | +npm run lint:css # If CSS changed |
| 64 | +npm run env-test # Run tests |
| 65 | +npm run build # If assets changed |
169 | 66 | ``` |
170 | 67 |
|
171 | | -See [Development Cycle](../activitypub-dev-cycle/SKILL.md) for complete testing and linting commands. |
172 | | - |
173 | | -### Creating the PR |
174 | | - |
175 | | -1. Push your branch to remote. |
176 | | -2. Create PR via GitHub UI or `gh pr create`. |
177 | | -3. Fill out PR template completely. |
178 | | -4. Add changelog entry (or "Skip Changelog" label). |
179 | | -5. **Assign yourself**. |
180 | | -6. **Add Fediverse as reviewer**. |
181 | | -7. Mark as draft if not ready for review. |
182 | | - |
183 | | -### Review and Iteration |
| 68 | +See [activitypub-dev-cycle](../activitypub-dev-cycle/SKILL.md) for complete commands. |
184 | 69 |
|
185 | | -After receiving feedback: |
| 70 | +### Keep Branch Updated |
186 | 71 | ```bash |
187 | | -# Make requested changes. |
188 | | -git add . |
189 | | -git commit -m "Address review feedback" |
190 | | -git push |
191 | | - |
192 | | -# CI re-runs automatically. |
193 | | -# Re-request review after addressing feedback. |
| 72 | +git fetch origin |
| 73 | +git rebase origin/trunk |
| 74 | +# Resolve conflicts if any |
| 75 | +git push --force-with-lease |
194 | 76 | ``` |
195 | 77 |
|
196 | | -## Special PR Types |
| 78 | +## Special Cases |
197 | 79 |
|
198 | | -### Hotfixes |
199 | | -For urgent fixes: |
200 | | -1. Branch from trunk: `fix/critical-issue`. |
201 | | -2. Minimal changeset. |
202 | | -3. Add "Hotfix" label. |
203 | | -4. Request expedited review. |
| 80 | +**Hotfixes:** Branch `fix/critical-issue`, minimal changes, add "Hotfix" label, request expedited review. |
204 | 81 |
|
205 | | -### Experimental Changes |
206 | | -For trying ideas: |
207 | | -1. Use `try/` prefix. |
208 | | -2. Mark as draft PR. |
209 | | -3. Request feedback early. |
210 | | -4. Convert to proper branch type once approach confirmed. |
| 82 | +**Experimental:** Use `try/` prefix, mark as draft, get early feedback, convert to proper branch type once confirmed. |
211 | 83 |
|
212 | | -## Keeping Branch Updated |
213 | | - |
214 | | -```bash |
215 | | -# Fetch latest trunk. |
216 | | -git fetch origin |
217 | | - |
218 | | -# Rebase your branch. |
219 | | -git rebase origin/trunk |
220 | | - |
221 | | -# Resolve conflicts if any, then continue. |
222 | | -git add . |
223 | | -git rebase --continue |
224 | | - |
225 | | -# Force push (safe if you're the only one on the branch). |
226 | | -git push --force-with-lease |
227 | | -``` |
| 84 | +**Multi-PR features:** Create tracking issue, link all PRs, use consistent naming (`add/feature-part-1`, etc.), merge in order. |
228 | 85 |
|
229 | | -**When to rebase:** Always rebase before final merge to trunk for clean history. |
| 86 | +## Labels |
230 | 87 |
|
231 | | -See [Pull Request Guide](../../../docs/pull-request.md) for detailed rebase and merge conflict resolution. |
| 88 | +| Label | Use | |
| 89 | +|-------|-----| |
| 90 | +| `[Type] Bug` | Bug fixes | |
| 91 | +| `[Type] Enhancement` | New features | |
| 92 | +| `[Type] Documentation` | Doc updates | |
| 93 | +| `Skip Changelog` | No changelog needed | |
| 94 | +| `Needs Review` | Ready for review | |
| 95 | +| `In Progress` | Still working | |
| 96 | +| `Hotfix` | Urgent fix | |
232 | 97 |
|
233 | | -## Common PR Labels |
| 98 | +## Reference |
234 | 99 |
|
235 | | -- `[Type] Bug` - Bug fixes. |
236 | | -- `[Type] Enhancement` - New features. |
237 | | -- `[Type] Documentation` - Doc updates. |
238 | | -- `Skip Changelog` - No changelog needed. |
239 | | -- `Needs Review` - Ready for review. |
240 | | -- `In Progress` - Still working. |
241 | | -- `Hotfix` - Urgent fix. |
| 100 | +See [Pull Request Guide](../../../docs/pull-request.md) for complete workflow details. |
0 commit comments