From 3cd57d4b735adf5e342c1e632a07cc426ccd635b Mon Sep 17 00:00:00 2001 From: "anthropic-code-agent[bot]" <242468646+Claude@users.noreply.github.com> Date: Thu, 16 Apr 2026 01:59:00 +0000 Subject: [PATCH] Migrate project to Claude Code as primary AI coding assistant Agent-Logs-Url: https://github.com/objectstack-ai/framework/sessions/5c860d51-bea2-48cb-918a-9129f37adb46 Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com> --- .github/copilot-instructions.md | 2 +- .github/prompts/OVERVIEW.md | 16 ++++++---- .github/prompts/README.md | 10 +++++-- CLAUDE.md | 53 +++++++++++++++++++++++++++++++-- 4 files changed, 71 insertions(+), 10 deletions(-) diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md index 780439637..593aba2b6 100644 --- a/.github/copilot-instructions.md +++ b/.github/copilot-instructions.md @@ -90,7 +90,7 @@ objectstack-ai/spec/ │ ├── app-crm/ # Advanced: full CRM with relations │ └── plugin-bi/ # Plugin example: BI dashboard │ -├── skills/ # 🤖 AI skill definitions (for Copilot/Cursor) +├── skills/ # 🤖 AI skill definitions (for Claude Code, Copilot, Cursor) │ ├── objectstack-schema/ │ ├── objectstack-query/ │ ├── objectstack-api/ diff --git a/.github/prompts/OVERVIEW.md b/.github/prompts/OVERVIEW.md index 22aa23fc0..69c015832 100644 --- a/.github/prompts/OVERVIEW.md +++ b/.github/prompts/OVERVIEW.md @@ -114,16 +114,22 @@ ObjectStack AI Prompts ## 🚀 使用方式 (Usage) -### GitHub Copilot 集成 +### AI 编码助手集成 -这些提示词会被 GitHub Copilot 自动加载: +这些提示词兼容多个 AI 编码助手: + +- **Claude Code**(推荐):从代码库上下文自动加载 +- **GitHub Copilot**:在代码库中工作时自动加载 +- **Cursor**:可引用这些提示词获取上下文感知帮助 + +提示词会根据以下内容自动加载: ``` .github/ └── prompts/ - ├── data-protocol.prompt.md ← 编辑数据协议时自动加载 - ├── ui-protocol.prompt.md ← 编辑UI协议时自动加载 - ├── system-protocol.prompt.md ← 编辑系统协议时自动加载 + ├── data-protocol.prompt.md ← 编辑数据协议时加载 + ├── ui-protocol.prompt.md ← 编辑UI协议时加载 + ├── system-protocol.prompt.md ← 编辑系统协议时加载 └── ... ``` diff --git a/.github/prompts/README.md b/.github/prompts/README.md index 997a8bc1c..227af063b 100644 --- a/.github/prompts/README.md +++ b/.github/prompts/README.md @@ -142,9 +142,15 @@ These prompts help with specific development tasks: ## 🎯 How to Use These Prompts -### For GitHub Copilot +### For AI Coding Assistants -These prompts are automatically loaded by GitHub Copilot when working in the repository. They provide context-aware assistance based on: +These prompts are compatible with multiple AI coding assistants: + +- **Claude Code** (Recommended): Automatically loaded from the repository context +- **GitHub Copilot**: Automatically loaded when working in the repository +- **Cursor**: Can reference these prompts for context-aware assistance + +They provide context-aware assistance based on: - The file you're editing - The protocol layer you're working on - The task you're performing diff --git a/CLAUDE.md b/CLAUDE.md index c61b58037..f3388bf23 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -2,7 +2,8 @@ > **Last synced with `.github/copilot-instructions.md`:** 2026-04-16 > -> This file is the **Claude Code** equivalent of `.github/copilot-instructions.md` (GitHub Copilot). +> This file is the **Claude Code** primary instruction file for ObjectStack development. +> A parallel `.github/copilot-instructions.md` exists for GitHub Copilot compatibility. > Keep both files in sync when updating project-wide AI instructions. --- @@ -88,7 +89,7 @@ objectstack-ai/framework/ │ └── server/ # 🚀 Production server (multi-app orchestration) │ ├── examples/ # 📚 Reference implementations -├── skills/ # 🤖 AI skill definitions (for Copilot/Cursor/Claude) +├── skills/ # 🤖 AI skill definitions (for Claude Code, Copilot, Cursor) └── content/docs/ # 📝 Documentation content ``` @@ -264,6 +265,54 @@ When editing files matching these patterns, apply the corresponding architectura --- +## Claude Code Best Practices + +This project is optimized for development with **Claude Code** (Anthropic's official AI coding assistant). Follow these practices for the best experience: + +### Effective Prompting + +1. **Be Specific**: Reference exact file paths and line numbers when discussing code +2. **Provide Context**: Mention the protocol domain you're working in (Data, UI, System, AI, API) +3. **Use Domain Skills**: Reference the appropriate skill file when working on specialized tasks +4. **Sequential Tasks**: Break complex tasks into smaller, testable increments + +### Leveraging Claude Code Features + +1. **Multi-File Awareness**: Claude Code can read and edit multiple files simultaneously +2. **Deep Analysis**: Request architectural analysis before making significant changes +3. **Code Review**: Ask for code review suggestions before committing +4. **Test-Driven**: Request test generation alongside implementation + +### Working with This Repository + +1. **Start with Skills**: Consult `skills/objectstack-{domain}/SKILL.md` for domain-specific guidance +2. **Check Prompts**: Review `.github/prompts/{domain}-protocol.prompt.md` for detailed context +3. **Follow Conventions**: Always adhere to Prime Directives (Zod-first, naming conventions, etc.) +4. **Incremental Changes**: Make small, focused changes and test frequently + +### Example Prompts + +**Data Protocol Work:** +``` +"I need to add a new field type 'geolocation' to packages/spec/src/data/field-type.zod.ts. +First, read the existing field types to understand the pattern, then implement following +the Zod-first approach with proper TSDoc comments." +``` + +**Testing:** +``` +"Review the test coverage for packages/spec/src/ui/view.zod.ts and suggest additional +edge cases we should test, particularly around view type validation." +``` + +**Architecture:** +``` +"I want to add a new service for caching. Review packages/services/service-cache/ if it exists, +or suggest the architecture following the kernel-managed service pattern used in other services." +``` + +--- + ## Post-Task Checklist After completing any task: