From 9ea3f0842c0973038ff6060b0eda32d58929bd6f Mon Sep 17 00:00:00 2001 From: Vaayne Date: Mon, 29 Sep 2025 11:12:56 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=93=9D=20docs:=20refresh=20AI=20assistant?= =?UTF-8?q?=20guidelines?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CLAUDE.md | 28 +++++++++++++--------------- 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/CLAUDE.md b/CLAUDE.md index 91197166f9..bfd724e316 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -2,22 +2,20 @@ This file provides guidance to AI coding assistants when working with code in this repository. Adherence to these guidelines is crucial for maintaining code quality and consistency. -## Guiding Principles +## Guiding Principles (MUST FOLLOW) -- **Clarity and Simplicity**: Write code that is easy to understand and maintain. -- **Consistency**: Follow existing patterns and conventions in the codebase. -- **Correctness**: Ensure code is correct, well-tested, and robust. -- **Efficiency**: Write performant code and use resources judiciously. - -## MUST Follow Rules - -1. **Code Search**: Use `ast-grep` for semantic code pattern searches when available. Fallback to `rg` (ripgrep) or `grep` for text-based searches. -2. **UI Framework**: Exclusively use **HeroUI** for all new UI components. The use of `antd` or `styled-components` is strictly **PROHIBITED**. -3. **Quality Assurance**: **Always** run `yarn build:check` before finalizing your work or making any commits. This ensures code quality (linting, testing, and type checking). -4. **Centralized Logging**: Use the `loggerService` exclusively for all application logging (info, warn, error levels) with proper context. Do not use `console.log`. -5. **External Research**: Leverage `subagent` for gathering external information, including latest documentation, API references, news, or web-based research. This keeps the main conversation focused on the task at hand. -6. **Code Reviews**: Always seek a code review from a human developer before merging significant changes. This ensures adherence to project standards and catches potential issues. -7. **Documentation**: Update or create documentation for any new features, modules, or significant changes to existing functionality. +- **Keep it clear**: Write code that is easy to read, maintain, and explain. +- **Match the house style**: Reuse existing patterns, naming, and conventions. +- **Ship correctness**: Make changes that are robust, tested, and type-safe. +- **Mind performance**: Choose efficient solutions and avoid wasted resources. +- **Search smart**: Prefer `ast-grep` for semantic queries; fall back to `rg`/`grep` when needed. +- **Build with HeroUI**: Use HeroUI for every new UI component; never add `antd` or `styled-components`. +- **Guard quality**: Run `yarn build:check` before you finish or commit; fix formatting or i18n drift first if required. +- **Log centrally**: Route all logging through `loggerService` with the right context—no `console.log`. +- **Research via subagent**: Lean on `subagent` for external docs, APIs, news, and references. +- **Seek review**: Ask a human developer to review substantial changes before merging. +- **Document changes**: Update or create docs for new features or significant edits. +- **Commit in rhythm**: Keep commits small, conventional, and emoji-tagged. ## Development Commands