|
2 | 2 |
|
3 | 3 | > **Last synced with `.github/copilot-instructions.md`:** 2026-04-16 |
4 | 4 | > |
5 | | -> This file is the **Claude Code** equivalent of `.github/copilot-instructions.md` (GitHub Copilot). |
| 5 | +> This file is the **Claude Code** primary instruction file for ObjectStack development. |
| 6 | +> A parallel `.github/copilot-instructions.md` exists for GitHub Copilot compatibility. |
6 | 7 | > Keep both files in sync when updating project-wide AI instructions. |
7 | 8 |
|
8 | 9 | --- |
@@ -88,7 +89,7 @@ objectstack-ai/framework/ |
88 | 89 | │ └── server/ # 🚀 Production server (multi-app orchestration) |
89 | 90 | │ |
90 | 91 | ├── examples/ # 📚 Reference implementations |
91 | | -├── skills/ # 🤖 AI skill definitions (for Copilot/Cursor/Claude) |
| 92 | +├── skills/ # 🤖 AI skill definitions (for Claude Code, Copilot, Cursor) |
92 | 93 | └── content/docs/ # 📝 Documentation content |
93 | 94 | ``` |
94 | 95 |
|
@@ -264,6 +265,54 @@ When editing files matching these patterns, apply the corresponding architectura |
264 | 265 |
|
265 | 266 | --- |
266 | 267 |
|
| 268 | +## Claude Code Best Practices |
| 269 | + |
| 270 | +This project is optimized for development with **Claude Code** (Anthropic's official AI coding assistant). Follow these practices for the best experience: |
| 271 | + |
| 272 | +### Effective Prompting |
| 273 | + |
| 274 | +1. **Be Specific**: Reference exact file paths and line numbers when discussing code |
| 275 | +2. **Provide Context**: Mention the protocol domain you're working in (Data, UI, System, AI, API) |
| 276 | +3. **Use Domain Skills**: Reference the appropriate skill file when working on specialized tasks |
| 277 | +4. **Sequential Tasks**: Break complex tasks into smaller, testable increments |
| 278 | + |
| 279 | +### Leveraging Claude Code Features |
| 280 | + |
| 281 | +1. **Multi-File Awareness**: Claude Code can read and edit multiple files simultaneously |
| 282 | +2. **Deep Analysis**: Request architectural analysis before making significant changes |
| 283 | +3. **Code Review**: Ask for code review suggestions before committing |
| 284 | +4. **Test-Driven**: Request test generation alongside implementation |
| 285 | + |
| 286 | +### Working with This Repository |
| 287 | + |
| 288 | +1. **Start with Skills**: Consult `skills/objectstack-{domain}/SKILL.md` for domain-specific guidance |
| 289 | +2. **Check Prompts**: Review `.github/prompts/{domain}-protocol.prompt.md` for detailed context |
| 290 | +3. **Follow Conventions**: Always adhere to Prime Directives (Zod-first, naming conventions, etc.) |
| 291 | +4. **Incremental Changes**: Make small, focused changes and test frequently |
| 292 | + |
| 293 | +### Example Prompts |
| 294 | + |
| 295 | +**Data Protocol Work:** |
| 296 | +``` |
| 297 | +"I need to add a new field type 'geolocation' to packages/spec/src/data/field-type.zod.ts. |
| 298 | +First, read the existing field types to understand the pattern, then implement following |
| 299 | +the Zod-first approach with proper TSDoc comments." |
| 300 | +``` |
| 301 | + |
| 302 | +**Testing:** |
| 303 | +``` |
| 304 | +"Review the test coverage for packages/spec/src/ui/view.zod.ts and suggest additional |
| 305 | +edge cases we should test, particularly around view type validation." |
| 306 | +``` |
| 307 | + |
| 308 | +**Architecture:** |
| 309 | +``` |
| 310 | +"I want to add a new service for caching. Review packages/services/service-cache/ if it exists, |
| 311 | +or suggest the architecture following the kernel-managed service pattern used in other services." |
| 312 | +``` |
| 313 | + |
| 314 | +--- |
| 315 | + |
267 | 316 | ## Post-Task Checklist |
268 | 317 |
|
269 | 318 | After completing any task: |
|
0 commit comments