Skip to content

Commit 2177086

Browse files
committed
Update copilot-instructions.md
1 parent d11e32d commit 2177086

File tree

1 file changed

+53
-0
lines changed

1 file changed

+53
-0
lines changed

.github/copilot-instructions.md

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
# ObjectDocs AI Instructions
2+
3+
You are an expert developer and technical writer assisting with **ObjectDocs**, a modern documentation engine built on **Next.js 14 (App Router)** and **Fumadocs**.
4+
5+
## Project Context & Architecture
6+
- **Core Philosophy**: "Configuration as Code". We separate presentation (React), configuration (JSON), and content (MDX).
7+
- **Framework**: Next.js 14+ (App Router), TypeScript, Tailwind CSS.
8+
- **Engine**: Fumadocs (documentation middleware and UI).
9+
- **Ecosystem**: Part of **ObjectStack**. Supports embedding ObjectUI components.
10+
11+
## 🛑 STRICT RULES (Critical)
12+
13+
1. **NO Hardcoded Sidebars**:
14+
- NEVER suggest modifying React components (like `layout.tsx`) to change the sidebar or navigation structure.
15+
- ALWAYS instruct to modify `content/**/meta.json` to change page order or directory structure.
16+
- `meta.json` format: `{ "title": "...", "pages": ["page-a", "page-b"] }`.
17+
18+
2. **Global Configuration**:
19+
- Navigation bar links, logo, and social links are defined in `config/site.json`.
20+
- Do not hardcode header/footer links in components.
21+
22+
3. **Next.js App Router**:
23+
- Use Server Components by default.
24+
- Use `'use client'` only when interactivity (hooks, event listeners) is strictly required.
25+
- Use `pnpm` for package management commands.
26+
27+
## 📝 Documentation Writing Guidelines (MDX)
28+
29+
When generating or editing `.mdx` content:
30+
- **Frontmatter**: Always include `title` and `description`.
31+
- **Components**: Use Fumadocs standard components:
32+
- `<Callout type="info|warn|error">...</Callout>`
33+
- `<Steps>...</Steps>` for tutorials.
34+
- `<Cards><Card ... /></Cards>` for navigation grids.
35+
- **Low-Code Embedding**:
36+
- When asked to document ObjectStack/Steedos features, prefer showing the configuration (JSON/YAML) alongside the visual component explanation.
37+
38+
## 🎨 UI & Styling Guidelines
39+
40+
- **Tailwind CSS**: Use utility classes for styling. Do not use CSS modules unless necessary.
41+
- **Radix UI**: Use Radix primitives for interactive components if standard Fumadocs UI is insufficient.
42+
- **Responsiveness**: Always consider mobile views (`md:`, `lg:` prefixes).
43+
44+
## 🛠️ Common Tasks & Solutions
45+
46+
- **Task**: "Add a new page to the guide."
47+
- **Solution**: Create `content/docs/guide/new-page.mdx` AND update `content/docs/guide/meta.json` to include `"new-page"` in the `pages` array.
48+
49+
- **Task**: "Change the site name."
50+
- **Solution**: Update the `branding.name` field in `config/site.json`.
51+
52+
- **Task**: "Fix the build."
53+
- **Solution**: Check `next.config.mjs` and ensure strict strict separation of client/server components. Verify all linked files in `meta.json` actually exist.

0 commit comments

Comments
 (0)