@martinffx/atelier 1.2.2 → 1.3.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/CHANGELOG.md +19 -0
- package/README.md +22 -24
- package/agents/architect.md +1 -1
- package/agents/oracle.md +1 -1
- package/dist/atelier.js +12 -14
- package/package.json +1 -1
- package/skills/code-commit/SKILL.md +5 -13
- package/skills/code-pull-request/SKILL.md +36 -0
- package/skills/code-pull-request/references/common.md +76 -0
- package/skills/code-pull-request/references/create-pr.md +122 -0
- package/skills/code-pull-request/references/default-template.md +25 -0
- package/skills/code-pull-request/references/leave-comment.md +53 -0
- package/skills/code-pull-request/references/merge-pr.md +94 -0
- package/skills/code-pull-request/references/read-comments.md +61 -0
- package/skills/code-pull-request/references/respond-to-comment.md +66 -0
- package/skills/code-review/SKILL.md +21 -12
- package/skills/code-review/references/reviewers.md +142 -41
- package/skills/code-review/references/rq.md +48 -32
- package/skills/oracle-debug/SKILL.md +218 -0
- package/skills/{code-debug → oracle-debug}/references/bug-patterns.md +3 -3
- package/skills/oracle-domain-modelling/SKILL.md +84 -0
- package/skills/oracle-grill-me/SKILL.md +20 -0
- package/skills/spec-brainstorm/SKILL.md +91 -71
- package/skills/spec-finish/SKILL.md +20 -14
- package/skills/spec-implement/SKILL.md +3 -2
- package/skills/spec-orchestrator/SKILL.md +4 -15
- package/skills/spec-plan/SKILL.md +1 -1
- package/agents/scout.md +0 -40
- package/skills/code-commit/references/pr-workflow.md +0 -145
- package/skills/code-debug/SKILL.md +0 -199
- package/skills/code-docs/SKILL.md +0 -171
- package/skills/code-docs/references/api-docs.md +0 -116
- package/skills/code-docs/references/changelog.md +0 -64
- package/skills/code-docs/references/readme-structure.md +0 -94
- package/skills/oracle-architect/SKILL.md +0 -327
- package/skills/oracle-architect/references/api-design.md +0 -345
- package/skills/oracle-architect/references/data-modeling.md +0 -318
- package/skills/oracle-architect/references/ddd-patterns.md +0 -348
- package/skills/oracle-architect/references/interface-design.md +0 -203
- package/skills/oracle-challenge/SKILL.md +0 -126
- package/skills/oracle-doubt/SKILL.md +0 -252
- package/skills/oracle-doubt/references/adversarial-prompt.md +0 -47
- package/skills/oracle-grillme/SKILL.md +0 -160
- package/skills/oracle-security/SKILL.md +0 -225
- package/skills/oracle-security/references/security-patterns.md +0 -236
- package/skills/oracle-security/references/threat-modeling-guide.md +0 -137
- package/skills/oracle-testing/SKILL.md +0 -237
- package/skills/oracle-testing/references/anti-patterns.md +0 -618
- package/skills/oracle-testing/references/boundaries.md +0 -579
- package/skills/oracle-testing/references/core-testing.md +0 -691
- package/skills/oracle-testing/references/edge-testing.md +0 -794
- package/skills/oracle-testing/references/stub-driven-tdd.md +0 -322
- package/skills/oracle-thinkdeep/SKILL.md +0 -164
- /package/skills/{code-debug → oracle-debug}/references/language-tools.md +0 -0
- /package/skills/{code-debug → oracle-debug}/references/techniques.md +0 -0
- /package/skills/{oracle-grillme → oracle-domain-modelling}/references/ADR-FORMAT.md +0 -0
- /package/skills/{oracle-grillme → oracle-domain-modelling}/references/CONTEXT-FORMAT.md +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,24 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [1.3.0](https://github.com/martinffx/atelier/compare/v1.2.2...v1.3.0) (2026-07-17)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* **code-pull-request:** add comment and merge workflows with progressive disclosure ([53e8957](https://github.com/martinffx/atelier/commit/53e89574ae1c37d0c3e868c7bbecee560e38c573))
|
|
9
|
+
* **code:** add code-pull-request skill for PR creation ([62e32a6](https://github.com/martinffx/atelier/commit/62e32a6373be02cfad5fd3cb3fa248efcf3cc06c))
|
|
10
|
+
* **code:** add code-pull-request skill for PR creation ([e4d2475](https://github.com/martinffx/atelier/commit/e4d24752f610177d6706cf382f3db3c9f5406355))
|
|
11
|
+
* **skills:** split oracle-grillme into oracle-grill-me and oracle-domain-modelling ([#40](https://github.com/martinffx/atelier/issues/40)) ([e373c12](https://github.com/martinffx/atelier/commit/e373c12d05d9cde3ddb02fb0fc26ee770fb959a2))
|
|
12
|
+
* **spec-brainstorm:** add section-by-section design approval ([f66eb62](https://github.com/martinffx/atelier/commit/f66eb6275780768300218d329bff8882b6d20e5d))
|
|
13
|
+
* **spec-brainstorm:** add section-by-section design approval ([9cfb7e7](https://github.com/martinffx/atelier/commit/9cfb7e732fe20c546c2465218a8392dcba7859ad))
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
### Bug Fixes
|
|
17
|
+
|
|
18
|
+
* **code-pull-request:** correct description contract and base-branch detection ([73d48c6](https://github.com/martinffx/atelier/commit/73d48c6652f14bcc5224d91e546d219816d27e03))
|
|
19
|
+
* **code-pull-request:** resolve code-review findings ([fda9086](https://github.com/martinffx/atelier/commit/fda90860b99ef7ed2fd0731785af0b27251e5d1f))
|
|
20
|
+
* **skills:** address review findings from skill consolidation ([cccb1f8](https://github.com/martinffx/atelier/commit/cccb1f8430de7b699900c70d1b33207d771ac664))
|
|
21
|
+
|
|
3
22
|
## [1.2.2](https://github.com/martinffx/atelier/compare/v1.2.1...v1.2.2) (2026-05-23)
|
|
4
23
|
|
|
5
24
|
|
package/README.md
CHANGED
|
@@ -14,13 +14,13 @@ Install Atelier with a single command. It auto-detects your AI harness (Claude C
|
|
|
14
14
|
|
|
15
15
|
```bash
|
|
16
16
|
# Initialize atelier in your project
|
|
17
|
-
bunx atelier@latest init
|
|
17
|
+
bunx @martinffx/atelier@latest init
|
|
18
18
|
|
|
19
19
|
# Or install everything including skills
|
|
20
|
-
bunx atelier@latest init --all
|
|
20
|
+
bunx @martinffx/atelier@latest init --all
|
|
21
21
|
|
|
22
22
|
# Non-interactive mode (CI/CD)
|
|
23
|
-
bunx atelier@latest init --yes
|
|
23
|
+
bunx @martinffx/atelier@latest init --yes
|
|
24
24
|
```
|
|
25
25
|
|
|
26
26
|
That's it. Your project is now configured for spec-driven development.
|
|
@@ -29,7 +29,7 @@ That's it. Your project is now configured for spec-driven development.
|
|
|
29
29
|
|
|
30
30
|
Atelier sets up three things in your project:
|
|
31
31
|
|
|
32
|
-
### 1. Skills (
|
|
32
|
+
### 1. Skills (28 available)
|
|
33
33
|
|
|
34
34
|
Specialized knowledge modules that auto-invoke based on context. Install them via the CLI (`--all` flag) or separately:
|
|
35
35
|
|
|
@@ -93,7 +93,7 @@ Single source of truth in `.atelier/config.json`:
|
|
|
93
93
|
Initialize atelier in the current project.
|
|
94
94
|
|
|
95
95
|
```bash
|
|
96
|
-
bunx atelier@latest init [options]
|
|
96
|
+
bunx @martinffx/atelier@latest init [options]
|
|
97
97
|
```
|
|
98
98
|
|
|
99
99
|
**Options:**
|
|
@@ -109,7 +109,7 @@ bunx atelier@latest init [options]
|
|
|
109
109
|
Refresh hooks and agents from the latest templates without touching skills:
|
|
110
110
|
|
|
111
111
|
```bash
|
|
112
|
-
bunx atelier@latest update
|
|
112
|
+
bunx @martinffx/atelier@latest update
|
|
113
113
|
```
|
|
114
114
|
|
|
115
115
|
### `remove`
|
|
@@ -117,14 +117,14 @@ bunx atelier@latest update
|
|
|
117
117
|
Remove all atelier-generated files from the project:
|
|
118
118
|
|
|
119
119
|
```bash
|
|
120
|
-
bunx atelier@latest remove
|
|
120
|
+
bunx @martinffx/atelier@latest remove
|
|
121
121
|
```
|
|
122
122
|
|
|
123
123
|
Skills remain installed. Run `npx skills remove martinffx/atelier` to remove them separately.
|
|
124
124
|
|
|
125
125
|
## Skills
|
|
126
126
|
|
|
127
|
-
This repository includes
|
|
127
|
+
This repository includes 28 skills that enhance AI agents with specialized knowledge and workflows.
|
|
128
128
|
|
|
129
129
|
### Installing Skills
|
|
130
130
|
|
|
@@ -148,7 +148,7 @@ Skills fall into four categories based on what they do:
|
|
|
148
148
|
|
|
149
149
|
Process-oriented skills that guide you through structured development workflows. These produce artifacts and should be followed step-by-step.
|
|
150
150
|
|
|
151
|
-
- `spec-brainstorm` → `
|
|
151
|
+
- `spec-brainstorm` → `design.md` — Discovery, requirements, architecture
|
|
152
152
|
- `spec-plan` → `plan.json` — Break spec into implementable tasks
|
|
153
153
|
- `spec-implement` — Execute tasks with TDD
|
|
154
154
|
- `spec-finish` — Validate, review, prepare for PR
|
|
@@ -158,13 +158,9 @@ Process-oriented skills that guide you through structured development workflows.
|
|
|
158
158
|
|
|
159
159
|
Analytical skills that provide patterns, principles, and deep reasoning. These adapt to your specific situation.
|
|
160
160
|
|
|
161
|
-
- `oracle-
|
|
162
|
-
- `oracle-
|
|
163
|
-
- `oracle-
|
|
164
|
-
- `oracle-grillme` — Socratic interrogation of plans against domain model
|
|
165
|
-
- `oracle-security` — Security architecture and threat modeling
|
|
166
|
-
- `oracle-testing` — Stub-driven TDD, layer boundary testing
|
|
167
|
-
- `oracle-thinkdeep` — Extended sequential reasoning for complex problems
|
|
161
|
+
- `oracle-debug` — Systematic debugging, root cause before fixes
|
|
162
|
+
- `oracle-grill-me` — Socratic interrogation of plans against domain model
|
|
163
|
+
- `oracle-domain-modelling` — Build and sharpen the project's domain model
|
|
168
164
|
|
|
169
165
|
#### Domain Knowledge (`python:*`, `typescript:*`)
|
|
170
166
|
|
|
@@ -195,9 +191,8 @@ Technology-specific patterns and best practices. These are like having a senior
|
|
|
195
191
|
Task-specific tools you invoke when you need them.
|
|
196
192
|
|
|
197
193
|
- `code-commit` — Generate and validate conventional commits
|
|
198
|
-
- `code-debug` — Systematic debugging workflow
|
|
199
|
-
- `code-docs` — README, API docs, changelog generation
|
|
200
194
|
- `code-handoff` — Compact conversation into handoff document
|
|
195
|
+
- `code-pull-request` — Create, comment on, and merge GitHub pull requests or GitLab merge requests
|
|
201
196
|
- `code-review` — Multi-agent code review with specialized reviewers
|
|
202
197
|
- `code-subagents` — Dispatch patterns for parallel implementation
|
|
203
198
|
|
|
@@ -227,9 +222,10 @@ Skills are organized into four categories based on their role:
|
|
|
227
222
|
|
|
228
223
|
```mermaid
|
|
229
224
|
graph LR
|
|
230
|
-
A[spec-brainstorm] -->|
|
|
225
|
+
A[spec-brainstorm] -->|design.md| B[spec-plan]
|
|
231
226
|
B -->|plan.json| C[spec-implement]
|
|
232
227
|
C --> D[spec-finish]
|
|
228
|
+
D -.->|invokes| E[code-pull-request]
|
|
233
229
|
|
|
234
230
|
B -.->|design flaw| A
|
|
235
231
|
C -.->|missing tasks| B
|
|
@@ -238,10 +234,10 @@ graph LR
|
|
|
238
234
|
```
|
|
239
235
|
|
|
240
236
|
**Standard flow:**
|
|
241
|
-
1. **Research** - Discovery + research + architecture → `
|
|
237
|
+
1. **Research** - Discovery + research + architecture → `design.md`
|
|
242
238
|
2. **Plan** - Break into tasks → `plan.json`
|
|
243
239
|
3. **Implement** - Execute with TDD
|
|
244
|
-
4. **Finish** - Validate and
|
|
240
|
+
4. **Finish** - Validate, review, and open the PR
|
|
245
241
|
|
|
246
242
|
**Iteration is normal** - Backflows (dotted lines) are expected when:
|
|
247
243
|
- Planning reveals design flaws → back to research
|
|
@@ -257,9 +253,11 @@ graph LR
|
|
|
257
253
|
| "Write a plan" | spec-plan |
|
|
258
254
|
| "Implement this" | spec-implement |
|
|
259
255
|
| "Review this code" | code-review |
|
|
260
|
-
| "
|
|
261
|
-
| "
|
|
262
|
-
| "
|
|
256
|
+
| "Open a PR" | code-pull-request |
|
|
257
|
+
| "Merge this PR" | code-pull-request |
|
|
258
|
+
| "Read PR comments" | code-pull-request |
|
|
259
|
+
| "Leave a comment on the PR" | code-pull-request |
|
|
260
|
+
| "Debug this" | oracle-debug |
|
|
263
261
|
|
|
264
262
|
## Development
|
|
265
263
|
|
package/agents/architect.md
CHANGED
|
@@ -25,7 +25,7 @@ Before finishing, confirm you have:
|
|
|
25
25
|
- [ ] Specified API endpoints with methods, paths, and request/response contracts
|
|
26
26
|
- [ ] Listed error cases and handling strategy
|
|
27
27
|
- [ ] Broken work into dependency-ordered tasks (entity → repository → service → router)
|
|
28
|
-
- [ ] Written or updated the Technical Design section in `
|
|
28
|
+
- [ ] Written or updated the Technical Design section in `design.md`
|
|
29
29
|
- [ ] Written or updated `plan.json` with the task breakdown
|
|
30
30
|
|
|
31
31
|
## Boundaries
|
package/agents/oracle.md
CHANGED
|
@@ -28,7 +28,7 @@ Before finishing, confirm you have:
|
|
|
28
28
|
- [ ] Documented business rules, validations, and limits
|
|
29
29
|
- [ ] Defined scope—what is included and what is explicitly out of scope
|
|
30
30
|
- [ ] Generated 2–3 alternative approaches with trade-offs if the problem is complex
|
|
31
|
-
- [ ] Written or updated the Requirements section in `
|
|
31
|
+
- [ ] Written or updated the Requirements section in `design.md`
|
|
32
32
|
|
|
33
33
|
## Boundaries
|
|
34
34
|
|
package/dist/atelier.js
CHANGED
|
@@ -25484,24 +25484,22 @@ var providerModels = {
|
|
|
25484
25484
|
"opencode/claude-sonnet-4-6",
|
|
25485
25485
|
"opencode/claude-sonnet-4-5",
|
|
25486
25486
|
"opencode/claude-haiku-4-5",
|
|
25487
|
+
"opencode/deepseek-v4-pro",
|
|
25488
|
+
"opencode/deepseek-v4-flash",
|
|
25487
25489
|
"opencode/qwen3.6-plus",
|
|
25488
|
-
"opencode/minimax-
|
|
25489
|
-
"opencode/kimi-k2.
|
|
25490
|
-
"opencode/glm-5.
|
|
25490
|
+
"opencode/minimax-m3",
|
|
25491
|
+
"opencode/kimi-k2.7-code",
|
|
25492
|
+
"opencode/glm-5.2",
|
|
25491
25493
|
"opencode/gemini-3.1-pro",
|
|
25492
25494
|
"opencode/gemini-3-flash"
|
|
25493
25495
|
],
|
|
25494
25496
|
"opencode-go": [
|
|
25495
|
-
"opencode-go/glm-5.1",
|
|
25496
|
-
"opencode-go/glm-5",
|
|
25497
|
-
"opencode-go/kimi-k2.5",
|
|
25498
|
-
"opencode-go/kimi-k2.6",
|
|
25499
25497
|
"opencode-go/deepseek-v4-pro",
|
|
25500
25498
|
"opencode-go/deepseek-v4-flash",
|
|
25501
|
-
"opencode-go/
|
|
25502
|
-
"opencode-go/
|
|
25503
|
-
"opencode-go/qwen3.5-plus",
|
|
25499
|
+
"opencode-go/kimi-k2.7-code",
|
|
25500
|
+
"opencode-go/glm-5.2",
|
|
25504
25501
|
"opencode-go/qwen3.6-plus",
|
|
25502
|
+
"opencode-go/minimax-m3",
|
|
25505
25503
|
"opencode-go/mimo-v2.5",
|
|
25506
25504
|
"opencode-go/mimo-v2.5-pro"
|
|
25507
25505
|
],
|
|
@@ -25518,15 +25516,15 @@ var defaultModels = {
|
|
|
25518
25516
|
architect: "opus"
|
|
25519
25517
|
},
|
|
25520
25518
|
"opencode-zen": {
|
|
25521
|
-
recon: "opencode/
|
|
25522
|
-
oracle: "opencode/kimi-k2.
|
|
25519
|
+
recon: "opencode/deepseek-v4-flash",
|
|
25520
|
+
oracle: "opencode/kimi-k2.7-code",
|
|
25523
25521
|
architect: "opencode/deepseek-v4-pro",
|
|
25524
25522
|
build: "opencode/deepseek-v4-flash",
|
|
25525
25523
|
plan: "opencode/deepseek-v4-pro"
|
|
25526
25524
|
},
|
|
25527
25525
|
"opencode-go": {
|
|
25528
|
-
recon: "opencode-go/
|
|
25529
|
-
oracle: "opencode-go/kimi-k2.
|
|
25526
|
+
recon: "opencode-go/deepseek-v4-flash",
|
|
25527
|
+
oracle: "opencode-go/kimi-k2.7-code",
|
|
25530
25528
|
architect: "opencode-go/deepseek-v4-pro",
|
|
25531
25529
|
build: "opencode-go/deepseek-v4-flash",
|
|
25532
25530
|
plan: "opencode-go/deepseek-v4-pro"
|
package/package.json
CHANGED
|
@@ -76,20 +76,12 @@ When user asks to validate or check a commit message:
|
|
|
76
76
|
4. Check subject follows rules (lowercase, imperative, no period)
|
|
77
77
|
5. Flag any issues found
|
|
78
78
|
|
|
79
|
-
###
|
|
79
|
+
### Delegated: Pull Request Creation
|
|
80
80
|
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
3. Push branch if needed: `git push -u origin <branch>`
|
|
86
|
-
4. Create PR via `gh pr create`:
|
|
87
|
-
- Use `--fill` if commits are clean (auto-populates title/body)
|
|
88
|
-
- Use `--draft` for work-in-progress
|
|
89
|
-
- Use interactive mode if body needs custom content
|
|
90
|
-
5. Show the PR URL to the user
|
|
91
|
-
|
|
92
|
-
See [references/pr-workflow.md](references/pr-workflow.md) for full workflow details.
|
|
81
|
+
If the user wants to create a PR after committing, invoke the
|
|
82
|
+
[code-pull-request](../code-pull-request/SKILL.md) skill. It detects the platform
|
|
83
|
+
(GitHub/GitLab), finds a template, generates the body, and opens the PR via `gh`
|
|
84
|
+
or `glab`.
|
|
93
85
|
|
|
94
86
|
## Input Methods
|
|
95
87
|
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: code-pull-request
|
|
3
|
+
description: >
|
|
4
|
+
Manage GitHub pull requests or GitLab merge requests: create, read/leave/respond to
|
|
5
|
+
comments, and merge. Triggers on "open a PR", "make a PR", "merge this PR", "merge the
|
|
6
|
+
MR", "read PR comments", "leave a comment on the PR", "respond to a comment", "ship this",
|
|
7
|
+
or when a feature branch is ready for review.
|
|
8
|
+
user-invocable: true
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
# Pull Request / Merge Request Skill
|
|
12
|
+
|
|
13
|
+
Create, comment on, and merge GitHub pull requests or GitLab merge requests for the
|
|
14
|
+
current branch. Assumes the relevant CLI (`gh` or `glab`) is installed and authenticated.
|
|
15
|
+
|
|
16
|
+
This skill is **create/read + write-gated**. Every write action (create PR, leave
|
|
17
|
+
comment, respond to comment, merge) requires explicit human confirmation before running.
|
|
18
|
+
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
## Start Here
|
|
22
|
+
|
|
23
|
+
1. Detect the platform and find the current branch's open PR/MR — see
|
|
24
|
+
[references/common.md](references/common.md).
|
|
25
|
+
2. Pick a workflow:
|
|
26
|
+
|
|
27
|
+
| Workflow | Reference | Trigger phrases |
|
|
28
|
+
|----------|-----------|------------------|
|
|
29
|
+
| Create PR/MR | [create-pr.md](references/create-pr.md) | "open a PR", "make a PR", "submit for review" |
|
|
30
|
+
| Read comments | [read-comments.md](references/read-comments.md) | "read PR comments", "show MR comments" |
|
|
31
|
+
| Leave a comment | [leave-comment.md](references/leave-comment.md) | "leave a comment", "comment on the PR" |
|
|
32
|
+
| Respond to a comment | [respond-to-comment.md](references/respond-to-comment.md) | "respond to a comment", "reply on the PR" |
|
|
33
|
+
| Merge PR/MR | [merge-pr.md](references/merge-pr.md) | "merge this PR", "ship it", "merge the MR" |
|
|
34
|
+
|
|
35
|
+
Both GitHub (`gh`) and GitLab (`glab`) are first-class. Every write step pauses for
|
|
36
|
+
human approval before running the CLI command.
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
# Common: Platform Detection and PR Lookup
|
|
2
|
+
|
|
3
|
+
Shared steps used by every workflow. Run these first.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Detect Platform
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
git remote -v
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
Scan the push URLs for the platform host — don't assume the remote is named
|
|
14
|
+
`origin` (forks and multi-remote setups often use `upstream` or other names):
|
|
15
|
+
|
|
16
|
+
- Contains `github.com` → use `gh` (GitHub PR)
|
|
17
|
+
- Contains `gitlab` → use `glab` (GitLab MR)
|
|
18
|
+
- Multiple or no matches → ask the human which remote to use.
|
|
19
|
+
|
|
20
|
+
---
|
|
21
|
+
|
|
22
|
+
## Determine the Base Branch
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
base=$(git symbolic-ref --quiet refs/remotes/origin/HEAD 2>/dev/null | sed 's@^refs/remotes/origin/@@')
|
|
26
|
+
if [ -z "$base" ]; then
|
|
27
|
+
for candidate in main master; do
|
|
28
|
+
git rev-parse --verify --quiet "origin/$candidate" >/dev/null && base=$candidate && break
|
|
29
|
+
done
|
|
30
|
+
fi
|
|
31
|
+
echo "$base"
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
If that's still empty, ask the human what the base branch is.
|
|
35
|
+
|
|
36
|
+
---
|
|
37
|
+
|
|
38
|
+
## Preflight the CLI
|
|
39
|
+
|
|
40
|
+
Confirm the relevant CLI is installed and authenticated before any write:
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
gh auth status # GitHub
|
|
44
|
+
glab auth status # GitLab
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
If not authenticated, stop and tell the human. Don't proceed with writes.
|
|
48
|
+
|
|
49
|
+
---
|
|
50
|
+
|
|
51
|
+
## Find the Open PR/MR for the Current Branch
|
|
52
|
+
|
|
53
|
+
GitHub:
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
gh pr view --json state,number,url,headRefName
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
GitLab:
|
|
60
|
+
|
|
61
|
+
```bash
|
|
62
|
+
glab mr view --json state,iid,web_url,source_branch
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
- **Open** → use this PR/MR number/URL for comment and merge workflows.
|
|
66
|
+
- **Closed/merged** → for merge workflow: check for new commits
|
|
67
|
+
(`git log --oneline origin/<base>..HEAD`); otherwise stop and tell the human.
|
|
68
|
+
- **None** → for merge workflow: run [create-pr.md](create-pr.md), then continue.
|
|
69
|
+
For comment workflows: stop — nothing to comment on.
|
|
70
|
+
|
|
71
|
+
---
|
|
72
|
+
|
|
73
|
+
## Safety Guard
|
|
74
|
+
|
|
75
|
+
Refuse to operate from the default branch — that's almost always a mistake. Ask the
|
|
76
|
+
human to switch to a feature branch first.
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
# Workflow: Create PR/MR
|
|
2
|
+
|
|
3
|
+
Create a pull request (GitHub) or merge request (GitLab) for the current branch.
|
|
4
|
+
|
|
5
|
+
Start with [common.md](common.md) (platform detection, base branch, preflight).
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## Step 1: Check for Existing PR/MR
|
|
10
|
+
|
|
11
|
+
GitHub:
|
|
12
|
+
```bash
|
|
13
|
+
gh pr view --json state,number,url
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
GitLab:
|
|
17
|
+
```bash
|
|
18
|
+
glab mr view --json state,iid,web_url
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
- **Open** → show the URL, stop. Don't create a duplicate.
|
|
22
|
+
- **Closed/merged** → check for new commits since the PR was closed:
|
|
23
|
+
```bash
|
|
24
|
+
git log --oneline origin/<base>..HEAD
|
|
25
|
+
```
|
|
26
|
+
New commits exist → proceed to create a new PR.
|
|
27
|
+
No new commits → tell the human, stop.
|
|
28
|
+
- **None** → proceed to create.
|
|
29
|
+
|
|
30
|
+
---
|
|
31
|
+
|
|
32
|
+
## Step 2: Find a Template
|
|
33
|
+
|
|
34
|
+
Look for the repo's PR/MR template:
|
|
35
|
+
|
|
36
|
+
GitHub:
|
|
37
|
+
```bash
|
|
38
|
+
ls .github/PULL_REQUEST_TEMPLATE.md 2>/dev/null
|
|
39
|
+
ls .github/PULL_REQUEST_TEMPLATE/*.md 2>/dev/null
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
GitLab:
|
|
43
|
+
```bash
|
|
44
|
+
ls .gitlab/merge_request_templates/*.md 2>/dev/null
|
|
45
|
+
ls .gitlab/merge_request_template.md 2>/dev/null
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
Also check common locations:
|
|
49
|
+
```bash
|
|
50
|
+
ls docs/PULL_REQUEST_TEMPLATE.md 2>/dev/null
|
|
51
|
+
ls PULL_REQUEST_TEMPLATE.md 2>/dev/null
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
- **Template found** → use it. The CLI will auto-apply it in interactive mode, or
|
|
55
|
+
fill each section from the commits and diff for inline mode.
|
|
56
|
+
- **No template** → use the fallback template at
|
|
57
|
+
[default-template.md](default-template.md).
|
|
58
|
+
|
|
59
|
+
---
|
|
60
|
+
|
|
61
|
+
## Step 3: Generate Title and Body
|
|
62
|
+
|
|
63
|
+
```bash
|
|
64
|
+
git log --oneline origin/<base>..HEAD # commit list
|
|
65
|
+
git log origin/<base>..HEAD --format='%H %s%n%b' # full commit messages
|
|
66
|
+
git diff --stat origin/<base>...HEAD # changed files summary
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
Derive the title from the most significant conventional commit. If commits are
|
|
70
|
+
messy, synthesize from the diff:
|
|
71
|
+
|
|
72
|
+
```
|
|
73
|
+
<type>(<scope>): <description>
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
Fill the body (template sections or fallback) from the commits and diff:
|
|
77
|
+
- **Summary** — what and why, one or two sentences
|
|
78
|
+
- **Changes** — bulleted, grouped by area
|
|
79
|
+
- **Testing** — how it was verified (if known)
|
|
80
|
+
- **Checklist** — tests pass, conventional commits, docs updated
|
|
81
|
+
- **Linked issues** — extract `Closes #N`, `Fixes #N`, `Relates to #N` from commit
|
|
82
|
+
footers
|
|
83
|
+
|
|
84
|
+
---
|
|
85
|
+
|
|
86
|
+
## Step 4: Create the PR
|
|
87
|
+
|
|
88
|
+
Push the branch first if it isn't on the remote:
|
|
89
|
+
|
|
90
|
+
```bash
|
|
91
|
+
git push -u origin <branch-name>
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
**Show the human the generated title and body before creating.** Ask for confirmation,
|
|
95
|
+
or proceed if they said "just do it" up front.
|
|
96
|
+
|
|
97
|
+
### GitHub
|
|
98
|
+
|
|
99
|
+
| Mode | Command |
|
|
100
|
+
|------|---------|
|
|
101
|
+
| Auto-fill | `gh pr create --fill` |
|
|
102
|
+
| Inline | `gh pr create --title "<title>" --body-file -` (body via stdin) |
|
|
103
|
+
| Draft | `gh pr create --draft --title "<title>" --body-file -` (body via stdin) |
|
|
104
|
+
|
|
105
|
+
### GitLab
|
|
106
|
+
|
|
107
|
+
| Mode | Command |
|
|
108
|
+
|------|---------|
|
|
109
|
+
| Auto-fill | `glab mr create --fill` |
|
|
110
|
+
| Inline | `glab mr create --title "<title>" --description "$(cat <body-file>)"` |
|
|
111
|
+
| Draft | `glab mr create --draft --title "<title>" --description "$(cat <body-file>)"` |
|
|
112
|
+
|
|
113
|
+
Default to inline with the generated body. **Never pass a multi-line body directly
|
|
114
|
+
in the command string** (`--body "<body>"`) — quotes, backticks, and `$` in
|
|
115
|
+
Markdown break shell quoting. Write the body to a temp file first, then pass it
|
|
116
|
+
via stdin (`gh --body-file -`) or command substitution (`glab` has no
|
|
117
|
+
description-file flag). Reserve direct inline strings for one-line bodies.
|
|
118
|
+
|
|
119
|
+
Use `--fill` when commits are clean and the body would be redundant. Use `--draft`
|
|
120
|
+
when the human signals work in progress.
|
|
121
|
+
|
|
122
|
+
After creation, show the PR/MR URL to the human. Done.
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# Default PR/MR Template
|
|
2
|
+
|
|
3
|
+
Fallback body template when the repository has no `.github/PULL_REQUEST_TEMPLATE.md`
|
|
4
|
+
or `.gitlab/merge_request_template.md`. Fill each section from the conventional
|
|
5
|
+
commits and diff.
|
|
6
|
+
|
|
7
|
+
```markdown
|
|
8
|
+
## Summary
|
|
9
|
+
<!-- One or two sentences: what and why -->
|
|
10
|
+
|
|
11
|
+
## Changes
|
|
12
|
+
<!-- Bulleted, grouped by area. Each bullet self-contained. -->
|
|
13
|
+
-
|
|
14
|
+
|
|
15
|
+
## Testing
|
|
16
|
+
<!-- How it was verified: test commands run, manual steps, edge cases checked -->
|
|
17
|
+
|
|
18
|
+
## Checklist
|
|
19
|
+
- [ ] Tests pass
|
|
20
|
+
- [ ] Commits follow conventional format
|
|
21
|
+
- [ ] Documentation updated (if needed)
|
|
22
|
+
|
|
23
|
+
## Linked Issues
|
|
24
|
+
<!-- Closes #123, Fixes #456, Relates to #789 -->
|
|
25
|
+
```
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
# Workflow: Leave a Comment
|
|
2
|
+
|
|
3
|
+
Post a new top-level comment on the current branch's open PR/MR.
|
|
4
|
+
|
|
5
|
+
Start with [common.md](common.md) (platform detection, find the open PR/MR).
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## Step 1: Find the Open PR/MR
|
|
10
|
+
|
|
11
|
+
Run the lookup in [common.md](common.md#find-the-open-prmr-for-the-current-branch).
|
|
12
|
+
If none is open, stop — nothing to comment on.
|
|
13
|
+
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
## Step 2: Compose the Comment
|
|
17
|
+
|
|
18
|
+
Ask the human for the comment body. Accept either:
|
|
19
|
+
|
|
20
|
+
- Their exact text, or
|
|
21
|
+
- A draft you generate (e.g., a status update, summary, or question) that they edit.
|
|
22
|
+
|
|
23
|
+
Prefer passing the body via stdin or a temp file to avoid shell-escaping issues with
|
|
24
|
+
quotes, backticks, or `$` in the message:
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
gh pr comment <number> --body-file -
|
|
28
|
+
glab mr note <iid> --message-file - # if supported; otherwise --message
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
---
|
|
32
|
+
|
|
33
|
+
## Step 3: Confirm and Post
|
|
34
|
+
|
|
35
|
+
**Show the human the final comment text and target PR/MR. Ask for confirmation
|
|
36
|
+
before running the write command.**
|
|
37
|
+
|
|
38
|
+
### GitHub
|
|
39
|
+
```bash
|
|
40
|
+
gh pr comment <number> --body "<body>"
|
|
41
|
+
```
|
|
42
|
+
Or via stdin to avoid escaping:
|
|
43
|
+
```bash
|
|
44
|
+
echo "$body" | gh pr comment <number> --body-file -
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
### GitLab
|
|
48
|
+
```bash
|
|
49
|
+
glab mr note <iid> --message "<body>"
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
After posting, show the human the comment URL or the updated PR/MR URL. Done. Do not
|
|
53
|
+
merge or make further changes unless the human asks for another workflow.
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
# Workflow: Merge PR/MR
|
|
2
|
+
|
|
3
|
+
Merge the current branch's open PR/MR after confirming CI is green.
|
|
4
|
+
|
|
5
|
+
Defaults: **squash merge + delete the source branch**. If CI is pending, abort and
|
|
6
|
+
report — don't block waiting unless the human says otherwise.
|
|
7
|
+
|
|
8
|
+
Start with [common.md](common.md) (platform detection, base branch, preflight).
|
|
9
|
+
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
## Step 1: Find or Create the Open PR/MR
|
|
13
|
+
|
|
14
|
+
Run the lookup in [common.md](common.md#find-the-open-prmr-for-the-current-branch).
|
|
15
|
+
|
|
16
|
+
- **Open** → continue to Step 2.
|
|
17
|
+
- **None** → run [create-pr.md](create-pr.md) first, then continue.
|
|
18
|
+
- **Closed/merged** → check for new commits since it was closed
|
|
19
|
+
(`git log --oneline origin/<base>..HEAD`); stop if none.
|
|
20
|
+
|
|
21
|
+
---
|
|
22
|
+
|
|
23
|
+
## Step 2: Check CI Is Green
|
|
24
|
+
|
|
25
|
+
### GitHub
|
|
26
|
+
```bash
|
|
27
|
+
gh pr checks <number> # all checks
|
|
28
|
+
gh pr checks <number> --required # the merge gate
|
|
29
|
+
```
|
|
30
|
+
Exit codes for `--required`: 0 = all required checks pass; non-zero includes the
|
|
31
|
+
pending case (exit 8). Use `gh pr checks <number> --watch` to wait if the human
|
|
32
|
+
asks for it.
|
|
33
|
+
|
|
34
|
+
`--required` only shows required checks. If the full run shows failing **optional**
|
|
35
|
+
checks (lint, coverage, etc.), warn the human before proceeding — don't silently
|
|
36
|
+
ignore them.
|
|
37
|
+
|
|
38
|
+
### GitLab
|
|
39
|
+
```bash
|
|
40
|
+
glab ci status
|
|
41
|
+
# or
|
|
42
|
+
glab pipeline status
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
If any required check is **pending**, offer auto-merge instead of a direct merge:
|
|
46
|
+
`gh pr merge --auto` (GitHub) or `glab mr merge --auto-merge` (GitLab) queues the
|
|
47
|
+
merge to run once checks pass. A bare `gh pr merge` fails while required checks
|
|
48
|
+
are pending — "merge anyway" does not work in that state. Note: `glab mr merge`
|
|
49
|
+
enables auto-merge by default while a pipeline is running.
|
|
50
|
+
|
|
51
|
+
If any required check is **failing**, stop and report the status to the human.
|
|
52
|
+
Don't merge on red. If the human says "merge anyway": on GitHub a forced merge
|
|
53
|
+
requires `--admin` (bypasses branch protection, needs admin rights on the repo) —
|
|
54
|
+
state that implication explicitly before using it. On GitLab, merging on red is
|
|
55
|
+
controlled by project settings — ask the human to fix the pipeline or adjust the
|
|
56
|
+
setting.
|
|
57
|
+
|
|
58
|
+
---
|
|
59
|
+
|
|
60
|
+
## Step 3: Confirm Before Merging
|
|
61
|
+
|
|
62
|
+
**Show the human:**
|
|
63
|
+
- PR/MR URL and number/iid
|
|
64
|
+
- CI status (green/red)
|
|
65
|
+
- Merge strategy (squash by default)
|
|
66
|
+
- Whether the source branch will be deleted
|
|
67
|
+
|
|
68
|
+
Ask for explicit confirmation before running the merge command.
|
|
69
|
+
|
|
70
|
+
---
|
|
71
|
+
|
|
72
|
+
## Step 4: Merge
|
|
73
|
+
|
|
74
|
+
### GitHub
|
|
75
|
+
```bash
|
|
76
|
+
gh pr merge <number> --squash --delete-branch
|
|
77
|
+
```
|
|
78
|
+
Alternatives: `--rebase`, `--merge`, `--auto` (merge automatically once required
|
|
79
|
+
checks pass), or `--admin` (forced merge — see Step 2) per the human's request.
|
|
80
|
+
|
|
81
|
+
### GitLab
|
|
82
|
+
```bash
|
|
83
|
+
glab mr merge <iid> --squash --remove-source-branch
|
|
84
|
+
```
|
|
85
|
+
Alternatives: `--rebase`, or `--auto-merge` (merge once the pipeline succeeds —
|
|
86
|
+
already the default while a pipeline is running) per the human's request.
|
|
87
|
+
|
|
88
|
+
---
|
|
89
|
+
|
|
90
|
+
## Step 5: Report
|
|
91
|
+
|
|
92
|
+
Show the human the merge result — the merge commit SHA, the target branch tip, and
|
|
93
|
+
whether the source branch was deleted. Suggest switching back to the base branch
|
|
94
|
+
locally (`git checkout <base> && git pull`) if the source branch was removed. Done.
|