Skip to content

Commit f447c51

Browse files
docs(boilerplate): update SKILL.md for per-DB architecture
- Update directory structure (remove (authenticated) group) - Add /getting-started page description - Add detailed SDK import rules table - Highlight: invite mutations are in @sdk/admin - Update example code with real mutation format
1 parent dd85aad commit f447c51

1 file changed

Lines changed: 33 additions & 22 deletions

File tree

  • skills/constructive-boilerplate-nextjs-app

skills/constructive-boilerplate-nextjs-app/SKILL.md

Lines changed: 33 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -152,9 +152,8 @@ Required backend services:
152152
src/
153153
├── app/ # Next.js App Router pages
154154
│ ├── layout.tsx # Root layout with providers
155-
│ ├── page.tsx # Home page (Start Building Here)
156-
│ ├── (authenticated)/ # Protected pages
157-
│ │ └── organizations/ # Organizations list
155+
│ ├── page.tsx # Home (login → build guide, edit this!)
156+
│ ├── organizations/ # Organizations list
158157
│ ├── login/ # Login page
159158
│ ├── register/ # Registration page
160159
│ ├── forgot-password/ # Password reset request
@@ -234,60 +233,72 @@ import { useCurrentUserQuery, useSignInMutation } from '@sdk/auth';
234233
import { useOrgMembershipsQuery, useAppMembershipsQuery } from '@sdk/admin';
235234
```
236235

237-
### SDK Structure
236+
### SDK Import Rules
238237

239-
| SDK | Import | Use For |
240-
|-----|--------|---------|
241-
| `@sdk/admin` | `import { ... } from '@sdk/admin'` | Organizations, members, permissions, invites |
242-
| `@sdk/auth` | `import { ... } from '@sdk/auth'` | Users, emails, signIn, signUp, currentUser |
243-
| `@sdk/app` | `import { ... } from '@sdk/app'` | Your business tables |
238+
| API | Import From | Reason |
239+
|-----|-------------|--------|
240+
| `useCurrentUserQuery` | `@sdk/auth` | User data in auth endpoint |
241+
| `useSignInMutation`, `useSignOutMutation` | `@sdk/auth` | Auth mutations |
242+
| `useSetPasswordMutation`, `useResetPasswordMutation` | `@sdk/auth` | Password in auth |
243+
| `useCreateUserMutation`, `useDeleteUserMutation` | `@sdk/auth` | User CRUD |
244+
| `useOrganizationsQuery`, `useOrgMembershipsQuery` | `@sdk/admin` | Org data in admin |
245+
| `useAppPermissionsQuery`, `useOrgPermissionsQuery` | `@sdk/admin` | Permissions in admin |
246+
| `useSubmitInviteCodeMutation`, `useSubmitOrgInviteCodeMutation` | `@sdk/admin` | **Invite mutations in admin, NOT auth** |
247+
| `useBoardsQuery`, `useCreateBoardMutation` | `@sdk/app` | Your business tables |
248+
249+
**Key rule**: Invite mutations (`useSubmitInviteCodeMutation`, `useSubmitOrgInviteCodeMutation`) are in `@sdk/admin`, not `@sdk/auth`.
244250

245251
## Building Your App
246252

247-
After login, the home page (`src/app/page.tsx`) shows a guide. To add your business logic:
253+
After login, you'll see the build guide on the home page. To add your business logic:
248254

249255
### 1. Edit the Home Page
250256

251-
Replace the guide content in `src/app/page.tsx` with your main feature:
257+
Replace the build guide in `src/app/page.tsx` with your main feature:
252258

253259
```typescript
254260
'use client';
255261

256-
import { useYourTableQuery, useCreateYourTableMutation } from '@sdk/app';
262+
import { useBoardsQuery, useCreateBoardMutation } from '@sdk/app';
257263

258264
export default function HomePage() {
259-
const { data, isLoading } = useYourTableQuery({});
260-
const createMutation = useCreateYourTableMutation();
265+
const { data, isLoading } = useBoardsQuery({
266+
selection: { fields: { id: true, name: true, description: true } },
267+
});
268+
const createMutation = useCreateBoardMutation();
261269

262270
if (isLoading) return <div>Loading...</div>;
263271

264272
return (
265273
<div className="p-8">
266-
<h1 className="text-2xl font-bold mb-4">Your Feature</h1>
274+
<h1 className="text-2xl font-bold mb-4">Boards</h1>
267275

268276
<ul className="space-y-2">
269-
{data?.yourTable?.nodes?.map((item) => (
270-
<li key={item.id}>{item.name}</li>
277+
{data?.boards?.nodes?.map((board) => (
278+
<li key={board.id}>{board.name}</li>
271279
))}
272280
</ul>
273281

274282
<button
275-
onClick={() => createMutation.mutate({ input: { name: 'New Item' } })}
283+
onClick={() => createMutation.mutate({
284+
input: { object: { name: 'New Board' } }
285+
})}
276286
className="mt-4 px-4 py-2 bg-primary text-white rounded"
277287
>
278-
Create New
288+
Create Board
279289
</button>
280290
</div>
281291
);
282292
}
283293
```
284294

285-
### 2. Add New Pages
295+
### 2. Add More Pages
286296

287-
Create pages in `src/app/(authenticated)/`:
297+
Create additional pages in `src/app/`:
288298

289299
```
290-
src/app/(authenticated)/your-feature/page.tsx
300+
src/app/boards/[boardId]/page.tsx
301+
src/app/settings/page.tsx
291302
```
292303

293304
### 3. Update Sidebar

0 commit comments

Comments
 (0)