Skip to content

Support: add pre-commit testing logic, restructure to .claude/skills and rules#146

Merged
ChaoWao merged 1 commit into
mainfrom
support/restructure-skills-and-rules
Mar 1, 2026
Merged

Support: add pre-commit testing logic, restructure to .claude/skills and rules#146
ChaoWao merged 1 commit into
mainfrom
support/restructure-skills-and-rules

Conversation

@ChaoWao
Copy link
Copy Markdown
Collaborator

@ChaoWao ChaoWao commented Mar 1, 2026

  • Migrate .ai-instructions/ into .claude/ following pypto skill/rules pattern
    • coding conventions → .claude/rules/ (architecture, codestyle, ascend-device)
    • git-commit workflow → .claude/skills/git-commit/SKILL.md (with frontmatter)
    • testing guide + pre-commit strategy → .claude/skills/testing/SKILL.md (merged)
  • Add pre-commit testing strategy (4-step decision flow): npu-smi detection, git-diff scope analysis, nproc parallel, idle device cap (max 2)
  • Rename test-sim/test-device commands to test-example-* for clarity
  • Add test-runtime-sim and test-runtime-device commands for runtime-scoped testing
  • Update test-all-device to auto-detect idle NPU devices instead of hardcoded -d 4-7
  • Update test-all-sim with nproc-based parallel decision
  • Require detailed commit body for multi-file changes in git-commit skill
  • Update CLAUDE.md to reference new .claude/rules/ and .claude/skills/ paths

@gemini-code-assist
Copy link
Copy Markdown

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly refactors the project's internal documentation and testing infrastructure. The primary goal is to centralize and standardize guidelines and workflows under a new .claude/ directory, making them more accessible and actionable. Concurrently, it introduces a robust pre-commit testing framework designed to streamline the development process by automating test scope, parallelism, and hardware resource allocation, thereby improving code quality and developer efficiency.

Highlights

  • Documentation and Workflow Restructuring: Migrated .ai-instructions/ content into a new .claude/ directory, separating 'rules' (always-loaded guidelines) from 'skills' (task-specific workflows) for better organization and accessibility.
  • Enhanced Pre-Commit Testing Strategy: Introduced a comprehensive 4-step pre-commit testing strategy that includes NPU device detection, git-diff scope analysis, CPU core count-based parallelism, and idle device capping to streamline the testing process.
  • Refined Test Commands: Renamed existing test commands (test-sim, test-device) to test-example-* for improved clarity and added new test-runtime-* commands to enable runtime-scoped testing.
  • Intelligent Test Execution: Updated test-all-device and test-all-sim commands to automatically detect idle NPU devices and dynamically adjust parallelism based on CPU core count, optimizing resource utilization.
  • Updated Git Commit Guidelines: Revised the git-commit skill to enforce detailed commit bodies for multi-file changes and integrated a reference to the new pre-commit testing strategy, promoting more informative commit messages.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • .ai-instructions/git-commit/commit-message.md
    • Removed the old commit message rules file.
  • .claude/commands/test-all-device.md
    • Updated the command to include NPU-SMI detection, idle device identification (max 2), dynamic device range construction, and CPU core count-based parallelism for running hardware CI.
  • .claude/commands/test-all-sim.md
    • Modified the command to dynamically determine parallelism based on CPU core count (nproc).
  • .claude/commands/test-example-device.md
    • Renamed from .claude/commands/test-device.md.
  • .claude/commands/test-example-sim.md
    • Renamed from .claude/commands/test-sim.md.
  • .claude/commands/test-runtime-device.md
    • Added a new command for running hardware device tests for a single specified runtime, incorporating NPU-SMI detection, idle device selection, and CPU core count-based parallelism.
  • .claude/commands/test-runtime-sim.md
    • Added a new command for running simulation tests for a single specified runtime, with parallelism determined by CPU core count.
  • .claude/rules/architecture.md
    • Renamed from .ai-instructions/coding/architecture.md.
  • .claude/rules/ascend-device.md
    • Renamed from .ai-instructions/terminologies/ascend-device.md.
  • .claude/rules/codestyle.md
    • Renamed from .ai-instructions/coding/codestyle.md.
  • .claude/skills/git-commit/SKILL.md
    • Added a new skill document detailing the git commit workflow, including prerequisites, pre-commit testing reference, commit message format (with new rules for body content), co-author policy, and post-commit verification.
  • .claude/skills/testing/SKILL.md
    • Renamed from .ai-instructions/coding/testing.md and significantly updated to include a detailed 4-step pre-commit testing strategy (platform availability, test scope, parallel strategy, device detection) and a decision tree.
  • .gitignore
    • Added .claude/settings.json and .claude/worktrees to the ignore list.
  • CLAUDE.md
    • Updated the main CLAUDE.md file to reference the new .claude/rules/ for coding conventions and .claude/skills/ for task-specific workflows.
Activity
  • No human activity has been recorded on this pull request yet.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request effectively restructures the AI instructions into a more organized .claude/ directory, separating them into rules and skills. It also introduces a more sophisticated pre-commit testing strategy that intelligently considers available hardware, test scope, and parallelism. The changes are well-organized and significantly improve the testing workflow. My review includes a few suggestions to clarify ambiguities in the new testing logic, particularly around handling non-consecutive NPU devices, and to fix an incomplete command example in the testing guide.

Comment thread .claude/commands/test-all-device.md Outdated
Comment thread .claude/commands/test-runtime-device.md Outdated
Comment thread .claude/skills/testing/SKILL.md Outdated
Comment thread .claude/skills/testing/SKILL.md Outdated
@ChaoWao ChaoWao force-pushed the support/restructure-skills-and-rules branch 2 times, most recently from 8bb2fad to a3053f4 Compare March 1, 2026 06:46
- Migrate .ai-instructions/ into .claude/ following skills/rules pattern
  - coding conventions → .claude/rules/ (architecture, codestyle, ascend-device)
  - git-commit and testing workflows → .claude/skills/ (with frontmatter)
- Add pre-commit testing strategy (4-step decision flow):
  npu-smi detection, git-diff scope analysis, nproc parallel, idle device cap
- Add fix-issue skill: fetch issue → create branch → plan → implement → test
- Add address-pr-comments skill: triage PR comments → classify → address
- Rename test-sim/test-device commands to test-example-* for clarity
- Add test-runtime-sim and test-runtime-device commands
- Update test-all-device/test-all-sim with auto-detection logic
@ChaoWao ChaoWao force-pushed the support/restructure-skills-and-rules branch from a3053f4 to 37be52e Compare March 1, 2026 06:50
@ChaoWao ChaoWao merged commit c1a57e0 into main Mar 1, 2026
3 checks passed
@ChaoWao ChaoWao deleted the support/restructure-skills-and-rules branch March 1, 2026 06:58
PKUZHOU pushed a commit to PKUZHOU/simpler that referenced this pull request Mar 31, 2026
…hw-native-sys#146)

- Migrate .ai-instructions/ into .claude/ following skills/rules pattern
  - coding conventions → .claude/rules/ (architecture, codestyle, ascend-device)
  - git-commit and testing workflows → .claude/skills/ (with frontmatter)
- Add pre-commit testing strategy (4-step decision flow):
  npu-smi detection, git-diff scope analysis, nproc parallel, idle device cap
- Add fix-issue skill: fetch issue → create branch → plan → implement → test
- Add address-pr-comments skill: triage PR comments → classify → address
- Rename test-sim/test-device commands to test-example-* for clarity
- Add test-runtime-sim and test-runtime-device commands
- Update test-all-device/test-all-sim with auto-detection logic
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant