Read README.md before starting work.
- Use same language as past conversations (Japanese if previous was Japanese)
- Source code and docs in English
- Bug fixing: When a bug is discovered, always check related files for similar bugs and propose to the user to inspect them
- Use Task tool with
subagent_type=Explorefor open-ended exploration - Use Grep for structure:
pub fn,impl.*for,^pub (struct|enum|type) - Read specific lines with
offset/limitparameters - Prefer API docs over full source files
cargo fmt for formatting, cargo clippy for linting. Avoid unwrap()/expect() in library code.
Always run cargo fmt --all before committing changes.
- Test tolerance changes: When relaxing test tolerances (unit tests, codecov targets, etc.), always seek explicit user approval before making changes.
Only make functions pub when truly public API.
- Never access low-level APIs or internal data structures from downstream crates. Use high-level public methods instead of directly manipulating internal representations.
- This applies to both library code and test code. Tests should also use public APIs to maintain consistency and reduce maintenance burden when internal representations change.
- Avoid duplicate test code. Use macros, functions, or generic functions to share test logic.
Never push/create PR without user approval.
Before creating a PR, always run lint checks locally:
cargo fmt --all # Format all code
cargo clippy --workspace # Check for common issues
cargo test --workspace # Run all tests| Change Type | Workflow |
|---|---|
| Minor fixes | Branch + PR with auto-merge |
| Large features | Worktree + PR with auto-merge |
# Minor: branch workflow
git checkout -b fix-name && git add -A && git commit -m "msg"
cargo fmt --all && cargo clippy --workspace # Lint before push
git push -u origin fix-name
gh pr create --base main --title "Title" --body "Desc"
gh pr merge --auto --squash --delete-branch
# Large: worktree workflow
git worktree add ../rsmpi-rt-feature -b feature
# Check PR before update
gh pr view <NUM> --json state # Never push to merged PR
# Monitor CI
gh pr checks <NUM>
gh run view <RUN_ID> --log-failedBefore creating PR: Verify README.md is accurate (project structure, examples).