Skip to content

Commit aa5c8a4

Browse files
Copilothuangyiirene
andcommitted
Add comprehensive AI prompts for all protocol layers
Co-authored-by: huangyiirene <7665279+huangyiirene@users.noreply.github.com>
1 parent fea9483 commit aa5c8a4

10 files changed

Lines changed: 4711 additions & 0 deletions

.github/prompts/README.md

Lines changed: 371 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,371 @@
1+
# ObjectStack AI Prompts Index
2+
3+
This directory contains specialized AI prompts for working with the ObjectStack specification repository. Each prompt defines a specific role, context, and responsibilities to help AI assistants provide focused, high-quality assistance.
4+
5+
## 📂 Prompt Categories
6+
7+
### Protocol Architecture Prompts
8+
9+
These prompts help define the core ObjectStack protocols:
10+
11+
#### 1. [Data Protocol Architect](./data-protocol.prompt.md)
12+
**Location:** `packages/spec/src/data/`
13+
**Focus:** ObjectQL - Data structure, validation, permissions, workflows
14+
**Key Responsibilities:**
15+
- Field definitions (23+ types)
16+
- Object schemas
17+
- Validation rules
18+
- Permission systems
19+
- Workflow automation
20+
- Flow builders
21+
- Query AST
22+
- Trigger contexts
23+
24+
**Use When:** Defining data models, business logic, or data access patterns
25+
26+
---
27+
28+
#### 2. [UI Protocol Architect](./ui-protocol.prompt.md)
29+
**Location:** `packages/spec/src/ui/`
30+
**Focus:** ObjectUI - Server-Driven UI definitions
31+
**Key Responsibilities:**
32+
- View protocols (List, Form, Calendar, Kanban, Gantt)
33+
- App navigation structures
34+
- Dashboard layouts and widgets
35+
- Report definitions
36+
- Action buttons
37+
- Page layouts
38+
- Theme configurations
39+
- Widget contracts
40+
41+
**Use When:** Defining UI structures, views, or user interactions
42+
43+
---
44+
45+
#### 3. [System Protocol Architect](./system-protocol.prompt.md)
46+
**Location:** `packages/spec/src/system/`
47+
**Focus:** ObjectOS - Runtime environment and platform capabilities
48+
**Key Responsibilities:**
49+
- Manifest (packaging)
50+
- Plugin lifecycle
51+
- Driver interface
52+
- Identity & authentication
53+
- Role-based access control
54+
- API contracts
55+
- Webhooks
56+
- Translations (i18n)
57+
- Multi-tenancy
58+
59+
**Use When:** Defining system-level features, plugins, or platform capabilities
60+
61+
---
62+
63+
#### 4. [AI Protocol Architect](./ai-protocol.prompt.md)
64+
**Location:** `packages/spec/src/ai/`
65+
**Focus:** AI agent integration
66+
**Key Responsibilities:**
67+
- Agent definitions
68+
- Tool integrations
69+
- Knowledge bases (RAG)
70+
- Conversation management
71+
- Prompt templates
72+
- AI workflows
73+
- Model configurations
74+
75+
**Use When:** Integrating AI capabilities, defining agents, or building RAG systems
76+
77+
---
78+
79+
#### 5. [API Protocol Architect](./api-protocol.prompt.md)
80+
**Location:** `packages/spec/src/api/`
81+
**Focus:** API contracts and standardization
82+
**Key Responsibilities:**
83+
- Response envelopes
84+
- Request schemas
85+
- API contracts
86+
- Error codes
87+
- REST endpoints
88+
- GraphQL schemas
89+
- Webhook payloads
90+
- Batch operations
91+
92+
**Use When:** Defining API structures, endpoints, or integration contracts
93+
94+
---
95+
96+
### Specialized Role Prompts
97+
98+
These prompts help with specific development tasks:
99+
100+
#### 6. [Testing Engineer](./testing-engineer.prompt.md)
101+
**Focus:** Comprehensive test coverage for all protocols
102+
**Key Responsibilities:**
103+
- Schema validation tests
104+
- Type inference tests
105+
- Edge case testing
106+
- Integration tests
107+
- Regression tests
108+
- Performance tests
109+
- Documentation tests
110+
111+
**Use When:** Writing tests, improving coverage, or validating schemas
112+
113+
---
114+
115+
#### 7. [Documentation Writer](./documentation-writer.prompt.md)
116+
**Focus:** Clear, comprehensive documentation
117+
**Key Responsibilities:**
118+
- TSDoc comments
119+
- Concept documentation
120+
- API reference docs
121+
- Tutorials and guides
122+
- Migration guides
123+
- Example documentation
124+
125+
**Use When:** Writing docs, adding comments, or creating tutorials
126+
127+
---
128+
129+
#### 8. [Example Creator](./example-creator.prompt.md)
130+
**Focus:** Realistic, runnable examples
131+
**Key Responsibilities:**
132+
- Full application examples (CRM, Todo, etc.)
133+
- Quick start examples
134+
- Feature-specific examples
135+
- Real-world scenarios
136+
- Advanced examples
137+
- Example documentation
138+
139+
**Use When:** Creating examples, demos, or reference implementations
140+
141+
---
142+
143+
## 🎯 How to Use These Prompts
144+
145+
### For GitHub Copilot
146+
147+
These prompts are automatically loaded by GitHub Copilot when working in the repository. They provide context-aware assistance based on:
148+
- The file you're editing
149+
- The protocol layer you're working on
150+
- The task you're performing
151+
152+
### For Custom AI Assistants
153+
154+
1. **Choose the Right Prompt**: Select the prompt that matches your task
155+
2. **Provide Context**: Share relevant code, requirements, or issues
156+
3. **Be Specific**: Clear instructions get better results
157+
158+
### Quick Command Reference
159+
160+
Each prompt includes interaction commands for common tasks:
161+
162+
**Data Protocol:**
163+
- "Create Field Protocol" → Implement field definitions
164+
- "Create Object Protocol" → Implement object schemas
165+
- "Create Validation Rules" → Implement validation engine
166+
167+
**UI Protocol:**
168+
- "Create View Protocol" → Implement view definitions
169+
- "Create Dashboard Protocol" → Implement dashboard layouts
170+
- "Create Theme System" → Implement theming
171+
172+
**System Protocol:**
173+
- "Create Manifest Protocol" → Implement packaging
174+
- "Create Plugin System" → Implement plugin lifecycle
175+
- "Create Driver Interface" → Implement database drivers
176+
177+
**AI Protocol:**
178+
- "Create Agent Protocol" → Implement AI agents
179+
- "Create Knowledge Base" → Implement RAG system
180+
181+
**Testing:**
182+
- "Write tests for X" → Create comprehensive tests
183+
- "Add edge case tests" → Add boundary tests
184+
185+
**Documentation:**
186+
- "Document X schema" → Write complete docs
187+
- "Add TSDoc comments" → Add inline documentation
188+
189+
**Examples:**
190+
- "Create CRM example" → Build full CRM app
191+
- "Add lookup example" → Show relationship patterns
192+
193+
---
194+
195+
## 📋 Protocol Standards
196+
197+
All prompts enforce these standards:
198+
199+
### Naming Conventions
200+
- **Configuration Keys** (TS properties): `camelCase`
201+
- Example: `maxLength`, `referenceFilters`, `defaultValue`
202+
- **Machine Names** (data values): `snake_case`
203+
- Example: `first_name`, `project_task`, `account_id`
204+
205+
### Zod-First Approach
206+
```typescript
207+
// 1. Define Zod schema
208+
export const MySchema = z.object({
209+
field: z.string().describe('Purpose'),
210+
});
211+
212+
// 2. Infer TypeScript type
213+
export type My = z.infer<typeof MySchema>;
214+
```
215+
216+
### Documentation Requirements
217+
- Every field must have `.describe()` annotation
218+
- Complex schemas need JSDoc comments
219+
- Include examples in tests and docs
220+
221+
### Testing Requirements
222+
- 80%+ code coverage target
223+
- Test valid inputs, invalid inputs, edge cases
224+
- Integration tests for connected schemas
225+
226+
---
227+
228+
## 🔄 Workflow Integration
229+
230+
### Development Workflow
231+
232+
1. **Design Phase**
233+
- Use Protocol Architect prompts to define schemas
234+
- Reference existing protocols for consistency
235+
236+
2. **Implementation Phase**
237+
- Use architect prompts to implement Zod schemas
238+
- Follow naming conventions strictly
239+
240+
3. **Testing Phase**
241+
- Use Testing Engineer prompt
242+
- Achieve 80%+ coverage
243+
244+
4. **Documentation Phase**
245+
- Use Documentation Writer prompt
246+
- Add TSDoc and concept docs
247+
248+
5. **Example Phase**
249+
- Use Example Creator prompt
250+
- Create runnable examples
251+
252+
### Code Review Checklist
253+
254+
- [ ] Follows naming conventions (camelCase/snake_case)
255+
- [ ] Zod schema with `.describe()` annotations
256+
- [ ] Type inferred from Zod
257+
- [ ] Unit tests with 80%+ coverage
258+
- [ ] TSDoc comments
259+
- [ ] Documentation updated
260+
- [ ] Example created/updated (if major feature)
261+
262+
---
263+
264+
## 🎓 Best Practices
265+
266+
### Design Principles
267+
268+
1. **Zod First**: Always start with Zod schema, derive types
269+
2. **Strict Types**: Never use `any`, use proper unions
270+
3. **No Business Logic**: Only definitions, no implementations
271+
4. **Extensibility**: Design for plugin additions
272+
5. **Backwards Compatibility**: Never break existing APIs
273+
274+
### Benchmarking
275+
276+
When designing protocols, benchmark against:
277+
- **Salesforce**: Object/Field model, Lightning components
278+
- **ServiceNow**: Service catalog, CMDB
279+
- **Kubernetes**: Manifest structure, CRDs
280+
- **OpenAPI**: API contract definitions
281+
282+
### Philosophy
283+
284+
- **Data as Code**: All metadata is versioned
285+
- **Idempotency**: Same input = same output
286+
- **Immutable Infrastructure**: No runtime schema mutations
287+
- **Convention over Configuration**: Sensible defaults
288+
289+
---
290+
291+
## 📚 Related Resources
292+
293+
### Repository Documentation
294+
- [ARCHITECTURE.md](../../ARCHITECTURE.md) - System architecture
295+
- [DEVELOPMENT_ROADMAP.md](../../DEVELOPMENT_ROADMAP.md) - Development plan
296+
- [PRIORITIES.md](../../PRIORITIES.md) - Priority matrix
297+
- [README.md](../../README.md) - Project overview
298+
299+
### Protocol Documentation
300+
- [Data Protocol Docs](../../content/docs/protocols/data/)
301+
- [UI Protocol Docs](../../content/docs/protocols/ui/)
302+
- [System Protocol Docs](../../content/docs/protocols/system/)
303+
304+
### Examples
305+
- [CRM Example](../../examples/crm/) - Complete application
306+
- [Todo Example](../../examples/todo/) - Quick start
307+
- [Feature Examples](../../examples/features/) - Specific features
308+
309+
---
310+
311+
## 🤝 Contributing
312+
313+
When adding new prompts:
314+
315+
1. **Follow Template**: Use existing prompts as template
316+
2. **Define Scope**: Clear role and responsibilities
317+
3. **Include Examples**: Show expected patterns
318+
4. **Add Commands**: List interaction shortcuts
319+
5. **Update Index**: Add to this README
320+
321+
### Prompt Template
322+
323+
```markdown
324+
# 🎯 [Role Name]
325+
326+
**Role:** You are the **[Title]** for ObjectStack.
327+
**Context:** [What you're defining]
328+
**Location:** [Directory or scope]
329+
330+
## Mission
331+
332+
[One-paragraph mission statement]
333+
334+
## Core Responsibilities
335+
336+
### 1. [Responsibility Name]
337+
[Details with code examples]
338+
339+
## Coding Standards
340+
[Standards specific to this role]
341+
342+
## Interaction Commands
343+
[Quick commands for common tasks]
344+
345+
## Best Practices
346+
[Tips and guidelines]
347+
348+
## Reference Examples
349+
[Links to relevant examples]
350+
```
351+
352+
---
353+
354+
## 📞 Support
355+
356+
- **Discord**: [Join our community](https://discord.gg/objectstack)
357+
- **GitHub Issues**: [Report issues](https://github.com/objectstack-ai/spec/issues)
358+
- **Documentation**: [Read the docs](https://docs.objectstack.ai)
359+
360+
---
361+
362+
## 📄 License
363+
364+
These prompts are part of the ObjectStack Protocol specification.
365+
License: Apache 2.0 © ObjectStack
366+
367+
---
368+
369+
**Last Updated:** 2026-01-21
370+
**Version:** 1.0.0
371+
**Maintainer:** ObjectStack Team

0 commit comments

Comments
 (0)