@phuc1403/musketeer 0.8.0 → 0.10.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/INSTALLATION.md +52 -52
- package/README.md +49 -49
- package/bin/musketeer.js +168 -168
- package/manifest.json +333 -301
- package/package.json +48 -48
- package/src/dotnet-scaffold-copier.js +79 -79
- package/src/provisioner/detect.js +93 -93
- package/src/self-update.js +77 -77
- package/template/.claude/agents/code-reviewer.md +182 -166
- package/template/.claude/agents/git-manager.md +18 -18
- package/template/.claude/agents/hallmark-auditor.md +78 -78
- package/template/.claude/agents/researcher.md +33 -33
- package/template/.claude/hooks/block-unsafe-adr-title.cjs +85 -85
- package/template/.claude/hooks/git-skill-reminder.cjs +53 -0
- package/template/.claude/hooks/init-adr-dir.cjs +173 -173
- package/template/.claude/hooks/inject-adr-flags.cjs +94 -94
- package/template/.claude/hooks/lib/adr/command-scan.cjs +115 -115
- package/template/.claude/hooks/lib/characteristics/checker.cjs +357 -357
- package/template/.claude/hooks/lib/colors.cjs +180 -122
- package/template/.claude/hooks/lib/git-info-cache.cjs +191 -191
- package/template/.claude/hooks/lib/transcript-parser.cjs +300 -277
- package/template/.claude/hooks/sync-adr-toc.cjs +146 -146
- package/template/.claude/hooks/{usage-context-awareness.cjs → usage-quota-cache-refresh.cjs} +166 -166
- package/template/.claude/hooks/validate-characteristics-hook.cjs +66 -66
- package/template/.claude/hooks/validate-cml-hook.js +145 -145
- package/template/.claude/skills/adr-writer/SKILL.md +48 -48
- package/template/.claude/skills/adr-writer/references/adr-example.md +35 -35
- package/template/.claude/skills/architecture-characteristic-writer/SKILL.md +215 -215
- package/template/.claude/skills/architecture-characteristic-writer/assets/worksheet-template.md +29 -29
- package/template/.claude/skills/architecture-characteristic-writer/references/characteristics-catalog.md +40 -40
- package/template/.claude/skills/architecture-characteristic-writer/scripts/ranking-table.cjs +171 -171
- package/template/.claude/skills/code-review/SKILL.md +201 -54
- package/template/.claude/skills/code-review/references/checklist-workflow.md +96 -0
- package/template/.claude/skills/code-review/references/checklists/api.md +52 -52
- package/template/.claude/skills/code-review/references/checklists/base.md +100 -100
- package/template/.claude/skills/code-review/references/checklists/web-app.md +54 -54
- package/template/.claude/skills/code-review/references/code-review-reception.md +113 -0
- package/template/.claude/skills/code-review/references/codebase-scan-workflow.md +30 -0
- package/template/.claude/skills/code-review/references/edge-case-scouting.md +119 -0
- package/template/.claude/skills/code-review/references/input-mode-resolution.md +135 -0
- package/template/.claude/skills/code-review/references/parallel-review-workflow.md +76 -0
- package/template/.claude/skills/code-review/references/requesting-code-review.md +116 -0
- package/template/.claude/skills/code-review/references/spec-compliance-review.md +43 -0
- package/template/.claude/skills/code-review/references/task-management-reviews.md +140 -0
- package/template/.claude/skills/code-review/references/verification-before-completion.md +139 -0
- package/template/.claude/skills/context-map/SKILL.md +80 -80
- package/template/.claude/skills/context-map/example.cml +106 -106
- package/template/.claude/skills/context-map/reference/Bounded Context/Bounded Context.md +40 -40
- package/template/.claude/skills/context-map/reference/Bounded Context/businessModel.md +5 -5
- package/template/.claude/skills/context-map/reference/Bounded Context/domainVisionStatement.md +2 -2
- package/template/.claude/skills/context-map/reference/Bounded Context/evolution.md +5 -5
- package/template/.claude/skills/context-map/reference/Bounded Context/implementationTechnology.md +1 -1
- package/template/.claude/skills/context-map/reference/Bounded Context/implements.md +1 -1
- package/template/.claude/skills/context-map/reference/Bounded Context/knowledgeLevel.md +4 -4
- package/template/.claude/skills/context-map/reference/Bounded Context/realizes.md +9 -9
- package/template/.claude/skills/context-map/reference/Bounded Context/refines.md +10 -10
- package/template/.claude/skills/context-map/reference/Bounded Context/responsibilities.md +26 -26
- package/template/.claude/skills/context-map/reference/Bounded Context/type.md +23 -23
- package/template/.claude/skills/context-map/reference/Bounded Context Relationship/Anticorruption Layer.md +5 -5
- package/template/.claude/skills/context-map/reference/Bounded Context Relationship/Bounded Context Relationship.md +12 -12
- package/template/.claude/skills/context-map/reference/Bounded Context Relationship/Conformist.md +5 -5
- package/template/.claude/skills/context-map/reference/Bounded Context Relationship/Customer-Supplier (C-S).md +22 -22
- package/template/.claude/skills/context-map/reference/Bounded Context Relationship/Open Host Service.md +4 -4
- package/template/.claude/skills/context-map/reference/Bounded Context Relationship/Partnership (P).md +13 -13
- package/template/.claude/skills/context-map/reference/Bounded Context Relationship/Published Language.md +4 -4
- package/template/.claude/skills/context-map/reference/Bounded Context Relationship/Shared Kernel (SK).md +12 -12
- package/template/.claude/skills/context-map/reference/Context Map.md +62 -62
- package/template/.claude/skills/context-map/reference/Domain/Domain.md +30 -30
- package/template/.claude/skills/context-map/reference/Domain/supports.md +33 -33
- package/template/.claude/skills/context-map/reference/Domain/type.md +3 -3
- package/template/.claude/skills/context-map/reference/Semantic Rules.md +32 -32
- package/template/.claude/skills/git/SKILL.md +131 -115
- package/template/.claude/skills/git/references/branch-management.md +88 -88
- package/template/.claude/skills/git/references/commit-standards.md +46 -46
- package/template/.claude/skills/git/references/context-efficiency.md +54 -0
- package/template/.claude/skills/git/references/gh-cli-guide.md +109 -109
- package/template/.claude/skills/git/references/safety-protocols.md +69 -69
- package/template/.claude/skills/git/references/workflow-commit.md +58 -58
- package/template/.claude/skills/git/references/workflow-merge-pr.md +136 -0
- package/template/.claude/skills/git/references/workflow-merge.md +48 -48
- package/template/.claude/skills/git/references/workflow-pr.md +58 -58
- package/template/.claude/skills/git/references/workflow-push.md +52 -52
- package/template/.claude/skills/hallmark/SKILL.md +552 -552
- package/template/.claude/skills/hallmark/references/anti-patterns.md +412 -412
- package/template/.claude/skills/hallmark/references/assets.md +406 -406
- package/template/.claude/skills/hallmark/references/color.md +95 -95
- package/template/.claude/skills/hallmark/references/component-cookbook.md +256 -256
- package/template/.claude/skills/hallmark/references/components/c1-outlined-chip.md +12 -12
- package/template/.claude/skills/hallmark/references/components/c2-inline-form-as-cta.md +16 -16
- package/template/.claude/skills/hallmark/references/components/c3-typographic-link.md +8 -8
- package/template/.claude/skills/hallmark/references/components/c4-sticky-bottom-bar.md +16 -16
- package/template/.claude/skills/hallmark/references/components/f1-bento-grid.md +20 -20
- package/template/.claude/skills/hallmark/references/components/f2-sticky-scroll-stack.md +20 -20
- package/template/.claude/skills/hallmark/references/components/f3-tabular-spec-sheet.md +11 -11
- package/template/.claude/skills/hallmark/references/components/f4-step-sequence.md +11 -11
- package/template/.claude/skills/hallmark/references/components/f5-annotated-screenshot.md +11 -11
- package/template/.claude/skills/hallmark/references/components/f6-product-card-grid.md +41 -41
- package/template/.claude/skills/hallmark/references/components/ft1-mast-headed.md +13 -13
- package/template/.claude/skills/hallmark/references/components/ft2-inline-rule-single-line.md +10 -10
- package/template/.claude/skills/hallmark/references/components/ft3-index-style-category-list.md +12 -12
- package/template/.claude/skills/hallmark/references/components/ft4-dense-typographic.md +10 -10
- package/template/.claude/skills/hallmark/references/components/ft5-statement.md +21 -21
- package/template/.claude/skills/hallmark/references/components/ft6-letter-close.md +19 -19
- package/template/.claude/skills/hallmark/references/components/ft7-newsletter-first.md +27 -27
- package/template/.claude/skills/hallmark/references/components/ft8-marquee-scroll.md +25 -25
- package/template/.claude/skills/hallmark/references/components/h1-marquee.md +15 -15
- package/template/.claude/skills/hallmark/references/components/h2-split-diptych.md +15 -15
- package/template/.claude/skills/hallmark/references/components/h3-quote-led.md +11 -11
- package/template/.claude/skills/hallmark/references/components/h4-stat-led.md +14 -14
- package/template/.claude/skills/hallmark/references/components/h5-letter-hero.md +11 -11
- package/template/.claude/skills/hallmark/references/components/h6-photographic-fold.md +16 -16
- package/template/.claude/skills/hallmark/references/components/h7-demo-video-clipped-by-viewport-edge.md +27 -27
- package/template/.claude/skills/hallmark/references/components/h8-mockup-split-browser-framed.md +23 -23
- package/template/.claude/skills/hallmark/references/components/h9-custom-illustration-centerpiece.md +27 -27
- package/template/.claude/skills/hallmark/references/components/n1-wordmark-2-links.md +12 -12
- package/template/.claude/skills/hallmark/references/components/n10-floating-on-scroll-morph.md +19 -19
- package/template/.claude/skills/hallmark/references/components/n2-floating-chip.md +14 -14
- package/template/.claude/skills/hallmark/references/components/n3-side-rail.md +14 -14
- package/template/.claude/skills/hallmark/references/components/n4-hidden-behind-k.md +9 -9
- package/template/.claude/skills/hallmark/references/components/n5-floating-pill.md +28 -28
- package/template/.claude/skills/hallmark/references/components/n6-newspaper-masthead.md +24 -24
- package/template/.claude/skills/hallmark/references/components/n7-brutal-slab.md +22 -22
- package/template/.claude/skills/hallmark/references/components/n8-terminal-command.md +21 -21
- package/template/.claude/skills/hallmark/references/components/n9-edge-aligned-minimal.md +17 -17
- package/template/.claude/skills/hallmark/references/components/s1-left-margin-numbered.md +15 -15
- package/template/.claude/skills/hallmark/references/components/s2-hanging.md +13 -13
- package/template/.claude/skills/hallmark/references/components/s3-sticky-pinned.md +19 -19
- package/template/.claude/skills/hallmark/references/components/s4-inline-no-break.md +11 -11
- package/template/.claude/skills/hallmark/references/components/s5-bottom-anchored.md +13 -13
- package/template/.claude/skills/hallmark/references/components/t1-pull-quote-with-marginalia.md +12 -12
- package/template/.claude/skills/hallmark/references/components/t2-logo-wall-hairline.md +19 -19
- package/template/.claude/skills/hallmark/references/components/t3-single-huge-quote.md +11 -11
- package/template/.claude/skills/hallmark/references/components/t4-numbered-stat-strip.md +14 -14
- package/template/.claude/skills/hallmark/references/contract.md +24 -24
- package/template/.claude/skills/hallmark/references/copy.md +182 -182
- package/template/.claude/skills/hallmark/references/custom-craft.md +626 -626
- package/template/.claude/skills/hallmark/references/custom-theme.md +329 -329
- package/template/.claude/skills/hallmark/references/design-md.md +116 -116
- package/template/.claude/skills/hallmark/references/export-formats.md +328 -328
- package/template/.claude/skills/hallmark/references/floating-nav.md +89 -89
- package/template/.claude/skills/hallmark/references/genres/atmospheric.md +65 -65
- package/template/.claude/skills/hallmark/references/genres/editorial.md +70 -70
- package/template/.claude/skills/hallmark/references/genres/modern-minimal.md +67 -67
- package/template/.claude/skills/hallmark/references/genres/playful.md +65 -65
- package/template/.claude/skills/hallmark/references/hero-enrichment.md +474 -474
- package/template/.claude/skills/hallmark/references/imagery-kit.md +170 -170
- package/template/.claude/skills/hallmark/references/interaction-and-states.md +207 -207
- package/template/.claude/skills/hallmark/references/layout-and-space.md +111 -111
- package/template/.claude/skills/hallmark/references/macrostructures/01-bento-grid.md +35 -35
- package/template/.claude/skills/hallmark/references/macrostructures/02-long-document.md +34 -34
- package/template/.claude/skills/hallmark/references/macrostructures/03-marquee-hero.md +31 -31
- package/template/.claude/skills/hallmark/references/macrostructures/04-stat-led.md +32 -32
- package/template/.claude/skills/hallmark/references/macrostructures/05-workbench.md +32 -32
- package/template/.claude/skills/hallmark/references/macrostructures/06-conversational-faq.md +33 -33
- package/template/.claude/skills/hallmark/references/macrostructures/07-manifesto.md +32 -32
- package/template/.claude/skills/hallmark/references/macrostructures/08-photographic.md +34 -34
- package/template/.claude/skills/hallmark/references/macrostructures/09-quote-led.md +32 -32
- package/template/.claude/skills/hallmark/references/macrostructures/10-specimen.md +32 -32
- package/template/.claude/skills/hallmark/references/macrostructures/11-catalogue.md +23 -23
- package/template/.claude/skills/hallmark/references/macrostructures/12-letter.md +23 -23
- package/template/.claude/skills/hallmark/references/macrostructures/13-index-first.md +23 -23
- package/template/.claude/skills/hallmark/references/macrostructures/14-narrative-workflow.md +23 -23
- package/template/.claude/skills/hallmark/references/macrostructures/15-split-studio.md +23 -23
- package/template/.claude/skills/hallmark/references/macrostructures/16-feature-stack.md +23 -23
- package/template/.claude/skills/hallmark/references/macrostructures/17-type-specimen.md +23 -23
- package/template/.claude/skills/hallmark/references/macrostructures/18-portfolio-grid.md +23 -23
- package/template/.claude/skills/hallmark/references/macrostructures/19-map-diagram.md +23 -23
- package/template/.claude/skills/hallmark/references/macrostructures/20-ecosystem-index.md +23 -23
- package/template/.claude/skills/hallmark/references/macrostructures/21-component-playground.md +23 -23
- package/template/.claude/skills/hallmark/references/macrostructures.md +89 -89
- package/template/.claude/skills/hallmark/references/microinteractions.md +260 -260
- package/template/.claude/skills/hallmark/references/motion.md +109 -109
- package/template/.claude/skills/hallmark/references/preview-examples.md +49 -49
- package/template/.claude/skills/hallmark/references/responsive.md +138 -138
- package/template/.claude/skills/hallmark/references/slop-test.md +205 -205
- package/template/.claude/skills/hallmark/references/structure.md +164 -164
- package/template/.claude/skills/hallmark/references/study.md +511 -511
- package/template/.claude/skills/hallmark/references/typography.md +243 -243
- package/template/.claude/skills/hallmark/references/verbs/audit.md +25 -25
- package/template/.claude/skills/hallmark/references/verbs/redesign.md +269 -269
- package/template/.claude/skills/hallmark-loop/SKILL.md +105 -105
- package/template/.claude/skills/hallmark-loop/references/auditor-call.md +60 -60
- package/template/.claude/skills/hallmark-loop/references/capture.md +78 -78
- package/template/.claude/skills/hallmark-loop/references/loop-control.md +79 -79
- package/template/.claude/skills/handoff/SKILL.md +15 -15
- package/template/.claude/skills/knowledge-crunching/SKILL.md +94 -94
- package/template/.claude/skills/research/SKILL.md +69 -69
- package/template/.claude/skills/skill-creator/LICENSE.txt +201 -201
- package/template/.claude/skills/skill-creator/SKILL.md +154 -149
- package/template/.claude/skills/skill-creator/agents/analyzer.md +274 -274
- package/template/.claude/skills/skill-creator/agents/comparator.md +202 -202
- package/template/.claude/skills/skill-creator/agents/grader.md +223 -223
- package/template/.claude/skills/skill-creator/assets/eval_review.html +146 -146
- package/template/.claude/skills/skill-creator/eval-viewer/generate_review.py +471 -471
- package/template/.claude/skills/skill-creator/eval-viewer/viewer.html +1325 -1325
- package/template/.claude/skills/skill-creator/references/benchmark-optimization-guide.md +86 -86
- package/template/.claude/skills/skill-creator/references/distribution-guide.md +79 -79
- package/template/.claude/skills/skill-creator/references/eval-infrastructure-guide.md +129 -129
- package/template/.claude/skills/skill-creator/references/eval-schemas.md +121 -121
- package/template/.claude/skills/skill-creator/references/mcp-skills-integration.md +71 -71
- package/template/.claude/skills/skill-creator/references/metadata-quality-criteria.md +94 -94
- package/template/.claude/skills/skill-creator/references/plugin-marketplace-hosting.md +104 -104
- package/template/.claude/skills/skill-creator/references/plugin-marketplace-overview.md +89 -89
- package/template/.claude/skills/skill-creator/references/plugin-marketplace-schema.md +93 -93
- package/template/.claude/skills/skill-creator/references/plugin-marketplace-sources.md +103 -103
- package/template/.claude/skills/skill-creator/references/plugin-marketplace-troubleshooting.md +76 -76
- package/template/.claude/skills/skill-creator/references/script-quality-criteria.md +106 -106
- package/template/.claude/skills/skill-creator/references/skill-anatomy-and-requirements.md +77 -77
- package/template/.claude/skills/skill-creator/references/skill-creation-workflow.md +152 -151
- package/template/.claude/skills/skill-creator/references/skill-design-patterns.md +75 -75
- package/template/.claude/skills/skill-creator/references/skillmark-benchmark-criteria.md +102 -102
- package/template/.claude/skills/skill-creator/references/structure-organization-criteria.md +114 -114
- package/template/.claude/skills/skill-creator/references/testing-and-iteration.md +78 -78
- package/template/.claude/skills/skill-creator/references/token-efficiency-criteria.md +74 -74
- package/template/.claude/skills/skill-creator/references/troubleshooting-guide.md +81 -81
- package/template/.claude/skills/skill-creator/references/validation-checklist.md +83 -83
- package/template/.claude/skills/skill-creator/references/writing-effective-instructions.md +88 -88
- package/template/.claude/skills/skill-creator/references/yaml-frontmatter-reference.md +92 -92
- package/template/.claude/skills/skill-creator/scripts/aggregate_benchmark.py +401 -401
- package/template/.claude/skills/skill-creator/scripts/encoding_utils.py +36 -36
- package/template/.claude/skills/skill-creator/scripts/generate_report.py +326 -326
- package/template/.claude/skills/skill-creator/scripts/improve_description.py +248 -248
- package/template/.claude/skills/skill-creator/scripts/init_skill.py +360 -360
- package/template/.claude/skills/skill-creator/scripts/package_skill.py +143 -143
- package/template/.claude/skills/skill-creator/scripts/quick_validate.py +110 -110
- package/template/.claude/skills/skill-creator/scripts/run_eval.py +310 -310
- package/template/.claude/skills/skill-creator/scripts/run_loop.py +332 -332
- package/template/.claude/skills/skill-creator/scripts/utils.py +47 -47
- package/template/.claude/skills/tdd/SKILL.md +142 -142
- package/template/.claude/skills/tdd/deep-modules.md +15 -15
- package/template/.claude/skills/tdd/interface-design.md +31 -31
- package/template/.claude/skills/tdd/mocking.md +59 -59
- package/template/.claude/skills/tdd/refactoring.md +10 -10
- package/template/.claude/skills/tdd/tests.md +61 -61
- package/template/.claude/statusline.cjs +0 -0
- package/template/.claude/skills/code-review/references/adversarial-review.md +0 -223
|
@@ -1,109 +1,109 @@
|
|
|
1
|
-
# GitHub CLI Guide
|
|
2
|
-
|
|
3
|
-
## Authentication
|
|
4
|
-
```bash
|
|
5
|
-
gh auth login # Interactive login
|
|
6
|
-
gh auth status # Check auth state
|
|
7
|
-
gh auth logout # Logout
|
|
8
|
-
```
|
|
9
|
-
|
|
10
|
-
## Pull Requests
|
|
11
|
-
|
|
12
|
-
### Create PR
|
|
13
|
-
```bash
|
|
14
|
-
# Basic
|
|
15
|
-
gh pr create --base main --head feature-branch --title "feat: add login" --body "Summary"
|
|
16
|
-
|
|
17
|
-
# With HEREDOC body
|
|
18
|
-
gh pr create --base main --title "feat(auth): add OAuth" --body "$(cat <<'EOF'
|
|
19
|
-
## Summary
|
|
20
|
-
- Added OAuth2 provider support
|
|
21
|
-
- Implemented token refresh
|
|
22
|
-
|
|
23
|
-
## Test plan
|
|
24
|
-
- [ ] Unit tests pass
|
|
25
|
-
- [ ] Manual login test
|
|
26
|
-
EOF
|
|
27
|
-
)"
|
|
28
|
-
|
|
29
|
-
# Draft mode
|
|
30
|
-
gh pr create --draft --title "WIP: new feature"
|
|
31
|
-
|
|
32
|
-
# Assign reviewers
|
|
33
|
-
gh pr create --reviewer @user1,@user2
|
|
34
|
-
|
|
35
|
-
# Add labels
|
|
36
|
-
gh pr create --label "bug,priority:high"
|
|
37
|
-
```
|
|
38
|
-
|
|
39
|
-
### View/Review PR
|
|
40
|
-
```bash
|
|
41
|
-
gh pr list # List PRs
|
|
42
|
-
gh pr view 123 # View PR details
|
|
43
|
-
gh pr view 123 --web # Open in browser
|
|
44
|
-
gh pr checkout 123 # Checkout PR locally
|
|
45
|
-
gh pr diff 123 # View PR diff
|
|
46
|
-
gh pr status # Your PRs + reviews
|
|
47
|
-
```
|
|
48
|
-
|
|
49
|
-
### Merge PR
|
|
50
|
-
```bash
|
|
51
|
-
gh pr merge 123 # Default merge commit
|
|
52
|
-
gh pr merge 123 --squash # Squash commits
|
|
53
|
-
gh pr merge 123 --rebase # Rebase merge
|
|
54
|
-
gh pr merge 123 --auto # Auto-merge when checks pass
|
|
55
|
-
gh pr merge 123 --delete-branch # Delete branch after
|
|
56
|
-
```
|
|
57
|
-
|
|
58
|
-
### PR Comments
|
|
59
|
-
```bash
|
|
60
|
-
gh pr comment 123 --body "LGTM!"
|
|
61
|
-
gh api repos/{owner}/{repo}/pulls/123/comments # View all
|
|
62
|
-
```
|
|
63
|
-
|
|
64
|
-
## Issues
|
|
65
|
-
|
|
66
|
-
```bash
|
|
67
|
-
gh issue list # List issues
|
|
68
|
-
gh issue view 42 # View issue
|
|
69
|
-
gh issue create --title "Bug" --body "Description"
|
|
70
|
-
gh issue develop 42 -c # Create branch from issue
|
|
71
|
-
```
|
|
72
|
-
|
|
73
|
-
## Repository
|
|
74
|
-
|
|
75
|
-
```bash
|
|
76
|
-
gh repo view # Current repo info
|
|
77
|
-
gh repo clone owner/repo # Clone
|
|
78
|
-
gh browse # Open repo in browser
|
|
79
|
-
gh browse path/to/file:42 # Open file at line
|
|
80
|
-
```
|
|
81
|
-
|
|
82
|
-
## Workflow Runs
|
|
83
|
-
|
|
84
|
-
```bash
|
|
85
|
-
gh run list # List workflow runs
|
|
86
|
-
gh run view <run-id> # View run details
|
|
87
|
-
gh run watch # Watch running workflow
|
|
88
|
-
gh run rerun <run-id> # Rerun failed workflow
|
|
89
|
-
```
|
|
90
|
-
|
|
91
|
-
## JSON Output (scripting)
|
|
92
|
-
|
|
93
|
-
```bash
|
|
94
|
-
gh pr list --json number,title,author
|
|
95
|
-
gh pr view 123 --json commits,reviews
|
|
96
|
-
gh issue list --json number,title --jq '.[].title'
|
|
97
|
-
```
|
|
98
|
-
|
|
99
|
-
## Common Patterns
|
|
100
|
-
|
|
101
|
-
### Create PR with auto-merge
|
|
102
|
-
```bash
|
|
103
|
-
gh pr create --fill && gh pr merge --auto --squash
|
|
104
|
-
```
|
|
105
|
-
|
|
106
|
-
### Close stale PRs
|
|
107
|
-
```bash
|
|
108
|
-
gh pr list --state open --json number -q '.[].number' | xargs -I {} gh pr close {}
|
|
109
|
-
```
|
|
1
|
+
# GitHub CLI Guide
|
|
2
|
+
|
|
3
|
+
## Authentication
|
|
4
|
+
```bash
|
|
5
|
+
gh auth login # Interactive login
|
|
6
|
+
gh auth status # Check auth state
|
|
7
|
+
gh auth logout # Logout
|
|
8
|
+
```
|
|
9
|
+
|
|
10
|
+
## Pull Requests
|
|
11
|
+
|
|
12
|
+
### Create PR
|
|
13
|
+
```bash
|
|
14
|
+
# Basic
|
|
15
|
+
gh pr create --base main --head feature-branch --title "feat: add login" --body "Summary"
|
|
16
|
+
|
|
17
|
+
# With HEREDOC body
|
|
18
|
+
gh pr create --base main --title "feat(auth): add OAuth" --body "$(cat <<'EOF'
|
|
19
|
+
## Summary
|
|
20
|
+
- Added OAuth2 provider support
|
|
21
|
+
- Implemented token refresh
|
|
22
|
+
|
|
23
|
+
## Test plan
|
|
24
|
+
- [ ] Unit tests pass
|
|
25
|
+
- [ ] Manual login test
|
|
26
|
+
EOF
|
|
27
|
+
)"
|
|
28
|
+
|
|
29
|
+
# Draft mode
|
|
30
|
+
gh pr create --draft --title "WIP: new feature"
|
|
31
|
+
|
|
32
|
+
# Assign reviewers
|
|
33
|
+
gh pr create --reviewer @user1,@user2
|
|
34
|
+
|
|
35
|
+
# Add labels
|
|
36
|
+
gh pr create --label "bug,priority:high"
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
### View/Review PR
|
|
40
|
+
```bash
|
|
41
|
+
gh pr list # List PRs
|
|
42
|
+
gh pr view 123 # View PR details
|
|
43
|
+
gh pr view 123 --web # Open in browser
|
|
44
|
+
gh pr checkout 123 # Checkout PR locally
|
|
45
|
+
gh pr diff 123 # View PR diff
|
|
46
|
+
gh pr status # Your PRs + reviews
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
### Merge PR
|
|
50
|
+
```bash
|
|
51
|
+
gh pr merge 123 # Default merge commit
|
|
52
|
+
gh pr merge 123 --squash # Squash commits
|
|
53
|
+
gh pr merge 123 --rebase # Rebase merge
|
|
54
|
+
gh pr merge 123 --auto # Auto-merge when checks pass
|
|
55
|
+
gh pr merge 123 --delete-branch # Delete branch after
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
### PR Comments
|
|
59
|
+
```bash
|
|
60
|
+
gh pr comment 123 --body "LGTM!"
|
|
61
|
+
gh api repos/{owner}/{repo}/pulls/123/comments # View all
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
## Issues
|
|
65
|
+
|
|
66
|
+
```bash
|
|
67
|
+
gh issue list # List issues
|
|
68
|
+
gh issue view 42 # View issue
|
|
69
|
+
gh issue create --title "Bug" --body "Description"
|
|
70
|
+
gh issue develop 42 -c # Create branch from issue
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
## Repository
|
|
74
|
+
|
|
75
|
+
```bash
|
|
76
|
+
gh repo view # Current repo info
|
|
77
|
+
gh repo clone owner/repo # Clone
|
|
78
|
+
gh browse # Open repo in browser
|
|
79
|
+
gh browse path/to/file:42 # Open file at line
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
## Workflow Runs
|
|
83
|
+
|
|
84
|
+
```bash
|
|
85
|
+
gh run list # List workflow runs
|
|
86
|
+
gh run view <run-id> # View run details
|
|
87
|
+
gh run watch # Watch running workflow
|
|
88
|
+
gh run rerun <run-id> # Rerun failed workflow
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
## JSON Output (scripting)
|
|
92
|
+
|
|
93
|
+
```bash
|
|
94
|
+
gh pr list --json number,title,author
|
|
95
|
+
gh pr view 123 --json commits,reviews
|
|
96
|
+
gh issue list --json number,title --jq '.[].title'
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
## Common Patterns
|
|
100
|
+
|
|
101
|
+
### Create PR with auto-merge
|
|
102
|
+
```bash
|
|
103
|
+
gh pr create --fill && gh pr merge --auto --squash
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
### Close stale PRs
|
|
107
|
+
```bash
|
|
108
|
+
gh pr list --state open --json number -q '.[].number' | xargs -I {} gh pr close {}
|
|
109
|
+
```
|
|
@@ -1,69 +1,69 @@
|
|
|
1
|
-
# Git Safety Protocols
|
|
2
|
-
|
|
3
|
-
## Secret Detection Patterns
|
|
4
|
-
|
|
5
|
-
### Scan Command
|
|
6
|
-
```bash
|
|
7
|
-
git diff --cached | grep -iE "(AKIA|api[_-]?key|token|password|secret|credential|private[_-]?key|mongodb://|postgres://|mysql://|redis://|-----BEGIN)"
|
|
8
|
-
```
|
|
9
|
-
|
|
10
|
-
### Patterns to Detect
|
|
11
|
-
|
|
12
|
-
| Category | Pattern | Example |
|
|
13
|
-
|----------|---------|---------|
|
|
14
|
-
| API Keys | `api[_-]?key`, `apiKey` | `API_KEY=abc123` |
|
|
15
|
-
| AWS | `AKIA[0-9A-Z]{16}` | `AKIAIOSFODNN7EXAMPLE` |
|
|
16
|
-
| Tokens | `token`, `auth_token`, `jwt` | `AUTH_TOKEN=xyz` |
|
|
17
|
-
| Passwords | `password`, `passwd`, `pwd` | `DB_PASSWORD=secret` |
|
|
18
|
-
| Private Keys | `-----BEGIN PRIVATE KEY-----` | PEM files |
|
|
19
|
-
| DB URLs | `mongodb://`, `postgres://`, `mysql://` | Connection strings |
|
|
20
|
-
| OAuth | `client_secret`, `oauth_token` | `CLIENT_SECRET=abc` |
|
|
21
|
-
|
|
22
|
-
### Files to Warn About
|
|
23
|
-
- `.env`, `.env.*` (except `.env.example`)
|
|
24
|
-
- `*.key`, `*.pem`, `*.p12`
|
|
25
|
-
- `credentials.json`, `secrets.json`
|
|
26
|
-
- `config/private.*`
|
|
27
|
-
|
|
28
|
-
### Action on Detection
|
|
29
|
-
1. **BLOCK commit immediately**
|
|
30
|
-
2. Show matching lines: `git diff --cached | grep -B2 -A2 <pattern>`
|
|
31
|
-
3. Suggest: "Add to .gitignore or use environment variables"
|
|
32
|
-
4. Offer to unstage: `git reset HEAD <file>`
|
|
33
|
-
|
|
34
|
-
## Branch Protection
|
|
35
|
-
|
|
36
|
-
### Never Force Push To
|
|
37
|
-
- `main`, `master`, `production`, `prod`, `release/*`
|
|
38
|
-
|
|
39
|
-
### Pre-Merge Checks
|
|
40
|
-
```bash
|
|
41
|
-
# Check for conflicts before merge
|
|
42
|
-
git merge --no-commit --no-ff origin/{branch} && git merge --abort
|
|
43
|
-
```
|
|
44
|
-
|
|
45
|
-
### Remote-First Operations
|
|
46
|
-
Always use `origin/{branch}` for comparisons:
|
|
47
|
-
- ✅ `git diff origin/main...origin/feature`
|
|
48
|
-
- ❌ `git diff main...HEAD` (includes local uncommitted)
|
|
49
|
-
|
|
50
|
-
## Error Recovery
|
|
51
|
-
|
|
52
|
-
### Undo Last Commit (unpushed)
|
|
53
|
-
```bash
|
|
54
|
-
git reset --soft HEAD~1 # Keep changes staged
|
|
55
|
-
git reset HEAD~1 # Keep changes unstaged
|
|
56
|
-
```
|
|
57
|
-
|
|
58
|
-
### Abort Merge
|
|
59
|
-
```bash
|
|
60
|
-
git merge --abort
|
|
61
|
-
```
|
|
62
|
-
|
|
63
|
-
### Discard Local Changes
|
|
64
|
-
```bash
|
|
65
|
-
git checkout -- <file> # Single file
|
|
66
|
-
git reset --hard HEAD # All files (DANGER)
|
|
67
|
-
```
|
|
68
|
-
|
|
69
|
-
**Always confirm with user before destructive operations.**
|
|
1
|
+
# Git Safety Protocols
|
|
2
|
+
|
|
3
|
+
## Secret Detection Patterns
|
|
4
|
+
|
|
5
|
+
### Scan Command
|
|
6
|
+
```bash
|
|
7
|
+
git diff --cached | grep -iE "(AKIA|api[_-]?key|token|password|secret|credential|private[_-]?key|mongodb://|postgres://|mysql://|redis://|-----BEGIN)"
|
|
8
|
+
```
|
|
9
|
+
|
|
10
|
+
### Patterns to Detect
|
|
11
|
+
|
|
12
|
+
| Category | Pattern | Example |
|
|
13
|
+
|----------|---------|---------|
|
|
14
|
+
| API Keys | `api[_-]?key`, `apiKey` | `API_KEY=abc123` |
|
|
15
|
+
| AWS | `AKIA[0-9A-Z]{16}` | `AKIAIOSFODNN7EXAMPLE` |
|
|
16
|
+
| Tokens | `token`, `auth_token`, `jwt` | `AUTH_TOKEN=xyz` |
|
|
17
|
+
| Passwords | `password`, `passwd`, `pwd` | `DB_PASSWORD=secret` |
|
|
18
|
+
| Private Keys | `-----BEGIN PRIVATE KEY-----` | PEM files |
|
|
19
|
+
| DB URLs | `mongodb://`, `postgres://`, `mysql://` | Connection strings |
|
|
20
|
+
| OAuth | `client_secret`, `oauth_token` | `CLIENT_SECRET=abc` |
|
|
21
|
+
|
|
22
|
+
### Files to Warn About
|
|
23
|
+
- `.env`, `.env.*` (except `.env.example`)
|
|
24
|
+
- `*.key`, `*.pem`, `*.p12`
|
|
25
|
+
- `credentials.json`, `secrets.json`
|
|
26
|
+
- `config/private.*`
|
|
27
|
+
|
|
28
|
+
### Action on Detection
|
|
29
|
+
1. **BLOCK commit immediately**
|
|
30
|
+
2. Show matching lines: `git diff --cached | grep -B2 -A2 <pattern>`
|
|
31
|
+
3. Suggest: "Add to .gitignore or use environment variables"
|
|
32
|
+
4. Offer to unstage: `git reset HEAD <file>`
|
|
33
|
+
|
|
34
|
+
## Branch Protection
|
|
35
|
+
|
|
36
|
+
### Never Force Push To
|
|
37
|
+
- `main`, `master`, `production`, `prod`, `release/*`
|
|
38
|
+
|
|
39
|
+
### Pre-Merge Checks
|
|
40
|
+
```bash
|
|
41
|
+
# Check for conflicts before merge
|
|
42
|
+
git merge --no-commit --no-ff origin/{branch} && git merge --abort
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
### Remote-First Operations
|
|
46
|
+
Always use `origin/{branch}` for comparisons:
|
|
47
|
+
- ✅ `git diff origin/main...origin/feature`
|
|
48
|
+
- ❌ `git diff main...HEAD` (includes local uncommitted)
|
|
49
|
+
|
|
50
|
+
## Error Recovery
|
|
51
|
+
|
|
52
|
+
### Undo Last Commit (unpushed)
|
|
53
|
+
```bash
|
|
54
|
+
git reset --soft HEAD~1 # Keep changes staged
|
|
55
|
+
git reset HEAD~1 # Keep changes unstaged
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
### Abort Merge
|
|
59
|
+
```bash
|
|
60
|
+
git merge --abort
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
### Discard Local Changes
|
|
64
|
+
```bash
|
|
65
|
+
git checkout -- <file> # Single file
|
|
66
|
+
git reset --hard HEAD # All files (DANGER)
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
**Always confirm with user before destructive operations.**
|
|
@@ -1,58 +1,58 @@
|
|
|
1
|
-
# Commit Workflow
|
|
2
|
-
|
|
3
|
-
Execute via `git-manager` subagent.
|
|
4
|
-
|
|
5
|
-
## Tool 1: Stage + Analyze
|
|
6
|
-
```bash
|
|
7
|
-
git add -A && \
|
|
8
|
-
echo "=== STAGED ===" && git diff --cached --stat && \
|
|
9
|
-
echo "=== SECURITY ===" && \
|
|
10
|
-
git diff --cached | grep -c -iE "(api[_-]?key|token|password|secret|credential)" | awk '{print "SECRETS:"$1}' && \
|
|
11
|
-
echo "=== GROUPS ===" && \
|
|
12
|
-
git diff --cached --name-only | awk -F'/' '{
|
|
13
|
-
if ($0 ~ /\.(md|txt)$/) print "docs:"$0
|
|
14
|
-
else if ($0 ~ /test|spec/) print "test:"$0
|
|
15
|
-
else if ($0 ~ /\.claude/) print "config:"$0
|
|
16
|
-
else if ($0 ~ /package\.json|lock/) print "deps:"$0
|
|
17
|
-
else print "code:"$0
|
|
18
|
-
}'
|
|
19
|
-
```
|
|
20
|
-
|
|
21
|
-
**If SECRETS > 0:** STOP, show matches, block commit.
|
|
22
|
-
|
|
23
|
-
## Tool 2: Split Decision
|
|
24
|
-
|
|
25
|
-
NOTE:
|
|
26
|
-
- Search for related issues on GitHub and add to body.
|
|
27
|
-
- Only use `feat`, `fix`, or `perf` prefixes for files in `.claude` directory (do not use `docs`).
|
|
28
|
-
|
|
29
|
-
**From groups, decide:**
|
|
30
|
-
|
|
31
|
-
**A) Single commit:** Same type/scope, FILES ≤ 3, LINES ≤ 50
|
|
32
|
-
|
|
33
|
-
**B) Multi commit:** Mixed types/scopes, group by:
|
|
34
|
-
- Group 1: `config:` → `chore(config): ...`
|
|
35
|
-
- Group 2: `deps:` → `chore(deps): ...`
|
|
36
|
-
- Group 3: `test:` → `test: ...`
|
|
37
|
-
- Group 4: `code:` → `feat|fix: ...`
|
|
38
|
-
- Group 5: `docs:` → `docs: ...`
|
|
39
|
-
|
|
40
|
-
## Tool 3: Commit
|
|
41
|
-
|
|
42
|
-
**Single:**
|
|
43
|
-
```bash
|
|
44
|
-
git commit -m "type(scope): description"
|
|
45
|
-
```
|
|
46
|
-
|
|
47
|
-
**Multi (sequential):**
|
|
48
|
-
```bash
|
|
49
|
-
git reset && git add file1 file2 && git commit -m "type(scope): desc"
|
|
50
|
-
```
|
|
51
|
-
Repeat for each group.
|
|
52
|
-
|
|
53
|
-
## Tool 4: Push (if requested)
|
|
54
|
-
```bash
|
|
55
|
-
git push && echo "✓ pushed: yes" || echo "✓ pushed: no"
|
|
56
|
-
```
|
|
57
|
-
|
|
58
|
-
**Only push if user explicitly requested** ("push", "commit and push").
|
|
1
|
+
# Commit Workflow
|
|
2
|
+
|
|
3
|
+
Execute via `git-manager` subagent.
|
|
4
|
+
|
|
5
|
+
## Tool 1: Stage + Analyze
|
|
6
|
+
```bash
|
|
7
|
+
git add -A && \
|
|
8
|
+
echo "=== STAGED ===" && git diff --cached --stat && \
|
|
9
|
+
echo "=== SECURITY ===" && \
|
|
10
|
+
git diff --cached | grep -c -iE "(api[_-]?key|token|password|secret|credential)" | awk '{print "SECRETS:"$1}' && \
|
|
11
|
+
echo "=== GROUPS ===" && \
|
|
12
|
+
git diff --cached --name-only | awk -F'/' '{
|
|
13
|
+
if ($0 ~ /\.(md|txt)$/) print "docs:"$0
|
|
14
|
+
else if ($0 ~ /test|spec/) print "test:"$0
|
|
15
|
+
else if ($0 ~ /\.claude/) print "config:"$0
|
|
16
|
+
else if ($0 ~ /package\.json|lock/) print "deps:"$0
|
|
17
|
+
else print "code:"$0
|
|
18
|
+
}'
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
**If SECRETS > 0:** STOP, show matches, block commit.
|
|
22
|
+
|
|
23
|
+
## Tool 2: Split Decision
|
|
24
|
+
|
|
25
|
+
NOTE:
|
|
26
|
+
- Search for related issues on GitHub and add to body.
|
|
27
|
+
- Only use `feat`, `fix`, or `perf` prefixes for files in `.claude` directory (do not use `docs`).
|
|
28
|
+
|
|
29
|
+
**From groups, decide:**
|
|
30
|
+
|
|
31
|
+
**A) Single commit:** Same type/scope, FILES ≤ 3, LINES ≤ 50
|
|
32
|
+
|
|
33
|
+
**B) Multi commit:** Mixed types/scopes, group by:
|
|
34
|
+
- Group 1: `config:` → `chore(config): ...`
|
|
35
|
+
- Group 2: `deps:` → `chore(deps): ...`
|
|
36
|
+
- Group 3: `test:` → `test: ...`
|
|
37
|
+
- Group 4: `code:` → `feat|fix: ...`
|
|
38
|
+
- Group 5: `docs:` → `docs: ...`
|
|
39
|
+
|
|
40
|
+
## Tool 3: Commit
|
|
41
|
+
|
|
42
|
+
**Single:**
|
|
43
|
+
```bash
|
|
44
|
+
git commit -m "type(scope): description"
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
**Multi (sequential):**
|
|
48
|
+
```bash
|
|
49
|
+
git reset && git add file1 file2 && git commit -m "type(scope): desc"
|
|
50
|
+
```
|
|
51
|
+
Repeat for each group.
|
|
52
|
+
|
|
53
|
+
## Tool 4: Push (if requested)
|
|
54
|
+
```bash
|
|
55
|
+
git push && echo "✓ pushed: yes" || echo "✓ pushed: no"
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
**Only push if user explicitly requested** ("push", "commit and push").
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
# Merge PR Workflow
|
|
2
|
+
|
|
3
|
+
Execute via `git-manager` subagent.
|
|
4
|
+
|
|
5
|
+
## Variables
|
|
6
|
+
- PR_REFS: one or more PR numbers or GitHub PR URLs
|
|
7
|
+
- READY_LABEL: `ready to ship`
|
|
8
|
+
|
|
9
|
+
## Step 1: Parse and Inspect
|
|
10
|
+
|
|
11
|
+
Require at least one PR ref:
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
gh auth status
|
|
15
|
+
gh repo view --json nameWithOwner,defaultBranchRef
|
|
16
|
+
for pr in "$@"; do
|
|
17
|
+
gh pr view "$pr" --json number,url,title,baseRefName,headRefName,mergeStateStatus,statusCheckRollup
|
|
18
|
+
done
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
If any PR ref is invalid, from another repo, closed, or not visible to `gh`, stop before reviewing or merging any PRs.
|
|
22
|
+
|
|
23
|
+
## Step 2: Review
|
|
24
|
+
|
|
25
|
+
For each PR, run the code review:
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
/code-review <PR number or URL>
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
Do not label or merge until all of these hold:
|
|
32
|
+
- the review reports no Critical or Important findings
|
|
33
|
+
- `mergeStateStatus` from Step 1 shows no conflicts
|
|
34
|
+
- required PR checks are terminal and green (`statusCheckRollup` from Step 1)
|
|
35
|
+
|
|
36
|
+
The review reports findings; it does not auto-fix them and posts nothing back to
|
|
37
|
+
GitHub. Fix anything blocking, push, then re-run this step before continuing.
|
|
38
|
+
|
|
39
|
+
`/code-review` ships in the optional `code-review` component. If it is not
|
|
40
|
+
installed, review the PR diff directly (`gh pr diff <PR>`) and apply the same
|
|
41
|
+
gate before labeling — never skip the review step.
|
|
42
|
+
|
|
43
|
+
If a PR still needs changes, stop the entire merge batch. Report:
|
|
44
|
+
- PR number/URL
|
|
45
|
+
- remaining findings or blockers
|
|
46
|
+
- exact failed checks or merge state, if any
|
|
47
|
+
- recommended next action
|
|
48
|
+
|
|
49
|
+
## Step 3: Apply Ready Label
|
|
50
|
+
|
|
51
|
+
Ensure the label exists, then apply it to each reviewed-ready PR:
|
|
52
|
+
|
|
53
|
+
```bash
|
|
54
|
+
gh label list --json name --jq '.[].name' | grep -Fx "ready to ship" >/dev/null \
|
|
55
|
+
|| gh label create "ready to ship" --color "0E8A16" --description "Reviewed and ready to merge"
|
|
56
|
+
gh pr edit "$PR_REF" --add-label "ready to ship"
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
If labeling fails for any reason other than an already-existing label, stop and report the exact `gh` error.
|
|
60
|
+
|
|
61
|
+
## Step 4: Merge
|
|
62
|
+
|
|
63
|
+
Merge reviewed-ready PRs one at a time in the order provided.
|
|
64
|
+
|
|
65
|
+
Before each merge:
|
|
66
|
+
- re-read `mergeStateStatus`, `baseRefName`, and `statusCheckRollup`
|
|
67
|
+
- confirm required checks are still green or use auto-merge if branch protection is waiting on pending checks
|
|
68
|
+
- use the repository's allowed merge method and branch-protection rules
|
|
69
|
+
|
|
70
|
+
Select the merge method before running `gh pr merge`; do not let `gh` prompt interactively:
|
|
71
|
+
|
|
72
|
+
```bash
|
|
73
|
+
MERGE_METHOD_FLAG="--merge" # or --squash / --rebase, based on repo convention
|
|
74
|
+
gh pr merge "$PR_REF" --auto --delete-branch "$MERGE_METHOD_FLAG"
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
Use `--auto` when required checks are pending. If checks are already green, use the same repo convention without `--auto`:
|
|
78
|
+
|
|
79
|
+
```bash
|
|
80
|
+
gh pr merge "$PR_REF" --delete-branch "$MERGE_METHOD_FLAG"
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
Never force push. Never direct-push to protected target branches.
|
|
84
|
+
|
|
85
|
+
## Step 5: Watch Target-Branch CI
|
|
86
|
+
|
|
87
|
+
After each merge, capture the base branch and merge commit:
|
|
88
|
+
|
|
89
|
+
```bash
|
|
90
|
+
gh pr view "$PR_REF" --json baseRefName,mergeCommit
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
Watch CI/deploy workflows for that merge commit on the target branch:
|
|
94
|
+
|
|
95
|
+
```bash
|
|
96
|
+
gh run list --branch "$BASE_BRANCH" --commit "$MERGE_SHA" --json databaseId,status,conclusion,name,url
|
|
97
|
+
gh run watch "$RUN_ID" --exit-status
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
If no workflow appears immediately, poll briefly before deciding there are no workflows for the merge commit.
|
|
101
|
+
|
|
102
|
+
## Step 6: CI Failure Convergence
|
|
103
|
+
|
|
104
|
+
If target-branch CI fails:
|
|
105
|
+
|
|
106
|
+
1. Inspect failed logs:
|
|
107
|
+
```bash
|
|
108
|
+
gh run view "$RUN_ID" --json status,conclusion,jobs
|
|
109
|
+
gh run view "$RUN_ID" --job "$JOB_ID" --log
|
|
110
|
+
```
|
|
111
|
+
2. If the failure is transient infrastructure, rerun failed jobs once:
|
|
112
|
+
```bash
|
|
113
|
+
gh run rerun "$RUN_ID" --failed
|
|
114
|
+
```
|
|
115
|
+
3. If the failure is deterministic and repo-fixable, stop and report it with:
|
|
116
|
+
workflow name, run id, job id, the failing command, and the exact error.
|
|
117
|
+
4. Once the fix is made, ship it through PR review/merge, then watch target-branch CI again.
|
|
118
|
+
|
|
119
|
+
Stop when target-branch CI succeeds, an external blocker remains, or the same blocker survives 3 attempts.
|
|
120
|
+
|
|
121
|
+
## Output Format
|
|
122
|
+
|
|
123
|
+
```text
|
|
124
|
+
reviewed: PR #123 no blocking findings, CI green
|
|
125
|
+
labeled: PR #123 ready to ship
|
|
126
|
+
merged: PR #123 into dev (merge SHA abc123)
|
|
127
|
+
CI: green for abc123
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
If blocked:
|
|
131
|
+
|
|
132
|
+
```text
|
|
133
|
+
stopped: PR #123 not merge-ready
|
|
134
|
+
reason: <finding/check/merge blocker>
|
|
135
|
+
suggestion: <next action>
|
|
136
|
+
```
|