Skip to content

Latest commit

 

History

History
79 lines (52 loc) · 2.52 KB

File metadata and controls

79 lines (52 loc) · 2.52 KB

Agent Guidelines for rsmpi-rt

Read README.md before starting work.

General Guidelines

  • 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

Context-Efficient Exploration

  • Use Task tool with subagent_type=Explore for open-ended exploration
  • Use Grep for structure: pub fn, impl.*for, ^pub (struct|enum|type)
  • Read specific lines with offset/limit parameters
  • Prefer API docs over full source files

Code Style

cargo fmt for formatting, cargo clippy for linting. Avoid unwrap()/expect() in library code.

Always run cargo fmt --all before committing changes.

Testing

  • Test tolerance changes: When relaxing test tolerances (unit tests, codecov targets, etc.), always seek explicit user approval before making changes.

API Design

Only make functions pub when truly public API.

Layering and Maintainability

  • 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.

Code Deduplication

  • Avoid duplicate test code. Use macros, functions, or generic functions to share test logic.

Git Workflow

Never push/create PR without user approval.

Pre-PR Checks

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-failed

Before creating PR: Verify README.md is accurate (project structure, examples).