@devran-ai/kit 4.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/.agent/CheatSheet.md +350 -0
- package/.agent/README.md +76 -0
- package/.agent/agents/README.md +155 -0
- package/.agent/agents/architect.md +185 -0
- package/.agent/agents/backend-specialist.md +276 -0
- package/.agent/agents/build-error-resolver.md +207 -0
- package/.agent/agents/code-reviewer.md +162 -0
- package/.agent/agents/database-architect.md +138 -0
- package/.agent/agents/devops-engineer.md +144 -0
- package/.agent/agents/doc-updater.md +229 -0
- package/.agent/agents/e2e-runner.md +145 -0
- package/.agent/agents/explorer-agent.md +143 -0
- package/.agent/agents/frontend-specialist.md +144 -0
- package/.agent/agents/go-reviewer.md +128 -0
- package/.agent/agents/knowledge-agent.md +197 -0
- package/.agent/agents/mobile-developer.md +150 -0
- package/.agent/agents/performance-optimizer.md +175 -0
- package/.agent/agents/planner.md +133 -0
- package/.agent/agents/pr-reviewer.md +148 -0
- package/.agent/agents/python-reviewer.md +123 -0
- package/.agent/agents/refactor-cleaner.md +201 -0
- package/.agent/agents/reliability-engineer.md +156 -0
- package/.agent/agents/security-reviewer.md +141 -0
- package/.agent/agents/sprint-orchestrator.md +124 -0
- package/.agent/agents/tdd-guide.md +179 -0
- package/.agent/agents/typescript-reviewer.md +110 -0
- package/.agent/checklists/README.md +102 -0
- package/.agent/checklists/pre-commit.md +93 -0
- package/.agent/checklists/session-end.md +99 -0
- package/.agent/checklists/session-start.md +102 -0
- package/.agent/checklists/task-complete.md +81 -0
- package/.agent/commands/README.md +130 -0
- package/.agent/commands/adr.md +29 -0
- package/.agent/commands/ask.md +28 -0
- package/.agent/commands/build.md +30 -0
- package/.agent/commands/changelog.md +40 -0
- package/.agent/commands/checkpoint.md +28 -0
- package/.agent/commands/code-review.md +65 -0
- package/.agent/commands/compact.md +28 -0
- package/.agent/commands/cook.md +30 -0
- package/.agent/commands/db.md +30 -0
- package/.agent/commands/debug.md +31 -0
- package/.agent/commands/deploy.md +37 -0
- package/.agent/commands/design.md +29 -0
- package/.agent/commands/doc.md +30 -0
- package/.agent/commands/eval.md +30 -0
- package/.agent/commands/fix.md +32 -0
- package/.agent/commands/git.md +32 -0
- package/.agent/commands/help.md +273 -0
- package/.agent/commands/implement.md +30 -0
- package/.agent/commands/integrate.md +32 -0
- package/.agent/commands/learn.md +29 -0
- package/.agent/commands/perf.md +31 -0
- package/.agent/commands/plan.md +56 -0
- 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 -0
- package/.agent/commands/refactor.md +32 -0
- package/.agent/commands/research.md +28 -0
- package/.agent/commands/scout.md +30 -0
- package/.agent/commands/security-scan.md +33 -0
- package/.agent/commands/setup.md +31 -0
- package/.agent/commands/status.md +59 -0
- package/.agent/commands/tdd.md +73 -0
- package/.agent/commands/verify.md +58 -0
- package/.agent/contexts/brainstorm.md +26 -0
- package/.agent/contexts/debug.md +28 -0
- package/.agent/contexts/implement.md +29 -0
- package/.agent/contexts/plan-quality-log.md +30 -0
- package/.agent/contexts/review.md +27 -0
- package/.agent/contexts/ship.md +28 -0
- package/.agent/decisions/001-trust-grade-governance.md +46 -0
- package/.agent/decisions/002-cross-ide-generation.md +15 -0
- package/.agent/engine/identity.json +4 -0
- package/.agent/engine/loading-rules.json +193 -0
- package/.agent/engine/marketplace-index.json +29 -0
- package/.agent/engine/mcp-servers/filesystem.json +9 -0
- package/.agent/engine/mcp-servers/github.json +11 -0
- package/.agent/engine/mcp-servers/postgres.json +11 -0
- package/.agent/engine/mcp-servers/supabase.json +11 -0
- package/.agent/engine/mcp-servers/vercel.json +11 -0
- package/.agent/engine/reliability-config.json +14 -0
- package/.agent/engine/sdlc-map.json +50 -0
- package/.agent/engine/workflow-state.json +167 -0
- package/.agent/hooks/README.md +101 -0
- package/.agent/hooks/hooks.json +104 -0
- package/.agent/hooks/templates/session-end.md +110 -0
- package/.agent/hooks/templates/session-start.md +95 -0
- package/.agent/manifest.json +466 -0
- package/.agent/rules/agent-upgrade-policy.md +56 -0
- package/.agent/rules/architecture.md +111 -0
- package/.agent/rules/coding-style.md +75 -0
- package/.agent/rules/documentation.md +74 -0
- package/.agent/rules/git-workflow.md +140 -0
- package/.agent/rules/quality-gate.md +117 -0
- package/.agent/rules/security.md +67 -0
- package/.agent/rules/sprint-tracking.md +103 -0
- package/.agent/rules/testing.md +80 -0
- package/.agent/rules/workflow-standards.md +30 -0
- package/.agent/rules.md +293 -0
- package/.agent/session-context.md +69 -0
- package/.agent/session-state.json +27 -0
- package/.agent/skills/README.md +135 -0
- package/.agent/skills/api-patterns/SKILL.md +117 -0
- package/.agent/skills/app-builder/SKILL.md +202 -0
- package/.agent/skills/architecture/SKILL.md +101 -0
- package/.agent/skills/behavioral-modes/SKILL.md +295 -0
- package/.agent/skills/brainstorming/SKILL.md +156 -0
- package/.agent/skills/clean-code/SKILL.md +142 -0
- package/.agent/skills/context-budget/SKILL.md +78 -0
- package/.agent/skills/continuous-learning/SKILL.md +145 -0
- package/.agent/skills/database-design/SKILL.md +303 -0
- package/.agent/skills/debugging-strategies/SKILL.md +158 -0
- package/.agent/skills/deployment-procedures/SKILL.md +191 -0
- package/.agent/skills/docker-patterns/SKILL.md +161 -0
- package/.agent/skills/eval-harness/SKILL.md +89 -0
- package/.agent/skills/frontend-patterns/SKILL.md +141 -0
- package/.agent/skills/git-workflow/SKILL.md +159 -0
- package/.agent/skills/i18n-localization/SKILL.md +191 -0
- package/.agent/skills/intelligent-routing/SKILL.md +180 -0
- package/.agent/skills/mcp-integration/SKILL.md +240 -0
- package/.agent/skills/mobile-design/SKILL.md +191 -0
- package/.agent/skills/nodejs-patterns/SKILL.md +164 -0
- package/.agent/skills/parallel-agents/SKILL.md +200 -0
- package/.agent/skills/performance-profiling/SKILL.md +134 -0
- package/.agent/skills/plan-validation/SKILL.md +192 -0
- package/.agent/skills/plan-writing/SKILL.md +183 -0
- package/.agent/skills/plan-writing/domain-enhancers.md +184 -0
- package/.agent/skills/plan-writing/plan-retrospective.md +116 -0
- package/.agent/skills/plan-writing/plan-schema.md +119 -0
- package/.agent/skills/pr-toolkit/SKILL.md +174 -0
- package/.agent/skills/production-readiness/SKILL.md +126 -0
- package/.agent/skills/security-practices/SKILL.md +109 -0
- package/.agent/skills/shell-conventions/SKILL.md +92 -0
- package/.agent/skills/strategic-compact/SKILL.md +62 -0
- package/.agent/skills/testing-patterns/SKILL.md +141 -0
- package/.agent/skills/typescript-expert/SKILL.md +160 -0
- package/.agent/skills/ui-ux-pro-max/SKILL.md +137 -0
- package/.agent/skills/ui-ux-pro-max/data/charts.csv +26 -0
- package/.agent/skills/ui-ux-pro-max/data/colors.csv +97 -0
- package/.agent/skills/ui-ux-pro-max/data/icons.csv +101 -0
- package/.agent/skills/ui-ux-pro-max/data/landing.csv +31 -0
- package/.agent/skills/ui-ux-pro-max/data/products.csv +97 -0
- package/.agent/skills/ui-ux-pro-max/data/react-performance.csv +45 -0
- package/.agent/skills/ui-ux-pro-max/data/stacks/astro.csv +54 -0
- package/.agent/skills/ui-ux-pro-max/data/stacks/flutter.csv +53 -0
- package/.agent/skills/ui-ux-pro-max/data/stacks/html-tailwind.csv +56 -0
- package/.agent/skills/ui-ux-pro-max/data/stacks/jetpack-compose.csv +53 -0
- package/.agent/skills/ui-ux-pro-max/data/stacks/nextjs.csv +53 -0
- package/.agent/skills/ui-ux-pro-max/data/stacks/nuxt-ui.csv +51 -0
- package/.agent/skills/ui-ux-pro-max/data/stacks/nuxtjs.csv +59 -0
- package/.agent/skills/ui-ux-pro-max/data/stacks/react-native.csv +52 -0
- package/.agent/skills/ui-ux-pro-max/data/stacks/react.csv +54 -0
- package/.agent/skills/ui-ux-pro-max/data/stacks/shadcn.csv +61 -0
- package/.agent/skills/ui-ux-pro-max/data/stacks/svelte.csv +54 -0
- package/.agent/skills/ui-ux-pro-max/data/stacks/swiftui.csv +51 -0
- package/.agent/skills/ui-ux-pro-max/data/stacks/vue.csv +50 -0
- package/.agent/skills/ui-ux-pro-max/data/styles.csv +68 -0
- package/.agent/skills/ui-ux-pro-max/data/typography.csv +58 -0
- package/.agent/skills/ui-ux-pro-max/data/ui-reasoning.csv +101 -0
- package/.agent/skills/ui-ux-pro-max/data/ux-guidelines.csv +100 -0
- package/.agent/skills/ui-ux-pro-max/data/web-interface.csv +31 -0
- package/.agent/skills/ui-ux-pro-max/scripts/core.py +253 -0
- package/.agent/skills/ui-ux-pro-max/scripts/design_system.py +1067 -0
- package/.agent/skills/ui-ux-pro-max/scripts/search.py +114 -0
- package/.agent/skills/verification-loop/SKILL.md +89 -0
- package/.agent/skills/webapp-testing/SKILL.md +175 -0
- package/.agent/templates/adr-template.md +32 -0
- package/.agent/templates/bug-report.md +37 -0
- package/.agent/templates/feature-request.md +32 -0
- package/.agent/workflows/README.md +101 -0
- package/.agent/workflows/brainstorm.md +86 -0
- package/.agent/workflows/create.md +85 -0
- package/.agent/workflows/debug.md +83 -0
- package/.agent/workflows/deploy.md +114 -0
- package/.agent/workflows/enhance.md +85 -0
- package/.agent/workflows/orchestrate.md +106 -0
- package/.agent/workflows/plan.md +105 -0
- package/.agent/workflows/pr-fix.md +163 -0
- package/.agent/workflows/pr-merge.md +117 -0
- package/.agent/workflows/pr-review.md +178 -0
- package/.agent/workflows/pr-split.md +118 -0
- package/.agent/workflows/pr.md +184 -0
- package/.agent/workflows/preflight.md +107 -0
- package/.agent/workflows/preview.md +95 -0
- package/.agent/workflows/quality-gate.md +103 -0
- package/.agent/workflows/retrospective.md +100 -0
- package/.agent/workflows/review.md +104 -0
- package/.agent/workflows/status.md +89 -0
- package/.agent/workflows/test.md +98 -0
- package/.agent/workflows/ui-ux-pro-max.md +93 -0
- package/.agent/workflows/upgrade.md +97 -0
- package/LICENSE +21 -0
- package/README.md +218 -0
- package/bin/kit.js +773 -0
- package/lib/agent-registry.js +228 -0
- package/lib/agent-reputation.js +343 -0
- package/lib/circuit-breaker.js +195 -0
- package/lib/cli-commands.js +322 -0
- package/lib/config-validator.js +274 -0
- package/lib/conflict-detector.js +252 -0
- package/lib/constants.js +47 -0
- package/lib/engineering-manager.js +336 -0
- package/lib/error-budget.js +370 -0
- package/lib/hook-system.js +256 -0
- package/lib/ide-generator.js +434 -0
- package/lib/identity.js +240 -0
- package/lib/io.js +146 -0
- package/lib/learning-engine.js +163 -0
- package/lib/loading-engine.js +421 -0
- package/lib/logger.js +118 -0
- package/lib/marketplace.js +321 -0
- package/lib/plugin-system.js +604 -0
- package/lib/plugin-verifier.js +197 -0
- package/lib/rate-limiter.js +113 -0
- package/lib/security-scanner.js +312 -0
- package/lib/self-healing.js +468 -0
- package/lib/session-manager.js +264 -0
- package/lib/skill-sandbox.js +244 -0
- package/lib/task-governance.js +522 -0
- package/lib/task-model.js +332 -0
- package/lib/updater.js +240 -0
- package/lib/verify.js +279 -0
- package/lib/workflow-engine.js +373 -0
- package/lib/workflow-events.js +166 -0
- package/lib/workflow-persistence.js +160 -0
- package/package.json +57 -0
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Fix PR issues from review comments. Fetch findings, prioritize by severity, implement fixes with evidence, verify, push, and post resolution summary with reviewer attribution.
|
|
3
|
+
version: 1.1.0
|
|
4
|
+
sdlc-phase: build
|
|
5
|
+
skills: [pr-toolkit, verification-loop]
|
|
6
|
+
commit-types: [fix]
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# /pr-fix — Pull Request Fix Workflow
|
|
10
|
+
|
|
11
|
+
> **Trigger**: `/pr-fix <url>` · `/pr-fix <owner/repo>#<number>` · `/pr-fix #<number>`
|
|
12
|
+
> **Lifecycle**: Build — remediation after review, before re-review
|
|
13
|
+
|
|
14
|
+
> Standards: See `rules/workflow-standards.md` (artifact discipline, evidence standard, governance)
|
|
15
|
+
|
|
16
|
+
> [!CAUTION]
|
|
17
|
+
> This workflow modifies code and pushes to the PR branch. Ensure write access and coordinate with PR author if needed.
|
|
18
|
+
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
## Critical Rules
|
|
22
|
+
|
|
23
|
+
1. **REVIEWER ATTRIBUTION** — every fix MUST credit the reviewer who flagged it (stated once, applies to all steps and output)
|
|
24
|
+
2. Fetch ALL review comments (humans AND bots) before implementing any fix
|
|
25
|
+
3. Prioritize fixes: CRITICAL → HIGH → MEDIUM → LOW — never skip severity levels
|
|
26
|
+
4. Run `/review` pipeline after all fixes before pushing — never push broken code
|
|
27
|
+
5. Never modify code unrelated to review findings — stay scoped
|
|
28
|
+
6. Atomic commits — one fix per commit referencing the finding (exception: related doc fixes in same file)
|
|
29
|
+
|
|
30
|
+
---
|
|
31
|
+
|
|
32
|
+
## Argument Parsing
|
|
33
|
+
|
|
34
|
+
| Command | Action |
|
|
35
|
+
| :--- | :--- |
|
|
36
|
+
| `/pr-fix #<number>` | Fix PR in current repo |
|
|
37
|
+
| `/pr-fix <url>` | Fix PR at GitHub URL |
|
|
38
|
+
| `/pr-fix #<number> --critical-only` | Fix only CRITICAL findings |
|
|
39
|
+
| `/pr-fix #<number> --dry-run` | Show fix plan without implementing |
|
|
40
|
+
|
|
41
|
+
---
|
|
42
|
+
|
|
43
|
+
## Steps
|
|
44
|
+
|
|
45
|
+
### Step 1: Parse PR Reference and Validate
|
|
46
|
+
|
|
47
|
+
// turbo
|
|
48
|
+
|
|
49
|
+
Parse PR reference, validate PR is open. If closed/merged → **STOP**.
|
|
50
|
+
|
|
51
|
+
### Step 2: Fetch ALL Review Comments
|
|
52
|
+
|
|
53
|
+
```bash
|
|
54
|
+
gh api repos/<owner>/<repo>/pulls/<number>/reviews
|
|
55
|
+
gh api repos/<owner>/<repo>/pulls/<number>/comments
|
|
56
|
+
gh api repos/<owner>/<repo>/issues/<number>/comments
|
|
57
|
+
gh pr diff <number> --repo <owner/repo>
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
For each comment extract: **Reviewer**, **Type** (inline/general), **Finding**, **Severity**, **Suggested fix**, **Status**. Skip resolved/outdated comments.
|
|
61
|
+
|
|
62
|
+
**Bot parsing**: Gemini → `Medium/High Priority` labels + `Suggested change` blocks. CodeRabbit → severity badges. SonarCloud → quality gate issues.
|
|
63
|
+
|
|
64
|
+
### Step 3: Categorize and Prioritize
|
|
65
|
+
|
|
66
|
+
| Priority | Category | Examples |
|
|
67
|
+
| :--- | :--- | :--- |
|
|
68
|
+
| P0 | CRITICAL | Security, data loss, crashes |
|
|
69
|
+
| P1 | HIGH | Broken functionality, test failures |
|
|
70
|
+
| P2 | MEDIUM | Doc inconsistencies, naming |
|
|
71
|
+
| P3 | LOW/NIT | Suggestions, preferences |
|
|
72
|
+
|
|
73
|
+
Generate fix plan table: `# | Priority | Reviewer | File:Line | Finding | Planned Fix`
|
|
74
|
+
|
|
75
|
+
If `--dry-run` → display plan and **STOP**. If `--critical-only` → filter to P0.
|
|
76
|
+
|
|
77
|
+
### Step 4: Checkout PR Branch
|
|
78
|
+
|
|
79
|
+
```bash
|
|
80
|
+
git fetch origin <head-branch> && git checkout <head-branch> && git pull origin <head-branch>
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
### Step 5: Implement Fixes
|
|
84
|
+
|
|
85
|
+
For each fix (P0 → P3 order):
|
|
86
|
+
1. Read file, record before state with line number
|
|
87
|
+
2. Implement fix addressing reviewer's exact concern
|
|
88
|
+
3. Record after state
|
|
89
|
+
4. Verify fix, commit:
|
|
90
|
+
```bash
|
|
91
|
+
git commit -m "fix(review): <description>
|
|
92
|
+
|
|
93
|
+
Addresses @<reviewer>'s finding at <file>:<line>"
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
**Guidelines**: Address exact concern — no over-fixing. Apply bot `Suggested change` blocks when valid. Verify cross-file consistency after each fix. Closely related fixes in same file from same reviewer may be grouped with documented reason.
|
|
97
|
+
|
|
98
|
+
### Step 6: Run Verification
|
|
99
|
+
|
|
100
|
+
Run `/review` pipeline (lint → type-check → tests → security → build). Record per-gate status. Max 3 retry cycles on failure.
|
|
101
|
+
|
|
102
|
+
### Step 7: Push Fixes
|
|
103
|
+
|
|
104
|
+
```bash
|
|
105
|
+
git push origin <head-branch>
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
### Step 8: Post Resolution Summary
|
|
109
|
+
|
|
110
|
+
Post comment on PR with fixes table, before/after diffs, verification results, and disposition. Re-request review from human reviewers via `gh pr edit --add-reviewer`.
|
|
111
|
+
|
|
112
|
+
---
|
|
113
|
+
|
|
114
|
+
## Output Template
|
|
115
|
+
|
|
116
|
+
```markdown
|
|
117
|
+
## PR Fix Complete: #{number} — {title}
|
|
118
|
+
|
|
119
|
+
| Field | Value |
|
|
120
|
+
| :--- | :--- |
|
|
121
|
+
| Fixes Applied | {count} ({n} humans, {n} bots) |
|
|
122
|
+
| Commits | {count} |
|
|
123
|
+
| Verification | All gates passed |
|
|
124
|
+
|
|
125
|
+
### Fix Summary
|
|
126
|
+
| # | Priority | Reviewer | File:Line | Fix Applied | Commit |
|
|
127
|
+
| :--- | :--- | :--- | :--- | :--- | :--- |
|
|
128
|
+
|
|
129
|
+
### Verification
|
|
130
|
+
| Gate | Status |
|
|
131
|
+
| :--- | :--- |
|
|
132
|
+
| Lint / Type Check / Tests / Security / Build | Pass/Fail |
|
|
133
|
+
|
|
134
|
+
**Next**: Wait for re-review. Bots re-analyze automatically on push.
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
---
|
|
138
|
+
|
|
139
|
+
## Governance
|
|
140
|
+
|
|
141
|
+
**PROHIBITED:** Modifying unrelated code · pushing without verification · dismissing comments without justification · force-pushing · omitting before/after diffs or reviewer attribution
|
|
142
|
+
|
|
143
|
+
**REQUIRED:** Read ALL comments before fixing · priority-ordered fixing · atomic commits · full verification before push · detailed summary with attribution and file:line · re-request review
|
|
144
|
+
|
|
145
|
+
---
|
|
146
|
+
|
|
147
|
+
## Completion Criteria
|
|
148
|
+
|
|
149
|
+
- [ ] All review comments fetched and attributed
|
|
150
|
+
- [ ] Fix plan generated with priority ordering
|
|
151
|
+
- [ ] Fixes implemented with before/after evidence
|
|
152
|
+
- [ ] Verification pipeline passed
|
|
153
|
+
- [ ] Summary comment posted with attribution and diffs
|
|
154
|
+
- [ ] Re-review requested
|
|
155
|
+
|
|
156
|
+
---
|
|
157
|
+
|
|
158
|
+
## Related Resources
|
|
159
|
+
|
|
160
|
+
- **Skill**: `.agent/skills/pr-toolkit/SKILL.md`
|
|
161
|
+
- **Previous**: `/pr-review`
|
|
162
|
+
- **Next**: Re-review cycle
|
|
163
|
+
- **Related**: `/review` · `/pr`
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Safe PR merge with dependency validation, CI verification, post-merge checks, and branch cleanup.
|
|
3
|
+
version: 1.0.0
|
|
4
|
+
sdlc-phase: ship
|
|
5
|
+
skills: [pr-toolkit, verification-loop]
|
|
6
|
+
commit-types: [feat, fix, refactor, perf, chore, docs, test]
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# /pr-merge — Safe Pull Request Merge Workflow
|
|
10
|
+
|
|
11
|
+
> **Trigger**: `/pr-merge <url>` · `/pr-merge #<number>`
|
|
12
|
+
> **Lifecycle**: Ship — after review approval, before deployment
|
|
13
|
+
|
|
14
|
+
> Standards: See `rules/workflow-standards.md`
|
|
15
|
+
|
|
16
|
+
> [!CAUTION]
|
|
17
|
+
> Merging modifies the target branch and is difficult to reverse. Ensure all checks pass, reviews approved, and dependencies merged.
|
|
18
|
+
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
## Critical Rules
|
|
22
|
+
|
|
23
|
+
1. Never merge with failing CI checks
|
|
24
|
+
2. Never merge without at least 1 approval (unless solo project)
|
|
25
|
+
3. Never merge with unresolved `Depends-On:` PRs still open
|
|
26
|
+
4. Verify merge target matches branch strategy
|
|
27
|
+
5. Run post-merge validation for integration issues
|
|
28
|
+
6. Prefer squash merge for features, merge commit for release/dev→main
|
|
29
|
+
|
|
30
|
+
---
|
|
31
|
+
|
|
32
|
+
## Argument Parsing
|
|
33
|
+
|
|
34
|
+
| Command | Action |
|
|
35
|
+
| :--- | :--- |
|
|
36
|
+
| `/pr-merge #<number>` | Merge PR in current repo |
|
|
37
|
+
| `/pr-merge #<number> --squash/--merge-commit/--rebase` | Force merge strategy |
|
|
38
|
+
| `/pr-merge #<number> --dry-run` | Validate readiness without merging |
|
|
39
|
+
|
|
40
|
+
---
|
|
41
|
+
|
|
42
|
+
## Steps
|
|
43
|
+
|
|
44
|
+
### Step 1: Validate PR State
|
|
45
|
+
// turbo
|
|
46
|
+
Verify PR is open, mergeable, not blocked via `gh pr view`.
|
|
47
|
+
|
|
48
|
+
### Step 2: Verify Prerequisites
|
|
49
|
+
// turbo
|
|
50
|
+
- **Review**: `reviewDecision` must be `APPROVED`
|
|
51
|
+
- **CI**: all checks passing via `gh pr checks`
|
|
52
|
+
- **Dependencies**: extract `Depends-On` from body, verify all merged
|
|
53
|
+
- **Branch strategy**: verify target matches detected strategy
|
|
54
|
+
|
|
55
|
+
### Step 3: Execute Merge
|
|
56
|
+
|
|
57
|
+
| Scenario | Default Strategy |
|
|
58
|
+
| :--- | :--- |
|
|
59
|
+
| Feature → dev | Squash merge |
|
|
60
|
+
| dev → main (release) | Merge commit |
|
|
61
|
+
| hotfix → main | Squash merge |
|
|
62
|
+
|
|
63
|
+
```bash
|
|
64
|
+
gh pr merge <number> --repo <owner/repo> --{squash|merge|rebase} --delete-branch
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
### Step 4: Post-Merge Validation
|
|
68
|
+
// turbo
|
|
69
|
+
- Verify merge recorded, check target branch CI
|
|
70
|
+
- Notify dependent PRs that this dependency is now merged
|
|
71
|
+
|
|
72
|
+
---
|
|
73
|
+
|
|
74
|
+
## Output Template
|
|
75
|
+
|
|
76
|
+
```markdown
|
|
77
|
+
## PR Merged: #{number}
|
|
78
|
+
|
|
79
|
+
| Field | Value |
|
|
80
|
+
| :--- | :--- |
|
|
81
|
+
| Merged into | {base} |
|
|
82
|
+
| Strategy | {squash/merge/rebase} |
|
|
83
|
+
| Branch cleanup | Deleted |
|
|
84
|
+
|
|
85
|
+
### Post-Merge
|
|
86
|
+
| Check | Status |
|
|
87
|
+
| :--- | :--- |
|
|
88
|
+
| CI on target | {status} |
|
|
89
|
+
| Dependent PRs notified | {count} |
|
|
90
|
+
|
|
91
|
+
**Next**: `/deploy` when ready
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
---
|
|
95
|
+
|
|
96
|
+
## Governance
|
|
97
|
+
|
|
98
|
+
**PROHIBITED:** Merging with failing CI · without approval · with open dependencies · force-merging past protections
|
|
99
|
+
|
|
100
|
+
**REQUIRED:** All CI passing · review approval · dependency validation · branch strategy compliance · post-merge verification · branch cleanup
|
|
101
|
+
|
|
102
|
+
---
|
|
103
|
+
|
|
104
|
+
## Completion Criteria
|
|
105
|
+
|
|
106
|
+
- [ ] PR validated (open, mergeable, approved, CI passing)
|
|
107
|
+
- [ ] Dependencies verified, strategy compliance checked
|
|
108
|
+
- [ ] Merged with appropriate strategy, branch deleted
|
|
109
|
+
- [ ] Post-merge CI checked, dependent PRs notified
|
|
110
|
+
|
|
111
|
+
---
|
|
112
|
+
|
|
113
|
+
## Related Resources
|
|
114
|
+
|
|
115
|
+
- **Skill**: `.agent/skills/pr-toolkit/SKILL.md`
|
|
116
|
+
- **Previous**: `/pr-review` · `/pr-fix`
|
|
117
|
+
- **Next**: `/deploy`
|
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Multi-perspective PR review covering hygiene, branch strategy, code quality, security, testing, and architecture. Engages with existing reviewer comments and tracks review rounds.
|
|
3
|
+
version: 1.1.0
|
|
4
|
+
sdlc-phase: verify
|
|
5
|
+
skills: [pr-toolkit, verification-loop]
|
|
6
|
+
commit-types: []
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# /pr-review — Pull Request Review Workflow
|
|
10
|
+
|
|
11
|
+
> **Trigger**: `/pr-review <url>` · `/pr-review <owner/repo>#<number>` · `/pr-review #<number>`
|
|
12
|
+
> **Lifecycle**: Verify — peer review before merge
|
|
13
|
+
|
|
14
|
+
> Standards: See `rules/workflow-standards.md` (artifact discipline, evidence standard, governance)
|
|
15
|
+
|
|
16
|
+
> [!CAUTION]
|
|
17
|
+
> This workflow posts reviews to GitHub visible to the entire team. Ensure findings are accurate, constructive, and properly prioritized.
|
|
18
|
+
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
## Critical Rules
|
|
22
|
+
|
|
23
|
+
1. **EVIDENCE MANDATE** — every finding MUST include `file:line` reference with concrete fix suggestion. Generic statements are not findings. This applies globally to ALL steps below
|
|
24
|
+
2. Fetch full PR diff before reviewing — never review from title/description alone
|
|
25
|
+
3. Detect branch strategy before assessing target branch compliance
|
|
26
|
+
4. Never post review with only NITs — if clean, APPROVE explicitly
|
|
27
|
+
5. Never approve with known CRITICAL findings
|
|
28
|
+
6. Engage with ALL existing reviews/comments (bots and humans) — acknowledge, challenge, or reference
|
|
29
|
+
7. Track review rounds — for follow-ups, report which prior findings were addressed
|
|
30
|
+
8. Review title: `PR #{number} Review — {content-specific summary}` (no agent branding)
|
|
31
|
+
|
|
32
|
+
---
|
|
33
|
+
|
|
34
|
+
## Argument Parsing
|
|
35
|
+
|
|
36
|
+
| Command | Action |
|
|
37
|
+
| :--- | :--- |
|
|
38
|
+
| `/pr-review <url>` | Review PR at GitHub URL |
|
|
39
|
+
| `/pr-review #<number>` | Review PR in current repo |
|
|
40
|
+
| `/pr-review #<number> --local` | Review locally only — do not post |
|
|
41
|
+
| `/pr-review #<number> --focus security` | Focus on security perspective only |
|
|
42
|
+
|
|
43
|
+
---
|
|
44
|
+
|
|
45
|
+
## Steps
|
|
46
|
+
|
|
47
|
+
### Step 1: Parse PR Reference
|
|
48
|
+
|
|
49
|
+
// turbo
|
|
50
|
+
|
|
51
|
+
Extract `owner/repo` and PR number. Validate PR exists and is open via `gh pr view`.
|
|
52
|
+
|
|
53
|
+
### Step 2: Fetch PR Data & Existing Comments
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
gh pr view <number> --repo <owner/repo> \
|
|
57
|
+
--json title,body,state,baseRefName,headRefName,author,files,additions,deletions,changedFiles,commits,labels,url,reviews,reviewRequests
|
|
58
|
+
gh pr diff <number> --repo <owner/repo>
|
|
59
|
+
gh api repos/<owner>/<repo>/pulls/<number>/reviews
|
|
60
|
+
gh api repos/<owner>/<repo>/pulls/<number>/comments
|
|
61
|
+
gh api repos/<owner>/<repo>/issues/<number>/comments
|
|
62
|
+
gh pr checks <number> --repo <owner/repo>
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
### Step 3: Review Round & Existing Comment Analysis
|
|
66
|
+
|
|
67
|
+
**3a. Round Detection**: Count prior substantive reviews. If Round N+1, cross-reference current diff against previous findings to track addressed vs unaddressed items.
|
|
68
|
+
|
|
69
|
+
**3b. Existing Comment Engagement**: For each comment from any reviewer (human or bot):
|
|
70
|
+
- Classify finding severity and assess validity
|
|
71
|
+
- Valid + open → reference and build on it
|
|
72
|
+
- Valid + addressed → acknowledge resolution
|
|
73
|
+
- Invalid → challenge constructively with evidence
|
|
74
|
+
- Duplicate of your finding → skip yours, reference theirs
|
|
75
|
+
|
|
76
|
+
### Step 4: PR Hygiene
|
|
77
|
+
|
|
78
|
+
// turbo
|
|
79
|
+
|
|
80
|
+
- **Title**: conventional commits format, imperative mood, <72 chars
|
|
81
|
+
- **Body**: Summary, Changes, Test Plan sections present
|
|
82
|
+
- **Size**: XS/S/M/L/XL per pr-toolkit matrix. XL (50+ files/1500+ LOC) → CRITICAL (exception: automated vendor upgrades)
|
|
83
|
+
- **Scope**: detect mixed concerns → HIGH
|
|
84
|
+
|
|
85
|
+
### Step 5: Branch Strategy
|
|
86
|
+
|
|
87
|
+
// turbo
|
|
88
|
+
|
|
89
|
+
- Detect GitFlow vs Trunk-Based (check for `dev`/`develop` remote branch)
|
|
90
|
+
- Validate target branch per strategy rules
|
|
91
|
+
- Check branch naming convention
|
|
92
|
+
|
|
93
|
+
### Step 6: Multi-Perspective Code Review
|
|
94
|
+
|
|
95
|
+
Read each changed file. For every finding include: `file:line`, quoted code, impact explanation, concrete fix.
|
|
96
|
+
|
|
97
|
+
**Cross-file consistency**: verify counts, references, categorizations match across related files.
|
|
98
|
+
|
|
99
|
+
**6a. Code Quality** — function size (>50 lines), file size (>800 lines), nesting (>4 levels), error handling, debug artifacts, naming, immutability
|
|
100
|
+
|
|
101
|
+
**6b. Security** — hardcoded secrets, input validation, injection risks, XSS, auth/authz, PII exposure
|
|
102
|
+
|
|
103
|
+
**6c. Testing** — untested new code, coverage reduction, flaky patterns, missing edge cases
|
|
104
|
+
|
|
105
|
+
**6d. Architecture** — pattern consistency, separation of concerns, circular deps, over-engineering, API consistency
|
|
106
|
+
|
|
107
|
+
### Step 7: Generate Review Report
|
|
108
|
+
|
|
109
|
+
1. Title: `PR #{number} Review — {2-5 word summary}`
|
|
110
|
+
2. Round indicator with prior findings tracker (if Round 2+)
|
|
111
|
+
3. Existing reviewer engagement summary
|
|
112
|
+
4. **Group findings by severity** (CRITICAL → HIGH → MEDIUM → LOW → NIT) — mandatory
|
|
113
|
+
5. "What's Good" section: 3+ specific positive observations with file paths
|
|
114
|
+
6. Verdict per decision table
|
|
115
|
+
|
|
116
|
+
### Step 8: Post Review to GitHub
|
|
117
|
+
|
|
118
|
+
Skip if `--local`. Post via `gh pr review` with verdict. Post inline findings via `gh api`. Fallback to local display on failure.
|
|
119
|
+
|
|
120
|
+
---
|
|
121
|
+
|
|
122
|
+
## Output Template
|
|
123
|
+
|
|
124
|
+
```markdown
|
|
125
|
+
## PR #{number} Review — {summary}
|
|
126
|
+
|
|
127
|
+
| Field | Value |
|
|
128
|
+
| :--- | :--- |
|
|
129
|
+
| PR | #{number} — {title} |
|
|
130
|
+
| Branch | {head} → {base} |
|
|
131
|
+
| Size | {label} ({files} files, +{add}/-{del}) |
|
|
132
|
+
| Round | {Round N — X/Y prior findings addressed} |
|
|
133
|
+
| Verdict | {APPROVE / REQUEST_CHANGES / COMMENT} |
|
|
134
|
+
|
|
135
|
+
### Existing Reviewer Comments
|
|
136
|
+
| Reviewer | Comments | Agreed | Challenged | Addressed |
|
|
137
|
+
| :--- | :--- | :--- | :--- | :--- |
|
|
138
|
+
|
|
139
|
+
### Assessment Summary
|
|
140
|
+
| Perspective | Status | Findings |
|
|
141
|
+
| :--- | :--- | :--- |
|
|
142
|
+
| PR Hygiene / Branch / Code Quality / Security / Testing / Architecture | {status} | {count} |
|
|
143
|
+
|
|
144
|
+
### Must Fix / High / Medium / Low
|
|
145
|
+
{numbered findings with file:line, impact, fix suggestion}
|
|
146
|
+
|
|
147
|
+
### What's Good
|
|
148
|
+
- {3+ specific positive observations with file paths}
|
|
149
|
+
|
|
150
|
+
## Verdict: {verdict} — {justification}
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
---
|
|
154
|
+
|
|
155
|
+
## Governance
|
|
156
|
+
|
|
157
|
+
**PROHIBITED:** Approving with CRITICAL findings · reviewing without full diff · findings without `file:line` · ignoring existing reviewer comments · agent branding in titles · severity-by-perspective grouping
|
|
158
|
+
|
|
159
|
+
**REQUIRED:** Full diff analysis · concrete fix per finding · severity-first ordering · branch strategy detection · "What's Good" section · existing comment engagement · round tracking · cross-file consistency
|
|
160
|
+
|
|
161
|
+
---
|
|
162
|
+
|
|
163
|
+
## Completion Criteria
|
|
164
|
+
|
|
165
|
+
- [ ] PR data, diff, and all existing comments fetched
|
|
166
|
+
- [ ] Review round detected; existing comments analyzed
|
|
167
|
+
- [ ] All 6 perspectives reviewed with file:line evidence
|
|
168
|
+
- [ ] Findings grouped by severity with fix suggestions
|
|
169
|
+
- [ ] "What's Good" section with 3+ observations
|
|
170
|
+
- [ ] Verdict rendered and review posted (unless `--local`)
|
|
171
|
+
|
|
172
|
+
---
|
|
173
|
+
|
|
174
|
+
## Related Resources
|
|
175
|
+
|
|
176
|
+
- **Skill**: `.agent/skills/pr-toolkit/SKILL.md`
|
|
177
|
+
- **Agent**: `.agent/agents/pr-reviewer.md`
|
|
178
|
+
- **Related**: `/pr` · `/pr-fix` · `/review`
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Guide splitting large PRs into focused sub-PRs by concern category with dependency-ordered merge plan.
|
|
3
|
+
version: 1.0.0
|
|
4
|
+
sdlc-phase: build
|
|
5
|
+
skills: [pr-toolkit, git-workflow]
|
|
6
|
+
commit-types: [chore]
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# /pr-split — Pull Request Split Workflow
|
|
10
|
+
|
|
11
|
+
> **Trigger**: `/pr-split` (current branch) · `/pr-split #<number>` (existing PR)
|
|
12
|
+
> **Lifecycle**: Build — remediation for oversized PRs
|
|
13
|
+
|
|
14
|
+
> Standards: See `rules/workflow-standards.md`
|
|
15
|
+
|
|
16
|
+
> [!CAUTION]
|
|
17
|
+
> Uses `git cherry-pick` and selective checkout — does NOT rewrite commits. Original branch preserved until user closes it.
|
|
18
|
+
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
## Critical Rules
|
|
22
|
+
|
|
23
|
+
1. Never delete or force-push the original branch
|
|
24
|
+
2. Analyze full diff before proposing split
|
|
25
|
+
3. Each sub-PR must independently pass `/review`
|
|
26
|
+
4. Include dependency ordering in split plan
|
|
27
|
+
5. Use cherry-pick or selective checkout — preserve all commits
|
|
28
|
+
6. Each sub-PR must be independently mergeable and testable
|
|
29
|
+
|
|
30
|
+
---
|
|
31
|
+
|
|
32
|
+
## Argument Parsing
|
|
33
|
+
|
|
34
|
+
| Command | Action |
|
|
35
|
+
| :--- | :--- |
|
|
36
|
+
| `/pr-split` | Analyze current branch |
|
|
37
|
+
| `/pr-split #<number>` | Analyze existing PR |
|
|
38
|
+
| `/pr-split --dry-run` | Show plan only |
|
|
39
|
+
| `/pr-split --auto` | Auto-split by file category |
|
|
40
|
+
|
|
41
|
+
---
|
|
42
|
+
|
|
43
|
+
## Steps
|
|
44
|
+
|
|
45
|
+
### Step 1: Analyze Diff
|
|
46
|
+
// turbo
|
|
47
|
+
Classify PR size. If XS/S/M → **STOP** (splitting not needed). If L/XL → proceed.
|
|
48
|
+
|
|
49
|
+
### Step 2: Categorize Files
|
|
50
|
+
// turbo
|
|
51
|
+
Group changed files by concern: Feature Code, Tests, Configuration, Dependencies, Documentation.
|
|
52
|
+
|
|
53
|
+
### Step 3: Propose Split Plan
|
|
54
|
+
// turbo
|
|
55
|
+
Generate plan with merge ordering. Present for user approval. If `--dry-run` → **STOP**.
|
|
56
|
+
|
|
57
|
+
```markdown
|
|
58
|
+
| # | Sub-PR | Branch | Files | Type | Depends On |
|
|
59
|
+
| :--- | :--- | :--- | :--- | :--- | :--- |
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
### Step 4: Create Sub-Branches
|
|
63
|
+
For each sub-PR: checkout target, create `split/<original>-<category>`, selectively checkout files from original branch, commit.
|
|
64
|
+
|
|
65
|
+
### Step 5: Verify Each Sub-Branch
|
|
66
|
+
// turbo
|
|
67
|
+
Run `/review` pipeline per sub-branch. Each must independently build and test.
|
|
68
|
+
|
|
69
|
+
### Step 6: Create Sub-PRs
|
|
70
|
+
Follow `/pr` workflow for each sub-PR. Include in body: split context, dependency declarations, merge order.
|
|
71
|
+
|
|
72
|
+
### Step 7: Update Original PR
|
|
73
|
+
Post comment linking all sub-PRs with merge order.
|
|
74
|
+
|
|
75
|
+
---
|
|
76
|
+
|
|
77
|
+
## Output Template
|
|
78
|
+
|
|
79
|
+
```markdown
|
|
80
|
+
## PR Split Complete
|
|
81
|
+
|
|
82
|
+
| Field | Value |
|
|
83
|
+
| :--- | :--- |
|
|
84
|
+
| Original | #{number} |
|
|
85
|
+
| Sub-PRs | {count} |
|
|
86
|
+
| Verification | All pass /review |
|
|
87
|
+
|
|
88
|
+
### Sub-PRs
|
|
89
|
+
| # | PR | Title | Size | Status |
|
|
90
|
+
|
|
91
|
+
**Next**: Review and merge in order.
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
---
|
|
95
|
+
|
|
96
|
+
## Governance
|
|
97
|
+
|
|
98
|
+
**PROHIBITED:** Deleting original branch · sub-PRs that can't build independently · circular dependencies · proceeding without user approval
|
|
99
|
+
|
|
100
|
+
**REQUIRED:** Full diff analysis · user approval of plan · each sub-PR passes `/review` · dependency ordering · original PR updated with links
|
|
101
|
+
|
|
102
|
+
---
|
|
103
|
+
|
|
104
|
+
## Completion Criteria
|
|
105
|
+
|
|
106
|
+
- [ ] PR analyzed, files categorized
|
|
107
|
+
- [ ] Split plan approved by user
|
|
108
|
+
- [ ] Sub-branches created and verified
|
|
109
|
+
- [ ] Sub-PRs created with dependency declarations
|
|
110
|
+
- [ ] Original PR updated
|
|
111
|
+
|
|
112
|
+
---
|
|
113
|
+
|
|
114
|
+
## Related Resources
|
|
115
|
+
|
|
116
|
+
- **Skill**: `.agent/skills/pr-toolkit/SKILL.md`
|
|
117
|
+
- **Previous**: `/pr` (XL warning triggered)
|
|
118
|
+
- **Next**: `/pr-review` · `/pr-merge`
|