chore(claude): add CLAUDE.md and tighten commit/pr skills (#27119)

Signed-off-by: Jacob Dahl <dahl.jakejacob@gmail.com>
Signed-off-by: Ramon Roche <mrpollo@gmail.com>
Co-authored-by: Ramon Roche <mrpollo@gmail.com>
This commit is contained in:
Jacob Dahl
2026-04-23 12:39:08 -08:00
committed by GitHub
parent 329b4c6a05
commit d07fcec626
3 changed files with 46 additions and 19 deletions
+18 -11
View File
@@ -7,21 +7,28 @@ allowed-tools: Bash, Read, Glob, Grep
# PX4 Conventional Commit
Create a git commit: `type(scope): description`
Create a git commit in conventional-commit format: `type(scope): description`.
**NEVER add Co-Authored-By lines. No Claude attribution in commits.**
- **type:** `feat`, `fix`, `refactor`, `perf`, `docs`, `style`, `test`,
`build`, `ci`, `chore`, `revert`. Append `!` before `:` for breaking changes.
- **scope:** the module/driver/area affected — derive from the directory
path of the changed files (`src/modules/ekf2/``ekf2`,
`src/drivers/imu/invensense/icm42688p/``drivers/icm42688p`,
`.github/workflows/``ci`).
- **description:** imperative, concise, ≥5 chars.
Follow [CONTRIBUTING.md](../../CONTRIBUTING.md) for full project conventions.
**NEVER add Co-Authored-By Claude Code. No Claude attribution.**
## Steps
1. **Read [CONTRIBUTING.md](../../CONTRIBUTING.md)** for commit message format, types, scopes, and conventions.
2. Check branch (`git branch --show-current`). If on `main`, create a feature branch. Use `<username>/<description>` format where `<username>` comes from `gh api user --jq .login`. If unavailable, just use `<description>`.
3. Run `git status` and `git diff --staged`. If nothing staged, ask what to stage.
4. Follow the commit message convention from CONTRIBUTING.md: pick the correct **type** and **scope**, write a concise imperative description. The scope table is not exhaustive — derive the scope from the directory path of the changed files.
5. Body (if needed): explain **why**, not what.
6. Run `make format` or `./Tools/astyle/fix_code_style.sh <file>` on changed C/C++ files before committing.
7. Check if GPG signing is available: `git config --get user.signingkey`. If set, use `git commit -S -s`. Otherwise, use `git commit -s`.
8. Stage and commit. No `Co-Authored-By`.
1. Check branch (`git branch --show-current`). If on `main`, create a feature
branch `<username>/<description>` where `<username>` comes from
`gh api user --jq .login`.
2. Run `git status` and `git diff --staged`. If nothing staged, ask what to stage.
3. Run `make format` (or `./Tools/astyle/fix_code_style.sh <file>`) on changed
C/C++ files.
4. Body (if needed): explain **why**, not what.
5. Check GPG signing: `git config --get user.signingkey`. If set,
`git commit -S -s`; else `git commit -s`.
If the user provided arguments, use them as context: $ARGUMENTS
+16 -8
View File
@@ -9,15 +9,23 @@ allowed-tools: Bash, Read, Glob, Grep
**No Claude attribution anywhere (no Co-Authored-By, no "Generated with Claude").**
Follow [CONTRIBUTING.md](../../CONTRIBUTING.md) for full project conventions.
## Steps
1. Check branch. If on `main`, create a feature branch. Use `<username>/<description>` format where `<username>` comes from `gh api user --jq .login`. If unavailable, just use `<description>`.
2. Gather context: `git status`, `git log --oneline main..HEAD`, `git diff main...HEAD --stat`, check if remote tracking branch exists.
3. PR **title**: `type(scope): description` — under 72 chars, describes the overall change across all commits. This becomes the squash-merge commit message.
4. PR **body**: brief summary + bullet points for key changes. No filler.
5. Push with `-u` if needed, then `gh pr create`. Default base is `main` unless user says otherwise.
6. Return the PR URL.
1. Check branch. If on `main`, create a feature branch `<username>/<description>`
where `<username>` comes from `gh api user --jq .login`.
2. Gather context: `git status`, `git log --oneline main..HEAD`,
`git diff main...HEAD --stat`, check for remote tracking branch.
3. Sanity-build the targets we care about. Fix any build errors before opening
the PR:
- `make px4_fmu-v6x` — hardware target
- `make px4_sitl` — simulation
4. PR **title:** `type(scope): description` — under 72 chars, covers the
overall change across all commits. This becomes the squash-merge commit
message.
5. PR **body:** start with a plain leading paragraph explaining what the PR does and why. No headings (`## Summary`, `## Test plan`, etc.), no boilerplate, no Claude attribution. Use bullet lists only to enumerate discrete changes; don't force prose into bullets. Describe testing inline if relevant, no separate test plan section. Use markdown (links, code blocks, lists) only when warranted. Keep it concise and well-formatted.
6. Push with `-u` if needed, then `gh pr create`. Default base is `main`
unless user says otherwise.
7. Return the PR URL.
If the user provided arguments, use them as context: $ARGUMENTS
+12
View File
@@ -0,0 +1,12 @@
# PX4-Autopilot
Safety-critical C/C++ flight control firmware for autopilots, plus SITL
simulation and Python tooling.
- **Commits:** use the `/commit` skill. Conventional commit format with
topic-based scope: `type(scope): description`.
- **Pull requests:** use the `/pr` skill.
- **No Claude attribution** — no `Co-Authored-By: Claude`, no "Generated
with Claude Code" footer.
- **Style:** run `make format` on changed C/C++ before committing; CI
enforces `make check_format`.