📝 docs: refresh AI assistant guidelines

This commit is contained in:
Vaayne 2025-09-29 11:12:56 +08:00
parent 90242e2285
commit 9ea3f0842c

View File

@ -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. 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. - **Keep it clear**: Write code that is easy to read, maintain, and explain.
- **Consistency**: Follow existing patterns and conventions in the codebase. - **Match the house style**: Reuse existing patterns, naming, and conventions.
- **Correctness**: Ensure code is correct, well-tested, and robust. - **Ship correctness**: Make changes that are robust, tested, and type-safe.
- **Efficiency**: Write performant code and use resources judiciously. - **Mind performance**: Choose efficient solutions and avoid wasted resources.
- **Search smart**: Prefer `ast-grep` for semantic queries; fall back to `rg`/`grep` when needed.
## MUST Follow Rules - **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.
1. **Code Search**: Use `ast-grep` for semantic code pattern searches when available. Fallback to `rg` (ripgrep) or `grep` for text-based searches. - **Log centrally**: Route all logging through `loggerService` with the right context—no `console.log`.
2. **UI Framework**: Exclusively use **HeroUI** for all new UI components. The use of `antd` or `styled-components` is strictly **PROHIBITED**. - **Research via subagent**: Lean on `subagent` for external docs, APIs, news, and references.
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). - **Seek review**: Ask a human developer to review substantial changes before merging.
4. **Centralized Logging**: Use the `loggerService` exclusively for all application logging (info, warn, error levels) with proper context. Do not use `console.log`. - **Document changes**: Update or create docs for new features or significant edits.
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. - **Commit in rhythm**: Keep commits small, conventional, and emoji-tagged.
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.
## Development Commands ## Development Commands