From 775b058b2c09f079d65a940c9b5df19fdcae85d5 Mon Sep 17 00:00:00 2001 From: Naohiro CHIKAMATSU Date: Sun, 31 Aug 2025 21:19:43 +0900 Subject: [PATCH] Add instruction for LLMs --- .cursorrules | 56 ++++++++++++++++++++++++++++++ .github/copilot-instructions.md | 61 +++++++++++++++++++++++++++++++++ CLAUDE.md | 53 ++++++++++++++++++++++++++++ CONTRIBUTING.md | 20 +++++++++++ Makefile | 5 --- doc/es/CONTRIBUTING.md | 20 +++++++++++ doc/fr/CONTRIBUTING.md | 20 +++++++++++ doc/ja/CONTRIBUTING.md | 20 +++++++++++ doc/ko/CONTRIBUTING.md | 20 +++++++++++ doc/ru/CONTRIBUTING.md | 20 +++++++++++ doc/zh-cn/CONTRIBUTING.md | 20 +++++++++++ 11 files changed, 310 insertions(+), 5 deletions(-) create mode 100644 .cursorrules create mode 100644 .github/copilot-instructions.md create mode 100644 CLAUDE.md diff --git a/.cursorrules b/.cursorrules new file mode 100644 index 0000000..462f05a --- /dev/null +++ b/.cursorrules @@ -0,0 +1,56 @@ +# filesql + +filesql is a library that implements the common functionality of the following commands: "Load files such as CSV into SQLite3 and execute SQL queries against CSV, etc." +- [sqly](https://github.com/nao1215/sqly): easily execute SQL against CSV/TSV/LTSV/JSON and Microsoft Excel™ with shell. +- [sqluv](https://github.com/nao1215/sqluv): simple terminal UI for RDBMS & CSV/TSV/LTSV at local/https/s3 + +filesql reads the contents of specified input files and returns [sql.DB](https://pkg.go.dev/database/sql#DB). Developers can execute SQL queries in the same way as the standard sql.DB they normally use, making it easy to learn. + +## Codebase Information +### Development Commands +- `make test`: Run tests and measure coverage (generates cover.out file, viewable in browser with cover.html) +- `make lint`: Code inspection with golangci-lint (.golangci.yml configuration) +- `make clean`: Delete generated files +- `make tools`: Install dependency tools (golangci-lint, octocov) + +### Key Features +- Input file formats: CSV, TSV, LTSV, Parquet, Excel + compressed versions (.gz, .bz2, .xz, .zst) +- Input methods: File path, directory, io.Reader, embed.FS +- Streaming: Chunk-based processing for large files +- Type inference: Automatic column data type detection (INTEGER/REAL/TEXT) +- Auto-save: Automatic saving at Commit or db.Close timing + +## Development Rules +- Test-Driven Development: We adopt the test-driven development promoted by t-wada (Takuto Wada). Always write test code and be mindful of the test pyramid. +- Working code: Ensure that `make test` and `make lint` succeed after completing work. +- Sponsor acquisition: Since development incurs financial costs, we seek sponsors via `https://github.com/sponsors/nao1215`. Include sponsor links in README and documentation. +- Contributor acquisition: Create developer documentation so anyone can participate in development and recruit contributors. +- Comments in English: Write code comments in English to accept international contributors. +- User-friendly documentation comments: Write detailed explanations and example code for public functions so users can understand usage at a glance. + +## Coding Guidelines +- No global variables: Do not use global variables. Manage state through function arguments and return values. +- Coding rules: Follow Golang coding rules. [Effective Go](https://go.dev/doc/effective_go) is the basic rule. +- Package comments are mandatory: Describe the package overview in `doc.go` for each package. Clarify the purpose and usage of the package. +- Comments for public functions, variables, and struct fields are mandatory: When visibility is public, always write comments following go doc rules. +- Remove duplicate code: After completing your work, check if you have created duplicate code and remove unnecessary code. +- Update README: When adding new features, update the README at the following paths: + - README.md + - doc/es/README.md + - doc/fr/README.md + - doc/ja/README.md + - doc/ko/README.md + - doc/ru/README.md + - doc/zh-cn/README.md + +## Testing +- [Readable Test Code](https://logmi.jp/main/technology/327449): Avoid excessive optimization (DRY) and aim for a state where it's easy to understand what tests exist. +- Clear input/output: Create tests with `t.Run()` and clarify test case input/output. Test cases clarify test intent by explicitly showing input and expected output. +- Test granularity: Aim for 80% or higher coverage with unit tests. +- Parallel test execution: Use `t.Parallel()` to run tests in parallel whenever possible. +- Using `octocov`: Run `octocov` after `make test` to confirm test coverage exceeds 80%. +- Cross-platform support: Tests run on Linux, macOS, and Windows through GitHub Actions. Examples of non-cross-platform code include "concatenating paths without using `filepath.Join`" and "using "\n" for line breaks". +- Test data storage: Store sample files in various formats in the testdata directory + +## Important Notes for Cursor +When using Cursor's AI features, please ensure all generated code adheres to these guidelines. Always review and understand the generated code before committing. The AI should help you follow TDD practices by suggesting tests first, then implementation. \ No newline at end of file diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md new file mode 100644 index 0000000..6bdc37c --- /dev/null +++ b/.github/copilot-instructions.md @@ -0,0 +1,61 @@ +# filesql + +filesql is a library that implements the common functionality of the following commands: "Load files such as CSV into SQLite3 and execute SQL queries against CSV, etc." +- [sqly](https://github.com/nao1215/sqly): easily execute SQL against CSV/TSV/LTSV/JSON and Microsoft Excel™ with shell. +- [sqluv](https://github.com/nao1215/sqluv): simple terminal UI for RDBMS & CSV/TSV/LTSV at local/https/s3 + +filesql reads the contents of specified input files and returns [sql.DB](https://pkg.go.dev/database/sql#DB). Developers can execute SQL queries in the same way as the standard sql.DB they normally use, making it easy to learn. + +## Codebase Information +### Development Commands +- `make test`: Run tests and measure coverage (generates cover.out file, viewable in browser with cover.html) +- `make lint`: Code inspection with golangci-lint (.golangci.yml configuration) +- `make clean`: Delete generated files +- `make tools`: Install dependency tools (golangci-lint, octocov) + +### Key Features +- Input file formats: CSV, TSV, LTSV, Parquet, Excel + compressed versions (.gz, .bz2, .xz, .zst) +- Input methods: File path, directory, io.Reader, embed.FS +- Streaming: Chunk-based processing for large files +- Type inference: Automatic column data type detection (INTEGER/REAL/TEXT) +- Auto-save: Automatic saving at Commit or db.Close timing + +## Development Rules +- Test-Driven Development: We adopt the test-driven development promoted by t-wada (Takuto Wada). Always write test code and be mindful of the test pyramid. +- Working code: Ensure that `make test` and `make lint` succeed after completing work. +- Sponsor acquisition: Since development incurs financial costs, we seek sponsors via `https://github.com/sponsors/nao1215`. Include sponsor links in README and documentation. +- Contributor acquisition: Create developer documentation so anyone can participate in development and recruit contributors. +- Comments in English: Write code comments in English to accept international contributors. +- User-friendly documentation comments: Write detailed explanations and example code for public functions so users can understand usage at a glance. + +## Coding Guidelines +- No global variables: Do not use global variables. Manage state through function arguments and return values. +- Coding rules: Follow Golang coding rules. [Effective Go](https://go.dev/doc/effective_go) is the basic rule. +- Package comments are mandatory: Describe the package overview in `doc.go` for each package. Clarify the purpose and usage of the package. +- Comments for public functions, variables, and struct fields are mandatory: When visibility is public, always write comments following go doc rules. +- Remove duplicate code: After completing your work, check if you have created duplicate code and remove unnecessary code. +- Update README: When adding new features, update the README at the following paths: + - README.md + - doc/es/README.md + - doc/fr/README.md + - doc/ja/README.md + - doc/ko/README.md + - doc/ru/README.md + - doc/zh-cn/README.md + +## Testing +- [Readable Test Code](https://logmi.jp/main/technology/327449): Avoid excessive optimization (DRY) and aim for a state where it's easy to understand what tests exist. +- Clear input/output: Create tests with `t.Run()` and clarify test case input/output. Test cases clarify test intent by explicitly showing input and expected output. +- Test granularity: Aim for 80% or higher coverage with unit tests. +- Parallel test execution: Use `t.Parallel()` to run tests in parallel whenever possible. +- Using `octocov`: Run `octocov` after `make test` to confirm test coverage exceeds 80%. +- Cross-platform support: Tests run on Linux, macOS, and Windows through GitHub Actions. Examples of non-cross-platform code include "concatenating paths without using `filepath.Join`" and "using "\n" for line breaks". +- Test data storage: Store sample files in various formats in the testdata directory + +## GitHub Copilot Instructions +When generating code suggestions, GitHub Copilot should: +1. Always suggest tests before implementation following TDD principles +2. Ensure all generated code follows the Effective Go guidelines +3. Include proper godoc comments for all public APIs +4. Suggest parallel test execution with `t.Parallel()` where appropriate +5. Use `filepath.Join()` for path operations to ensure cross-platform compatibility \ No newline at end of file diff --git a/CLAUDE.md b/CLAUDE.md new file mode 100644 index 0000000..4a3ea8a --- /dev/null +++ b/CLAUDE.md @@ -0,0 +1,53 @@ +# filesql + +filesql is a library that implements the common functionality of the following commands: "Load files such as CSV into SQLite3 and execute SQL queries against CSV, etc." +- [sqly](https://github.com/nao1215/sqly): easily execute SQL against CSV/TSV/LTSV/JSON and Microsoft Excel™ with shell. +- [sqluv](https://github.com/nao1215/sqluv): simple terminal UI for RDBMS & CSV/TSV/LTSV at local/https/s3 + +filesql reads the contents of specified input files and returns [sql.DB](https://pkg.go.dev/database/sql#DB). Developers can execute SQL queries in the same way as the standard sql.DB they normally use, making it easy to learn. + +## Codebase Information +### Development Commands +- `make test`: Run tests and measure coverage (generates cover.out file, viewable in browser with cover.html) +- `make lint`: Code inspection with golangci-lint (.golangci.yml configuration) +- `make clean`: Delete generated files +- `make tools`: Install dependency tools (golangci-lint, octocov) + +### Key Features +- Input file formats: CSV, TSV, LTSV, Parquet, Excel + compressed versions (.gz, .bz2, .xz, .zst) +- Input methods: File path, directory, io.Reader, embed.FS +- Streaming: Chunk-based processing for large files +- Type inference: Automatic column data type detection (INTEGER/REAL/TEXT) +- Auto-save: Automatic saving at Commit or db.Close timing + +## Development Rules +- Test-Driven Development: We adopt the test-driven development promoted by t-wada (Takuto Wada). Always write test code and be mindful of the test pyramid. +- Working code: Ensure that `make test` and `make lint` succeed after completing work. +- Sponsor acquisition: Since development incurs financial costs, we seek sponsors via `https://github.com/sponsors/nao1215`. Include sponsor links in README and documentation. +- Contributor acquisition: Create developer documentation so anyone can participate in development and recruit contributors. +- Comments in English: Write code comments in English to accept international contributors. +- User-friendly documentation comments: Write detailed explanations and example code for public functions so users can understand usage at a glance. + +## Coding Guidelines +- No global variables: Do not use global variables. Manage state through function arguments and return values. +- Coding rules: Follow Golang coding rules. [Effective Go](https://go.dev/doc/effective_go) is the basic rule. +- Package comments are mandatory: Describe the package overview in `doc.go` for each package. Clarify the purpose and usage of the package. +- Comments for public functions, variables, and struct fields are mandatory: When visibility is public, always write comments following go doc rules. +- Remove duplicate code: After completing your work, check if you have created duplicate code and remove unnecessary code. +- Update README: When adding new features, update the README at the following paths: + - README.md + - doc/es/README.md + - doc/fr/README.md + - doc/ja/README.md + - doc/ko/README.md + - doc/ru/README.md + - doc/zh-cn/README.md + +## Testing +- [Readable Test Code](https://logmi.jp/main/technology/327449): Avoid excessive optimization (DRY) and aim for a state where it's easy to understand what tests exist. +- Clear input/output: Create tests with `t.Run()` and clarify test case input/output. Test cases clarify test intent by explicitly showing input and expected output. +- Test granularity: Aim for 80% or higher coverage with unit tests. +- Parallel test execution: Use `t.Parallel()` to run tests in parallel whenever possible. +- Using `octocov`: Run `octocov` after `make test` to confirm test coverage exceeds 80%. +- Cross-platform support: Tests run on Linux, macOS, and Windows through GitHub Actions. Examples of non-cross-platform code include "concatenating paths without using `filepath.Join`" and "using "\n" for line breaks". +- Test data storage: Store sample files in various formats in the testdata directory diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index ce7db5c..434ce50 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -109,6 +109,25 @@ func TestFile_Parse(t *testing.T) { } ``` +## Using AI Assistants (LLMs) + +We actively encourage the use of AI coding assistants to improve productivity and code quality. Tools like Claude Code, GitHub Copilot, and Cursor are welcome for: + +- Writing boilerplate code +- Generating comprehensive test cases +- Improving documentation +- Refactoring existing code +- Finding potential bugs +- Suggesting performance optimizations +- Translating documentation + +### Guidelines for AI-Assisted Development + +1. **Review all generated code**: Always review and understand AI-generated code before committing +2. **Maintain consistency**: Ensure AI-generated code follows our coding standards in CLAUDE.md +3. **Test thoroughly**: AI-generated code must pass all tests and linting (`make test` and `make lint`) +4. **Use project configuration**: We provide `CLAUDE.md`, `.cursorrules` and `.github/copilot-instructions.md` to help AI assistants understand our project standards + ## Creating Pull Requests ### Preparation @@ -120,6 +139,7 @@ func TestFile_Parse(t *testing.T) { 2. **Write Tests** - Always add tests for new features - For bug fixes, create tests that reproduce the bug + - AI tools can help generate comprehensive test cases 3. **Quality Check** ```bash diff --git a/Makefile b/Makefile index 838be18..aa544b1 100644 --- a/Makefile +++ b/Makefile @@ -16,8 +16,6 @@ GOOS = "" GOARCH = "" GO_PKGROOT = ./... GO_PACKAGES = $(shell $(GO_LIST) $(GO_PKGROOT)) -GO_LDFLAGS = -ldflags '-X github.com/nao1215/sqluv/config.Version=${VERSION}' - clean: ## Clean project -rm -rf $(APP) cover.* @@ -26,9 +24,6 @@ test: ## Start test env GOOS=$(GOOS) $(GO_TEST) -cover $(GO_PKGROOT) -coverpkg=./... -coverprofile=cover.out $(GO_TOOL) cover -html=cover.out -o cover.html -gen: ## Generate code from templates - $(GO) generate ./... - tools: ## Install dependency tools $(GO_INSTALL) github.com/golangci/golangci-lint/v2/cmd/golangci-lint@latest $(GO_INSTALL) github.com/k1LoW/octocov@latest diff --git a/doc/es/CONTRIBUTING.md b/doc/es/CONTRIBUTING.md index a6bcbf4..eead7e8 100644 --- a/doc/es/CONTRIBUTING.md +++ b/doc/es/CONTRIBUTING.md @@ -109,6 +109,25 @@ func TestFile_Parse(t *testing.T) { } ``` +## Uso de Asistentes de IA (LLMs) + +Fomentamos activamente el uso de asistentes de codificación con IA para mejorar la productividad y la calidad del código. Herramientas como Claude Code, GitHub Copilot y Cursor son bienvenidas para: + +- Escribir código repetitivo +- Generar casos de prueba completos +- Mejorar la documentación +- Refactorizar código existente +- Encontrar posibles errores +- Sugerir optimizaciones de rendimiento +- Traducir documentación + +### Pautas para el Desarrollo Asistido por IA + +1. **Revisar todo el código generado**: Siempre revisa y comprende el código generado por IA antes de hacer commit +2. **Mantener la coherencia**: Asegúrate de que el código generado por IA siga nuestros estándares de codificación en CLAUDE.md +3. **Probar exhaustivamente**: El código generado por IA debe pasar todas las pruebas y el linting (`make test` y `make lint`) +4. **Usar configuración del proyecto**: Proporcionamos `CLAUDE.md`, `.cursorrules` y `.github/copilot-instructions.md` para ayudar a los asistentes de IA a entender nuestros estándares del proyecto + ## Crear Pull Requests ### Preparación @@ -120,6 +139,7 @@ func TestFile_Parse(t *testing.T) { 2. **Escribir Pruebas** - Siempre agrega pruebas para nuevas características - Para correcciones de errores, crea pruebas que reproduzcan el error + - Las herramientas de IA pueden ayudar a generar casos de prueba completos 3. **Verificación de Calidad** ```bash diff --git a/doc/fr/CONTRIBUTING.md b/doc/fr/CONTRIBUTING.md index 6003dc9..b08f50f 100644 --- a/doc/fr/CONTRIBUTING.md +++ b/doc/fr/CONTRIBUTING.md @@ -109,6 +109,25 @@ func TestFile_Parse(t *testing.T) { } ``` +## Utilisation des Assistants IA (LLMs) + +Nous encourageons activement l'utilisation d'assistants de codage IA pour améliorer la productivité et la qualité du code. Des outils comme Claude Code, GitHub Copilot et Cursor sont les bienvenus pour : + +- Écrire du code répétitif +- Générer des cas de test complets +- Améliorer la documentation +- Refactoriser le code existant +- Trouver des bogues potentiels +- Suggérer des optimisations de performance +- Traduire la documentation + +### Directives pour le Développement Assisté par IA + +1. **Réviser tout le code généré** : Toujours réviser et comprendre le code généré par l'IA avant de faire un commit +2. **Maintenir la cohérence** : S'assurer que le code généré par l'IA suit nos standards de codage dans CLAUDE.md +3. **Tester minutieusement** : Le code généré par l'IA doit passer tous les tests et le linting (`make test` et `make lint`) +4. **Utiliser la configuration du projet** : Nous fournissons `CLAUDE.md`, `.cursorrules` et `.github/copilot-instructions.md` pour aider les assistants IA à comprendre nos standards de projet + ## Créer des Pull Requests ### Préparation @@ -120,6 +139,7 @@ func TestFile_Parse(t *testing.T) { 2. **Écrire des Tests** - Toujours ajouter des tests pour les nouvelles fonctionnalités - Pour les corrections de bogues, créez des tests qui reproduisent le bogue + - Les outils IA peuvent aider à générer des cas de test complets 3. **Contrôle de Qualité** ```bash diff --git a/doc/ja/CONTRIBUTING.md b/doc/ja/CONTRIBUTING.md index aeec848..f0c57db 100644 --- a/doc/ja/CONTRIBUTING.md +++ b/doc/ja/CONTRIBUTING.md @@ -109,6 +109,25 @@ func TestFile_Parse(t *testing.T) { } ``` +## AIアシスタント(LLM)の活用 + +私たちは生産性と品質向上のため、AIコーディングアシスタントの利用を積極的に推奨しています。Claude Code、GitHub Copilot、Cursorなどのツールは以下の用途で活用できます: + +- ボイラープレートコードの生成 +- 包括的なテストケースの生成 +- ドキュメントの改善 +- 既存コードのリファクタリング +- 潜在的なバグの発見 +- パフォーマンス最適化の提案 +- ドキュメントの翻訳 + +### AI支援開発のガイドライン + +1. **生成コードのレビュー**: AI生成コードは必ずレビューし、理解してからコミットしてください +2. **一貫性の維持**: AI生成コードがCLAUDE.mdのコーディング標準に従っていることを確認してください +3. **徹底的なテスト**: AI生成コードは全てのテストとリンティング(`make test`と`make lint`)に合格する必要があります +4. **プロジェクト設定の利用**: `CLAUDE.md`、`.cursorrules`と`.github/copilot-instructions.md`を用意しており、AIアシスタントがプロジェクト標準を理解できるようになっています + ## Pull Requestの作成 ### 事前準備 @@ -120,6 +139,7 @@ func TestFile_Parse(t *testing.T) { 2. **テストの作成** - 新機能にはテストを必ず追加してください - バグ修正の場合は、バグを再現するテストを作成してください + - AIツールを使って包括的なテストケースを生成できます 3. **品質チェック** ```bash diff --git a/doc/ko/CONTRIBUTING.md b/doc/ko/CONTRIBUTING.md index f848ade..bd0bd21 100644 --- a/doc/ko/CONTRIBUTING.md +++ b/doc/ko/CONTRIBUTING.md @@ -109,6 +109,25 @@ func TestFile_Parse(t *testing.T) { } ``` +## AI 어시스턴트(LLM) 활용 + +생산성과 코드 품질 향상을 위해 AI 코딩 어시스턴트 사용을 적극 권장합니다. Claude Code, GitHub Copilot, Cursor 같은 도구들을 다음 용도로 활용할 수 있습니다: + +- 보일러플레이트 코드 작성 +- 포괄적인 테스트 케이스 생성 +- 문서 개선 +- 기존 코드 리팩토링 +- 잠재적 버그 발견 +- 성능 최적화 제안 +- 문서 번역 + +### AI 지원 개발 가이드라인 + +1. **생성된 코드 검토**: AI가 생성한 코드는 항상 검토하고 이해한 후 커밋하세요 +2. **일관성 유지**: AI 생성 코드가 CLAUDE.md의 코딩 표준을 따르는지 확인하세요 +3. **철저한 테스트**: AI 생성 코드는 모든 테스트와 린팅(`make test`와 `make lint`)을 통과해야 합니다 +4. **프로젝트 설정 사용**: AI 어시스턴트가 프로젝트 표준을 이해할 수 있도록 `CLAUDE.md`, `.cursorrules`와 `.github/copilot-instructions.md`를 제공합니다 + ## Pull Request 생성 ### 준비 @@ -120,6 +139,7 @@ func TestFile_Parse(t *testing.T) { 2. **테스트 작성** - 새 기능에는 항상 테스트를 추가하세요 - 버그 수정의 경우, 버그를 재현하는 테스트를 생성하세요 + - AI 도구를 사용하여 포괄적인 테스트 케이스를 생성할 수 있습니다 3. **품질 확인** ```bash diff --git a/doc/ru/CONTRIBUTING.md b/doc/ru/CONTRIBUTING.md index 79630a5..3fe4453 100644 --- a/doc/ru/CONTRIBUTING.md +++ b/doc/ru/CONTRIBUTING.md @@ -109,6 +109,25 @@ func TestFile_Parse(t *testing.T) { } ``` +## Использование ИИ-ассистентов (LLM) + +Мы активно поощряем использование ИИ-ассистентов для кодирования для повышения производительности и качества кода. Такие инструменты, как Claude Code, GitHub Copilot и Cursor, приветствуются для: + +- Написания шаблонного кода +- Генерации полных тестовых случаев +- Улучшения документации +- Рефакторинга существующего кода +- Поиска потенциальных ошибок +- Предложения оптимизации производительности +- Перевода документации + +### Руководство по разработке с помощью ИИ + +1. **Проверяйте весь сгенерированный код**: Всегда проверяйте и понимайте код, сгенерированный ИИ, перед коммитом +2. **Поддерживайте согласованность**: Убедитесь, что код, сгенерированный ИИ, следует нашим стандартам кодирования в CLAUDE.md +3. **Тщательно тестируйте**: Код, сгенерированный ИИ, должен пройти все тесты и линтинг (`make test` и `make lint`) +4. **Используйте конфигурацию проекта**: Мы предоставляем `CLAUDE.md`, `.cursorrules` и `.github/copilot-instructions.md`, чтобы помочь ИИ-ассистентам понять стандарты нашего проекта + ## Создание Pull Request ### Подготовка @@ -120,6 +139,7 @@ func TestFile_Parse(t *testing.T) { 2. **Написание тестов** - Всегда добавляйте тесты для новых функций - Для исправления ошибок создайте тесты, которые воспроизводят ошибку + - Инструменты ИИ могут помочь генерировать полные тестовые случаи 3. **Проверка качества** ```bash diff --git a/doc/zh-cn/CONTRIBUTING.md b/doc/zh-cn/CONTRIBUTING.md index dfcf806..457fbc8 100644 --- a/doc/zh-cn/CONTRIBUTING.md +++ b/doc/zh-cn/CONTRIBUTING.md @@ -109,6 +109,25 @@ func TestFile_Parse(t *testing.T) { } ``` +## 使用 AI 助手(LLM) + +我们积极鼓励使用 AI 编码助手来提高生产力和代码质量。Claude Code、GitHub Copilot 和 Cursor 等工具可用于: + +- 编写样板代码 +- 生成全面的测试用例 +- 改进文档 +- 重构现有代码 +- 发现潜在的错误 +- 建议性能优化 +- 翻译文档 + +### AI 辅助开发指南 + +1. **审查所有生成的代码**:始终审查并理解 AI 生成的代码后再提交 +2. **保持一致性**:确保 AI 生成的代码遵循 CLAUDE.md 中的编码标准 +3. **彻底测试**:AI 生成的代码必须通过所有测试和代码检查(`make test` 和 `make lint`) +4. **使用项目配置**:我们提供 `CLAUDE.md`, `.cursorrules` 和 `.github/copilot-instructions.md` 来帮助 AI 助手理解我们的项目标准 + ## 创建拉取请求 ### 准备工作 @@ -120,6 +139,7 @@ func TestFile_Parse(t *testing.T) { 2. **编写测试** - 始终为新功能添加测试 - 对于错误修复,创建重现错误的测试 + - AI 工具可以帮助生成全面的测试用例 3. **质量检查** ```bash