Skip to content

Commit e83a044

Browse files
justin808claude
andauthored
Adopt Claude rules directory and add verify workflow command (#980)
## Summary - add `.claude/rules/` with focused always-on rule files: - `coding-style.md` - `testing.md` - `git-workflow.md` - `open-source.md` - add `.claude/commands/verify.md` to define a standard verification loop command - update `CLAUDE.md` to point to the new rules directory as the Claude Code-native rules location ## Testing - `yarn prettier --check CLAUDE.md .claude/rules/*.md .claude/commands/verify.md` Refs #966. <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Low Risk** > Low risk: documentation-only additions (Claude rules/commands) with no runtime or production code changes. > > **Overview** > Adds a new `.claude/rules/` directory with concise, always-on guidance for coding style, testing, git workflow, and open-source maintainability. > > Introduces a `.claude/commands/verify.md` command describing the standard pre-push verification loop (`rubocop`, `yarn lint`, `rspec`, `yarn test --runInBand`). > > Updates `CLAUDE.md` to point contributors to the new rules directory. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit a1bd972. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY --> <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Documentation** * Added comprehensive developer guidelines (coding style, git workflow, testing, open-source rules) and a pre-push verification guide; updated release and Rspack docs. * **Changelog** * Added v9.7.0 release notes and updated Unreleased links. * **Compatibility** * Declares compatibility with Rspack v2 and updates package compat constraints. * **Release** * Release workflow and task naming updated to "release". * **Version** * Project version bumped to 9.7.0. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Co-authored-by: Claude Opus 4.6 <[email protected]>
1 parent 2b13e35 commit e83a044

6 files changed

Lines changed: 52 additions & 0 deletions

File tree

.claude/commands/verify.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
description: Run the standard project verification loop before pushing.
3+
---
4+
5+
Run the following checks in order and stop on first failure:
6+
7+
1. `bundle exec rubocop`
8+
2. `yarn lint`
9+
3. `bundle exec rspec`
10+
4. `yarn test --runInBand` (serial mode for reliable pre-push verification)
11+
12+
If all checks pass, summarize command outcomes and total runtime.

.claude/rules/coding-style.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Coding Style Rules
2+
3+
1. Always end files with a trailing newline.
4+
2. Always use `bundle exec` when running Ruby commands.
5+
3. Follow existing code conventions in the file you are editing.
6+
4. Keep changes focused and minimal; avoid unrelated diffs.
7+
5. Do not add unnecessary comments unless requested.

.claude/rules/git-workflow.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Git Workflow Rules
2+
3+
1. Create feature branches for all changes.
4+
2. Never push directly to `main`.
5+
3. Keep PRs small and focused.
6+
4. Open a PR immediately after pushing branch changes.

.claude/rules/open-source.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Open Source Maintainability Rules
2+
3+
1. Prefer removing complexity over adding new configuration.
4+
2. Treat every new option as long-term maintenance surface.
5+
3. Favor secure defaults over convenience defaults.
6+
4. Keep feature PRs focused; do not refactor adjacent code in the same PR.
7+
5. For niche needs, prefer existing extension points over new global options.

.claude/rules/testing.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Testing Rules
2+
3+
1. Run corresponding specs/tests when changing source files.
4+
2. Run `bundle exec rubocop` before committing Ruby changes.
5+
3. Run `yarn lint` before committing JavaScript changes.
6+
4. Prefer explicit RSpec spy assertions (`have_received`) over indirect counters.
7+
5. Validate both webpack and rspack paths when changing core Shakapacker behavior.
8+
6. Run `bundle exec rspec` (full suite) before pushing.
9+
7. Run `yarn test --runInBand` (JS tests) before pushing.

CLAUDE.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,16 @@
11
# Shakapacker Project Guidelines
22

3+
## Rules Directory
4+
5+
Concise always-on reminders live in `.claude/rules/`:
6+
7+
- `.claude/rules/coding-style.md`
8+
- `.claude/rules/testing.md`
9+
- `.claude/rules/git-workflow.md`
10+
- `.claude/rules/open-source.md`
11+
12+
See the sections below for full detail and examples.
13+
314
## Critical Requirements
415

516
- **ALWAYS end all files with a trailing newline character.** This is required by the project's linting rules.

0 commit comments

Comments
 (0)