You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: .claude/skills/create-pr/SKILL.md
+15-7Lines changed: 15 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,26 +10,34 @@ Create a pull request for the current branch following the Datadog Agent contrib
10
10
11
11
## Instructions
12
12
13
-
1.**Check the current branch** and ensure it's not `main`
13
+
1.**Check the current branch**. If the current branch is `main` (or the default branch):
14
+
- Check for uncommitted or staged changes (`git status`). If there are changes, create a new feature branch from the default branch (`git checkout -b <branch-name>`), stage the changes, commit, and push.
15
+
- If there are no changes at all, stop and inform the user there is nothing to open a PR for.
14
16
2.**Get the commits** on this branch compared to `main` using `git log main..HEAD`
15
17
3.**Get the diff** using `git diff main..HEAD` to understand all changes
16
18
4.**Read the PR template** from `.github/PULL_REQUEST_TEMPLATE.md`
17
-
5.**Push the branch** to origin if needed
18
-
6.**Open the PR**: By default, open as **Draft** using `gh pr create --draft`. If `$ARGUMENTS` contains `--real`, open as a regular (non-draft) PR instead (omit the `--draft` flag). Remove `--real` from `$ARGUMENTS` before processing remaining arguments as labels.
19
-
7.**PR title**: Use [conventional commits](https://www.conventionalcommits.org/en/v1.0.0/) format, prefixed with the general area of change. Examples:
19
+
5.**Codex review** (optional): Check if `codex` is installed (`command -v codex`). If it is, run a review against the default branch:
20
+
```bash
21
+
DEFAULT_BRANCH=$(git rev-parse --abbrev-ref origin/HEAD | sed 's|^origin/||')
22
+
codex review --base "$DEFAULT_BRANCH"
23
+
```
24
+
Show the review output to the user. If codex is not installed, skip this step silently.
25
+
6.**Push the branch** to origin if needed
26
+
7.**Open the PR**: By default, open as **Draft** using `gh pr create --draft`. If `$ARGUMENTS` contains `--real`, open as a regular (non-draft) PR instead (omit the `--draft` flag). Remove `--real` from `$ARGUMENTS` before processing remaining arguments as labels.
27
+
8.**PR title**: Use [conventional commits](https://www.conventionalcommits.org/en/v1.0.0/) format, prefixed with the general area of change. Examples:
20
28
-`fix(e2e): Fix flaky diagnose test`
21
29
-`feat(logs): Add new log pipeline`
22
30
-`refactor(config): Simplify endpoint resolution`
23
-
8.**Labels**: Choose appropriate labels (plus any additional labels passed as $ARGUMENTS):
31
+
9.**Labels**: Choose appropriate labels (plus any additional labels passed as $ARGUMENTS):
24
32
- If the PR only changes tests, docs, CI config, or developer tooling (no Agent binary code changes), use `changelog/no-changelog` and `qa/no-code-change`
25
33
- If the PR changes Agent binary code and QA was done, use `qa/done`
26
34
- If the PR changes Agent binary code, a reno release note is expected (remind the user)
27
35
- Add `backport/<branch-name>` if the user asks for a backport
28
-
9.**PR body**: Fill in the PR template sections:
36
+
10.**PR body**: Fill in the PR template sections:
29
37
-**What does this PR do?**: A clear description of what is changed. Must be readable independently, tying back to the changed code.
30
38
-**Motivation**: A reason why the change is made. Point to an issue if applicable. Include drawbacks or tradeoffs if any.
31
39
-**Describe how you validated your changes**: How you validated the change (tests added/run, benchmarks, manual testing). Only needed when testing included work not covered by test suites.
32
-
-**Additional Notes**: Any extra context, links to predecessor PRs if part of a chain, notes that make code understanding easier.
40
+
-**Additional Notes**: Any extra context, links to predecessor PRs if part of a chain, notes that make code understanding easier.**Only include this section if there is genuinely useful context to add** — omit it entirely rather than filling it with filler.
0 commit comments