antigravity-ai-kit 3.7.0 → 3.9.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/.agent/CheatSheet.md +51 -16
- package/.agent/README.md +4 -4
- package/.agent/agents/README.md +8 -1
- package/.agent/agents/pr-reviewer.md +259 -0
- package/.agent/checklists/README.md +2 -1
- package/.agent/checklists/pre-commit.md +1 -1
- package/.agent/checklists/session-end.md +1 -1
- package/.agent/checklists/session-start.md +1 -1
- package/.agent/checklists/task-complete.md +1 -1
- package/.agent/commands/README.md +130 -119
- package/.agent/commands/help.md +36 -19
- package/.agent/commands/pr-describe.md +65 -0
- package/.agent/commands/pr-fix.md +45 -0
- package/.agent/commands/pr-merge.md +45 -0
- package/.agent/commands/pr-review.md +50 -0
- package/.agent/commands/pr-split.md +54 -0
- package/.agent/commands/pr-status.md +56 -0
- package/.agent/commands/pr.md +58 -30
- package/.agent/engine/loading-rules.json +5 -0
- package/.agent/hooks/README.md +9 -5
- package/.agent/manifest.json +39 -6
- package/.agent/rules/agent-upgrade-policy.md +56 -0
- package/.agent/session-context.md +1 -1
- package/.agent/skills/README.md +4 -2
- package/.agent/skills/pr-toolkit/SKILL.md +467 -0
- package/.agent/skills/production-readiness/SKILL.md +3 -3
- package/.agent/workflows/README.md +13 -6
- package/.agent/workflows/deploy.md +2 -1
- package/.agent/workflows/pr-fix.md +305 -0
- package/.agent/workflows/pr-merge.md +242 -0
- package/.agent/workflows/pr-review.md +312 -0
- package/.agent/workflows/pr-split.md +263 -0
- package/.agent/workflows/pr.md +116 -26
- package/.agent/workflows/preflight.md +2 -2
- package/.agent/workflows/upgrade.md +196 -0
- package/README.md +48 -35
- package/package.json +2 -2
|
@@ -0,0 +1,467 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: pr-toolkit
|
|
3
|
+
description: Pull request lifecycle domain knowledge — branch strategy detection, PR size classification, confidence-scored review, git-aware context, PR analytics, dependency management, and split/merge/describe operations.
|
|
4
|
+
version: 2.0.0
|
|
5
|
+
triggers: [pr, pull-request, review, merge, branch, code-review]
|
|
6
|
+
allowed-tools: Read, Grep, Bash
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# PR Toolkit Skill
|
|
10
|
+
|
|
11
|
+
> **Purpose**: Provide domain knowledge for the complete PR lifecycle — creation, review, remediation, merge, split, describe, analytics, and dependency management. Used by `/pr`, `/pr-review`, `/pr-fix`, `/pr-merge`, `/pr-split`, `/pr-describe`, and `/pr-status`.
|
|
12
|
+
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
## 1. Branch Strategy Detection
|
|
16
|
+
|
|
17
|
+
Detect the project's branching model before any PR operation. This enables generic behavior across GitFlow, trunk-based, and hybrid strategies.
|
|
18
|
+
|
|
19
|
+
### Detection Protocol
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
# Check for GitFlow indicators
|
|
23
|
+
git branch -r | grep -E 'origin/(dev|develop)$'
|
|
24
|
+
# Check for release branches
|
|
25
|
+
git branch -r | grep -E 'origin/release/'
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
| Indicator | Strategy | Description |
|
|
29
|
+
| :--- | :--- | :--- |
|
|
30
|
+
| `dev` or `develop` branch exists | GitFlow | Feature branches merge to dev; dev merges to main at release |
|
|
31
|
+
| Only `main`/`master` exists | Trunk-Based | Short-lived feature branches merge directly to main |
|
|
32
|
+
| `release/*` branches exist | GitFlow (full) | Includes release branch phase before main |
|
|
33
|
+
|
|
34
|
+
### Target Branch Validation — GitFlow
|
|
35
|
+
|
|
36
|
+
| Source Branch Pattern | Valid Target | Invalid Target | Action on Invalid |
|
|
37
|
+
| :--- | :--- | :--- | :--- |
|
|
38
|
+
| `feature/*` | `dev`, `develop` | `main`, `master` | **BLOCK** — redirect to dev |
|
|
39
|
+
| `bugfix/*` | `dev`, `develop` | `main`, `master` | **BLOCK** — redirect to dev |
|
|
40
|
+
| `hotfix/*` | `main`, `master` | — | Proceed (emergency path) |
|
|
41
|
+
| `release/*` | `main`, `master` | — | Proceed (release cut) |
|
|
42
|
+
| `dev`, `develop` | `main`, `master` | — | Proceed (sprint merge) |
|
|
43
|
+
| `chore/*`, `docs/*` | `dev`, `develop` | `main`, `master` | **BLOCK** — redirect to dev |
|
|
44
|
+
|
|
45
|
+
### Target Branch Validation — Trunk-Based
|
|
46
|
+
|
|
47
|
+
| Source Branch Pattern | Valid Target | Action |
|
|
48
|
+
| :--- | :--- | :--- |
|
|
49
|
+
| Any short-lived branch | `main`, `master` | Proceed |
|
|
50
|
+
|
|
51
|
+
### Auto-Detection Output
|
|
52
|
+
|
|
53
|
+
```markdown
|
|
54
|
+
**Branch Strategy**: GitFlow detected (origin/dev exists)
|
|
55
|
+
**Target Validation**: feature/X → dev ✅ (valid) | feature/X → main ❌ (invalid — redirect to dev)
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
---
|
|
59
|
+
|
|
60
|
+
## 2. PR Size Classification
|
|
61
|
+
|
|
62
|
+
Classify PRs to enforce reviewability standards. Based on Google's recommended PR size guidelines.
|
|
63
|
+
|
|
64
|
+
### Size Matrix
|
|
65
|
+
|
|
66
|
+
| Label | Files Changed | Lines Changed | Estimated Review Time | Recommendation |
|
|
67
|
+
| :--- | :--- | :--- | :--- | :--- |
|
|
68
|
+
| **XS** | 1-5 | < 100 | < 15 min | Fast-track review |
|
|
69
|
+
| **S** | 6-15 | 100-300 | 15-30 min | Standard review |
|
|
70
|
+
| **M** | 16-30 | 300-700 | 30-60 min | Thorough review |
|
|
71
|
+
| **L** | 31-50 | 700-1500 | 1-2 hours | Consider splitting |
|
|
72
|
+
| **XL** | 50+ | 1500+ | 2+ hours | **MUST split** — block creation |
|
|
73
|
+
|
|
74
|
+
### Detection Commands
|
|
75
|
+
|
|
76
|
+
```bash
|
|
77
|
+
# Count changed files
|
|
78
|
+
git diff --name-only origin/<target>..HEAD | wc -l
|
|
79
|
+
# Count changed lines
|
|
80
|
+
git diff --stat origin/<target>..HEAD | tail -1
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
### Scope Coherence Check
|
|
84
|
+
|
|
85
|
+
A PR is scope-coherent when ALL changed files relate to ONE logical change.
|
|
86
|
+
|
|
87
|
+
| Violation | Detection Pattern | Severity |
|
|
88
|
+
| :--- | :--- | :--- |
|
|
89
|
+
| Mixed feature + tooling | Framework/config files alongside source code | HIGH |
|
|
90
|
+
| Mixed feature + dependency upgrade | Unrelated `package.json` bumps alongside feature | MEDIUM |
|
|
91
|
+
| Mixed feature + documentation restructure | Deleted/moved docs alongside new code | HIGH |
|
|
92
|
+
| Multiple unrelated features | Changes span unrelated modules with no shared dependency | CRITICAL |
|
|
93
|
+
|
|
94
|
+
**Remediation**: Split into focused PRs:
|
|
95
|
+
|
|
96
|
+
1. Tooling/config changes → separate `chore:` PR
|
|
97
|
+
2. Dependency upgrades → separate `chore(deps):` PR
|
|
98
|
+
3. Documentation → separate `docs:` PR
|
|
99
|
+
4. Feature code → focused `feat:` PR
|
|
100
|
+
|
|
101
|
+
---
|
|
102
|
+
|
|
103
|
+
## 3. Title Format Enforcement
|
|
104
|
+
|
|
105
|
+
### Conventional Commits Title Format
|
|
106
|
+
|
|
107
|
+
```
|
|
108
|
+
type(scope): description
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
### Validation Rules
|
|
112
|
+
|
|
113
|
+
| Rule | Valid Example | Invalid Example |
|
|
114
|
+
| :--- | :--- | :--- |
|
|
115
|
+
| Has type prefix | `feat(auth): add login` | `add login feature` |
|
|
116
|
+
| Lowercase type | `feat:` | `Feat:`, `FEAT:` |
|
|
117
|
+
| Parenthesized scope (recommended) | `feat(auth):` | `feat-auth:` |
|
|
118
|
+
| Colon + space after type/scope | `feat: add` | `feat:add` |
|
|
119
|
+
| Imperative mood | `add`, `fix`, `update` | `added`, `fixes`, `updating` |
|
|
120
|
+
| No period at end | `feat: add login` | `feat: add login.` |
|
|
121
|
+
| Under 72 characters | Short description | Exceeds 72 character limit... |
|
|
122
|
+
|
|
123
|
+
### Branch-to-Title Parser
|
|
124
|
+
|
|
125
|
+
| Branch Name | Parsed Title |
|
|
126
|
+
| :--- | :--- |
|
|
127
|
+
| `feature/ABC-123-add-user-auth` | `feat(user): add user auth` |
|
|
128
|
+
| `bugfix/ABC-456-fix-login` | `fix(login): fix login` |
|
|
129
|
+
| `hotfix/PROD-001-patch-xss` | `fix(security): patch xss` |
|
|
130
|
+
| `chore/update-deps` | `chore(deps): update deps` |
|
|
131
|
+
| `docs/api-reference` | `docs(api): api reference` |
|
|
132
|
+
|
|
133
|
+
### Parsing Algorithm
|
|
134
|
+
|
|
135
|
+
1. Extract branch type prefix: `feature/` → `feat`, `bugfix/` → `fix`, `hotfix/` → `fix`
|
|
136
|
+
2. Remove ticket prefix: `ABC-123-` → strip
|
|
137
|
+
3. Extract first segment as scope: `add-user-auth` → scope: `user`
|
|
138
|
+
4. Remaining segments as description: `add user auth`
|
|
139
|
+
5. Compose: `feat(user): add user auth`
|
|
140
|
+
6. If parsing fails → fallback to first commit message subject line
|
|
141
|
+
|
|
142
|
+
---
|
|
143
|
+
|
|
144
|
+
## 4. Review Patterns
|
|
145
|
+
|
|
146
|
+
### Multi-Perspective Review Framework
|
|
147
|
+
|
|
148
|
+
When reviewing a PR, apply these 6 perspectives sequentially:
|
|
149
|
+
|
|
150
|
+
| # | Perspective | Focus | Key Questions |
|
|
151
|
+
| :--- | :--- | :--- | :--- |
|
|
152
|
+
| 1 | **PR Hygiene** | Structure | Title format? Body complete? Size acceptable? Scope coherent? |
|
|
153
|
+
| 2 | **Branch Strategy** | Process | Correct target branch? Branch naming convention? |
|
|
154
|
+
| 3 | **Code Quality** | Standards | Functions < 50 lines? Files < 800 lines? No deep nesting? Error handling? |
|
|
155
|
+
| 4 | **Security** | Vulnerabilities | Hardcoded secrets? Input validation? Injection? XSS? Auth checks? |
|
|
156
|
+
| 5 | **Testing** | Coverage | New code has tests? Edge cases covered? Coverage maintained? |
|
|
157
|
+
| 6 | **Architecture** | Design | Follows existing patterns? SOLID? No over-engineering? Clean dependencies? |
|
|
158
|
+
|
|
159
|
+
### Review Severity Levels
|
|
160
|
+
|
|
161
|
+
| Severity | Label | Action Required | Blocks Merge? |
|
|
162
|
+
| :--- | :--- | :--- | :--- |
|
|
163
|
+
| **CRITICAL** | :red_circle: | Must fix — security, data loss, crash risk | Yes |
|
|
164
|
+
| **HIGH** | :orange_circle: | Should fix — broken functionality, quality blocker | Yes (3+) |
|
|
165
|
+
| **MEDIUM** | :yellow_circle: | Consider fixing — improvement suggestion | No |
|
|
166
|
+
| **LOW** | :blue_circle: | Nice to have — optional improvement | No |
|
|
167
|
+
| **NIT** | :white_circle: | Style preference — no action required | No |
|
|
168
|
+
|
|
169
|
+
### Review Verdict Decision Table
|
|
170
|
+
|
|
171
|
+
| Condition | Verdict |
|
|
172
|
+
| :--- | :--- |
|
|
173
|
+
| Zero CRITICAL + zero HIGH | **APPROVE** |
|
|
174
|
+
| Zero CRITICAL + minor HIGH (1-2, acknowledged) | **COMMENT** |
|
|
175
|
+
| Any CRITICAL OR 3+ HIGH | **REQUEST_CHANGES** |
|
|
176
|
+
|
|
177
|
+
---
|
|
178
|
+
|
|
179
|
+
## 5. Fix Prioritization Framework
|
|
180
|
+
|
|
181
|
+
When implementing fixes from review comments:
|
|
182
|
+
|
|
183
|
+
### Priority Order
|
|
184
|
+
|
|
185
|
+
1. **CRITICAL** (security, data loss, crashes) → fix immediately
|
|
186
|
+
2. **HIGH** (broken functionality, code quality blockers) → fix before merge
|
|
187
|
+
3. **MEDIUM** (style, naming, documentation) → fix if time permits
|
|
188
|
+
4. **LOW/NIT** (preferences, suggestions) → optional
|
|
189
|
+
|
|
190
|
+
### Fix Commit Convention
|
|
191
|
+
|
|
192
|
+
```bash
|
|
193
|
+
# Individual fix commits (during fix process)
|
|
194
|
+
fix(review): address hardcoded API key in auth.ts
|
|
195
|
+
fix(review): add input validation for user endpoint
|
|
196
|
+
|
|
197
|
+
# Squash commit (final push)
|
|
198
|
+
fix(review): address PR #N review findings
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
### Fix Verification Protocol
|
|
202
|
+
|
|
203
|
+
After each fix:
|
|
204
|
+
|
|
205
|
+
1. Run affected tests
|
|
206
|
+
2. Verify the reviewer's specific concern is addressed
|
|
207
|
+
3. Reference the review comment in commit message
|
|
208
|
+
|
|
209
|
+
After all fixes:
|
|
210
|
+
|
|
211
|
+
1. Run full `/review` pipeline (lint, types, tests, security, build)
|
|
212
|
+
2. Push with descriptive commit
|
|
213
|
+
3. Re-request review from original reviewer
|
|
214
|
+
4. Comment on PR summarizing all changes made
|
|
215
|
+
|
|
216
|
+
---
|
|
217
|
+
|
|
218
|
+
## 6. PR Body Completeness Checklist
|
|
219
|
+
|
|
220
|
+
A complete PR body must contain:
|
|
221
|
+
|
|
222
|
+
| Section | Required | Description |
|
|
223
|
+
| :--- | :--- | :--- |
|
|
224
|
+
| Summary | Always | 1-3 sentences describing the change and its motivation |
|
|
225
|
+
| Changes | Always | Categorized list of what changed |
|
|
226
|
+
| Test Plan | Always | How to verify the changes work |
|
|
227
|
+
| Breaking Changes | When applicable | What breaks and migration steps |
|
|
228
|
+
| Related Issues | When applicable | `Closes #N` or `Related to #N` |
|
|
229
|
+
| Screenshots | For UI changes | Before/after visual comparison |
|
|
230
|
+
| Checklist | Always | Standard verification items completed |
|
|
231
|
+
|
|
232
|
+
---
|
|
233
|
+
|
|
234
|
+
## 7. Repository Health Signals
|
|
235
|
+
|
|
236
|
+
When creating or reviewing PRs, check for these repo-level indicators and recommend improvements:
|
|
237
|
+
|
|
238
|
+
| Signal | Check Method | Healthy State | Recommendation if Missing |
|
|
239
|
+
| :--- | :--- | :--- | :--- |
|
|
240
|
+
| Branch protection | `gh api repos/{owner}/{repo}/branches/{branch}/protection` | Rules configured | Set up branch protection rules |
|
|
241
|
+
| PR template | `.github/pull_request_template.md` exists | Template present | Create PR template |
|
|
242
|
+
| CODEOWNERS | `CODEOWNERS` or `.github/CODEOWNERS` exists | File present | Define code ownership |
|
|
243
|
+
| CI pipeline | `.github/workflows/` contains CI config | Workflows present | Set up CI/CD pipeline |
|
|
244
|
+
| Auto-delete branches | `gh api repos/{owner}/{repo} --jq .delete_branch_on_merge` | `true` | Enable auto-delete |
|
|
245
|
+
| Default branch | `gh api repos/{owner}/{repo} --jq .default_branch` | Matches strategy | Align with branch strategy |
|
|
246
|
+
|
|
247
|
+
---
|
|
248
|
+
|
|
249
|
+
## 8. Confidence Scoring Framework
|
|
250
|
+
|
|
251
|
+
Every review finding receives a confidence score (0-100) alongside its severity level. Findings below the configurable threshold are suppressed from the review output. Based on Anthropic's Code Review architecture.
|
|
252
|
+
|
|
253
|
+
### Confidence Scale
|
|
254
|
+
|
|
255
|
+
| Score Range | Label | Meaning | Action |
|
|
256
|
+
| :--- | :--- | :--- | :--- |
|
|
257
|
+
| 90-100 | **Certain** | Definitely a real issue — clear evidence in code | Always report |
|
|
258
|
+
| 70-89 | **High** | Very likely real — strong indicators present | Report (above default threshold) |
|
|
259
|
+
| 50-69 | **Moderate** | Possibly real — some indicators but ambiguous | Suppress by default |
|
|
260
|
+
| 25-49 | **Low** | Unlikely — weak signals, may be intentional | Suppress |
|
|
261
|
+
| 0-24 | **Noise** | Almost certainly false positive | Never report |
|
|
262
|
+
|
|
263
|
+
### Threshold Configuration
|
|
264
|
+
|
|
265
|
+
- **Default threshold**: 70 (report High + Certain findings only)
|
|
266
|
+
- **Strict mode** (`--strict`): threshold 50 (include Moderate)
|
|
267
|
+
- **Relaxed mode** (`--relaxed`): threshold 90 (only Certain)
|
|
268
|
+
|
|
269
|
+
### Scoring Heuristics
|
|
270
|
+
|
|
271
|
+
| Factor | Score Adjustment | Rationale |
|
|
272
|
+
| :--- | :--- | :--- |
|
|
273
|
+
| Pattern matches known vulnerability (OWASP) | +30 | High-confidence security pattern |
|
|
274
|
+
| Issue is in PR-introduced code (not pre-existing) | +20 | Git-aware context confirms newness |
|
|
275
|
+
| Issue has file:line evidence | +15 | Specific, verifiable finding |
|
|
276
|
+
| Codebase has similar patterns elsewhere | -15 | May be intentional project convention |
|
|
277
|
+
| Issue is style/preference only | -20 | Subjective, not objective |
|
|
278
|
+
| Test file or generated code | -25 | Lower risk context |
|
|
279
|
+
|
|
280
|
+
### Output Format with Confidence
|
|
281
|
+
|
|
282
|
+
```markdown
|
|
283
|
+
### CRITICAL (confidence: 95/100)
|
|
284
|
+
|
|
285
|
+
#### Hardcoded API key in auth service
|
|
286
|
+
- **File**: `src/auth/client.ts:42`
|
|
287
|
+
- **Confidence**: 95 — matches known secret pattern, introduced in this PR
|
|
288
|
+
- **Issue**: API key exposed in source code
|
|
289
|
+
- **Fix**: Move to environment variable via `process.env.AUTH_API_KEY`
|
|
290
|
+
```
|
|
291
|
+
|
|
292
|
+
---
|
|
293
|
+
|
|
294
|
+
## 9. PR Analytics & Metrics
|
|
295
|
+
|
|
296
|
+
Track PR lifecycle metrics aligned with DORA and industry standards. Used by `/pr-status` for reporting and trend detection.
|
|
297
|
+
|
|
298
|
+
### Core PR Metrics
|
|
299
|
+
|
|
300
|
+
| Metric | Definition | How to Measure | Healthy Target |
|
|
301
|
+
| :--- | :--- | :--- | :--- |
|
|
302
|
+
| **Coding Time** | First commit to PR open | `git log --format=%aI` on first commit vs PR creation time | < 2 days |
|
|
303
|
+
| **Pickup Time** | PR creation to first review action | PR `created_at` vs first review `submitted_at` | < 4 hours |
|
|
304
|
+
| **Review Time** | First review to merge | First review `submitted_at` vs `merged_at` | < 24 hours |
|
|
305
|
+
| **Cycle Time** | First commit to merge (end-to-end) | Sum of coding + pickup + review time | < 3 days |
|
|
306
|
+
| **Merge Frequency** | PRs merged per developer per week | Count of merged PRs / active devs / weeks | 3-5 PRs/dev/week |
|
|
307
|
+
| **Review Rounds** | Number of review cycles before merge | Count of `REQUEST_CHANGES` events | < 2 rounds |
|
|
308
|
+
| **PR Size (median)** | Median lines changed per PR | `additions + deletions` across merged PRs | 100-300 LOC |
|
|
309
|
+
|
|
310
|
+
### DORA Alignment
|
|
311
|
+
|
|
312
|
+
| DORA Metric | PR Toolkit Signal | Measurement |
|
|
313
|
+
| :--- | :--- | :--- |
|
|
314
|
+
| **Deployment Frequency** | Merge frequency | PRs merged to main/production per time period |
|
|
315
|
+
| **Lead Time for Changes** | Cycle time | First commit to production deployment |
|
|
316
|
+
| **Change Failure Rate** | Revert rate | PRs that required hotfix or revert after merge |
|
|
317
|
+
| **Mean Time to Recovery** | Hotfix cycle time | Time from incident to hotfix PR merged |
|
|
318
|
+
|
|
319
|
+
### Data Collection Commands
|
|
320
|
+
|
|
321
|
+
```bash
|
|
322
|
+
# List merged PRs with dates (last 30 days)
|
|
323
|
+
gh pr list --repo <owner/repo> --state merged --limit 50 \
|
|
324
|
+
--json number,title,createdAt,mergedAt,additions,deletions,changedFiles,reviews
|
|
325
|
+
|
|
326
|
+
# Calculate cycle time for a specific PR
|
|
327
|
+
gh pr view <number> --repo <owner/repo> \
|
|
328
|
+
--json createdAt,mergedAt,reviews,commits
|
|
329
|
+
|
|
330
|
+
# Review turnaround per reviewer
|
|
331
|
+
gh api repos/<owner>/<repo>/pulls/<number>/reviews \
|
|
332
|
+
--jq '[.[] | {user: .user.login, submitted: .submitted_at, state: .state}]'
|
|
333
|
+
```
|
|
334
|
+
|
|
335
|
+
### Staleness Detection
|
|
336
|
+
|
|
337
|
+
| PR Age | Status | Action |
|
|
338
|
+
| :--- | :--- | :--- |
|
|
339
|
+
| < 3 days | Fresh | Normal flow |
|
|
340
|
+
| 3-7 days | Aging | Nudge reviewers |
|
|
341
|
+
| 7-14 days | Stale | Escalate to team lead |
|
|
342
|
+
| 14+ days | Abandoned | Consider closing with comment |
|
|
343
|
+
|
|
344
|
+
---
|
|
345
|
+
|
|
346
|
+
## 10. PR Dependency Management
|
|
347
|
+
|
|
348
|
+
Manage dependencies between PRs to ensure correct merge ordering. Based on Mergify's `Depends-On` pattern.
|
|
349
|
+
|
|
350
|
+
### Depends-On Convention
|
|
351
|
+
|
|
352
|
+
Add dependency declarations in the PR body:
|
|
353
|
+
|
|
354
|
+
```markdown
|
|
355
|
+
## Dependencies
|
|
356
|
+
|
|
357
|
+
Depends-On: #42
|
|
358
|
+
Depends-On: #45
|
|
359
|
+
Depends-On: https://github.com/org/other-repo/pull/10
|
|
360
|
+
```
|
|
361
|
+
|
|
362
|
+
### Dependency Rules
|
|
363
|
+
|
|
364
|
+
| Rule | Description |
|
|
365
|
+
| :--- | :--- |
|
|
366
|
+
| **Block merge** | A PR with unmerged dependencies cannot be merged |
|
|
367
|
+
| **Cross-repo support** | Dependencies can reference PRs in other repositories |
|
|
368
|
+
| **Cycle detection** | If PR A depends on PR B and PR B depends on PR A → **BLOCK** both with warning |
|
|
369
|
+
| **Transitive** | If A depends on B and B depends on C, then A implicitly depends on C |
|
|
370
|
+
|
|
371
|
+
### Detection Commands
|
|
372
|
+
|
|
373
|
+
```bash
|
|
374
|
+
# Extract Depends-On from PR body
|
|
375
|
+
gh pr view <number> --repo <owner/repo> --json body \
|
|
376
|
+
--jq '.body' | grep -oP 'Depends-On:\s*#?\d+|Depends-On:\s*https://[^\s]+'
|
|
377
|
+
|
|
378
|
+
# Check dependency PR status
|
|
379
|
+
gh pr view <dep-number> --repo <owner/repo> --json state --jq '.state'
|
|
380
|
+
```
|
|
381
|
+
|
|
382
|
+
### Dependency Validation Output
|
|
383
|
+
|
|
384
|
+
```markdown
|
|
385
|
+
## Dependency Check: PR #{number}
|
|
386
|
+
|
|
387
|
+
| Dependency | Status | Blocking? |
|
|
388
|
+
| :--- | :--- | :--- |
|
|
389
|
+
| #42 | MERGED | No |
|
|
390
|
+
| #45 | OPEN (approved) | Yes — must merge first |
|
|
391
|
+
| org/other-repo#10 | OPEN (in review) | Yes — cross-repo dependency |
|
|
392
|
+
|
|
393
|
+
**Verdict**: 1 blocking dependency — cannot merge until #45 is merged.
|
|
394
|
+
```
|
|
395
|
+
|
|
396
|
+
---
|
|
397
|
+
|
|
398
|
+
## 11. PR Split Strategy
|
|
399
|
+
|
|
400
|
+
Guide for splitting large PRs into focused sub-PRs. Used by `/pr-split` workflow.
|
|
401
|
+
|
|
402
|
+
### Split Categories
|
|
403
|
+
|
|
404
|
+
| Category | Detection Pattern | Sub-PR Type |
|
|
405
|
+
| :--- | :--- | :--- |
|
|
406
|
+
| **Feature code** | `src/`, `lib/`, `app/` files | `feat:` PR |
|
|
407
|
+
| **Tests** | `tests/`, `__tests__/`, `*.test.*`, `*.spec.*` | `test:` PR |
|
|
408
|
+
| **Configuration** | `.agent/`, `.github/`, config files | `chore:` PR |
|
|
409
|
+
| **Dependencies** | `package.json`, lock files, `pubspec.yaml` | `chore(deps):` PR |
|
|
410
|
+
| **Documentation** | `*.md`, `docs/` | `docs:` PR |
|
|
411
|
+
| **Styling** | CSS/SCSS files, theme files | `style:` PR |
|
|
412
|
+
| **Infrastructure** | `Dockerfile`, CI/CD workflows, terraform | `ci:` or `chore:` PR |
|
|
413
|
+
|
|
414
|
+
### Split Protocol
|
|
415
|
+
|
|
416
|
+
1. **Analyze** the diff to categorize all changed files
|
|
417
|
+
2. **Group** files by category (feature, test, config, docs, deps)
|
|
418
|
+
3. **Identify** dependencies between groups (tests depend on feature code)
|
|
419
|
+
4. **Propose** split plan with merge order
|
|
420
|
+
5. **Create** sub-branches from the original branch using `git cherry-pick` or `git checkout -- <files>`
|
|
421
|
+
6. **Verify** each sub-PR independently passes `/review` pipeline
|
|
422
|
+
|
|
423
|
+
### Split Merge Order
|
|
424
|
+
|
|
425
|
+
```
|
|
426
|
+
chore(deps): update dependencies ← merge first (no dependencies)
|
|
427
|
+
chore: update configuration ← merge second
|
|
428
|
+
feat(feature): implement core feature ← merge third
|
|
429
|
+
test(feature): add tests for feature ← merge fourth (depends on feat)
|
|
430
|
+
docs: update documentation ← merge last
|
|
431
|
+
```
|
|
432
|
+
|
|
433
|
+
---
|
|
434
|
+
|
|
435
|
+
## 12. PR Auto-Description
|
|
436
|
+
|
|
437
|
+
Generate PR title, summary, labels, and changelog from commits and diff. Used by `/pr-describe` command.
|
|
438
|
+
|
|
439
|
+
### Description Generation Algorithm
|
|
440
|
+
|
|
441
|
+
1. **Title**: Parse from branch name (section 3) or compose from commit messages
|
|
442
|
+
2. **Summary**: Aggregate commit messages into 1-3 sentence summary
|
|
443
|
+
3. **Changes**: Group commits by type (feat, fix, chore, docs) into categorized list
|
|
444
|
+
4. **Labels**: Auto-suggest labels based on file paths and commit types
|
|
445
|
+
5. **Related Issues**: Extract from commit messages (`Closes #N`, `Fixes #N`, `Relates to #N`)
|
|
446
|
+
|
|
447
|
+
### Label Suggestion Rules
|
|
448
|
+
|
|
449
|
+
| File Pattern | Suggested Label |
|
|
450
|
+
| :--- | :--- |
|
|
451
|
+
| `src/`, `lib/`, `app/` | `feature` or `bugfix` (from commit type) |
|
|
452
|
+
| `tests/`, `*.test.*` | `testing` |
|
|
453
|
+
| `docs/`, `*.md` | `documentation` |
|
|
454
|
+
| `*.css`, `*.scss`, `*.styled.*` | `styling` |
|
|
455
|
+
| `.github/`, `Dockerfile`, CI config | `infrastructure` |
|
|
456
|
+
| `package.json`, lock files | `dependencies` |
|
|
457
|
+
| Security-related files | `security` |
|
|
458
|
+
|
|
459
|
+
### Size Label (auto-assigned)
|
|
460
|
+
|
|
461
|
+
| PR Size | Label |
|
|
462
|
+
| :--- | :--- |
|
|
463
|
+
| XS (1-5 files, <100 LOC) | `size/XS` |
|
|
464
|
+
| S (6-15 files, 100-300 LOC) | `size/S` |
|
|
465
|
+
| M (16-30 files, 300-700 LOC) | `size/M` |
|
|
466
|
+
| L (31-50 files, 700-1500 LOC) | `size/L` |
|
|
467
|
+
| XL (50+ files, 1500+ LOC) | `size/XL` |
|
|
@@ -3,7 +3,7 @@ name: production-readiness
|
|
|
3
3
|
description: Production readiness audit domains, weighted scoring criteria, and check specifications for the /preflight workflow.
|
|
4
4
|
version: 1.0.0
|
|
5
5
|
triggers: [pre-deploy, pre-launch, milestone, production-readiness]
|
|
6
|
-
allowed-tools: Read, Grep
|
|
6
|
+
allowed-tools: Read, Grep, Bash
|
|
7
7
|
---
|
|
8
8
|
|
|
9
9
|
# Production Readiness
|
|
@@ -23,7 +23,7 @@ This skill defines the audit domains, sub-check rubrics, and scoring model used
|
|
|
23
23
|
## Principles
|
|
24
24
|
|
|
25
25
|
1. **Evidence over assertion** — every score must be backed by observable proof
|
|
26
|
-
2. **Non-destructive** —
|
|
26
|
+
2. **Non-destructive** — checks do not modify source code; test suites, linters, and builds may run as verification commands but must not alter project state
|
|
27
27
|
3. **Fail-safe defaults** — unverifiable checks score 0 (not assumed pass)
|
|
28
28
|
4. **Domain independence** — each domain is scored independently
|
|
29
29
|
5. **Blocker precedence** — blocker rules override total score
|
|
@@ -225,7 +225,7 @@ Blocker rules **override** the total score. Even if the total score is above thr
|
|
|
225
225
|
| :--- | :--- | :--- | :--- |
|
|
226
226
|
| **Zero Domain** | Any domain scores 0/max | 🔴 Not Ready | A completely unchecked domain is a blind spot |
|
|
227
227
|
| **Security Floor** | D5 < 50% (< 9/18) | 🔴 Not Ready | Security is non-negotiable for production |
|
|
228
|
-
| **Quality Floor** | D4 < 50% (
|
|
228
|
+
| **Quality Floor** | D4 < 50% (score ≤ 7/15) | 🟡 Caps verdict at Conditionally Ready | Code quality below threshold needs attention |
|
|
229
229
|
|
|
230
230
|
**Precedence**: Zero Domain > Security Floor > Quality Floor > Total Score
|
|
231
231
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# Antigravity AI Kit — Workflows
|
|
2
2
|
|
|
3
3
|
> **Purpose**: Process templates for common development tasks
|
|
4
|
-
> **Count**:
|
|
4
|
+
> **Count**: 21 Workflows
|
|
5
5
|
> **Standard**: Enterprise Workflow Standard (EWS) v1.0
|
|
6
6
|
|
|
7
7
|
---
|
|
@@ -28,12 +28,17 @@ Invoke them using slash commands (e.g., `/brainstorm authentication system`).
|
|
|
28
28
|
| **test** | `/test` | Verify | Systematic test writing and execution |
|
|
29
29
|
| **review** | `/review` | Verify | Sequential quality gate pipeline |
|
|
30
30
|
| **preflight** | `/preflight` | Verify | Production readiness assessment with 10-domain scoring |
|
|
31
|
-
| **pr** | `/pr` | Ship | Production-grade PR creation with
|
|
31
|
+
| **pr** | `/pr` | Ship | Production-grade PR creation with branch validation and size guards |
|
|
32
|
+
| **pr-review** | `/pr-review` | Verify | Multi-perspective PR review with senior engineering expertise |
|
|
33
|
+
| **pr-fix** | `/pr-fix` | Build | Fix PR issues based on review comments with verification |
|
|
34
|
+
| **pr-merge** | `/pr-merge` | Ship | Safe PR merge with dependency validation and post-merge checks |
|
|
35
|
+
| **pr-split** | `/pr-split` | Build | Split oversized PRs into focused sub-PRs by concern category |
|
|
32
36
|
| **deploy** | `/deploy` | Ship | Production deployment with pre-flight checks |
|
|
33
37
|
| **debug** | `/debug` | Reactive | Systematic problem investigation |
|
|
34
38
|
| **orchestrate** | `/orchestrate` | Reactive | Multi-agent coordination for complex tasks |
|
|
35
39
|
| **retrospective** | `/retrospective` | Evaluate | Tier-1 quality audit against market standards |
|
|
36
40
|
| **status** | `/status` | Cross-cutting | Project status overview and health check |
|
|
41
|
+
| **upgrade** | `/upgrade` | Maintenance | Formal protocol for non-destructive framework upgrades |
|
|
37
42
|
|
|
38
43
|
---
|
|
39
44
|
|
|
@@ -43,15 +48,17 @@ Invoke them using slash commands (e.g., `/brainstorm authentication system`).
|
|
|
43
48
|
Discover ──► Plan ──► Build ──► Verify ──► Ship ──► Evaluate
|
|
44
49
|
│ │ │ │ │ │
|
|
45
50
|
▼ ▼ ▼ ▼ ▼ ▼
|
|
46
|
-
/brainstorm /plan /create /test
|
|
47
|
-
/quality-gate /enhance /review
|
|
48
|
-
/preview /preflight
|
|
51
|
+
/brainstorm /plan /create /test /pr /retrospective
|
|
52
|
+
/quality-gate /enhance /review /pr-merge
|
|
53
|
+
/preview /preflight /deploy
|
|
54
|
+
/pr-fix /pr-review
|
|
55
|
+
/pr-split
|
|
49
56
|
/ui-ux-pro-max
|
|
50
57
|
|
|
51
58
|
Reactive (any phase) Cross-cutting (any phase)
|
|
52
59
|
──────────────────── ────────────────────────
|
|
53
60
|
/debug /status
|
|
54
|
-
/orchestrate
|
|
61
|
+
/orchestrate /upgrade
|
|
55
62
|
```
|
|
56
63
|
|
|
57
64
|
---
|
|
@@ -60,7 +60,8 @@ Only deploy when changes affect **deployed artifacts**:
|
|
|
60
60
|
## Steps
|
|
61
61
|
|
|
62
62
|
// turbo
|
|
63
|
-
1. **Pre-Flight
|
|
63
|
+
1. **Pre-Flight Re-Validation**
|
|
64
|
+
These are fast re-validation checks to catch regressions between `/preflight` and `/deploy`. They are intentionally lighter than the full `/preflight` scan.
|
|
64
65
|
- Code quality: `npx tsc --noEmit`, `npx eslint .` (or equivalent)
|
|
65
66
|
- Tests: `npm test` (or equivalent)
|
|
66
67
|
- Security: `npm audit`, no hardcoded secrets
|